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.
git clone --depth 1 https://github.com/nedcodes-ok/cursor-doctorWrote 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.
[](https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/jest)<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/jest"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/jest/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.
<a href="https://agentmods.dev/rules/nedcodes-ok/cursor-doctor/jest"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursor-doctor/jest.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00978 | $0.00978 |
| Opus 5.5 | $0.00391 | $0.00391 |
| Sonnet 5.5 | $0.00196 | $0.00196 |
| Haiku 4.5 | $0.00098 | $0.00098 |
Grade A, and why
jest 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.
This is a copy
100% identical to jest — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Jest Cursor Rules
You are an expert in Jest testing (v29+). Follow these rules:
Structure
- One test file per source file:
user.service.ts→user.service.test.ts. Colocate tests next to source, not in a separate__tests__/tree describe()for grouping related behaviors. Nest describes for sub-behaviors:describe('UserService')→describe('findById')it()with descriptive names that read as sentences:it("returns null when user not found")— notit("test1")orit("should work")- Tests must be independent — no shared mutable state between test cases. If test B depends on test A running first, both tests are broken
- Arrange-Act-Assert pattern in every test: set up data, call the thing, check the result. One logical assertion per test (multiple
expectcalls checking one behavior is fine)
Matchers
.toBe()for primitives and reference equality..toEqual()for deep equality on objects/arrays —.toBe({a:1})fails because it's a different object reference.toMatchObject()for partial matching — don't over-specify with.toEqual()when you only care about 3 of 10 fields. Less brittle when the shape changes.toThrow()requires wrapping in a function:expect(() => fn()).toThrow()notexpect(fn()).toThrow()— this is the #1 gotcha.toHaveBeenCalledWith(expect.objectContaining({...}))for partial argument matching on mocks.toMatchInlineSnapshot()over.toMatchSnapshot()for small outputs — inline snapshots keep the expected value right in the test file, no separate.snapfile to maintain
Mocking
jest.fn()for standalone mock functions.jest.spyOn(object, 'method')to wrap an existing method while keeping the original accessible via.mockRestore()jest.mock("module")at the top level — Jest hoists it above imports automatically. Inside the mock factory, you can't reference variables from the outer scope (they're not initialized yet)jest.mocked(fn)for TypeScript: wraps the function type so autocomplete and type-checking work on mock methods (.mockReturnValue,.mockResolvedValue)jest.clearAllMocks()inbeforeEach— resets call counts and return values.jest.restoreAllMocks()also undoesspyOnreplacements. Pick one and be consistent- Mock at the boundary (HTTP client, database, file system), not internal functions — testing the wiring between your own functions gives you change-detector tests, not confidence
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.
- 1mo ago First seen · 48 lines · 978 tokens per session scan A 8ace8a931584
jest is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (9 stars, last pushed 7mo ago), licensed MIT. It adds 978 tokens to every session, about $0.0039 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to jest, differing in 0 lines, and is treated as a copy.
Other cursor rules, from other repositories
jest
Jest: describe/it, matchers, mocking, async testing.
pytest
You are an expert in pytest testing. Follow these rules.
vitest
Vitest: unit testing, mocking, coverage, snapshot testing.
webdriver-management
Selenium WebDriver lifecycle management — driver factory, explicit waits, browser options, and teardown.
test-patterns
Selenium pytest test patterns — data-driven tests, fixtures, error handling, and performance checks.
api-testing
Cypress network interception and API testing patterns (cy.intercept, service mocking, request/response validation).