nestjs-testing-skill

Set up and maintain NestJS tests using Jest, TestingModule, and Supertest.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/nccasia/bwl-v2 --skill nestjs-testing-skill-nccasia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nestjs-testing-skill
Source: https://github.com/nccasia/bwl-v2/tree/main/.agents/skills/nestjs-testing-skill
Command: npx skills add https://github.com/nccasia/bwl-v2 --skill nestjs-testing-skill-nccasia

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jest, @nestjs/testing, supertest, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the complexities of setting up, writing, and refactoring tests for NestJS applications, leveraging Jest, TestingModule, and Supertest.

Core Features & Use Cases

  • Test Configuration: Provides guidance on configuring Jest and NestJS for testing.
  • Unit Tests: Facilitates writing and refactoring unit tests for services, guards, pipes, interceptors, and controllers.
  • Integration Tests: Guides through writing integration tests that test provider interactions.
  • End-to-End (E2E) Tests: Helps create e2e tests that interact with real HTTP endpoints.
  • Test Data & Fixtures: Offers advice on structuring test data and fixtures.
  • CI Integration: Suggests CI/CD pipeline integration for running tests.

Quick Start

Trigger this skill by asking, "Set up tests for my NestJS application."

Frequently Asked Questions about nestjs-testing-skill

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

FAQPage Schema
How do I set up tests for my NestJS application using Jest and Supertest?

To set up NestJS tests, configure Jest and the NestJS TestingModule to write unit, integration, and end-to-end tests using Supertest for real HTTP endpoint interactions. This provides a structured foundation for validating services, guards, and controllers.

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

The best way to write unit tests for NestJS providers and controllers is using the NestJS TestingModule to isolate dependencies. This approach allows you to effectively test services, guards, pipes, and interceptors by mocking external interactions.

How do I test real HTTP endpoints in NestJS end-to-end tests?

You test real HTTP endpoints in NestJS end-to-end tests by integrating Supertest with the NestJS application instance. This configuration allows you to simulate HTTP requests and validate the entire request-response cycle, including provider interactions.

Can I use this NestJS testing setup with TypeORM and Jest?

Yes, this NestJS testing setup supports Jest and TypeORM. It guides you through writing integration tests that test provider interactions and offers advice on structuring test data and fixtures for database-driven modules.

How do I integrate my NestJS Jest tests into a CI/CD pipeline?

You integrate NestJS Jest tests into a CI/CD pipeline by executing the Jest test scripts during the build process. This ensures your unit, integration, and end-to-end tests run automatically, validating application integrity before deployment.

Do I need prior NestJS experience to configure these testing modules?

Yes, configuring these testing modules requires existing knowledge of NestJS and testing frameworks. The setup focuses on writing and refactoring tests for services, guards, and controllers, assuming a foundational understanding of the NestJS architecture.