-
Notifications
You must be signed in to change notification settings - Fork 15
/
jest.config.js
40 lines (36 loc) · 1.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 { defaults: tsjPreset } = require('ts-jest/presets');
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
module.exports = {
testEnvironment: 'jsdom',
// Automatically clear mock calls and instances between every test
clearMocks: true,
collectCoverage: false,
// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
collectCoverageFrom: [
'src/**/*.ts',
'src/**/*.tsx',
'!src/**/index.tsx',
'!src/**/index.ts',
'!src/**/*.d.ts',
'!src/**/*.test.ts',
'!src/**/*.test.tsx',
'!**/node_modules/**',
],
coverageThreshold: {
global: {
branches: 30,
functions: 30,
lines: 40,
statements: 50,
},
},
transform: {
...tsjPreset.transform,
'\\.(svg)$': '<rootDir>/jest/jest.transformer.js',
// to enable css module snapshots, see https://github.com/keyz/identity-obj-proxy/issues/8
'\\.(css||scss)$': '<rootDir>/jest/jest.transformer.stub.js',
},
setupFilesAfterEnv: [require.resolve('./jest/jest.setup.js')],
};