overleaf/services/web/test/unit/bootstrap.js
Jakob Ackermann 2a8e2efe62 Merge pull request #2845 from overleaf/jpa-faster-web-ci
[misc] faster web ci

GitOrigin-RevId: bbd6b12040956f6b397c6ea4d8144e733299400b
2020-05-23 03:18:08 +00:00

28 lines
664 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')
// 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()
})