jest.config.ts 621 B

1234567891011121314151617
  1. import nextJest from "next/jest";
  2. const createJestConfig = nextJest({
  3. // Provide the path to your Next.js app to load next.config.js and .env files in your test environment
  4. dir: "./",
  5. });
  6. // Add any custom config to be passed to Jest
  7. const customJestConfig = {
  8. setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
  9. testEnvironment: "jest-environment-jsdom",
  10. moduleDirectories: ["node_modules", "src"],
  11. modulePaths: ["<rootDir>"]
  12. };
  13. // createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
  14. module.exports = createJestConfig(customJestConfig);