typescript-unit-testing

Official

Master TypeScript unit testing with Jest

Authorbmad-labs
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill provides a comprehensive guide and practical examples for writing high-quality unit tests for TypeScript/NestJS projects using Jest. It covers everything from basic setup to advanced debugging and optimization techniques, ensuring your code is robust and maintainable.

Core Features & Use Cases

  • Test Structure & Conventions: Follows AAA pattern, uses target for SUT, and DeepMocked for type-safe mocks.
  • Component-Specific Guidance: Provides tailored advice for testing services, controllers, guards, pipes, and repositories.
  • Debugging & Optimization: Offers systematic approaches to fix failing tests and improve test suite performance.
  • Use Case: A developer needs to write unit tests for a new NestJS service. They can use this Skill to generate the test file structure, plan test cases (happy path, edge cases, errors), implement the tests following best practices, and ensure mock interactions are correctly verified.

Quick Start

Use the typescript-unit-testing skill to write tests for the UserService class.

Dependency Matrix

Required Modules

None required

Components

scriptsreferences

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: typescript-unit-testing
Download link: https://github.com/bmad-labs/skills/archive/main.zip#typescript-unit-testing

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.