2019-05-28 11:04:44 +00:00
|
|
|
const chai = require('chai')
|
2019-11-18 14:37:05 +00:00
|
|
|
const sinon = require('sinon')
|
2019-05-28 11:04:44 +00:00
|
|
|
|
2020-05-22 10:34:57 +00:00
|
|
|
// add chai.should()
|
|
|
|
chai.should()
|
|
|
|
|
2019-05-28 11:04:44 +00:00
|
|
|
// Load sinon-chai assertions so expect(stubFn).to.have.been.calledWith('abc')
|
|
|
|
// has a nicer failure messages
|
|
|
|
chai.use(require('sinon-chai'))
|
2019-07-18 14:18:56 +00:00
|
|
|
|
2019-08-28 12:59:41 +00:00
|
|
|
// Load promise support for chai
|
|
|
|
chai.use(require('chai-as-promised'))
|
|
|
|
|
2019-10-07 08:30:51 +00:00
|
|
|
// Do not truncate assertion errors
|
|
|
|
chai.config.truncateThreshold = 0
|
|
|
|
|
2019-07-18 14:18:56 +00:00
|
|
|
// add support for mongoose in sinon
|
|
|
|
require('sinon-mongoose')
|
2019-11-07 10:28:27 +00:00
|
|
|
|
2019-11-18 14:37:05 +00:00
|
|
|
afterEach(function() {
|
|
|
|
sinon.restore()
|
|
|
|
})
|