vegancheck.me/jest.config.ts
2024-10-26 19:51:08 +02:00

31 lines
830 B
TypeScript

import type { Config } from "jest";
import nextJest from "next/jest";
const createJestConfig = nextJest({
dir: "./",
});
const customJestConfig: Config = {
setupFilesAfterEnv: ["<rootDir>/src/tests/setup.ts"],
testEnvironment: "jest-environment-jsdom",
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
},
testMatch: ["**/*.test.ts", "**/*.test.tsx"],
collectCoverage: true,
coverageDirectory: "coverage",
coverageReporters: ["text", "lcov", "json"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json"],
testPathIgnorePatterns: [
"<rootDir>/node_modules/",
"<rootDir>/.next/",
"<rootDir>/playwright/",
],
transformIgnorePatterns: [
"/node_modules/",
"^.+\\.module\\.(css|sass|scss)$",
],
coverageProvider: "v8",
};
export default createJestConfig(customJestConfig);