2018-05-08 21:35:56 +00:00
|
|
|
// @flow
|
2018-02-18 16:13:29 +00:00
|
|
|
"use strict";
|
2018-02-17 21:28:47 +00:00
|
|
|
|
|
|
|
// Do this as the first thing so that any code reading it knows the right env.
|
2018-02-18 16:13:29 +00:00
|
|
|
process.env.BABEL_ENV = "test";
|
|
|
|
process.env.NODE_ENV = "test";
|
|
|
|
process.env.PUBLIC_URL = "";
|
2018-02-17 21:28:47 +00:00
|
|
|
|
2018-06-05 18:11:48 +00:00
|
|
|
require("../src/tools/entry");
|
2018-02-17 21:28:47 +00:00
|
|
|
|
|
|
|
// Ensure environment variables are read.
|
2018-02-18 16:13:29 +00:00
|
|
|
require("../config/env");
|
2018-02-17 21:28:47 +00:00
|
|
|
|
2018-02-18 16:13:29 +00:00
|
|
|
const jest = require("jest");
|
2018-02-17 21:28:47 +00:00
|
|
|
const argv = process.argv.slice(2);
|
|
|
|
|
|
|
|
// Watch unless on CI or in coverage mode
|
2018-02-18 16:13:29 +00:00
|
|
|
if (!process.env.CI && argv.indexOf("--coverage") < 0) {
|
|
|
|
argv.push("--watch");
|
2018-02-17 21:28:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
jest.run(argv);
|