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/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/node-testing)<a href="https://agentmods.dev/rules/adonai-labs/agent-runway/node-testing"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/node-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.
<a href="https://agentmods.dev/rules/adonai-labs/agent-runway/node-testing"><img src="https://agentmods.dev/badge/rules/adonai-labs/agent-runway/node-testing.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.00000 | $0.00571 |
| Opus 5 | $0.00000 | $0.00285 |
| Sonnet 5 | $0.00000 | $0.00114 |
| Haiku 4.5 | $0.00000 | $0.00057 |
Grade A, and why
node-testing scanned grade A with 1 finding 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 7d 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- Test `SIGTERM` and `SIGINT` handling via `child_process.fork()` — verify clean exit with code `0` How it starts
The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Node.js Testing Guidelines
Applied when working with Node.js test files and configuration. Australian English spelling throughout.
API Testing
- Use Supertest to test HTTP routes without starting a real server; bind directly to the app instance
- Build the app with injected test dependencies — do not start with
app.listen()in tests - Test every HTTP status code path: success, validation failure (400), auth failure (401/403), not found (404), server error (500)
- Assert
Content-Typeand response shape for all API endpoints
Process Lifecycle Testing
- Test
SIGTERMandSIGINThandling viachild_process.fork()— verify clean exit with code0 - Verify the process exits with a non-zero code on startup failure (missing env, failed DB connection)
- Test that the server stops accepting new requests before shutdown dependencies are closed
Queue Consumer Testing
- Test consumer message handlers as plain functions — inject a fake queue client
- Always test idempotency: processing the same message twice must not cause duplicate side effects
- Test error handling: what happens when the handler throws, the DB is unavailable, or a downstream call fails
Stream Testing
- Test
Transformstreams independently usingReadable.from()as input and a collectingWritableas output - Use
pipelinefromnode:stream/promisesin tests — it propagates errors correctly - Test back-pressure: verify the stream does not consume unbounded memory on slow consumers
Integration Testing
- Use Testcontainers for real PostgreSQL, Redis, Kafka, or other infrastructure dependencies
- Start containers in
beforeAll, truncate state inbeforeEach, stop inafterAll - Set a generous timeout on
beforeAll(≥60s) — container startup in CI can be slow - Do not use in-memory SQLite as a Postgres proxy — behaviour differs
Checklist
- HTTP routes tested with Supertest; all status codes covered
- Process shutdown tested via
child_process.fork() - Queue consumer idempotency tested explicitly
- Stream transformers tested independently
- Integration tests use Testcontainers; CI runs them separately from unit tests
- No shared mutable state between tests; state reset in
beforeEach
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.
- 7d ago First seen · 63 lines · 0 tokens per session scan A 8c035bb6cf47
node-testing is a cursor rule published in the GitHub repository adonai-labs/agent-runway (2 stars, last pushed 20d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 571 tokens. A static security scan graded it A with 1 finding (runs shell commands). 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
cypress-integration-testing-cursorrules-prompt-file
Cursor rules for Cypress development with integration testing.
playwright-integration-testing-cursorrules-prompt-file
Cursor rules for Playwright development with integration testing.
playwright-e2e-testing-cursorrules-prompt-file
Cursor rules for Playwright development with E2E testing.
playwright-api-testing-cursorrules-prompt-file
Cursor rules for Playwright development with API testing.
manual-review.backend
A set of rules for verifying backend-only changes and changes that use different verification channels. It separates evidence the agent can collect from checks that require a person, a production authorization, or a business decision.
integration-testing
Integration testing patterns and database test setup.