Skip to content
Back to skills

Testing Conventions

ASecurity

Pin the contract in tests with absolute-instant fixtures and partial module mocks. Use when writing or reviewing test files (*.test.*, *.spec.*, tests/, e2e/).

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 16, 2026
ai-agentstypescriptpythongophptestinggitdatabase

Works with

  • claude code

Security analysis

A100/100

Scanned November 17, 2026

npx -y skills add msolecki/developer-os --skill testing-conventions --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Testing Conventions?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Testing Conventions
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/msolecki-testing-conventions/badge)](https://www.skillsdirectory.com/skills/msolecki-testing-conventions)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: testing-conventions
description: Pin the contract in tests with absolute-instant fixtures and partial module mocks. Use when writing or reviewing test files (*.test.*, *.spec.*, tests/, e2e/).
license: MIT
compatibility: "Claude Code"
---

# Tests - pin the contract, remove the ambient dependency

- A test pins the contract, not current behavior. If a test "passes after fixing the test," verify that you did not encode a bug; a red test may describe the correct contract.
- A fixture must pin an absolute instant (`2030-01-01T08:00:00Z`), never a local-time literal. An ambient-timezone fixture hides a contract mismatch until CI runs in a different timezone from your machine.
- Mock a module with a partial built on the original (the real module with only the faked member replaced), never an exhaustive hand-written stub. A stub with fixed bounds is a latent failure that fires the day the module gains a member, and one new member can break every suite that stubs it.
- A regression test must fail on the unfixed code: run it before the fix and see it red. A test written after the fix and only ever seen green may not exercise the bug at all.
- Do not fake the boundary that could be wrong. A fake database that returns ready records hides a broken query; test that path against a real test database or the real call.
- A failure message names the missing record or shows the actual response, so the next reader can fix it without rerunning. Never raise retries or timeouts to hide a flaky test; find the race instead.
- To see a test fail, mutate the code with one edit, run the test, then undo that same edit by hand. Never revert with `git checkout`, `git restore` or `git stash`: they discard or hide other uncommitted work, and a command guard may block them.
- A convention the project documents (its `docs/reference/conventions.md`, a decision record) wins over a rule here on layout and tooling: file names, the mock library, the fixture format. It never permits a regression test that was not seen red, a skipped test or a raised retry to hide a flake.

Examples and probes for your language: `references/<lang>.md` beside this file (`typescript`, `python`, `go`, `php`); read the one for the code at hand.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.