generated from Open-Attestation/react-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
jest.config.ts
27 lines (23 loc) · 949 Bytes
/
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
import type { Config } from "@jest/types";
import { pathsToModuleNameMapper } from "ts-jest";
import nextJest from "next/jest";
import { compilerOptions } from "./tsconfig.json";
const createJestConfig = nextJest({
dir: "./", // Path to the Next.js app to load next.config.js and .env files for test environment
});
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/
const config: Config.InitialOptions = {
preset: "ts-jest",
testEnvironment: "jest-environment-jsdom",
testPathIgnorePatterns: ["node_modules", "integration", "monitoring", ".next"],
roots: ["<rootDir>"],
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths),
uuid: require.resolve("uuid"), // FIXME: Somehow required after jest is upgraded from v27.5.1 to v28.1.3
},
};
export default createJestConfig(config);