2019-11-13 14:01:51 +00:00
|
|
|
import chai from 'chai';
|
|
|
|
import chaiAsPromised from 'chai-as-promised';
|
|
|
|
import sinonChai from 'sinon-chai';
|
|
|
|
import sourceMapSupport from 'source-map-support';
|
|
|
|
|
|
|
|
sourceMapSupport.install({
|
|
|
|
environment: 'node',
|
|
|
|
handleUncaughtExceptions: true,
|
|
|
|
hookRequire: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This will break the whole test run if any test leaks an unhandled rejection.
|
|
|
|
*/
|
2021-07-10 22:38:08 +00:00
|
|
|
process.on('unhandledRejection', (reason, _promise) => {
|
2019-11-13 14:01:51 +00:00
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.error('unhandled error during tests', reason);
|
|
|
|
process.exit(1);
|
|
|
|
});
|
|
|
|
|
|
|
|
chai.use(chaiAsPromised);
|
|
|
|
chai.use(sinonChai);
|