dankosik/fastify-backend-skills/typescript-unit-testing

Claude Code and agent skill by dankosik/fastify-backend-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Behavior. Use for TypeScript backend unit tests, assertions, mocks and deterministic fixtures with Node.js test runner, Vitest or Jest.

Install

npx vskill@latest install dankosik/fastify-backend-skills/typescript-unit-testing

SKILL.md

The same SKILL.md was published earlier as dankosik/fastify-backend-skills/typescript-unit-testing.

TypeScript Unit Testing

Behavior first. Find the observable promise. Choose fixtures whose values and relationships distinguish correct behavior from a plausible defect; derive expected results independently. Preserve relevant contract distinctions through observation and assertion: decoding, normalization, or helpers must not make incorrect results appear correct. Honor the requested outcome and preserve settled choices outside the requested change.

Use existing tests and commands; inspect runtime, module system, or runner configuration when API or discovery behavior is unclear. Preserve the testing stack. Executing TypeScript through a transformer or type stripping does not establish type correctness. Identify the project's applicable compiler check and whether it includes the changed test files before claiming they were type-checked.

Exercise functions and components directly. Prefer real values and fixtures. Mock a collaborator when its responses or effects define the scenario; verify calls when those calls are the requirement. Avoid broad module mocks and casts that hide an impossible fixture.

Await asynchronous assertions, nested tests and cleanup. Make rejection tests fail when the operation unexpectedly succeeds. Control time and randomness when relevant; advance promise-driven timers deliberately and bound completion without arbitrary sleeps.

Treat clearing call history, resetting implementations, restoring spies and clearing module caches as different operations. Check the runner's semantics and import timing before relying on isolation. Restore changed globals, environment and clocks; avoid concurrent tests sharing those mutations.

Challenge each test: could the defect survive it, or would harmless refactoring break it? For review, explain the gap without editing. When writing tests, run the relevant tests and applicable type checks, preserve required project checks, and confirm discovery and cleanup. Reuse valid results for the same revision and environment; state any unchecked type or runtime boundary rather than inventing a new test stack.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dankosik/fastify-backend-skills/typescript-unit-testing/badge)](https://verified-skill.com/skills/dankosik/fastify-backend-skills/typescript-unit-testing)

Something wrong with this skill or its page? Tell us.