-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.config.js
28 lines (23 loc) · 1011 Bytes
/
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
module.exports = {
// The root of source code
// `<rootDir>` is a token Jest substitutes
// A list of paths to directories that Jest should use to search for files in
roots: ["<rootDir>/src"],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
"\\.(css|less|scss|sss|styl)$": "<rootDir>/src/core/utils/test/__mocks__/styleMock.ts",
"\\.svg$": "<rootDir>/src/core/utils/test/__mocks__/svgrMock.ts"
},
// A preset that is used as a base for Jest's configuration
preset: "ts-jest",
// The test environment that will be used for testing
testEnvironment: "jsdom",
// Jest transformations -- this adds support for TypeScript
// using ts-jest
transform: {
"^.+\\.tsx?$": "ts-jest"
},
// Automatically clear mock calls and instances before every test.
// Equivalent to calling jest.clearAllMocks() before each test.
clearMocks: true
};