From c72f4a4b5e54c4b9ad751f499821c52aeec7d055 Mon Sep 17 00:00:00 2001 From: Daniel <57051444+daniel-lxs@users.noreply.github.com> Date: Wed, 2 Jul 2025 17:48:50 -0500 Subject: [PATCH] docs: add compact testing guidelines to project rules (#5353) --- .roo/rules/rules.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.roo/rules/rules.md b/.roo/rules/rules.md index d3795393f3..b423021844 100644 --- a/.roo/rules/rules.md +++ b/.roo/rules/rules.md @@ -6,6 +6,12 @@ - Ensure all tests pass before submitting changes - The vitest framework is used for testing; the `describe`, `test`, `it`, etc functions are defined by default in `tsconfig.json` and therefore don't need to be imported - Tests must be run from the same directory as the `package.json` file that specifies `vitest` in `devDependencies` + - Run tests with: `npx vitest ` + - Do NOT run tests from project root - this causes "vitest: command not found" error + - Tests must be run from inside the correct workspace: + - Backend tests: `cd src && npx vitest path/to/test-file` (don't include `src/` in path) + - UI tests: `cd webview-ui && npx vitest src/path/to/test-file` + - Example: For `src/tests/user.test.ts`, run `cd src && npx vitest tests/user.test.ts` NOT `npx vitest src/tests/user.test.ts` 2. Lint Rules: