forked from esquireofoz/abacus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
43 lines (42 loc) · 1.22 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 = {
collectCoverageFrom: [
// Note: Dot directories (e.g., .storybook) are also excluded automatically.
'**/*.{ts,tsx}',
'!**/*stories.tsx',
'!**/node_modules/**',
'!<rootDir>/api/**', // We test these with integration tests.
'!<rootDir>/coverage/**',
'!<rootDir>/e2e/**',
'!<rootDir>/pages/**', // We test these with e2e tests.
'!<rootDir>/public/**',
'!<rootDir>/styles/**',
'!<rootDir>/__tests__/**',
],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
globals: {
// Must specify a custom tsconfig for tests because we need the TypeScript
// transform to transform JSX into js rather than leaving it as JSX which the
// next build requires.
'ts-jest': {
babelConfig: true,
tsConfig: '<rootDir>/tsconfig.jest.json',
},
},
moduleNameMapper: {
'@/(.*)': '<rootDir>/$1',
},
preset: 'ts-jest',
// Adds special extended assertions to Jest, thus simplifying the tests.
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
testPathIgnorePatterns: ['/__tests__/', '/e2e/', '/node_modules/'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
}