diff --git a/CLAUDE.md b/CLAUDE.md index 6851fe56abd..721aea78445 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,6 +10,7 @@ npm run dev # Run client + server in dev mode with hot reload npm run start:client # Client only npm run start:server-dev # Server only npm test # Run all tests (Vitest) +npm run test:changed # Only tests affected by changes since origin/main npm run test:coverage # Tests with coverage npm run lint # Oxlint npm run lint:fix # Oxlint with auto-fix @@ -25,6 +26,8 @@ npx vitest tests/YourTest.test.ts --run npx vitest NationAllianceBehavior --run # match by name pattern ``` +While working, run `npm run test:changed` or the files you touched rather than the full suite: a few long simulation tests take most of its time and only matter when the engine changes. CI runs everything. `test:changed` follows imports, so a change to a file that tests read with `fs` (maps in `tests/testdata/`, `resources/`) can be missed; run those tests by name. A change to `package.json` or the Vitest config runs the whole suite. + ## Architecture OpenFront.io is a real-time multiplayer territorial strategy game. There are four components: diff --git a/package.json b/package.json index c5ed3ad2516..f97024f83a2 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "docs:map-generator": "cd map-generator && go doc -cmd -u -all", "tunnel": "npm run build-prod && npm run start:server", "test": "vitest run", + "test:changed": "vitest run --changed origin/main", "test:matchmaking": "node tests/matchmaking/contained.mjs", "test:matchmaking:e2e": "node tests/matchmaking/e2e.mjs", "test:matchmaking:cancel": "node tests/matchmaking/e2e-cancel.mjs",