-
Notifications
You must be signed in to change notification settings - Fork 42
/
jest.config.js
41 lines (41 loc) · 1.35 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
module.exports = {
restoreMocks: true,
rootDir: ".",
testPathIgnorePatterns: ["/node_modules/", "/dist/", "scripts"],
coverageReporters: ["json", "text"],
projects: [
{
displayName: "Jest",
roots: ["packages"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/testHelper/setupTests.ts"],
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
transform: {
"^.+\\.tsx?$": ["@swc/jest"],
"^.+\\.mdx$": "@storybook/addon-docs/jest-transform-mdx"
},
// Below is required for Jest + Webpack handling static assets: https://jestjs.io/docs/webpack
moduleNameMapper: {
"\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js",
"\\.(gif|ttf|eot|svg|png)$": "<rootDir>/__mocks__/fileMock.js"
}
},
{
displayName: "Prettier",
runner: "jest-runner-prettier",
moduleFileExtensions: ["js", "jsx", "json", "ts", "tsx"],
testPathIgnorePatterns: ["design-tokens"],
testMatch: [
"<rootDir>/packages/**/*.{ts|tsx}",
"eslint.json",
"tsconfig.json",
"tsconfig.lint.json",
"tsconfig.dist.json"
]
}
],
snapshotSerializers: [
"@emotion/jest/serializer" /* if needed other snapshotSerializers should go here */
]
};