-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
58 lines (56 loc) · 1.97 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
'use strict';
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
module.exports = {
// Run tests from one or more projects
projects: [
{
// Allows for a label to be printed alongside a test while it is running
displayName: 'test',
// The pattern or patterns Jest uses to detect test files
testRegex: ['.*unit\\.test\\.js$'],
// An array of regexp pattern strings that are matched against all test paths,
// matched tests are skipped
testPathIgnorePatterns: [
'/node_modules/',
'/demo/',
],
},
{
// Allows for a label to be printed alongside a test while it is running
displayName: 'lint',
// This option allows you to use a custom runner instead of Jest's default test runner
runner: 'jest-runner-eslint',
// The pattern or patterns Jest uses to detect test files
testRegex: ['.*\\.js$'],
// An array of regexp pattern strings that are matched against all test paths,
// matched tests are skipped
testPathIgnorePatterns: [
'/node_modules/',
'/build/',
],
},
],
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// The directory where Jest should output its coverage files
coverageDirectory: 'build/coverage/unit',
// An array of regexp pattern strings used to skip coverage collection
coveragePathIgnorePatterns: ['node_modules'],
// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
// Automatically clear mock calls and instances between every test
clearMocks: true,
// Use this configuration option to add custom reporters to Jest
reporters: [
'default',
['jest-junit', { outputDirectory: 'build/results/unit' }],
],
};