typescript-unit-testing

Write and debug Jest unit tests for TypeScript and NestJS projects.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/arch-playground/ai-workflow-runner --skill typescript-unit-testing-arch-playground
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-unit-testing
Source: https://github.com/arch-playground/ai-workflow-runner/tree/main/.agents/skills/typescript-unit-testing
Command: npx skills add https://github.com/arch-playground/ai-workflow-runner --skill typescript-unit-testing-arch-playground

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @nestjs/testing, jest, ts-jest, @golevelup/ts-jest, @types/jest, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the entire unit testing process for TypeScript/NestJS projects, from initial setup to debugging and optimization, ensuring robust and maintainable code.

Core Features & Use Cases

  • Setup: Configure Jest, install dependencies, and set up test infrastructure.
  • Writing: Create new unit tests for services, controllers, and other NestJS components.
  • Debugging: Systematically diagnose and fix failing tests one by one.
  • Optimization: Improve test performance and reliability by fixing open handles and optimizing setup.

Quick Start

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

Frequently Asked Questions about typescript-unit-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Jest unit testing in a TypeScript NestJS project?

Setting up Jest unit testing in TypeScript requires installing dependencies like `@nestjs/testing`, `jest`, and `ts-jest`, then configuring the test infrastructure. This Skill provides the comprehensive tooling and setup guidance needed to initialize the environment.

What is the best way to write unit tests for NestJS controllers and services?

Writing unit tests for NestJS components involves adhering to the AAA pattern and applying assertion best practices. This Skill provides comprehensive guidance for creating new tests specifically for services and controllers to ensure robust, maintainable TypeScript code.

Why does my Jest test execution run slowly or hang due to open handles?

Slow test execution and hanging often stem from open handles in your test suite. This Skill helps you systematically optimize test performance and reliability by identifying and fixing open handles while tuning the setup process.

How do I debug failing unit tests in a TypeScript project?

Debugging failing unit tests in TypeScript requires systematically diagnosing and fixing each failing test one by one. This Skill streamlines the entire debugging process for NestJS projects using Jest, ensuring robust and maintainable code.

Can I use ts-jest to analyze code coverage for TypeScript unit tests?

Yes, you can analyze code coverage for TypeScript unit tests using `ts-jest` and `@types/jest`. This Skill provides comprehensive guidance on coverage analysis alongside dependency management and assertion best practices to optimize your testing workflow.

Does this Skill work with existing Jest configurations or only new setups?

This Skill works for both new setups and existing configurations by providing comprehensive guidance on dependency management and optimization. It addresses common issues like open handles and slow execution to improve test reliability across any TypeScript NestJS project.