agentleFS
BetterTypedBetterTyped/react-zoom-pan-pinch/.cursor/rules/testing-workflow.mdc

react-zoom-pan-pinch / rules

Cursor rule2k starsChanged 8 months agoMITView on GitHub

When and whether to write tests during library work

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projectsWeek of Nov 8: 0 new projectsWeek of Nov 15: 0 new projectsWeek of Nov 22: 0 new projects
Oct 2026Nov 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about BetterTyped/react-zoom-pan-pinch

The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 50

Talked about on GitHub (50 times).

On GitHub · 50

45 more on GitHub

The file

We split this testing-workflow.mdc into the rules it gives an agent

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When implementing or modifying behaviour in src/, add tests where possible — __tests__/features/ for behaviour, __tests__/units/ for pure …

    line 10
  2. Very specific:

    Assert exact values: Prefer "translate(-35.48px, 0px) scale(1)" or a precise number over not.toBe(...) / toBeLessThan(...).

    line 14
  3. Distinctive:

    Do not write tests that:

    line 25
  4. Distinctive:

    Only assert that a component renders without crashing

    line 27
  5. Distinctive:

    Test React, jsdom or Jest behaviour rather than library logic

    line 29
  6. Distinctive:

    Every test should justify its existence by catching a realistic regression.

    line 32
  7. Distinctive:

    If you finish work that could reasonably be tested but you decided not to,

    line 36
  8. Distinctive:

    ask the user: before closing out:

    line 37
  9. Distinctive:

    Don't ask: when the change is inherently untestable or trivial — styles, story-only tweaks, constants, config, re-exports, type …

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 7,324 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
testing-workflow.mdc
---
description: When and whether to write tests during library work
alwaysApply: true
---

# Testing workflow

## When changing the library

When implementing or modifying behaviour in `src/`, **add tests where possible**
— `__tests__/features/` for behaviour, `__tests__/units/` for pure helpers,
`__tests__/regressions/` for issue-linked bugs.

- **Assert exact values.** Prefer `"translate(-35.48px, 0px) scale(1)"` or a
  precise number over `not.toBe(...)` / `toBeLessThan(...)`. Put the formula or
  the reasoning behind a magic number in a comment, so the next reader can
  re-derive it.
- **Check the test can fail.** For a guard or cap, break it for a moment and
  watch the test go red before trusting it.
- `renderApp` disables `autoAlignment`, `velocityAnimation` and `doubleClick` by
  default — enable what the test is about explicitly.

## Avoid trivial tests

Do not write tests that:

- Only assert that a component renders without crashing
- Mirror the implementation line by line with no added confidence
- Test React, jsdom or Jest behaviour rather than library logic
- Cover only types, constants, re-exports or other declarative code

Every test should justify its existence by catching a realistic regression.

## When you chose not to test

If you finish work that **could reasonably be tested** but you decided not to,
**ask the user** before closing out:

> "I didn't add tests for this change because [reason]. Would you like me to add
> any?"

**Don't ask** when the change is inherently untestable or trivial — styles,
story-only tweaks, constants, config, re-exports, type definitions, assets.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.