mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
## Summary Pure rename of CLAUDE.md files to AGENTS.md (no content changes). ## Changes | Old Path | New Path | |----------|----------| | `.github/CLAUDE.md` | `.github/AGENTS.md` | | `.storybook/CLAUDE.md` | `.storybook/AGENTS.md` | | `browser_tests/CLAUDE.md` | `browser_tests/AGENTS.md` | | `src/CLAUDE.md` | `src/AGENTS.md` | | `src/components/CLAUDE.md` | `src/components/AGENTS.md` | | `src/lib/litegraph/CLAUDE.md` | `src/lib/litegraph/AGENTS.md` | Root `CLAUDE.md` deleted (content will be merged into `AGENTS.md` in follow-up PR). ## Follow-up A second PR will add glob-based guidance files and consolidate redundancies. --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Christian Byrne <cbyrne@comfy.org>
37 lines
974 B
Markdown
37 lines
974 B
Markdown
---
|
|
globs:
|
|
- '**/*.test.ts'
|
|
---
|
|
|
|
# Vitest Unit Test Conventions
|
|
|
|
See `docs/testing/*.md` for detailed patterns.
|
|
|
|
## Test Quality
|
|
|
|
- Do not write change detector tests (tests that just assert defaults)
|
|
- Do not write tests dependent on non-behavioral features (styles, classes)
|
|
- Do not write tests that just test mocks - ensure real code is exercised
|
|
- Be parsimonious; avoid redundant tests
|
|
|
|
## Mocking
|
|
|
|
- Use Vitest's mocking utilities (`vi.mock`, `vi.spyOn`)
|
|
- Keep module mocks contained - no global mutable state
|
|
- Use `vi.hoisted()` for per-test mock manipulation
|
|
- Don't mock what you don't own
|
|
|
|
## Component Testing
|
|
|
|
- Use Vue Test Utils for component tests
|
|
- Follow advice about making components easy to test
|
|
- Wait for reactivity with `await nextTick()` after state changes
|
|
|
|
## Running Tests
|
|
|
|
```bash
|
|
pnpm test:unit # Run all unit tests
|
|
pnpm test:unit -- path/to/file # Run specific test
|
|
pnpm test:unit -- --watch # Watch mode
|
|
```
|