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.