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

Commit

Permalink
fix: pull in preconfigured chai from interface tests
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Oct 3, 2019
1 parent 1c3d92a commit 93765c1
Show file tree
Hide file tree
Showing 21 changed files with 23 additions and 107 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@
"devDependencies": {
"aegir": "^20.3.1",
"browser-process-platform": "~0.1.1",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"cross-env": "^6.0.0",
"dirty-chai": "^2.0.1",
"go-ipfs-dep": "^0.4.22",
"interface-ipfs-core": "ipfs/interface-js-ipfs-core#add-listing-config-profiles",
"ipfsd-ctl": "^0.47.1",
Expand Down
7 changes: 1 addition & 6 deletions test/commands.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const { expect } = require('interface-ipfs-core/src/utils/mocha')
const ipfsClient = require('../src')

const f = require('./utils/factory')

describe('.commands', function () {
Expand Down
6 changes: 1 addition & 5 deletions test/constructor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
'use strict'

const multiaddr = require('multiaddr')
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const { expect } = require('interface-ipfs-core/src/utils/mocha')
const f = require('./utils/factory')
const ipfsClient = require('../src/index.js')

Expand Down
6 changes: 1 addition & 5 deletions test/custom-headers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
'use strict'

const isNode = require('detect-node')
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const { expect } = require('interface-ipfs-core/src/utils/mocha')
const ipfsClient = require('../src')
const f = require('./utils/factory')

Expand Down
7 changes: 1 addition & 6 deletions test/dag.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@

'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const chaiAsPromised = require('chai-as-promised')
const expect = chai.expect
chai.use(dirtyChai)
chai.use(chaiAsPromised)
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const { DAGNode } = require('ipld-dag-pb')
const CID = require('cids')
const ipfsClient = require('../src')
Expand Down
6 changes: 1 addition & 5 deletions test/diag.spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const platform = require('browser-process-platform')

const ipfsClient = require('../src')
const f = require('./utils/factory')

Expand Down
6 changes: 1 addition & 5 deletions test/endpoint-config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
/* eslint max-nested-callbacks: ["error", 8] */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const isNode = require('detect-node')

const ipfsClient = require('../src')
const f = require('./utils/factory')

Expand Down
5 changes: 1 addition & 4 deletions test/exports.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ const multicodec = require('multicodec')
const multihash = require('multihashes')
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const { expect } = require('interface-ipfs-core/src/utils/mocha')

const IpfsHttpClient = require('../')

Expand Down
7 changes: 1 addition & 6 deletions test/files-mfs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
/* eslint max-nested-callbacks: ["error", 8] */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const chaiAsPromised = require('chai-as-promised')
const expect = chai.expect
chai.use(dirtyChai)
chai.use(chaiAsPromised)
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const loadFixture = require('aegir/fixtures')
const mh = require('multihashes')
const CID = require('cids')
Expand Down
7 changes: 1 addition & 6 deletions test/get.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@

'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const chaiAsPromised = require('chai-as-promised')
const expect = chai.expect
chai.use(dirtyChai)
chai.use(chaiAsPromised)
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const loadFixture = require('aegir/fixtures')

const ipfsClient = require('../src')
Expand Down
6 changes: 1 addition & 5 deletions test/key.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
/* eslint max-nested-callbacks: ["error", 8] */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const { expect } = require('interface-ipfs-core/src/utils/mocha')
const ipfsClient = require('../src')
const f = require('./utils/factory')

Expand Down
6 changes: 1 addition & 5 deletions test/lib.configure.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/* eslint-env mocha, browser */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const Multiaddr = require('multiaddr')
const { isBrowser, isWebWorker } = require('ipfs-utils/src/env')

const configure = require('../src/lib/configure')

describe('lib/configure', () => {
Expand Down
5 changes: 1 addition & 4 deletions test/lib.error-handler.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const { HTTPError } = require('ky-universal')
const expect = chai.expect
chai.use(dirtyChai)
const throwsAsync = require('./utils/throws-async')
const errorHandler = require('../src/lib/error-handler')

Expand Down
5 changes: 1 addition & 4 deletions test/lib.stream-to-iterable.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const toIterable = require('../src/lib/stream-to-iterable')

describe('lib/stream-to-iterable', () => {
Expand Down
6 changes: 1 addition & 5 deletions test/log.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
/* eslint max-nested-callbacks: ["error", 8] */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const { expect } = require('interface-ipfs-core/src/utils/mocha')
const ipfsClient = require('../src')
const f = require('./utils/factory')

Expand Down
8 changes: 1 addition & 7 deletions test/node/swarm.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
/* eslint-env mocha */
'use strict'

const { expect } = require('interface-ipfs-core/src/utils/mocha')
const nock = require('nock')
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const chaiAsPromised = require('chai-as-promised')
const expect = chai.expect
chai.use(dirtyChai)
chai.use(chaiAsPromised)

const ipfsClient = require('../../src')

describe('.swarm.peers', function () {
Expand Down
7 changes: 1 addition & 6 deletions test/ping.spec.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const chaiAsPromised = require('chai-as-promised')
const expect = chai.expect
chai.use(dirtyChai)
chai.use(chaiAsPromised)
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const pull = require('pull-stream/pull')
const collect = require('pull-stream/sinks/collect')

Expand Down
6 changes: 1 addition & 5 deletions test/repo.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const { expect } = require('interface-ipfs-core/src/utils/mocha')
const ipfsClient = require('../src')
const f = require('./utils/factory')

Expand Down
5 changes: 1 addition & 4 deletions test/request-api.spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const { expect } = require('interface-ipfs-core/src/utils/mocha')
const isNode = require('detect-node')
const ipfsClient = require('../src/index.js')
const ndjson = require('ndjson')
Expand Down
6 changes: 1 addition & 5 deletions test/stats.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const { expect } = require('interface-ipfs-core/src/utils/mocha')
const ipfsClient = require('../src')
const f = require('./utils/factory')

Expand Down
10 changes: 4 additions & 6 deletions test/sub-modules.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/* eslint-env mocha */
'use strict'

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const { expect } = require('interface-ipfs-core/src/utils/mocha')
const defaultConfig = require('../src/utils/default-config.js')
const config = defaultConfig()
config.host = 'test'
Expand Down Expand Up @@ -42,7 +38,9 @@ describe('submodules', () => {
expect(cfg.get).to.be.a('function')
expect(cfg.set).to.be.a('function')
expect(cfg.replace).to.be.a('function')
expect(cfg.profile).to.be.a('function')
expect(cfg).to.have.a.property('profiles')
expect(cfg.profiles.list).to.be.a('function')
expect(cfg.profiles.apply).to.be.a('function')
})

it('dht', () => {
Expand Down

0 comments on commit 93765c1

Please sign in to comment.