mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Relocated .cursor/rules/unit-test.mdc from litegraph subtree to project root maintaining folder structure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
21 lines
717 B
Plaintext
21 lines
717 B
Plaintext
---
|
|
description: Creating unit tests
|
|
globs:
|
|
alwaysApply: false
|
|
---
|
|
|
|
# Creating unit tests
|
|
|
|
- This project uses `vitest` for unit testing
|
|
- Tests are stored in the `test/` directory
|
|
- Tests should be cross-platform compatible; able to run on Windows, macOS, and linux
|
|
- e.g. the use of `path.resolve`, or `path.join` and `path.sep` to ensure that tests work the same on all platforms
|
|
- Tests should be mocked properly
|
|
- Mocks should be cleanly written and easy to understand
|
|
- Mocks should be re-usable where possible
|
|
|
|
## Unit test style
|
|
|
|
- Prefer the use of `test.extend` over loose variables
|
|
- To achieve this, import `test as baseTest` from `vitest`
|
|
- Never use `it`; `test` should be used in place of this |