continue-custom/.continue/rules/unit-testing-rules.md
Patrick Erichsen c1a47858f3
fix: rule colocation uri logic (#7164)
* fix: rule colocation uri logic

* rename to `fileUri`

* fix: type errors

* fix test mocks

* Update slugs.test.ts
2025-08-15 10:00:17 -07:00

1,006 B

name description alwaysApply
Unit Testing Rules Guidelines for unit testing in this project false

For unit testing in this project:

1. Testing frameworks

The project uses Vitest and Jest for testing. Prefer Vitest.

2. Test execution location

Run tests from within the specific package directory (e.g., cd core && ..).

3. Vitest tests

  • Test files follow the pattern *.vitest.ts
  • Run tests using vitest from within the specific package/module directory:
    cd [directory] && vitest -- [test file path]
    

4. Jest tests

  • Test files follow the pattern *.test.ts
  • Run tests using npm test from within the specific package/module directory:
    cd [directory] && npm test -- [test file path]
    
  • The test script uses experimental VM modules via NODE_OPTIONS flag

5. Test structure

  • Write tests as top-level test() functions - DO NOT use describe() blocks
  • Include the function name being tested in the test description for clarity