forked from geist-org/geist-ui
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.jest.config.js
43 lines (35 loc) · 1.11 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
module.exports = {
verbose: true,
setupFiles: ['./tests/setup.js', 'jest-date-mock'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
testPathIgnorePatterns: ['/pages/', '/dist/', '/lib/', '/esm/'],
transform: {
'^.+\\.tsx?$': ['babel-jest', { configFile: './tests/.babelrc.js' }],
},
testRegex: '.*\\.test\\.(j|t)sx?$',
// testRegex: 'grid\\/.*\\.test\\.(j|t)sx?$',
collectCoverageFrom: [
'components/**/*.{ts,tsx}',
'!components/**/styles.{ts,tsx}',
'!components/**/*types.{ts,tsx}',
'!components/styles/*',
'!components/index.ts',
'!components/utils/*',
],
// use codecov.io to block coverage decrease, sicne it's report is better
// https://jestjs.io/docs/en/configuration#coveragethreshold-object
// coverageThreshold: {
// global: {
// // meaning of each coverage
// // https://www.guru99.com/code-coverage.html
// branches: 96.1,
// functions: 99.15,
// lines: 100,
// statements: 98.78,
// },
// },
moduleNameMapper: {
'tests/(.*)$': '<rootDir>/tests/$1',
components: '<rootDir>/components/index.ts',
},
}