testing

testing is a cursor rule for Cursor from louisbrulenaudet/monorepo-template. It costs 1,330 tokens per session, scanned A, original, Apache-2.0.

A testing guide for Vitest tests, covering test placement, deterministic behavior, and checks at the boundaries where an application validates data or returns responses. It requires fixing source problems instead of weakening code or silencing failing tests.

In plain words
What is it for?
Use it when adding unit tests, testing schemas, allowed values, CORS behavior, route status codes, promises, or changes to API data shapes.
Why use it?
It makes tests more trustworthy and avoids passing tests by hiding failures, loosening types, or testing implementation details that users cannot observe.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding unit tests, testing schemas, allowed values, CORS behavior, route status codes, promises, or changes to API data shapes.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/louisbrulenaudet/monorepo-template/testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/louisbrulenaudet/monorepo-template

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing

README.md
[![agentmods](https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/testing/github.svg)](https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/testing)
Your own site
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/testing"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing

Your own site · 80×15
<a href="https://agentmods.dev/rules/louisbrulenaudet/monorepo-template/testing"><img src="https://agentmods.dev/badge/rules/louisbrulenaudet/monorepo-template/testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,330 This file is loaded in full into every session.
When invoked 1,330 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01330 $0.01330
Opus 5.5 $0.00532 $0.00532
Sonnet 5.5 $0.00266 $0.00266
Haiku 4.5 $0.00133 $0.00133

Measured 23d ago against content hash c6c2f15d0e9c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 23d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/quality/testing.mdc · 53 lines

How it starts

The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing

Runtime specifics: hono-workers.mdc (Workers pool), front-react.mdc (front-*). Auditing an existing suite: /review tests (human-invoked).

Toolchain

  • Tests live in the package's tests/ directory mirroring the source area, as kebab-case *.test.ts (.tsx in front-*). Import from "vitest" (no globals), never jest.*; in-app imports use #/*, never an invented @/ alias.
  • Run through turbo: pnpm turbo run test --filter=<pkg>; one file: pnpm --filter=<pkg> exec vitest run tests/<path>.test.ts. Package test scripts are vitest run; agents never leave watch mode or --ui running. Turbo caches test with no outputs: a hit replays the stored log, --force re-executes. Smoke-running the dev servers: skill run-app.
  • Each app owns a vitest.config.ts / .mts built from @repo/vitest-config, pinning root / test.dir with resolvePackageRoot(import.meta.dirname) (Vitest VS Code explorer). Two runtimes: worker-* / queue-* / webhook-* / mcp-* → @repo/vitest-config/workers; front-* → @repo/vitest-config (Node). Never the Workers pool or a /workers import on front-*, never Node pool knobs on Workers, never isolate: false / --no-isolate on Workers (it shares binding storage).
  • No root Vitest config with test.projects or the deprecated workspace: Turbo owns the graph. Never merge a front-* app's full vite.config into its Vitest config.
  • Leave reporters unset so agent / GitHub Actions auto-detection picks the reporter; a custom list must still include agent.
  • Prefer real pool bindings on Workers. On Node, mock only true I/O, through vi.fn / vi.stubGlobal or an injected fake - never module mocking (vi.mock & co. are lint errors via vitest/no-restricted-vi-methods).
  • any is allowed only in test files (typescript/no-explicit-any is relaxed there), never in source to make a test pass. Every other Oxc rule still applies (block statements, no floating promises - await or void).
  • Tests are deterministic and never depend on test order.

Read the full file on GitHub · 53 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 23d ago Changed · +6 lines · +343 tokens per session c6c2f15d0e9c
  2. 25d ago Changed · -23 tokens per session 19ce995a21c5
  3. 27d ago Changed · +26 lines · +620 tokens per session f8d5d5a67b29
  4. 1mo ago First seen · 21 lines · 390 tokens per session scan A 614334b61c92

Subscribe to this mod's changes

testing is a cursor rule published in the GitHub repository louisbrulenaudet/monorepo-template (19 stars, last pushed today), licensed Apache-2.0. It adds 1,330 tokens to every session, about $0.0053 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.