typescript-unit-testing

typescript-unit-testing is a skill for Claude Code, Codex from acolomba/pi-claude-marketplace. It costs 54 tokens per session (4,821 once invoked), scanned A, original, MIT.

A set of rules for writing unit tests in TypeScript. Unit tests check one small piece of code in isolation, and these rules cover test structure, assertions, mocks, test data, coverage, and file pairing.

In plain words
What is it for?
Use it when adding or changing TypeScript unit tests and the production modules they cover.
Why use it?
It prevents tests that pass without proving the behaviour they claim to check and keeps the test tools and layout consistent.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding or changing TypeScript unit tests and the production modules they cover.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/acolomba/pi-claude-marketplace/typescript-unit-testing
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.

Any agent
npx skills add acolomba/pi-claude-marketplace --skill typescript-unit-testing
Clone the repo
git clone --depth 1 https://github.com/acolomba/pi-claude-marketplace

Made for: Claude Code, Codex.

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 typescript-unit-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/acolomba/pi-claude-marketplace/typescript-unit-testing/github.svg)](https://agentmods.dev/skills/acolomba/pi-claude-marketplace/typescript-unit-testing)
Your own site
<a href="https://agentmods.dev/skills/acolomba/pi-claude-marketplace/typescript-unit-testing"><img src="https://agentmods.dev/badge/skills/acolomba/pi-claude-marketplace/typescript-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.

agentmods 80×15 button for typescript-unit-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/acolomba/pi-claude-marketplace/typescript-unit-testing"><img src="https://agentmods.dev/badge/skills/acolomba/pi-claude-marketplace/typescript-unit-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,821 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00054 $0.04821
Opus 5 $0.00027 $0.02410
Sonnet 5 $0.00011 $0.00964
Haiku 4.5 $0.00005 $0.00482

Measured yesterday against content hash 6fc0a1d12f63, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-18, from the pricing page.

Security

Grade A, and why

typescript-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 yesterday.

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.

skills/typescript-unit-testing/SKILL.md · 269 lines

How it starts

The opening of the file, as written. The whole thing — 269 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TypeScript unit testing rules

"Do" and "Do not" are hard rules. "Prefer" states the default and allows a justified exception. "May" grants a permission. Copy the Good form.

Every case must discriminate the behavior named in its title: a wrong implementation makes the assertion fail. A test with weak assertions costs all the maintenance of a test and gives none of the protection.

Tools

Use node:test for the runner, lifecycle, and the context's t.mock (stubs, spies, fake timers); node:assert/strict for assertions; strong-mock for strict interaction mocks; --experimental-test-coverage for coverage.

import assert from 'node:assert/strict'
import { describe, test } from 'node:test'
import { mock, verify, when } from 'strong-mock'

Do not add another runner, assertion library, or mocking library. Do not import the process-wide mock from node:test; use the context's t.mock.

Pairing and coverage

  • Every production .ts module under extensions/pi-claude-marketplace/ has exactly one .test.ts module under tests/ at the mirrored path: extensions/pi-claude-marketplace/orders/order-service.ts -> tests/orders/order-service.test.ts. That test module owns the source module's exported behavior.
  • No exclusions. Type-only modules, index.ts barrels, and one-function modules all need a test module. If a module is not worth a test, fold it into its consumer.
  • Do not co-locate tests under extensions/pi-claude-marketplace/, use .spec.ts, or test one source module from another module's test.
  • Test modules and test support (fakes, seeds, contracts) need no meta-tests; a fake is verified through its shared contract.
  • Each source-test pair reaches 100% function, line, and branch coverage when run alone. Aggregate coverage does not count.
  • Do not add coverage exceptions or /* node:coverage ignore */ directives. Remove dead code or cover it through a public-behavior case.
  • Run node --test <test-path> while developing, npm run test:coverage:direct -- <path> for the pair (:all after a shared contract, fake, or harness change), and npm run check before completion.

Read the full file on GitHub · 269 lines

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. yesterday First seen · 269 lines · 54 tokens per session scan A 6fc0a1d12f63

Subscribe to this mod's changes

typescript-unit-testing is a skill published in the GitHub repository acolomba/pi-claude-marketplace (24 stars, last pushed yesterday), licensed MIT. It adds 54 tokens to every session and 4,821 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-17.