nestjs-service-tdd

Enforce RED-GREEN-REFACTOR TDD for NestJS services with mock providers and TestingModule patterns.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/apireaisecurity/apire-ai-security-platform --skill nestjs-service-tdd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nestjs-service-tdd
Source: https://github.com/apireaisecurity/apire-ai-security-platform/tree/main/apire-redteam-kit/.agent/skills/nestjs-service-tdd
Command: npx skills add https://github.com/apireaisecurity/apire-ai-security-platform --skill nestjs-service-tdd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides developers to systematically implement and validate NestJS services using a strict Test-Driven Development workflow (RED → GREEN → REFACTOR), reducing regression risk and improving code quality.

Core Features & Use Cases

  • Enforces a canonical testing pattern based on a real project example (backend/src/tests/llm-analyzer.test.ts) to drive service development.
  • Provides step-by-step workflow for creating failing tests, implementing minimal code to pass, and refactoring with mock providers and TestingModule patterns.
  • Suitable for adding new methods, modifying existing logic, or introducing new services across modules with consistent test discipline.

Quick Start

Follow the RED-GREEN-REFACTOR cycle for a NestJS service, using backend/src/tests/llm-analyzer.test.ts as the guide.

Frequently Asked Questions about nestjs-service-tdd

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

FAQPage Schema
How do I implement NestJS service test-driven development with mock providers?

NestJS service test-driven development uses a strict RED-GREEN-REFACTOR cycle with mock providers and TestingModule patterns to guide creating failing tests, implementing minimal code, and refactoring for validation.

What is the RED-GREEN-REFACTOR workflow for NestJS testing?

The RED-GREEN-REFACTOR workflow for NestJS testing involves first writing a failing test, then implementing minimal code to pass the test, followed by refactoring and validating against canonical test patterns.

How do I mock providers in a NestJS TestingModule for TDD?

Mock providers in a NestJS TestingModule by following a canonical testing pattern based on a real project example to drive service development, ensuring consistent test discipline across modules.

Can I use this TDD approach to modify existing NestJS service methods?

Yes, this test-driven development approach is suitable for adding new methods, modifying existing logic, or introducing new NestJS services across modules while maintaining consistent test discipline.

Why does my NestJS service test need a canonical reference test?

A canonical reference test ensures consistency across modules by validating your NestJS service tests against a 246-line reference file, reducing regression risk and improving overall code quality.

Are there limitations to using Jest mocking for NestJS TDD?

Jest mocking for NestJS TDD requires adherence to a strict RED-GREEN-REFACTOR workflow and canonical reference tests to ensure consistency, reducing regression risk but demanding disciplined test pattern validation.