-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjest.config.js
More file actions
28 lines (24 loc) · 956 Bytes
/
Copy pathjest.config.js
File metadata and controls
28 lines (24 loc) · 956 Bytes
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
const path = require('path')
/** @type {import('@jest/types').Config.InitialOptions} */
const CI_CONFIG = {
reporters: ['summary', 'github-actions'],
coverageReporters: ['json-summary', 'text-summary', 'json'],
}
/** @type {import('@jest/types').Config.InitialOptions} */
const DEV_CONFIG = {
coverageReporters: ['json-summary', 'text-summary', 'lcov', 'json'],
}
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
testMatch: ['**/__tests__/**/*.test.?([cm])[jt]s?(x)', '**/?(*.)+(spec|test).?([cm])[jt]s?(x)'],
setupFilesAfterEnv: [path.join(__dirname, 'jest.setup.js')],
collectCoverage: false,
testTimeout: 10_000,
bail: true,
forceExit: true,
...(process.env.CI === 'true' ? CI_CONFIG : DEV_CONFIG),
}
// Integration tests are not run by default, opt-in via env flag
if (process.env.RUN_TESTS === 'integration') {
module.exports.testMatch = ['**/__tests__/**/*.integration-test.?([cm])[jt]s?(x)']
}