-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
65 lines (56 loc) · 2.38 KB
/
jest.config.ts
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
56
57
58
59
60
61
62
63
64
65
import { getJestProjects } from "@nx/jest";
/**
* Config for Jest unit tests
*
* https://jestjs.io/docs/configuration#projects-arraystring--projectconfig
*/
export default {
/**
* When the projects configuration is provided with an array of paths or glob patterns, Jest will run tests in all of the specified projects at the same time.
* This is great for monorepos or when working on multiple projects at the same time.
*/
projects: getJestProjects(),
/**
* Indicates whether the coverage information should be collected while executing the test. Because this retrofits all
* executed files with coverage collection statements, it may significantly slow down your tests. Default: false
*/
collectCoverage: true,
/**
* An array of glob patterns indicating a set of files for which coverage information should be collected.
* If a file matches the specified glob pattern, coverage information will be collected for it even if no tests exist
* for this file and it's never required in the test suite. Default: undefined
*/
// collectCoverageFrom: ["**/*(!*.spec).tsx", "**/*(!*.spec).ts"],
/**
* The directory where Jest should output its coverage files. Default: undefined
*/
coverageDirectory: "<rootDir>/coverage",
/**
* An array of regexp pattern strings that are matched against all file paths before executing the test. If the file path
* matches any of the patterns, coverage information will be skipped.
*/
coveragePathIgnorePatterns: [
"\\.spec\\.ts$",
"\\.test\\.ts$",
"<rootDir>/dist",
"<rootDir>/test",
"<rootDir>/__generated__",
"<rootDir>/node_modules",
],
/**
* The test environment that will be used for testing. The default environment in Jest is a Node.js environment.
* If you are building a web app, you can use a browser-like environment through jsdom instead.
*/
testEnvironment: "jest-environment-jsdom",
/**
* A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used.
* Default: ["json", "lcov", "text"]
*/
coverageReporters: ["lcov"],
setupFiles: ["<rootDir>/testing/__mocks__/jest.setup.js"],
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/testing/__mocks__/file.mock.js",
"\\.(css|less)$": "<rootDir>/testing/__mocks__/style.mock.js",
},
};