-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.js
37 lines (36 loc) · 1.65 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
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
module.exports = {
testEnvironment: 'jsdom',
// The directory where Jest should store its cached dependency information
cacheDirectory: '<rootDir>/.jest',
// Automatically clear mock calls and instances between every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: ['**/src/*.{ts,tsx}'],
// The directory where Jest should output its coverage files
coverageDirectory: './coverage/',
// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: ['lcov', 'html', 'text-summary'],
// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 91,
functions: 100,
lines: 96,
statements: 96,
},
},
// A preset that is used as a base for Jest's configuration
preset: null,
// Automatically reset mock state between every test
resetMocks: true,
// The paths to modules that runs some code to configure or set up the testing framework before each test
setupFilesAfterEnv: ['<rootDir>jest.setup.js'],
// The glob patterns Jest uses to detect test files
testMatch: ['<rootDir>/**/*.test.(js|jsx|tsx|ts)'],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: ['/node_modules/', '/scripts/', '/dist/'],
};