Agent skill · shipshitdev

nestjs-testing-expert

NestJS testing mechanics with Jest — building testing modules, mocking providers and repositories, writing service and controller specs, and driving HTTP end-to-end tests through the real application. Use for any test touching a NestJS service, controller, guard, module, or API endpoint, including test-module setup, provider overrides, database fakes, and Supertest request flows.

What it needs

About 4k tokens when loaded.

What this skill does

NestJS Testing Expert Build reliable Jest suites for NestJS modules, services, controllers, and HTTP endpoints. Scope This skill owns NestJS mechanics: testing modules, provider wiring, and request-level end-to-end flows. For framework-agnostic questions — which level a behavior belongs at, what a coverage number means, how to design a test that survives refactoring, how to kill a flake — use testing-expert. When to Use Writing unit, integration, or end-to-end tests for a NestJS application Setting up a testing module, overriding providers, or faking a database Testing controllers, guards, interceptors, or pipes Exercising HTTP endpoints against a booted Nest application Levels in a Nest Application Unit — a service or provider in isolation, collaborators replaced with test doubles. No module graph beyond the providers under test. Integration — a module compiled with its real providers, external systems faked. Proves the wiring and the contracts between layers. End-to-end — a booted application driven over HTTP. Proves the full request path: pipes, guards, controller, service, persistence. Service Specs Compile a testing module with the subject real and every collaborator supplied explicitly. Injection tokens come from whatever integration provides them — an ORM's token helper, a class reference, or a custom token constant. Assert on the arguments the collaborator received when they encode a business rule — the isDeleted: false filter above is the behavior, not an implementation detail. Controller Specs Register the controller, stub its service, and verify only the controller's own job: argument extraction, delegation, and response shaping. Business rules belong to the service spec. Overriding Providers Compile the real module and swap only what must not run for real. overrideProvider and overrideGuard keep the rest of the graph authentic, so the test still proves the wiring. Override the guard only in tests about something else. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills shipshitdev/nestjs-testing-expert--467f7c

View the source on GitHub

Browse the @skills marketplace