1 | ;
|
2 |
|
3 | // Do this as the first thing so that any code reading it knows the right env.
|
4 | process.env.BABEL_ENV = 'test';
|
5 | process.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.
|
10 | process.on('unhandledRejection', err => {
|
11 | throw err;
|
12 | });
|
13 |
|
14 | // eslint-disable-next-line @typescript-eslint/no-var-requires
|
15 | const jest = require('jest');
|
16 | let argv = process.argv.slice(2);
|
17 |
|
18 | // Watch unless on CI, in coverage mode, or explicitly running all tests
|
19 | if (!process.env.CI && argv.indexOf('--coverage') === -1 && argv.indexOf('--watchAll') === -1) {
|
20 | argv.push('--watch');
|
21 | }
|
22 |
|
23 | jest.run(argv);
|