test-engineer

Create Vitest test suites for Next.js TypeScript components with mock helpers.

Updated Nov 8, 2022
One-click install
npx skills add https://github.com/gvinokur/qatar-prode --skill test-engineer-gvinokur
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-engineer
Source: https://github.com/gvinokur/qatar-prode/tree/main/.claude/skills/test-engineer
Command: npx skills add https://github.com/gvinokur/qatar-prode --skill test-engineer-gvinokur

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a consistent, production-ready testing workflow to prevent hanging tests, inconsistent mocks, and low coverage by enforcing mandatory utilities, mock helpers, and testing conventions for a Next.js TypeScript codebase.

Core Features & Use Cases

  • Mandatory utilities: Requires renderWithTheme, renderWithProviders, testFactories, and mock-helpers to avoid ad-hoc wrappers and brittle tests.
  • Mocking patterns: Standardizes Next.js, next-auth, next-intl, and database mocks using module-level vi.fn() patterns and createMockSelectQuery/createMockInsertQuery helpers.
  • Test types covered: Component rendering, context-aware components, unit tests for utilities, repository/db mocking, and integration tests for database interactions.
  • Workflow optimizations: Parallel subagent test creation guidance for generating multiple test files in one coordinated invocation and explicit coverage targets (80%+ for new code).

Quick Start

Create Vitest tests for a target file using testFactories, mock-helpers, and renderWithTheme or renderWithProviders while aiming for 80% coverage.

Frequently Asked Questions about test-engineer

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

FAQPage Schema
How do I generate Vitest tests for Next.js components without them hanging?

Generate Vitest tests for Next.js components without hanging by using mandatory utilities like renderWithProviders and module-level vi.fn() mocks to prevent inconsistent mocks and ensure 80% coverage.

What is the best way to mock database queries in Vitest for TypeScript code?

Mock database queries in Vitest by using createMockSelectQuery and createMockInsertQuery helper functions alongside testFactories to standardize repository and database interactions for robust unit tests.

How do I test Next.js authentication and context providers in Vitest?

Test Next.js authentication and context providers by standardizing next-auth and next-intl mocks using module-level vi.fn() patterns, wrapping components with renderWithTheme or renderWithProviders for consistent test rendering.

Can I generate multiple Vitest test files at once for a Next.js codebase?

You can generate multiple test files at once using parallel subagent test creation guidance, coordinating the generation of several Vitest test suites in a single invocation to enforce testing conventions.

How do I maintain 80% test coverage when adding new TypeScript code?

Maintain 80% test coverage for new code by generating comprehensive Vitest test suites that enforce mandatory utilities, mock helpers, and testFactories, preventing low coverage and brittle tests in your Next.js codebase.