Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/JakubMikolajek/codex-skills-collectionnpx agentmods add skills/jakubmikolajek/codex-skills-collection/unit-testingWrote 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/skills/jakubmikolajek/codex-skills-collection/unit-testing)<a href="https://agentmods.dev/skills/jakubmikolajek/codex-skills-collection/unit-testing"><img src="https://agentmods.dev/badge/skills/jakubmikolajek/codex-skills-collection/unit-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/skills/jakubmikolajek/codex-skills-collection/unit-testing"><img src="https://agentmods.dev/badge/skills/jakubmikolajek/codex-skills-collection/unit-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.00068 | $0.03203 |
| Opus 5 | $0.00034 | $0.01602 |
| Sonnet 5 | $0.00014 | $0.00641 |
| Haiku 4.5 | $0.00007 | $0.00320 |
Grade A, and why
unit-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 9d 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 — 417 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Unit Testing (TypeScript / JavaScript)
This skill covers unit and component testing in the TypeScript/JavaScript ecosystem. It is the counterpart to e2e-testing (Playwright, full browser) and python-testing (pytest).
When to Use
- Writing unit tests for service logic, utility functions, or domain models
- Writing component tests with React Testing Library
- Reviewing test code for quality, coverage gaps, or brittle patterns
- Setting up a test framework from scratch in a new project
- Debugging a test that passes locally but fails in CI
When NOT to Use
- E2E tests covering full user journeys in a browser — use
e2e-testing - Python tests — use
python-testing - Visual regression testing — different toolchain (Chromatic, Percy)
Framework Choice
Vitest — preferred for new projects (especially Vite, Next.js App Router, Turborepo):
- Same config as Vite (no separate babel/transform setup)
- Faster than Jest in watch mode
- Native ESM support
- Drop-in Jest API compatibility
Jest — preferred when:
- Existing project already uses Jest
- CRA, some NestJS setups, older React Native
This skill uses Vitest syntax. Jest equivalents are identical except for vi.* → jest.*.
Test Structure
src/
├── services/
│ ├── document.service.ts
│ └── document.service.test.ts # co-located with source
├── components/
│ ├── DocumentCard.tsx
│ └── DocumentCard.test.tsx
└── utils/
├── slug.ts
└── slug.test.ts
Co-location (test next to source) is preferred over a separate __tests__ directory — easier to find, easier to maintain.
Test file naming: *.test.ts or *.spec.ts — choose one convention and apply it consistently.
Test Anatomy
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { DocumentService } from './document.service';
describe('DocumentService', () => {
let service: DocumentService;
beforeEach(() => {
// Fresh instance per test — no shared state between tests
service = new DocumentService(mockDb);
});
describe('create', () => {
it('returns created document with generated id', async () => {
// Arrange
const input = { title: 'Test', content: 'Hello' };
// Act
const result = await service.create(input);
// Assert
expect(result.id).toBeDefined();
expect(result.title).toBe('Test');
expect(result.content).toBe('Hello');
});
it('throws ValidationError when title is empty', async () => {
await expect(service.create({ title: '', content: 'x' }))
.rejects.toThrow(ValidationError);
});
});
});
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.
- 9d ago First seen · 417 lines · 68 tokens per session scan A db7194502052
unit-testing is a skill published in the GitHub repository JakubMikolajek/codex-skills-collection (5 stars, last pushed 7d ago), licensed MIT. It adds 68 tokens to every session and 3,203 once invoked, about $0.0003 per session on Opus 5. 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 skills, from other repositories
migrate-xunit-to-xunit-v3
Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…
go-testing
Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.
nw-fp-clojure
Clojure language-specific patterns, data-first modeling, REPL-driven development, and spec.
mobiai-ios-testing
Use when writing or running tests in an iOS project — unit tests, UI tests, snapshot tests, choosing the right framework.
junit-5-skill
Generates production-grade JUnit 5 unit and integration tests in Java. Covers assertions, parameterized tests, lifecycle hooks, mocking with Mockito, and nested tests. Use when user mentions "JUnit", "JUnit 5", "@Test", "assertEquals", "Assertions", "Java unit test". Triggers on: "JUnit", "@Test", "assertEquals"…
restore-internals-seams-in-finally-blocks-after-each-test
When delegating a task affected by this skill, include.