2019-05-29 14:11:44 +00:00
|
|
|
// @flow
|
|
|
|
process.env.NODE_ENV = 'test'
|
|
|
|
process.env.PUBLIC_URL = ''
|
2018-03-06 08:52:55 +00:00
|
|
|
|
|
|
|
// Load environment variables from .env file. Suppress warnings using silent
|
|
|
|
// if this file is missing. dotenv will never modify any environment variables
|
|
|
|
// that have already been set.
|
|
|
|
// https://github.com/motdotla/dotenv
|
2019-12-18 10:18:58 +00:00
|
|
|
require('dotenv-expand')(require('dotenv').config({ silent: true }))
|
2018-03-06 08:52:55 +00:00
|
|
|
|
2019-05-29 14:11:44 +00:00
|
|
|
const jest = require('jest')
|
|
|
|
|
|
|
|
const argv = process.argv.slice(2)
|
2019-09-20 14:05:05 +00:00
|
|
|
argv.push('--runInBand')
|
2018-03-06 08:52:55 +00:00
|
|
|
|
|
|
|
// Watch unless on CI or in coverage mode
|
|
|
|
if (!process.env.CI && argv.indexOf('--coverage') < 0) {
|
2019-05-29 14:11:44 +00:00
|
|
|
argv.push('--watch')
|
2018-03-06 08:52:55 +00:00
|
|
|
}
|
|
|
|
|
2019-05-29 14:11:44 +00:00
|
|
|
jest.run(argv)
|