Skip to content

Commit 515f60a

Browse files
committed
feat: integrate affected testing into npm scripts
- Add test:affected script for running affected tests - Update test-pre-commit to use affected test runner with --staged flag - Speeds up precommit hooks by only running relevant tests
1 parent 09ddc4b commit 515f60a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@
7878
"bs": "pnpm run build:dist:src; pnpm exec socket --",
7979
"s": "pnpm exec socket --",
8080
"test": "run-s check test:*",
81+
"test:affected": "node scripts/test-affected.mjs",
8182
"test:unit": "dotenvx -q run -f .env.test -- pnpm vitest run --config .config/vitest.config.mts",
8283
"test:unit:update": "dotenvx -q run -f .env.test -- pnpm vitest run --config .config/vitest.config.mts --update",
8384
"test:unit:coverage": "dotenvx -q run -f .env.test -- pnpm vitest run --config .config/vitest.config.mts --coverage",
8485
"test:validate": "node scripts/validate-tests.mjs",
8586
"test:wrapper": "node scripts/test-wrapper.mjs",
8687
"test-ci": "run-s test:*",
87-
"test-pre-commit": "pnpm test",
88+
"test-pre-commit": "dotenvx -q run -f .env.precommit -- node scripts/test-affected.mjs --staged",
8889
"testu": "dotenvx -q run -f .env.test -- run-s pretest:unit; pnpm run test:unit:update --",
8990
"testuf": "dotenvx -q run -f .env.test -- pnpm run test:unit:update --",
9091
"update": "run-p --aggregate-output update:*",

0 commit comments

Comments
 (0)