-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
36 lines (34 loc) · 1.35 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
const BASE_CONFIG = {
// Automatically clear mock calls and instances between every test
clearMocks: true,
collectCoverage: true,
// ignore these build, dist & library directories
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/build/'],
// An array of file extensions your modules use
moduleFileExtensions: ['jsx', 'js', 'json', 'node'],
modulePathIgnorePatterns: ['<rootDir>/build', 'npm-cache', '.npm'],
setupFilesAfterEnv: ['<rootDir>/config/setupTestFrameworkScriptFile.js'],
// ignore the folder where the fixtures are saved so they don't endlessly trigger re-runs in record mode
watchPathIgnorePatterns: ['__nocks__'],
// Indicates whether each individual test should be reported during the run
verbose: false,
};
module.exports = {
watchPlugins: ['<rootDir>/JestWatchPlugin'], // in a repo using this tool, ['@nerdwallet/jest-nock-fixtures/JestWatchPlugin']
projects: [
{
...BASE_CONFIG,
displayName: 'web',
// The test environment that will be used for testing
testEnvironment: 'jsdom',
},
{
...BASE_CONFIG,
displayName: 'other',
// store snapshots in `__snapshots__other__` instead of `__snapshots__`
snapshotResolver: '<rootDir>/config/snapshotResolver-other.js',
// The test environment that will be used for testing
testEnvironment: 'node',
},
],
};