-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
40 lines (39 loc) · 1 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
const { name } = require('./package.json')
module.exports = {
bail: 1,
displayName: name,
testTimeout: 30000,
name,
clearMocks: true,
preset: 'ts-jest',
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov'],
collectCoverageFrom: ['src/**/*.{js,ts}'],
coveragePathIgnorePatterns: ['node_modules', 'setup*.js', '__tests__', 'coverage', 'dist'],
moduleDirectories: ['node_modules', 'src'],
moduleFileExtensions: ['ts', 'js'],
testPathIgnorePatterns: ['dist', 'node_modules', 'requests'],
transform: {
// '.(js|jsx|ts|tsx)': 'babel-jest'
'.(js|jsx)': '@sucrase/jest-plugin'
},
setupFiles: [
'dotenv/config'
// '<rootDir>/jest.setup.js'
],
moduleNameMapper: {
'~/(.*)': '<rootDir>/src/$1'
},
testMatch: [
'<rootDir>/__tests__/**/*.(test).{js,jsx,ts,tsx}',
'<rootDir>/__tests__/**/?(*.)(spec|test).{js,jsx,ts,tsx}'
],
coverageThreshold: {
global: {
branches: 50,
functions: 85,
lines: 75,
statements: 80
}
}
}