Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: do not fail stop node if failed start node
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw committed May 16, 2018
1 parent faa51b4 commit 533760f
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 18 deletions.
5 changes: 4 additions & 1 deletion test/bitswap.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ describe('.bitswap', function () {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

it('.wantlist', (done) => {
ipfs.bitswap.wantlist((err, res) => {
Expand Down
5 changes: 4 additions & 1 deletion test/commands.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ describe('.commands', function () {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

it('lists commands', (done) => {
ipfs.commands((err, res) => {
Expand Down
5 changes: 4 additions & 1 deletion test/constructor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ describe('ipfs-api constructor tests', () => {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

it('opts', (done) => {
const splitted = apiAddr.split('/')
Expand Down
5 changes: 4 additions & 1 deletion test/diag.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ describe('.diag', function () {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

describe('Callback API', () => {
// Disabled in go-ipfs 0.4.10
Expand Down
5 changes: 4 additions & 1 deletion test/files.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ describe('.files (the MFS API part)', function () {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

it('add file for testing', (done) => {
ipfs.files.add(testfile, (err, res) => {
Expand Down
5 changes: 4 additions & 1 deletion test/get.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ describe('.get (specific go-ipfs features)', function () {
], done)
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

it('no compression args', (done) => {
ipfs.get(smallFile.cid, (err, files) => {
Expand Down
5 changes: 4 additions & 1 deletion test/key.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ describe('.key', function () {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

describe('Callback API', () => {
describe('.gen', () => {
Expand Down
5 changes: 4 additions & 1 deletion test/log.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ describe('.log', function () {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

it('.log.tail', (done) => {
const req = ipfs.log.tail((err, res) => {
Expand Down
10 changes: 8 additions & 2 deletions test/name.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ describe('.name', () => {

after((done) => {
parallel([
(cb) => ipfsd.stop(cb),
(cb) => otherd.stop(cb)
(cb) => {
if (!ipfsd) return cb()
ipfsd.stop(cb)
},
(cb) => {
if (!otherd) return cb()
otherd.stop(cb)
}
], done)
})

Expand Down
10 changes: 8 additions & 2 deletions test/ping.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ describe('.ping', function () {

after((done) => {
parallel([
(cb) => ipfsd.stop(cb),
(cb) => otherd.stop(cb)
(cb) => {
if (!ipfsd) return cb()
ipfsd.stop(cb)
},
(cb) => {
if (!otherd) return cb()
otherd.stop(cb)
}
], done)
})

Expand Down
5 changes: 4 additions & 1 deletion test/pubsub-in-browser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ describe('.pubsub is not supported in the browser, yet!', function () {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

describe('everything errors', () => {
describe('Callback API', () => {
Expand Down
5 changes: 4 additions & 1 deletion test/refs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ describe('.refs', function () {
], done)
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

const result = [
{
Expand Down
5 changes: 4 additions & 1 deletion test/repo.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ describe('.repo', function () {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

it('.repo.gc', (done) => {
ipfs.repo.gc((err, res) => {
Expand Down
5 changes: 4 additions & 1 deletion test/stats.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ describe('stats', function () {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

it('.stats.bitswap', (done) => {
ipfs.stats.bitswap((err, res) => {
Expand Down
5 changes: 4 additions & 1 deletion test/types.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ describe('.types', function () {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

it('types object', () => {
expect(ipfs.types).to.be.deep.equal({
Expand Down
5 changes: 4 additions & 1 deletion test/util.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ describe('.util', () => {
})
})

after((done) => ipfsd.stop(done))
after((done) => {
if (!ipfsd) return done()
ipfsd.stop(done)
})

it('.streamAdd', (done) => {
const tfpath = path.join(__dirname, '/fixtures/testfile.txt')
Expand Down

0 comments on commit 533760f

Please sign in to comment.