testing
NestJS Testing
When to Use This Skill
Use this skill when:
- Writing unit tests for services, controllers, or providers
- Testing modules with
Test.createTestingModule() - Mocking dependencies for isolated testing
- Writing end-to-end (E2E) tests for API endpoints
- Testing guards, interceptors, pipes, or filters
- Setting up test fixtures and test data
- Testing async operations and database interactions
- Implementing test coverage for NestJS applications
- Testing error handling and edge cases
What is Testing in NestJS?
NestJS provides built-in testing utilities that make it easy to write both unit and integration tests. The framework uses Jest as the default testing framework and provides specialized utilities for creating isolated testing modules.
More from ramziddin/ccplugins
security
NestJS security best practices including CORS, CSRF protection, Helmet for HTTP headers, rate limiting, encryption, and hashing. Use when implementing security features, hardening applications, or protecting against common vulnerabilities.
3authentication
NestJS authentication with JWT, Passport, local/JWT strategies, and auth guards. Use when implementing user login, token generation, protected routes, or integrating authentication systems.
3caching
NestJS caching with cache module, in-memory caching, Redis integration, cache interceptor, and TTL management. Use when implementing performance optimization, reducing database queries, or storing temporary data.
2exception-filters
NestJS exception filters for handling errors, customizing error responses, logging exceptions, and providing consistent error formatting across your application.
2cli
NestJS CLI for generating resources, managing workspaces, building applications, and development commands. Use when scaffolding NestJS projects, generating boilerplate code, or managing monorepo structures.
2controllers
NestJS controllers for handling HTTP requests, routing, route parameters, query parameters, request payloads, and responses. Use when creating API endpoints, handling HTTP methods, or working with request/response objects.
2