-
Notifications
You must be signed in to change notification settings - Fork 198
/
Copy pathtest.js
30 lines (24 loc) · 781 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Setup environment before any code -
// this makes sure everything coming after will run in the correct env.
process.env.NODE_ENV = 'test';
// Crash on unhandled rejections instead of failing silently.
process.on('unhandledRejection', (reason) => {
throw reason;
});
const jest = require('jest');
const yn = require('yn');
let argv = process.argv.slice(2);
if (yn(process.env.CI)) {
// Use CI mode
argv.push('--ci');
// Parallelized puppeteer tests have high memory overhead in CI environments.
// Fall back to run in series so tests could run faster.
argv.push('--runInBand');
// Add JUnit reporter
argv.push('--reporters="default"');
argv.push('--reporters="jest-junit"');
}
if (yn(process.env.DEBUG)) {
argv.push('--verbose');
}
void jest.run(argv);