-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
55 lines (54 loc) · 1.29 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
44
45
46
47
48
49
50
51
52
53
54
55
/** @type {import('jest').Config} */
const config = {
globals: {
'babel-jest': {},
},
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!src/**/*.d.ts'],
verbose: true,
testMatch: [
'<rootDir>/src/**/*.(test).{js,jsx,ts,tsx}',
'<rootDir>/test/**/*.(test).{js,jsx,ts,tsx}',
],
testEnvironment: 'jest-environment-jsdom',
testEnvironmentOptions: {
url: 'http://localhost/',
},
setupFilesAfterEnv: ['<rootDir>/test/setupTests.js'],
transform: {
'^.+\\.(t|j)sx?$': ['babel-jest'],
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '<rootDir>/test/fileTransform.js',
},
moduleNameMapper: {
'^@frontend/(.*)$': '<rootDir>/src/$1',
'^@frontend-test/(.*)$': '<rootDir>/test/$1',
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
},
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
moduleFileExtensions: [
'web.js',
'js',
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
'node',
],
resetMocks: true,
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
snapshotSerializers: ['jest-serializer-html'],
coverageThreshold: {
global: {
statements: 93.8,
branches: 85,
lines: 95,
functions: 96,
},
},
};
module.exports = config;