unit-testing SKILL.md skillA

unit-testing from petrkindlmann/qa-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add petrkindlmann/qa-skills/unit-testing@v2.0

Pins v2.0 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
petrkindlmann/qa-skills
Path
skills/unit-testing/SKILL.md
Versions recorded
5
Latest version
v2.0, committed Jun 10, 2026
First version recorded
Mar 30, 2026
Size
15,700 bytes
Repository stars
245
License
MIT

Write effective unit tests with Jest, Vitest, or pytest. Covers the test-doubles taxonomy (stub/spy/mock/fake), Arrange-Act-Assert, coverage threshold configuration and CI gating, snapshot testing, fake timers, and mutation testing with Stryker/mutmut. Use when: "unit test," "Jest," "Vitest," "pytest," "mock," "coverage threshold," "test doubles," "mutation testing," "fake timers," "snapshot test." Not for: interpreting coverage reports or finding coverage gaps — use coverage-analysis; AI…

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

<objective>
Write unit tests that fail when the code is wrong and pass when it is right — nothing
weaker. A test that mocks every collaborator stays green while the integration is
broken; the doubles taxonomy below stops that. A `coverageThreshold` typo (or the
plural `coverageThresholds`, which Jest silently ignores) lets 40%-covered code ship
on a green pipeline; the config and Verification sections below make the gate actually
fire. This skill covers Jest, Vitest, and pytest: doubles, coverage gating, snapshots,
fake timers, and mutation testing as a behavior check on top of coverage.
</objective>

---

## Discovery Questions

Check `.agents/qa-project-context.md` first — if it exists, use it and skip anything answered there.

1. **Framework:** Jest, Vitest, or pytest? Check `package.json` or `pyproject.toml`. The runner decides config keys and mock APIs.
2. **Coverage tooling:** Already configured? Look for `jest.config.*`, `vitest.config.*`, `.nycrc`, `[tool.coverage]`. Determines whether you add the gate or just tune it.
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add petrkindlmann/qa-skills/unit-testing@sha256:6ae2bf6de212f3d2

The line at the top of this page pins the label v2.0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_nqfwj3fv5z2ahc3e.svg)](https://markdownregistry.com/a/art_nqfwj3fv5z2ahc3e)

5 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 5 versions of this file, between Mar 30, 2026 and Jun 10, 2026, about one every 18 days.

versioncommittedcommitsizeaudit
v2.0 latest2026-06-10 bcd1201 15,700 BA view · diff
v1.02026-05-10 f124fd9 15,605 BA view · diff
v1.02026-05-10 a1e1025 15,400 BA view · diff
v1.02026-05-10 158e50a 14,419 BA view · diff
v1.02026-03-30 59713a4 13,651 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (15700 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

petrkindlmann/qa-skills · 245 stars · license MIT · pushed 2026-10-22 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_nqfwj3fv5z2ahc3e
GET https://markdownregistry.com/api/v1/resolve?ref=petrkindlmann/qa-skills/unit-testing
GET https://markdownregistry.com/api/v1/blob/6ae2bf6de212f3d2e1202f8964c56063cc22331d7b484e687a0b8c58992f9f21

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from petrkindlmann/qa-skills

AGENTS.md AGENTS.md file
petrkindlmann/qa-skills · AGENTS.md
git:20261022.699f439 · audit A · 245 stars
CLAUDE.md CLAUDE.md file
petrkindlmann/qa-skills · CLAUDE.md
git:20260323.b54e23c · audit B · 245 stars
accessibility-testing SKILL.md skill
petrkindlmann/qa-skills · skills/accessibility-testing/SKILL.md · Test for WCAG 2.2 AA compliance with axe-core + Playwright, keyboard navigation audits, screen reader testing, ARIA…
v2.1 · audit A · 245 stars
agentic-browser-testing SKILL.md skill
petrkindlmann/qa-skills · skills/agentic-browser-testing/SKILL.md · Goal-driven E2E testing where a browser agent (Playwright MCP / computer-use) reads a natural-language goal and…
v1.1 · audit A · 245 stars
ai-bug-triage SKILL.md skill
petrkindlmann/qa-skills · skills/ai-bug-triage/SKILL.md · Hybrid fingerprint + LLM pipeline for bug classification, deduplication, and ticket generation. Normalizes CI logs…
v2.0 · audit A · 245 stars
ai-qa-review SKILL.md skill
petrkindlmann/qa-skills · skills/ai-qa-review/SKILL.md · Review EXISTING test code for quality, smells, and testability issues. Detects test smells across six dimensions —…
v2.0 · audit A · 245 stars
ai-system-testing SKILL.md skill
petrkindlmann/qa-skills · skills/ai-system-testing/SKILL.md · Test AI/LLM features that ship in your product. Covers prompt regression testing, response quality evaluation…
v2.2 · audit F · 245 stars
ai-test-generation SKILL.md skill
petrkindlmann/qa-skills · skills/ai-test-generation/SKILL.md · Use AI to write NEW test code from specs, PRDs, user stories, code diffs, bug reports, or OpenAPI specs. Staged…
v2.0 · audit A · 245 stars
analytics-tracking-testing SKILL.md skill
petrkindlmann/qa-skills · skills/analytics-tracking-testing/SKILL.md · Validate that analytics and marketing tracking fire CORRECTLY: GA4/GTM dataLayer events, Meta/TikTok/LinkedIn pixels…
v1.1 · audit A · 245 stars
api-testing SKILL.md skill
petrkindlmann/qa-skills · skills/api-testing/SKILL.md · Test REST and GraphQL APIs with Playwright APIRequestContext, Supertest, or standalone HTTP clients. Covers schema…
v2.1 · audit A · 245 stars
bug-reproduction SKILL.md skill
petrkindlmann/qa-skills · skills/bug-reproduction/SKILL.md · Turn a vague bug report into a VERIFIED minimal reproduction and then a failing regression test, agent-driven end to…
v1.0 · audit A · 245 stars
chaos-engineering SKILL.md skill
petrkindlmann/qa-skills · skills/chaos-engineering/SKILL.md · Validate system resilience through controlled fault injection. Covers hypothesis-driven chaos experiments, failure…
v2.0 · audit A · 245 stars

Every file in petrkindlmann/qa-skills

Other files named unit-testing

unit-testing SKILL.md skill
nerds-odd-e/doughnut · .agents/skills/unit-testing/SKILL.md · Small-test style for unit tests — stable boundary, data over mocks, focused assertions, concise makeMe (all packages)…
git:20261012.6fadfdb · audit A · 50 stars
unit-testing SKILL.md skill
okhp3/skillz · community/unit-testing/SKILL.md · Writes unit tests for code that already exists — choosing what deserves a test, what the cases are, and how to assert…
git:20260828.866dec6 · audit A · 3 stars

Browse by kind, by grade A, or by owner.