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