-
Notifications
You must be signed in to change notification settings - Fork 6
/
jest.config.ts
38 lines (36 loc) · 1.1 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
import type { Config } from "@jest/types";
const config: Config.InitialOptions = {
collectCoverageFrom: ["**/*.{ts,tsx,js,jsx}"],
coveragePathIgnorePatterns: [
"/node_modules/",
"/.next/",
"/coverage/",
"/build/",
"/common-ui/types/",
"/dina-ui/out/",
"/dina-ui/intl",
"/jest.config.ts",
"/jest.setup.js",
"/next.config.js",
"index.ts",
"types.ts",
"next-env.d.ts"
],
testEnvironment: "jsdom",
moduleNameMapper: {
// Mocks CSS/SCSS imports to prevent throwing an error during tests.
"\\.css$": "identity-obj-proxy",
"\\.scss$": "identity-obj-proxy"
},
setupFiles: ["<rootDir>/jest.setup.js"],
testPathIgnorePatterns: ["/.next/", "/node_modules/"],
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|js?|tsx?|ts?)$",
transform: {
"^.+\\.tsx?$": ["babel-jest", { presets: ["next/babel"] }],
"^.+\\.js?$": ["babel-jest", { presets: ["next/babel"] }]
},
// Transform our local common-ui package
transformIgnorePatterns: [`/node_modules/(?!common-ui|axios)`],
globalSetup: "./jest-global-setup.js"
};
export default config;