| 1 | name: unit-testing-rules |
| 2 | version: 0.0.1 |
| 3 | schema: v1 |
| 4 | rules: |
| 5 | - name: unit-testing-rules |
| 6 | rule: >- |
| 7 | For unit testing in this project: |
| 8 | |
| 9 | |
| 10 | 1. The project uses Jest as the testing framework |
| 11 | |
| 12 | 2. Run tests using `npm test` from within the specific package/module |
| 13 | directory |
| 14 | |
| 15 | 3. Command structure: `cd [directory] && npm test -- [test file path]` |
| 16 | |
| 17 | 4. The test script uses experimental VM modules via NODE_OPTIONS flag |
| 18 | |
| 19 | 5. Test files follow the pattern `*.test.ts` |
| 20 | |
| 21 | 6. Tests must import Jest with `import { jest } from "@jest/globals";` |
| 22 | |
| 23 | 7. Run tests from within the specific package directory (e.g., `cd core` |
| 24 | for core module tests) |
| 25 | |
| 26 | 8. Write tests as top-level `test()` functions - DO NOT use `describe()` |
| 27 | blocks |
| 28 | |
| 29 | 9. Include the function name being tested in the test description for |
| 30 | clarity |