mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
29f09c50c2
Treat unhandled promise rejections as errors in tests GitOrigin-RevId: ba9d8fa02e0687c6b2d1d95e495fe0b54bb0cff5
22 lines
492 B
JavaScript
22 lines
492 B
JavaScript
const chai = require('chai')
|
|
const sinon = require('sinon')
|
|
|
|
// add chai.should()
|
|
chai.should()
|
|
|
|
// Load sinon-chai assertions so expect(stubFn).to.have.been.calledWith('abc')
|
|
// has a nicer failure messages
|
|
chai.use(require('sinon-chai'))
|
|
|
|
// Load promise support for chai
|
|
chai.use(require('chai-as-promised'))
|
|
|
|
// Do not truncate assertion errors
|
|
chai.config.truncateThreshold = 0
|
|
|
|
// add support for mongoose in sinon
|
|
require('sinon-mongoose')
|
|
|
|
afterEach(function() {
|
|
sinon.restore()
|
|
})
|