You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: migrate test runner from Jest to Vitest (#617)
Replace `jest` + `ts-jest` with `vitest` for faster, more reliable test
execution.
Drops Node 16 from the CI checks (incompatibility w/ latest Vitest
through missing `crypto` API).
Closes#612
Copy file name to clipboardExpand all lines: CLAUDE.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,10 @@ Internal Apify monorepo of shared TypeScript utilities and constants published a
11
11
```bash
12
12
npm install # Install all dependencies
13
13
npm run build # Build all packages (lerna run build)
14
-
npm test# Run all tests (jest --silent)
14
+
npm test# Run all tests (vitest)
15
15
npm run test-cov # Run tests with coverage
16
-
npx jest test/consts.test.ts # Run a single test file
17
-
npx jest test/consts.test.ts -t "pattern"# Run specific test by name
16
+
npx vitest run test/consts.test.ts # Run a single test file
17
+
npx vitest run test/consts.test.ts -t "pattern"# Run specific test by name
18
18
npm run lint # Lint all source and test files
19
19
npm run lint:fix # Lint with auto-fix
20
20
npm run clean # Clean all dist/ folders
@@ -29,10 +29,10 @@ npm run clean # Clean all dist/ folders
29
29
30
30
## Key Conventions
31
31
32
-
-**Imports in tests:** Always use absolute package names (`@apify/consts`, not relative paths to package sources). Jest's `moduleNameMapper` resolves `@apify/*` to `packages/*/src`
32
+
-**Imports in tests:** Always use absolute package names (`@apify/consts`, not relative paths to package sources). Vitest's `resolve.alias` resolves `@apify/*` to `packages/*/src`
33
33
-**Cross-package imports in source:** Use absolute `@apify/*` paths. Within the same package, use relative imports. Never self-import a package by its own `@apify/*` name
34
34
-**Dev dependencies** go in the root `package.json` only. Runtime dependencies go in each package's own `package.json`
35
-
-**No build needed for tests** — ts-jest compiles TypeScript directly from source
35
+
-**No build needed for tests** — Vitest compiles TypeScript directly from source via esbuild
36
36
-**Conventional commits** required: `fix:` (patch), `feat:` (minor), `BREAKING CHANGE:` in footer (major). Enforced by commitlint + husky hooks. PR titles must also follow this format
37
37
-**Adding a new package:** Copy an existing package directory, update `package.json` name/deps, keep the standard `build`/`clean`/`compile`/`copy` scripts
38
38
- Package dependencies must be declared in `package.json` so Lerna builds in correct topological order
0 commit comments