-
Notifications
You must be signed in to change notification settings - Fork 109
/
Copy pathjest.config.js
41 lines (34 loc) · 1.06 KB
/
jest.config.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
31
32
33
34
35
36
37
38
39
40
41
const jestPuppeteerConfig = require('./jest-puppeteer.config.js')
// Detect when browser has been launched headless
const { headless = true } = jestPuppeteerConfig.launch
/**
* @type {Config}
*/
module.exports = {
collectCoverageFrom: ['packages/**/*.js'],
// Reduce CPU usage during project test runs
maxWorkers: headless
? '50%' // Matches Jest default (50%) via `--watch`
: 1, // Use only 1x browser window when headless
projects: [
{
displayName: 'JSDom',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/tests/integration/jsdom/**/*.test.js']
},
{
displayName: 'Pupppeteer',
globalSetup: 'jest-environment-puppeteer/setup',
globalTeardown: 'jest-environment-puppeteer/teardown',
testEnvironment: 'jest-environment-puppeteer',
testMatch: ['<rootDir>/tests/integration/puppeteer/**/*.test.js']
}
],
// Enable GitHub Actions reporter UI
reporters: ['default', 'github-actions'],
// Browser test increased timeout (5s to 15s)
testTimeout: 15000
}
/**
* @import { Config } from 'jest'
*/