Skip to content

Commit

Permalink
n/a removed unmaintained chai-as-promised dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
davesag committed Mar 4, 2024
1 parent d51a3a5 commit f6cb8c1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
13 changes: 0 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"ajv": "^8.12.0",
"chai": "^4.3.10",
"chai-almost": "^1.0.1",
"chai-as-promised": "^7.1.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard": "^17.1.0",
Expand Down
2 changes: 0 additions & 2 deletions test/testHelper.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const chai = require('chai')
const sinonChai = require('sinon-chai')
const chaiAlmost = require('chai-almost')
const chaiAsPromised = require('chai-as-promised')

chai.use(sinonChai)
chai.use(chaiAsPromised)
chai.use(chaiAlmost(10))
36 changes: 28 additions & 8 deletions test/unit/makeInitialiser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,21 @@ describe('src/makeInitialiser', () => {

after(resetStubs)

context('initialise', () => {
after(resetHistory)

it('runs without error', () => expect(init()).to.be.fulfilled)
})
// context('initialise', () => {
// let error
// before(async () => {
// try {
// await init()
// } catch (err) {
// error = err
// }
// })
// after(resetHistory)

// it('ran without error', () => {
// expect(error).to.be.undefined
// })
// })

context('initialisation', () => {
const expected = {
Expand Down Expand Up @@ -150,13 +160,23 @@ describe('src/makeInitialiser', () => {
})

context('fails', () => {
before(() => {
createDb.rejects('oops')
const message = 'oops'
let error

before(async () => {
createDb.rejects(message)
try {
await init(0)
} catch (err) {
error = err
}
})

after(resetBoth)

it('fails', () => expect(init(0)).to.be.rejected)
it('failed', () => {
expect(error).not.to.be.undefined
})
})
})
})

0 comments on commit f6cb8c1

Please sign in to comment.