Skip to content

Commit

Permalink
fix: move IPFS_PATH test to a node specific file
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Apr 20, 2020
1 parent db64997 commit 9d9cedd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
15 changes: 0 additions & 15 deletions test/controller.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,6 @@ describe('Controller API', function () {
after(() => factory.clean())

describe('init', () => {
it('should use process.IPFS_PATH', async () => {
const repoPath = await factory.tmpDir()
process.env.IPFS_PATH = repoPath
const ctl = await factory.spawn({
type: 'go',
disposable: false,
ipfsOptions: {
init: false,
start: false
}
})

expect(ctl.path).to.equal(repoPath)
process.env.IPFS_PATH = undefined
})
describe('should work with defaults', () => {
for (const opts of types) {
it(`type: ${opts.type} remote: ${Boolean(opts.remote)}`, async () => {
Expand Down
30 changes: 30 additions & 0 deletions test/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,35 @@

'use strict'

const { expect } = require('aegir/utils/chai')
const { createFactory } = require('../src')

describe('Node specific tests', function () {
this.timeout(60000)

const factory = createFactory({
test: true,
ipfsHttpModule: require('ipfs-http-client'),
ipfsModule: require('ipfs'),
ipfsBin: require('go-ipfs-dep').path()
})

it('should use process.IPFS_PATH', async () => {
const repoPath = await factory.tmpDir()
process.env.IPFS_PATH = repoPath
const ctl = await factory.spawn({
type: 'go',
disposable: false,
ipfsOptions: {
init: false,
start: false
}
})

expect(ctl.path).to.equal(repoPath)
delete process.env.IPFS_PATH
})
})

require('./node.routes')
require('./node.utils')

0 comments on commit 9d9cedd

Please sign in to comment.