sk-testing-nextjs

Official

Ship fast tests with kit-aligned Vitest mocks.

AuthorTimeKast
Version1.0.0
Installs0

System Documentation

What problem does it solve?

The sk-testing-nextjs skill removes the friction of setting up and using the TimeKast Starter Kit’s Vitest + RTL testing environment, especially the common pain of mocking kit auth and Drizzle/DB schema code in jsdom.

Core Features & Use Cases

  • Kit-aligned Vitest infrastructure: Uses the shipped vitest.config.ts (jsdom, setup wiring, @ aliases, and v8 coverage exclusions) and vitest.setup.ts (RTL/JSDOM cleanup + jest-dom matchers).
  • Action testing with house-style mocks: Provides a reliable pattern for testing server actions by mocking module boundaries like @/lib/auth, @/lib/auth/permissions, and next/cache, while asserting on the returned { error } / { data } shape.
  • Drizzle-friendly DB mocking: Uses a chainable createChain() thenable helper to mock Drizzle query builder flows cleanly, without brittle chain replication.
  • Schema module mocking for jsdom safety: Mocks @/lib/db/schema/** modules as plain objects to avoid crashing imports from the Postgres/Neon driver in the test runtime.
  • Component testing best practices: Supports RTL component tests with the kit’s setup so you can test behavior (roles, userEvent) rather than internals.
  • Scope guidance: Clearly separates unit/component coverage vs E2E responsibilities (Playwright) according to the kit’s coverage strategy.

Quick Start

Use sk-testing-nextjs when writing a Vitest test that mocks kit auth or Drizzle DB access for unit/component coverage.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: sk-testing-nextjs
Download link: https://github.com/TimeKast/AgendaInteligente/archive/main.zip#sk-testing-nextjs

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.