Files
portfolio/jest.config.ts
denshooter 2c2c1f5d2d
All checks were successful
CI / CD / test-build (push) Successful in 10m16s
CI / CD / deploy-dev (push) Successful in 1m55s
CI / CD / deploy-production (push) Has been skipped
fix: SEO canonical URLs, LCP performance, remove unused dependencies
- Remove duplicate app/projects/ route (was causing 5xx and soft 404)
- Fix nginx: redirect www.dk0.dev → dk0.dev (non-www canonical)
- Fix not-found.tsx: locale-prefixed links, remove framer-motion dependency
- Add fetchPriority='high' and will-change to Hero LCP image
- Add preconnect hints for hardcover.app and cms.dk0.dev
- Reduce background blur from 100px to 80px (LCP rendering delay)
- Remove boneyard-js (~20 KiB), replace with custom Skeleton component
- Remove react-icons (~10 KiB), replace with inline SVGs
- Conditionally render mobile menu (saves ~20 DOM nodes)
- Add /books to sitemap
- Optimize image config with explicit deviceSizes/imageSizes
2026-04-17 09:50:31 +02:00

39 lines
1.6 KiB
TypeScript

import type { Config } from "jest";
import nextJest from "next/jest.js";
const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: "./",
});
// Add any custom config to be passed to Jest
const config: Config = {
coverageProvider: "v8",
testEnvironment: "jsdom",
// Add more setup options before each test is run
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
// Ignore tests inside __mocks__ directory and E2E tests (Playwright)
testPathIgnorePatterns: ["/node_modules/", "/__mocks__/", "/.next/", "/e2e/"],
// Transform react-markdown and other ESM modules
transformIgnorePatterns: [
"node_modules/(?!(react-markdown|remark-.*|rehype-.*|unified|bail|is-plain-obj|trough|vfile|vfile-message|unist-.*|micromark|parse-entities|character-entities|mdast-.*|hast-.*|property-information|space-separated-tokens|comma-separated-tokens|web-namespaces|zwitch|longest-streak|ccount)/)",
],
// Module name mapping to fix haste collision
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
},
// Exclude problematic directories from haste
modulePathIgnorePatterns: ["<rootDir>/.next/", "<rootDir>/node_modules/", "<rootDir>/e2e/"],
// Clear mocks between tests
clearMocks: true,
// Reset modules between tests
resetMocks: true,
// Restore mocks between tests
restoreMocks: true,
// Max workers for better performance
maxWorkers: "50%",
};
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
export default createJestConfig(config);