-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
57 lines (56 loc) · 1.42 KB
/
Copy pathjest.config.js
File metadata and controls
57 lines (56 loc) · 1.42 KB
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
module.exports = {
collectCoverageFrom: [
'**/*.{ts,tsx}',
'!**/node_modules/**',
'!**/.storybook/**',
'!**/tests/**',
'!**/coverage/**',
'!**/*.spec.{ts,tsx}',
'!**/*.test.{ts,tsx}',
'!**/*.stories.{ts,tsx}',
'!**/*.config.{ts,tsx,js}',
'!**/__mocks__/**',
'!jest.config.js',
'!next-env.d.ts',
'!global.d.ts',
'!enzyme.js',
'!lint-staged.config.js',
'!next.config.js',
'!types/**',
'!**/types/**',
'!*.d.ts',
],
coverageThreshold: {
global: {
branches: 18,
functions: 34,
lines: 39,
statements: 37,
},
},
// Enzyme stays here as a compatibility layer for the existing component specs.
setupFiles: ['<rootDir>/enzyme.js'],
preset: 'ts-jest',
testPathIgnorePatterns: [
'/.next/',
'/node_modules/',
'/lib/',
'/tests/',
'/coverage/',
'/.storybook/',
'/e2e/',
],
testRegex: '(/__test__/.*|\\.(test|spec))\\.(ts|tsx|js)$',
testURL: 'http://localhost',
testEnvironment: 'jsdom',
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
moduleNameMapper: {
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.js',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/fileMock.js',
},
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }],
},
transformIgnorePatterns: ['<rootDir>/node_modules/'],
};