diff --git a/CLAUDE.md b/CLAUDE.md index 0e70caed8..ba5232c0b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -439,6 +439,7 @@ npm run dev # Start server (port 3000) + client dev server (po | `npm run dev:client` | Start only the Webpack dev server | | `npm run build` | Build all packages (shared -> client -> server) | | `npm test` | Run all tests | +| `npm run test:collect` | List all tests (suites + names) without executing them | | `npm run lint` | Lint all code | | `npm run format` | Format all code | | `npm run typecheck` | Type-check all packages | diff --git a/jest.config.ts b/jest.config.ts index 566fddbfc..3bf98fbf0 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -40,6 +40,12 @@ const config: Config = { // Locally, use up to 2 workers and recycle when heap exceeds 512 MB. // CI auto-detects workers (GitHub Actions sets CI=true). ...(isCI ? {} : { maxWorkers: 2, workerIdleMemoryLimit: '512M' }), + // Give workers 2 s to release file-watchers and jsdom handles after tests + // complete before force-killing. The 500 ms default is too tight in the + // resource-constrained sandbox and produces spurious "worker failed to exit + // gracefully" warnings; 2000 ms lets legitimate cleanup finish while still + // bounding true hangs. + workerGracefulExitTimeout: 2000, projects: [ { ...baseConfig, diff --git a/package.json b/package.json index fb93019c0..5880178d2 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,8 @@ "test": "node --experimental-vm-modules node_modules/.bin/jest", "test:watch": "node --experimental-vm-modules node_modules/.bin/jest --watch", "test:coverage": "node --experimental-vm-modules node_modules/.bin/jest --coverage", + "test:collect": "node --experimental-vm-modules node_modules/.bin/jest --collectTests", + "test:collect:json": "node --experimental-vm-modules node_modules/.bin/jest --collectTests --json", "test:e2e": "npm test -w e2e", "test:e2e:shard": "npm run test:shard -w e2e", "test:e2e:smoke": "npm run test:smoke -w e2e",