Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 8c01259

Browse files
authored
fix: pull in preconfigured chai from interface tests (#2510)
This is to work around chaijs/chai#1298 Fundamentally we cannot pull in chai and add plugins to it without being careful of the order of those plugins as it's a singleton. All we're really interested in is the `expect` function to just get the preconfigured one from the interface tests.
1 parent fa99728 commit 8c01259

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+79
-245
lines changed

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"ipfs-bitswap": "^0.26.0",
100100
"ipfs-block": "~0.8.1",
101101
"ipfs-block-service": "~0.16.0",
102-
"ipfs-http-client": "^38.0.0",
102+
"ipfs-http-client": "^38.0.1",
103103
"ipfs-http-response": "~0.3.1",
104104
"ipfs-mfs": "^0.13.0",
105105
"ipfs-multipart": "^0.2.0",
@@ -195,16 +195,14 @@
195195
"devDependencies": {
196196
"aegir": "^20.3.1",
197197
"base64url": "^3.0.1",
198-
"chai": "^4.2.0",
199198
"clear-module": "^4.0.0",
200199
"delay": "^4.1.0",
201200
"detect-node": "^2.0.4",
202201
"dir-compare": "^1.7.3",
203-
"dirty-chai": "^2.0.1",
204202
"execa": "^2.0.4",
205203
"form-data": "^2.5.1",
206204
"hat": "0.0.3",
207-
"interface-ipfs-core": "^0.115.1",
205+
"interface-ipfs-core": "^0.115.3",
208206
"ipfs-interop": "~0.1.0",
209207
"ipfsd-ctl": "^0.47.2",
210208
"libp2p-websocket-star": "~0.10.2",

test/cli/bitswap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const expect = require('chai').expect
4+
const { expect } = require('interface-ipfs-core/src/utils/mocha')
55
const runOn = require('../utils/on-and-off').on
66
const PeerId = require('peer-id')
77
const CID = require('cids')

test/cli/block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const expect = require('chai').expect
4+
const { expect } = require('interface-ipfs-core/src/utils/mocha')
55
const runOnAndOff = require('../utils/on-and-off')
66

77
describe('block', () => runOnAndOff((thing) => {

test/cli/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-env mocha */
33
'use strict'
44

5-
const expect = require('chai').expect
5+
const { expect } = require('interface-ipfs-core/src/utils/mocha')
66
const runOnAndOff = require('../utils/on-and-off')
77

88
describe('bootstrap', () => runOnAndOff((thing) => {

test/cli/commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const expect = require('chai').expect
4+
const { expect } = require('interface-ipfs-core/src/utils/mocha')
55
const runOnAndOff = require('../utils/on-and-off')
66

77
const commandCount = 95

test/cli/config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const chai = require('chai')
5-
const dirtyChai = require('dirty-chai')
6-
const expect = chai.expect
7-
chai.use(dirtyChai)
4+
const { expect } = require('interface-ipfs-core/src/utils/mocha')
85
const fs = require('fs')
96
const path = require('path')
107
const runOnAndOff = require('../utils/on-and-off')

test/cli/daemon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const expect = require('chai').expect
4+
const { expect } = require('interface-ipfs-core/src/utils/mocha')
55
const clean = require('../utils/clean')
66
const ipfsCmd = require('../utils/ipfs-exec')
77
const isWindows = require('../utils/platforms').isWindows

test/cli/dag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const expect = require('chai').expect
4+
const { expect } = require('interface-ipfs-core/src/utils/mocha')
55
const runOnAndOff = require('../utils/on-and-off')
66
const path = require('path')
77

test/cli/dht.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
'use strict'
44

5-
const chai = require('chai')
6-
const dirtyChai = require('dirty-chai')
7-
const expect = chai.expect
8-
chai.use(dirtyChai)
9-
5+
const { expect } = require('interface-ipfs-core/src/utils/mocha')
106
const path = require('path')
117
const DaemonFactory = require('ipfsd-ctl')
128
const df = DaemonFactory.create({

test/cli/dns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-env mocha */
22
'use strict'
33

4-
const expect = require('chai').expect
4+
const { expect } = require('interface-ipfs-core/src/utils/mocha')
55
const runOnAndOff = require('../utils/on-and-off')
66
const isIPFS = require('is-ipfs')
77

0 commit comments

Comments
 (0)