Skip to content

Commit 2d7061a

Browse files
daniel-lxshannesrudolph
authored andcommitted
docs: add compact testing guidelines to project rules (#5353)
1 parent b2f6012 commit 2d7061a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.roo/rules/rules.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
- Ensure all tests pass before submitting changes
77
- 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
88
- Tests must be run from the same directory as the `package.json` file that specifies `vitest` in `devDependencies`
9+
- Run tests with: `npx vitest <relative-path-from-workspace-root>`
10+
- Do NOT run tests from project root - this causes "vitest: command not found" error
11+
- Tests must be run from inside the correct workspace:
12+
- Backend tests: `cd src && npx vitest path/to/test-file` (don't include `src/` in path)
13+
- UI tests: `cd webview-ui && npx vitest src/path/to/test-file`
14+
- Example: For `src/tests/user.test.ts`, run `cd src && npx vitest tests/user.test.ts` NOT `npx vitest src/tests/user.test.ts`
915

1016
2. Lint Rules:
1117

0 commit comments

Comments
 (0)