-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjest.config.js
More file actions
26 lines (23 loc) · 1.11 KB
/
Copy pathjest.config.js
File metadata and controls
26 lines (23 loc) · 1.11 KB
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
const nextJest = require('next/jest')
const createJestConfig = nextJest({
dir: './'
})
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironment: 'jsdom',
// Playwright E2E tests live under /e2e and have a separate runner.
// /.claude/worktrees/ holds in-flight subagent branches with duplicate
// test files; ignore them too so the main repo's `npm test` doesn't
// re-run every worktree's copy. /collab-server/ is its own package with
// its own lockfile + vitest runner (see .github/workflows/ci.yml).
testPathIgnorePatterns: ['/node_modules/', '/.next/', '/e2e/', '/.claude/worktrees/', '/collab-server/'],
// @vercel/analytics and uuid (v14+) ship ESM-only and trip Jest's CJS
// loader. Stub analytics to a no-op track(); back uuid's v4 with
// crypto.randomUUID() so tests still get real v4 UUIDs.
moduleNameMapper: {
'^@vercel/analytics$': '<rootDir>/jest.stubs/vercel-analytics.js',
'^@vercel/analytics/next$': '<rootDir>/jest.stubs/vercel-analytics.js',
'^uuid$': '<rootDir>/jest.stubs/uuid.js',
},
}
module.exports = createJestConfig(customJestConfig)