-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
33 lines (32 loc) · 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
import type { Config } from "@jest/types";
const config: Config.InitialOptions = {
roots: ["<rootDir>"],
testEnvironment: "jsdom",
collectCoverageFrom: [
"**/*.{js,jsx,ts,tsx}",
"!**/*.d.ts",
"!**/node_modules/**",
],
moduleFileExtensions: ["ts", "tsx", "js", "json", "jsx"],
testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/.next/"],
transformIgnorePatterns: [
"/node_modules/",
"^.+\\.module\\.(css|sass|scss)$",
],
transform: {
"^.+\\.(js|jsx|ts|tsx)$": ["babel-jest", { presets: ["next/babel"] }],
},
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname",
],
moduleNameMapper: {
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
"^.+\\.(css|sass|scss)$": "<rootDir>/__mocks__/styleMock.ts",
"^.+\\.(jpg|jpeg|png|gif|webp|avif|svg)$":
"<rootDir>/__mocks__/fileMock.ts",
"^@/components/(.*)$": "<rootDir>/components/$1",
},
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
};
export default config;