UNPKG

732 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';
6process.env.PUBLIC_URL = '';
7
8// Makes the script crash on unhandled rejections instead of silently
9// ignoring them. In the future, promise rejections that are not handled will
10// terminate the Node.js process with a non-zero exit code.
11process.on('unhandledRejection', err => {
12 throw err;
13});
14
15// Ensure environment variables are read.
16require('../config/env');
17
18const jest = require('jest');
19let argv = process.argv.slice(2);
20
21// Watch unless on CI or in coverage mode
22if (!process.env.CI && argv.indexOf('--coverage') < 0) {
23 argv.push('--watch');
24}
25
26
27jest.run(argv);