UNPKG

767 BJavaScriptView Raw
1'use strict';
2
3// Do this as the first thing so that any code reading it knows the right env.
4process.env.BABEL_ENV = 'test';
5process.env.NODE_ENV = 'test';
6
7// Makes the script crash on unhandled rejections instead of silently
8// ignoring them. In the future, promise rejections that are not handled will
9// terminate the Node.js process with a non-zero exit code.
10process.on('unhandledRejection', err => {
11 throw err;
12});
13
14// eslint-disable-next-line @typescript-eslint/no-var-requires
15const jest = require('jest');
16let argv = process.argv.slice(2);
17
18// Watch unless on CI, in coverage mode, or explicitly running all tests
19if (!process.env.CI && argv.indexOf('--coverage') === -1 && argv.indexOf('--watchAll') === -1) {
20 argv.push('--watch');
21}
22
23jest.run(argv);