nextjs-testing

Installation
SKILL.md

Next.js Testing

Priority: P1 (HIGH)

Test Runner

  • Existing projects (Pages Router / legacy stack): Use Jest (jest@29 + babel-jest + jest-environment-jsdom).
  • New projects (App Router): Use Vitest for speed and native ESM support.

Workflow: Test New Feature

  1. Write unit tests — Use Jest (or Vitest for new projects) + RTL with Arrange-Act-Assert pattern.
  2. Mock APIs — Set up MSW handlers for all fetch boundaries.
  3. Test interactions — Use userEvent (async) for clicks, typing, form submissions.
  4. Add E2E tests — Use Playwright for critical user flows (login, checkout).
  5. Verify coverage — Aim for 80%+ on core libraries via JSON coverage reports.

Component Test Example

See implementation examples

Installs
3
GitHub Stars
521
First Seen
May 28, 2026
nextjs-testing — hoangnguyen0403/agent-skills-standard