generated from masakudamatsu/nextjs-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
42 lines (41 loc) · 1.02 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
const path = require('path');
module.exports = {
clearMocks: true, // run jest.clearAllMocks() after each test
collectCoverageFrom: [
'src/**/*.{js,jsx}',
'!**/pages/_*.js',
'!**/*.test.js',
'!**/*.spec.js',
], // https://jestjs.io/docs/en/configuration#collectcoveragefrom-array
coverageThreshold: {
global: {
statements: 50,
branches: 46,
functions: 51,
lines: 51,
},
'./src/utils/colorAnalyzer.js': {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
'./src/utils/getContrastRatio.js': {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
moduleDirectories: [
'node_modules',
__dirname,
path.join(__dirname, '../src'), // allow imports with absolute paths
],
setupFilesAfterEnv: [
'@testing-library/jest-dom/extend-expect',
'jest-axe/extend-expect',
'jest-styled-components',
],
testPathIgnorePatterns: ['<rootDir>/cypress/', '<rootDir>/node_modules/'],
};