mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
When running vitest without the run parameter, it enters watch mode and waits for user input (like pressing q to quit), causing tests to hang in the terminal. This change updates the documentation to specify using npx vitest run instead of just npx vitest to ensure tests run to completion without requiring user interaction. Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org> Co-authored-by: Eric Wheeler <roo-code@z.ewheeler.org>
1.4 KiB
1.4 KiB
Code Quality Rules
-
Test Coverage:
- Before attempting completion, always make sure that any code changes have test coverage
- Ensure all tests pass before submitting changes
- The vitest framework is used for testing; the
describe,test,it, etc functions are defined by default intsconfig.jsonand therefore don't need to be imported - Tests must be run from the same directory as the
package.jsonfile that specifiesvitestindevDependencies - Run tests with:
npx vitest run <relative-path-from-workspace-root> - 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 run path/to/test-file(don't includesrc/in path) - UI tests:
cd webview-ui && npx vitest run src/path/to/test-file
- Backend tests:
- Example: For
src/tests/user.test.ts, runcd src && npx vitest run tests/user.test.tsNOTnpx vitest run src/tests/user.test.ts
-
Lint Rules:
- Never disable any lint rules without explicit user approval
-
Styling Guidelines:
- Use Tailwind CSS classes instead of inline style objects for new markup
- VSCode CSS variables must be added to webview-ui/src/index.css before using them in Tailwind classes
- Example:
<div className="text-md text-vscode-descriptionForeground mb-2" />instead of style objects