From 7545c58fd3e296c4bcdb7e5e5daf5a062fdc3b56 Mon Sep 17 00:00:00 2001 From: Nitin Patel Date: Thu, 14 Mar 2019 22:11:26 +0530 Subject: [PATCH] refactor: remove unnecessary tests License: MIT Signed-off by: Nitin Patel --- README.md | 2 -- SPEC/TYPES.md | 11 ----------- SPEC/UTIL.md | 6 ------ src/index.js | 2 -- src/types.js | 49 ------------------------------------------------- src/util.js | 40 ---------------------------------------- 6 files changed, 110 deletions(-) delete mode 100644 SPEC/TYPES.md delete mode 100644 SPEC/UTIL.md delete mode 100644 src/types.js delete mode 100644 src/util.js diff --git a/README.md b/README.md index b5a7351f1..63d9ceec8 100644 --- a/README.md +++ b/README.md @@ -171,8 +171,6 @@ In order to be considered "valid", an IPFS core implementation must expose the A - [key](/SPEC/KEY.md) - [stats](/SPEC/STATS.md) - [repo](/SPEC/REPO.md) -- [**Types**](/SPEC/TYPES.md) -- [**Util**](/SPEC/UTIL.md) ## Contribute diff --git a/SPEC/TYPES.md b/SPEC/TYPES.md deleted file mode 100644 index 0c5871546..000000000 --- a/SPEC/TYPES.md +++ /dev/null @@ -1,11 +0,0 @@ -# Types API - -A set of data types are exposed directly from the IPFS instance under `ipfs.types`. That way you're not required to import/require the following. - -- [`ipfs.types.Buffer`](https://www.npmjs.com/package/buffer) -- [`ipfs.types.PeerId`](https://github.com/libp2p/js-peer-id) -- [`ipfs.types.PeerInfo`](https://github.com/libp2p/js-peer-info) -- [`ipfs.types.multiaddr`](https://github.com/multiformats/js-multiaddr) -- [`ipfs.types.multibase`](https://github.com/multiformats/multibase) -- [`ipfs.types.multihash`](https://github.com/multiformats/js-multihash) -- [`ipfs.types.CID`](https://github.com/multiformats/js-cid) diff --git a/SPEC/UTIL.md b/SPEC/UTIL.md deleted file mode 100644 index 1d3d5724a..000000000 --- a/SPEC/UTIL.md +++ /dev/null @@ -1,6 +0,0 @@ -# Util API - -A set of utils are exposed directly from the IPFS instance under `ipfs.util`. That way you're not required to import/require the following: - -- [`ipfs.util.crypto`](https://github.com/libp2p/js-libp2p-crypto) -- [`ipfs.util.isIPFS`](https://github.com/ipfs-shipyard/is-ipfs) diff --git a/src/index.js b/src/index.js index 244e11d92..2c353faec 100644 --- a/src/index.js +++ b/src/index.js @@ -23,5 +23,3 @@ exports.key = require('./key') exports.miscellaneous = require('./miscellaneous') exports.repo = require('./repo') exports.stats = require('./stats') -exports.types = require('./types') -exports.util = require('./util') diff --git a/src/types.js b/src/types.js deleted file mode 100644 index 134e3e33f..000000000 --- a/src/types.js +++ /dev/null @@ -1,49 +0,0 @@ -/* eslint-env mocha */ -'use strict' - -const PeerId = require('peer-id') -const PeerInfo = require('peer-info') -const multiaddr = require('multiaddr') -const multibase = require('multibase') -const multihash = require('multihashes') -const CID = require('cids') -const { getDescribe, getIt, expect } = require('./utils/mocha') - -module.exports = (createCommon, options) => { - const describe = getDescribe(options) - const it = getIt(options) - const common = createCommon() - - 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) - - common.setup((err, factory) => { - expect(err).to.not.exist() - factory.spawnNode((err, node) => { - expect(err).to.not.exist() - ipfs = node - done() - }) - }) - }) - - after((done) => common.teardown(done)) - - it('should have a types object with the required values', () => { - expect(ipfs.types).to.be.deep.equal({ - Buffer: Buffer, - PeerId: PeerId, - PeerInfo: PeerInfo, - multiaddr: multiaddr, - multibase: multibase, - multihash: multihash, - CID: CID - }) - }) - }) -} diff --git a/src/util.js b/src/util.js deleted file mode 100644 index 3a0f32c05..000000000 --- a/src/util.js +++ /dev/null @@ -1,40 +0,0 @@ -/* eslint-env mocha */ -'use strict' - -const crypto = require('libp2p-crypto') -const isIPFS = require('is-ipfs') -const { getDescribe, getIt, expect } = require('./utils/mocha') - -module.exports = (createCommon, options) => { - const describe = getDescribe(options) - const it = getIt(options) - const common = createCommon() - - describe('.util', 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) - - common.setup((err, factory) => { - expect(err).to.not.exist() - factory.spawnNode((err, node) => { - expect(err).to.not.exist() - ipfs = node - done() - }) - }) - }) - - after((done) => common.teardown(done)) - - it('should have a util object with the required values', () => { - expect(ipfs.util).to.be.deep.equal({ - crypto: crypto, - isIPFS: isIPFS - }) - }) - }) -}