This repository was archived by the owner on Jan 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
47 lines (40 loc) · 1.72 KB
/
jest.config.js
File metadata and controls
47 lines (40 loc) · 1.72 KB
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
'use strict'
module.exports = {
// Provides nice test output of what's being run
verbose: true,
// OS notifications of test results is an opt in feature, enable by setting
// a truthy env value in your shell environment
notify: Boolean(process.env.ENABLE_JEST_NOTIFICATIONS),
// Ignore Cypress acceptance tests
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/cypress'],
// Collect test coverage of source files (excluding stories), report
// text-summary for devs and lcov for reporting to Code Climate in CI/CD envs.
collectCoverage: true,
coverageReporters: ['text-summary', 'lcov'],
collectCoverageFrom: ['src/**/*.{js,ts,tsx}', '!**/*.stories.{js,ts,tsx}'],
coverageDirectory: 'coverage_jest',
// Require unit test coverage for Redux logic
coverageThreshold: {
'src/dux': {
branches: 35,
functions: 50,
statements: 55,
},
},
// Environment setup entrypoints in order of execution
globalSetup: '<rootDir>/.jest/global-setup',
setupFiles: ['<rootDir>/.jest/jest-env-setup.js'],
setupFilesAfterEnv: ['<rootDir>/.jest/jest-after-env-setup.js'],
globalTeardown: '<rootDir>/.jest/global-teardown',
// Configure Jest resolver for non-standard project import and UI resources
// handled by webpack
moduleNameMapper: {
// webpack non-js resources loader mocks
'\\.(png|jpg)$': '<rootDir>/__mocks__/resource-loader-mock.js',
'\\.svg$': '<rootDir>/__mocks__/svgr-loader-mock.js',
'\\.css$': '<rootDir>/__mocks__/css-loader-mock.js',
'\\.scss$': '<rootDir>/__mocks__/scss-loader-mock.js',
// Workaround for: https://jestjs.io/docs/upgrading-to-jest28#packagejson-exports
'componentry': '<rootDir>/node_modules/componentry/dist/commonjs/index.js',
},
}