testing

testing is a cursor rule for Cursor from afaraha8403/balakit. It costs 714 tokens per session, scanned A, original, MIT.

A set of project rules for writing useful automated tests, including tests that check complete code paths and full user flows.

In plain words
What is it for?
It helps decide which behaviors to test, where to place unit, integration, and end-to-end tests, and which existing test tools and conventions to follow.
Why use it?
It prevents tests that only increase coverage numbers or pass because too much code was replaced with mocks.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It helps decide which behaviors to test, where to place unit, integration, and end-to-end tests, and which existing test tools and conventions to follow.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/afaraha8403/balakit/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/afaraha8403/balakit

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/afaraha8403/balakit/testing/github.svg)](https://agentmods.dev/rules/afaraha8403/balakit/testing)
Your own site
<a href="https://agentmods.dev/rules/afaraha8403/balakit/testing"><img src="https://agentmods.dev/badge/rules/afaraha8403/balakit/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/afaraha8403/balakit/testing"><img src="https://agentmods.dev/badge/rules/afaraha8403/balakit/testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 714 This file is loaded in full into every session.
When invoked 714 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.00714 $0.00714
Opus 5.5 $0.00286 $0.00286
Sonnet 5.5 $0.00143 $0.00143
Haiku 4.5 $0.00071 $0.00071

Measured 1mo ago against content hash cf2e5f358516, 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 1mo 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/testing.mdc · 59 lines

How it starts

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

Testing

Philosophy

Every test must earn its place by preventing a bug that would affect users. Do not write tests to hit a coverage number. If you cannot explain what bug a test would catch, do not write it.

Favor integration tests over unit tests. Test real code paths — input validated, work performed, result returned. Reserve unit tests for complex business logic: pricing calculations, date handling, permission resolution. Do not write unit tests for glue code or tests that mock everything away. If a test would still pass when every imported function returns undefined, rewrite the assertion or delete the test.

Folder Convention

Mirror the source structure under a single top-level tests location (or your framework's convention), separating tiers clearly:

  • Unit tests — complex business logic only.
  • Integration tests — the default tier for most behavior.
  • End-to-end tests — full-stack flows.

Follow whatever layout the project already uses; do not impose a new one mid-project.

Tooling

  • Use the test runner the project already adopts. Do not introduce an additional test framework without team agreement.
  • Match the existing assertion style, fixtures, and mocking approach.
  • Keep end-to-end tests pointed at a deployed/staging-like environment rather than hard-coded local URLs when the project's flow expects that.

When to Write Tests

A behavior change in a PR requires a test that exercises that behavior. "Behavior change" means: what the user sees or what the API returns is different. Refactors that preserve behavior do not require new tests — existing tests should still pass.

Bug fixes: Write the failing test first. The test is the proof the bug existed and that the fix works. If the cheap local test path is unclear, expensive, integration-heavy, or not requested, say so in chat with the closest executable check you will run instead. Prefer no test over a mock-only "regression" that would still pass if every imported function returned undefined.

Read the full file on GitHub · 59 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. 1mo ago Changed · +2 lines · +115 tokens per session cf2e5f358516
  2. 1mo ago First seen · 57 lines · 599 tokens per session scan A 6e270c6cf499

Subscribe to this mod's changes

testing is a cursor rule published in the GitHub repository afaraha8403/balakit (1 stars, last pushed 1mo ago), licensed MIT. It adds 714 tokens to every session, about $0.0029 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-08-31.