-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.js
53 lines (52 loc) · 1.53 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
const ignores = [
'/src/index.ts',
'/playground/',
'/node_modules/',
'/__tests__/helpers/',
'/__tests__/utils/',
'__mocks__',
];
module.exports = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/**/*.d.ts',
'!src/code-challenges/**/*.{js,jsx,ts,tsx}',
'!src/**/*.story.{js,jsx,ts,tsx}',
],
coverageDirectory: './coverage',
coverageReporters: ['json-summary', 'json', 'lcov', 'text'],
coveragePathIgnorePatterns: [...ignores],
coverageThreshold: {
global: {
branches: 90,
functions: 90,
lines: 90,
statements: 90,
},
},
moduleFileExtensions: ['js', 'jsx', 'json', 'ts', 'tsx', 'scss'],
modulePaths: ['src'],
preset: 'jest-preset-typescript',
setupFilesAfterEnv: ['<rootDir>/config/testSetup.js'],
testEnvironment: 'jest-environment-jsdom-fourteen',
testURL: 'http://localhost',
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
],
testRegex: [],
testPathIgnorePatterns: [...ignores],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|css|json)$)': '<rootDir>/config/jest/fileTransform.js',
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
watchPlugins: [
require.resolve('jest-watch-typeahead/filename'),
require.resolve('jest-watch-typeahead/testname'),
],
};