-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
29 lines (27 loc) · 1.01 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
import { Config } from "@jest/types";
const config: Config.InitialOptions = {
roots: ["<rootDir>"],
testPathIgnorePatterns: ["<rootDir>[/\\\\](node_modules|.next)[/\\\\]"],
transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(ts|tsx)$"],
setupFilesAfterEnv: ["./src/tests/jest.setup.ts"],
transform: {
"^.+\\.(js|jsx|ts|tsx)$": "./node_modules/babel-jest",
"\\.(gql|graphql)$": "jest-transform-graphql",
},
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname",
],
moduleNameMapper: {
"^.+\\.(css|less|scss)$": "identity-obj-proxy",
"^@/graphql(.*)$": "<rootDir>/src/lib/graphql$1",
"^@/animations(.*)$": "<rootDir>/src/Animations$1",
"^@/components(.*)$": "<rootDir>/Components$1",
"^@/apolloClient(.*)$": "<rootDir>/src/lib/apolloClient",
"^@/styles(.*)$": "<rootDir>/styles/pages$1",
"^@/src(.*)$": "<rootDir>/src$1",
"^@/api/(.*)$": "<rootDir>/pages/api$1",
"^@/pages(.*)$": "<rootDir>/pages$1",
},
};
export default config;