-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathjest.config.js
More file actions
29 lines (26 loc) · 1009 Bytes
/
jest.config.js
File metadata and controls
29 lines (26 loc) · 1009 Bytes
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
const nextJest = require("next/jest");
const createJestConfig = nextJest({
dir: "./",
});
/** @type {import('jest').Config} */
const customJestConfig = {
testEnvironment: "jest-environment-jsdom",
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
testMatch: ["**/__tests__/**/*?(*.)+(test|spec).[jt]s?(x)"],
testPathIgnorePatterns: [
"<rootDir>/.next/",
"<rootDir>/node_modules/",
"<rootDir>/cypress/",
],
// Some deps (uuid@13, @codegouvfr/react-dsfr) ship ESM which Jest (CJS) won’t parse from
// node_modules unless transformed by Next/Jest.
// With pnpm the physical path is typically:
// - node_modules/.pnpm/uuid@.../node_modules/uuid/...
// - node_modules/.pnpm/@codegouvfr+react-dsfr@.../node_modules/@codegouvfr/react-dsfr/...
transformIgnorePatterns: [
"/node_modules/(?!(\\.pnpm\\/(uuid@[^/]+|@codegouvfr\\+react-dsfr@[^/]+)|@codegouvfr\\/react-dsfr)/)",
],
testTimeout: 20000,
silent: true,
};
module.exports = createJestConfig(customJestConfig);