-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.js
38 lines (36 loc) · 1.19 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
'use strict'
const { defaults } = require('jest-config')
module.exports = {
collectCoverageFrom: [
'src/**/*.ts?(x)',
'!src/components/**/graphql.ts',
'!src/components/html/index.tsx',
'!src/routes/not-found/index.tsx',
'!src/routes/index.tsx',
'!src/store/index.ts',
'!src/store/locale.ts',
'!src/client.tsx',
'!src/config.ts',
'!src/handler.ts',
'!src/server.tsx',
],
coverageDirectory: 'coverage',
coverageThreshold: {
global: { branches: 100, functions: 100, lines: 100, statements: 100 },
},
errorOnDeprecated: true,
globals: { __IS_DEV__: false },
moduleDirectories: [...defaults.moduleDirectories, '<rootDir>/src'],
modulePathIgnorePatterns: ['<rootDir>/build'],
restoreMocks: true,
setupFilesAfterEnv: ['<rootDir>/config/jest/setup.ts'],
snapshotResolver: '<rootDir>/config/jest/snapshot-resolver.js',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/src/**/*(*.)test.ts?(x)'],
testRunner: 'jest-circus/runner',
transform: {
'^(?!.*\\.(js|json|ts(x)?)$)': '<rootDir>/config/jest/transformers/file.js',
'^.+\\.ts(x)?$': require.resolve('babel-jest'),
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.js$'],
}