-
Notifications
You must be signed in to change notification settings - Fork 26
/
jest.config.js
55 lines (54 loc) · 1.68 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
// SPDX-License-Identifier: MPL-2.0
// Copyright (C) 2019 - 2023 Gemeente Amsterdam
const path = require('path')
module.exports = {
collectCoverageFrom: [
'src/*.{js,jsx,ts,tsx}',
'src/**/*.{js,jsx,ts,tsx}',
'!src/*.test.{js,jsx,ts,tsx}',
'!src/**/*.test.{js,jsx,ts,tsx}',
'!src/test/**/*.{js,jsx,ts,tsx}',
'!src/*/RbGenerated*/*.{js,jsx,ts,tsx}',
'!src/app.{js,jsx,ts,tsx}',
'!src/polyfills.{js,jsx,ts,tsx}',
'!src/global-styles.{js,jsx,ts,tsx}',
'!src/**/definitions/*',
'!src/**/.*',
'!src/sw-proxy*.{js,jsx,ts,tsx}',
],
coverageThreshold: {
global: {
statements: 94.06,
branches: 88.01,
lines: 94.42,
functions: 93.53,
},
},
coverageReporters: process.env.CI ? ['text'] : ['lcov'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
moduleDirectories: ['node_modules', 'src'],
modulePathIgnorePatterns: ['<rootDir>/internals/', '<rootDir>/dist/'],
moduleNameMapper: {
'.*\\.css$': '<rootDir>/internals/mocks/cssModule.js',
'.*\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/internals/mocks/image.ts',
},
setupFiles: ['<rootDir>/internals/testing/jest.polyfills.ts'],
setupFilesAfterEnv: [
'<rootDir>/internals/testing/test-bundler.ts',
'<rootDir>/internals/testing/jest-setup-msw.ts',
],
testTimeout: 10000,
testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: [''],
},
transform: {
'^.+\\.(j|t)s(x?)$': [
'babel-jest',
{ configFile: path.resolve(__dirname, 'babel.config.js') },
],
},
testRegex: '.*\\.test\\.(js|ts(x?))$',
snapshotSerializers: ['enzyme-to-json/serializer'],
}