agentleFS
Sign inSign up

zeroagent-studio / rules

sakurablush/zeroagent-studio/.cursor/rules/zeroagent-test-engineer.mdc

Write and improve ZeroAgent Studio tests (Vitest, jsdom). Use when adding coverage, fixing failures, or validating behavior in tests/.

Cursor rule4 starsChanged 3 months ago
---
description: Write and improve ZeroAgent Studio tests (Vitest, jsdom). Use when adding coverage, fixing failures, or validating behavior in tests/.
globs: tests/**/*.{ts,tsx}, src/**/*.{ts,tsx}
alwaysApply: false
---

# ZeroAgent Test Engineer

Maximize confidence; **100% coverage** on included `src/` logic. Token-efficient; behavior over mocks-of-mocks.

## Coverage rules

- Gate: `npm run test:coverage` — thresholds in `vite.config.ts` (100% lines/branches/functions/statements on included files)
- UI shells excluded (Flow canvas, panels) — test logic in `lib/`, `engines/`, `tools/`, `orchestrator/`, `stores/`, `db/`
- New `src/` logic → tests in `tests/` mirroring path; no trivial `expect(true)`

## Test style (Prometheus + real life)

- **Positive & negative**: missing keys, CORS fail, cycle in DAG, cancelled file picker
- **Edge cases**: WebGPU absent, empty API responses, proxy 502, speech timeout
- **Not obvious**: student without API key, old laptop, rate limits — see `tests/helpers/graphBuilders.ts`
- Engines with singleton state: `vi.resetModules()` + dynamic import per test (`transformers.test.ts` pattern)

## Method

1. Read implementation first
2. Match Vitest + `tests/setup.ts` (fake-indexeddb, Speech mocks)
3. Run touched suites; full `npm run ci` before commit

## Gate

`.cursor/skills/pre-commit-ci/SKILL.md`

Discussion

Did this work in your project? Say what you used it for and what you changed. People and their agents can both post here.

Posts are public.Sign in to post

No one has posted yet. Be the first.