-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.web.config.js
35 lines (34 loc) · 1.21 KB
/
jest.web.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
/** @type {import("ts-jest/dist/types").InitialOptionsTsJest} */
module.exports = {
roots: ["<rootDir>/src"],
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts", "!src/mocks/**", "!src/__mock__/**"],
coveragePathIgnorePatterns: [],
testEnvironment: "jsdom",
setupFilesAfterEnv: [require.resolve("./setupTest.js")],
transform: {
"^.+\\.(t|j)sx?$": ["@swc/jest", require("./swc.web.json")],
"^.+\\.css$": require.resolve("./cssTransform.js"),
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": require.resolve("./fileTransform.js")
},
transformIgnorePatterns: ["[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$", "^.+\\.module\\.(css|sass|scss)$"],
modulePaths: ["<rootDir>/src"],
moduleNameMapper: {
"^react-native$": "react-native-web",
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
},
moduleFileExtensions: [
// Place tsx and ts to beginning as suggestion from Jest team
// https://jestjs.io/docs/configuration#modulefileextensions-arraystring
"tsx",
"ts",
"web.js",
"js",
"web.ts",
"web.tsx",
"json",
"web.jsx",
"jsx",
"node"
],
watchPlugins: ["jest-watch-typeahead/filename", "jest-watch-typeahead/testname"]
};