test-generator

Generate unit, integration, and E2E tests for NestJS applications with failure analysis.

Updated Oct 2, 2025
One-click install
npx skills add https://github.com/YuriiYInno/Innogram --skill test-generator-yuriiyinno
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-generator
Source: https://github.com/YuriiYInno/Innogram/tree/main/.codex/skills/test-generator
Command: npx skills add https://github.com/YuriiYInno/Innogram --skill test-generator-yuriiyinno

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing comprehensive tests across unit, integration, and E2E layers is time-consuming and often inconsistent with project conventions. This Skill generates tests that follow established patterns for NestJS command handlers, query handlers, repositories, and API endpoints, then runs test suites and analyzes failures. ## Core Features & Use Cases - Multi-Level Test Generation: Creates unit tests for command/query handlers with mocked unit-of-work patterns, integration tests for TypeORM repositories, and E2E tests for API endpoints using supertest. - Test Infrastructure Patterns: Provides factory, faker, and mock organization conventions under __tests__/ for reusable test data. - Failure Analysis & Escalation: Runs test suites via Nx commands, verifies results, and escalates persistent failures to a debugging workflow. - Use Case: After implementing a new CreateUserHandler, ask the Skill to generate unit tests covering the success path and the ConflictException edge case, then run them with coverage to verify they pass. ## Quick Start Ask the AI to write unit and integration tests for your new NestJS handler and run the test suite to confirm everything passes.

Frequently Asked Questions about test-generator

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

FAQPage Schema
How do I write unit tests for NestJS command handlers?▼

Use NestJS Test.createTestingModule to instantiate the handler with a mocked unit of work and repository. Mock repository methods with jest.fn(), then assert both the return value and that dependencies were called with expected arguments.

How to test TypeORM repositories with integration tests?▼

Create a test DataSource, instantiate the repository against it, and reset the database with synchronize(true) before each test. Save entities and verify retrieval to confirm real database behavior rather than mocked responses.

What is the difference between unit, integration, and E2E tests?▼

Unit tests cover a single unit like a handler or utility with mocked dependencies. Integration tests verify database or API interactions with real infrastructure. E2E tests exercise full user workflows through HTTP requests against a running application.

How do I run tests with coverage in an Nx workspace?▼

Run npx nx test backend -- --coverage to execute the suite with coverage reporting. Use --testPathPattern to target specific files, --watch for development, and npx nx e2e backend-e2e for end-to-end suites.

Why do my generated tests fail after creation?▼

Failures usually come from incorrect mock setups, mismatched constructor signatures, or missing test data. The Skill runs all generated tests to verify they pass and escalates persistent failures to a systematic debugging workflow.