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.
npx agentmods add rules/adonai-labs/agent-runway/typescript-testinggit clone --depth 1 https://github.com/adonai-labs/agent-runwayWrote 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/adonai-labs/agent-runway/typescript-testing)<a href="https://agentmods.dev/rules/adonai-labs/agent-runway/typescript-testing"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/typescript-testing.svg" alt="Measured on agentmods" 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.00000 | $0.00660 |
| Opus 5 | $0.00000 | $0.00330 |
| Sonnet 5 | $0.00000 | $0.00132 |
| Haiku 4.5 | $0.00000 | $0.00066 |
Grade A, and why
typescript-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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript Testing Guidelines
Applied when working with TypeScript test files and testing configuration. Australian English spelling throughout.
Test Framework
- Prefer Vitest for new projects — native ESM, fast watch mode, compatible Jest API, first-class TypeScript
- Use Jest only if the project already has it configured; do not migrate mid-project for its own sake
- Enable
globals: trueto avoid importingdescribe,it,expectin every file
What to Test
- Test behaviour and outcomes, not implementation details or internal method calls
- Business rules and domain logic deserve the most thorough test coverage
- Test every error path explicitly: invalid input, missing resources, downstream failures
- Do not chase a coverage percentage — coverage is a signal, not a target
Test Structure
- One
describeper unit under test; group related scenarios within it - Name tests as plain English sentences describing the expected outcome
- Keep tests small and focused — one assertion concept per test (multiple
expecton the same scenario is fine) - Use
beforeEach(() => vi.clearAllMocks())to prevent cross-test contamination
Mocking
- Inject dependencies via constructor or function parameter — do not patch modules directly
- Use
vi.fn()/jest.fn()for simple function mocks;vi.spyOn()for partial mocking - Use
vi.mock('module')only for third-party modules you cannot inject (e.g.node:crypto, cloud SDKs) - Always clear or reset mocks in
beforeEach— shared mock state between tests causes flaky failures
Integration Testing
- Use Testcontainers for real database and infrastructure tests — avoid SQLite as a Postgres proxy
- Start containers in
beforeAll, truncate state inbeforeEach, stop inafterAll - Run integration tests in CI only (not in watch mode) — tag with
@integrationor separate config file - Run migrations before the suite, not before each test
Coverage
- Run coverage in CI; report on lines, branches, and functions
- Focus coverage on domain logic and use cases; do not aim to cover generated code or
index.tsbarrel files - Exclude
*.d.ts,dist/, and test helpers from coverage reports
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.
- 2d ago First seen · 73 lines · 0 tokens per session scan A fc36d585742c
typescript-testing is a cursor rule published in the GitHub repository adonai-labs/agent-runway (2 stars, last pushed 16d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 660 tokens. 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.
Other cursor rules, from other repositories
rule-01
This is test rule number in the large package scalability test.
rule-02
This is test rule number in the large package scalability test.
rule-03
This is test rule number in the large package scalability test.
rule-04
This is test rule number in the large package scalability test.
rule-05
This is test rule number in the large package scalability test.
rule-06
This is test rule number in the large package scalability test.