Skip to content

Commit b0b84aa

Browse files
authored
Merge pull request ipfs#537 from ipfs/configure-chai-for-tests
fix: configure chai for use by other modules
2 parents ac4d362 + 77c8be9 commit b0b84aa

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"bs58": "^4.0.1",
4242
"callbackify": "^1.1.0",
4343
"chai": "^4.2.0",
44+
"chai-as-promised": "^7.1.1",
4445
"cids": "~0.7.1",
4546
"concat-stream": "^2.0.0",
4647
"delay": "^4.3.0",

src/key/rename.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
/* eslint max-nested-callbacks: ["error", 6] */
33
'use strict'
44

5-
const chai = require('chai')
6-
const dirtyChai = require('dirty-chai')
75
const hat = require('hat')
8-
const { getDescribe, getIt } = require('../utils/mocha')
9-
10-
const expect = chai.expect
11-
chai.use(dirtyChai)
6+
const { getDescribe, getIt, expect } = require('../utils/mocha')
127

138
module.exports = (createCommon, options) => {
149
const describe = getDescribe(options)

src/utils/mocha.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
'use strict'
33

44
const chai = require('chai')
5-
const dirtyChai = require('dirty-chai')
65

7-
chai.use(dirtyChai)
6+
// Do not reorder these statements - https://github.com/chaijs/chai/issues/1298
7+
chai.use(require('chai-as-promised'))
8+
chai.use(require('dirty-chai'))
89

910
module.exports.expect = chai.expect
1011

0 commit comments

Comments
 (0)