overleaf/services/web/test/unit/bootstrap.js
Eric Mc Sween 4f9eb281b7 Merge pull request #2356 from overleaf/em-upgrade-test-deps
Upgrade test dependencies

GitOrigin-RevId: 0bda49dea086f525211836b6008f67bafa2bbe48
2019-11-18 14:53:42 +00:00

25 lines
628 B
JavaScript

const chai = require('chai')
const sinon = require('sinon')
// 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')
// Crash the process on an unhandled promise rejection
process.on('unhandledRejection', err => {
console.error('Unhandled promise rejection:', err)
process.exit(1)
})
afterEach(function() {
sinon.restore()
})