diff --git a/js/src/index.js b/js/src/index.js index 9f527e19..881e5014 100644 --- a/js/src/index.js +++ b/js/src/index.js @@ -16,3 +16,4 @@ exports.key = require('./key') exports.stats = require('./stats') exports.repo = require('./repo') exports.bootstrap = require('./bootstrap') +exports.types = require('./types') diff --git a/js/src/types.js b/js/src/types.js index fbba03e8..070b4003 100644 --- a/js/src/types.js +++ b/js/src/types.js @@ -15,39 +15,41 @@ const dirtyChai = require('dirty-chai') const expect = chai.expect chai.use(dirtyChai) -describe('.types', function () { - let ipfs +module.exports = (common) => { + describe('.types', function () { + let ipfs - before(function (done) { - // CI takes longer to instantiate the daemon, so we need to increase the - // timeout for the before step - this.timeout(60 * 1000) + before(function (done) { + // CI takes longer to instantiate the daemon, so we need to increase the + // timeout for the before step + this.timeout(60 * 1000) - common.setup((err, factory) => { - expect(err).to.not.exist() - factory.spawnNode((err, node) => { + common.setup((err, factory) => { expect(err).to.not.exist() - ipfs = node - done() + factory.spawnNode((err, node) => { + expect(err).to.not.exist() + ipfs = node + done() + }) }) }) - }) - after((done) => { - common.teardown(done) - }) + after((done) => { + common.teardown(done) + }) - it('types object', () => { - expect(ipfs.types).to.be.deep.equal({ - Buffer: Buffer, - PeerId: PeerId, - PeerInfo: PeerInfo, - multiaddr: multiaddr, - multibase: multibase, - multihash: multihash, - CID: CID, - dagPB: dagPB, - dagCBOR: dagCBOR + it('types object', () => { + expect(ipfs.types).to.be.deep.equal({ + Buffer: Buffer, + PeerId: PeerId, + PeerInfo: PeerInfo, + multiaddr: multiaddr, + multibase: multibase, + multihash: multihash, + CID: CID, + dagPB: dagPB, + dagCBOR: dagCBOR + }) }) }) -}) +} diff --git a/js/src/util.js b/js/src/util.js index e0c53a04..7e884d71 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -8,7 +8,7 @@ const chai = require('chai') const dirtyChai = require('dirty-chai') const expect = chai.expect chai.use(dirtyChai) -util + describe('.types', function () { let ipfs