unit-tests

unit-tests is a command for Cursor from janhesters/react-router-saas-template. It costs 0 tokens per session (525 once invoked), scanned A, original, MIT.

A command for writing unit tests, which check one small part of a program in isolation, using Vitest.

In plain words
What is it for?
Use it to create isolated tests for JavaScript or TypeScript code with Vitest's describe, expect, and test functions.
Why use it?
It makes tests readable and explicit by requiring the tested unit, expected behavior, actual result, expected result, and useful edge cases.

Command for Cursor

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.

agentmods
npx agentmods add commands/janhesters/react-router-saas-template/unit-tests
Clone the repo
git clone --depth 1 https://github.com/janhesters/react-router-saas-template

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 unit-tests

README.md
[![agentmods](https://agentmods.dev/badge/commands/janhesters/react-router-saas-template/unit-tests.svg)](https://agentmods.dev/commands/janhesters/react-router-saas-template/unit-tests)
Your own site
<a href="https://agentmods.dev/commands/janhesters/react-router-saas-template/unit-tests"><img src="https://agentmods.dev/badge/commands/janhesters/react-router-saas-template/unit-tests.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 525 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00525
Opus 5 $0.00000 $0.00262
Sonnet 5 $0.00000 $0.00105
Haiku 4.5 $0.00000 $0.00052

Measured 5d ago against content hash 0c4deced410f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

unit-tests 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 5d 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/commands/unit-tests.md · 44 lines

What it actually says

Unit Tests

Act as a top-tier software engineer with serious testing skills.

TestConstraints { Ensure that the test answers these 5 questions { 1. What is the unit under test? (test should be in a named describe block) 2. What is the expected behavior? ($given and $should arguments are adequate) 3. What is the actual output? (the unit under test was exercised by the test) 4. What is the expected output? ($expected and/or $should are adequate) 5. How can we find the bug? (implicitly answered if the above questions are answered correctly) }

Tests must be: - Readable - Answer the 5 questions. - Isolated/Integrated - Units under test should be isolated from each other - Tests should be isolated from each other with no shared mutable state. - For integration tests, test integration with the real system. - Thorough - Test expected edge cases - Explicit - Everything you need to know to understand the test should be part of the test itself. If you need to produce the same data structure many times for many test cases, create a factory function and invoke it from the individual tests, rather than sharing mutable fixtures between tests.

Use Vitest with describe, expect, and test. Tests must use the "given: ..., should: ..." prose format. Ensure that within each test case: - There is an empty line before the actual variable assignment. - Do NOT add an empty line between the actual and expected assignments. - There is an empty line after the expected variable assignment before the toEqual assertion. Use cuid2 for IDs unless specified otherwise. Colocate tests with functions. Test files should be in the same folder as the implementation file. If an argument is a database entity, use an existing factory function and override values as needed. Capture the actual and the expected value in variables. The top-level describe block should describe the component under test. The test block should describe the case via "given: ..., should: ...". Avoid expect.any(Constructor) in assertions. Expect specific values instead. Always use the toEqual equality assertion. }

Constraints { Carefully think through correct output. Avoid hallucination. This is very important to ensure software works as expected and that user safety is protected. Please do your best work. }

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. 5d ago First seen · 44 lines · 0 tokens per session scan A 0c4deced410f

Subscribe to this mod's changes

unit-tests is a command published in the GitHub repository janhesters/react-router-saas-template (48 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 525 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-08-30.