Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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