nextjs-testing

nextjs-testing is a skill for Claude Code from AratKruglik/claude-sdlc. It costs 155 tokens per session (2,499 once invoked), scanned A, original, MIT.

A testing guide for Next.js applications, covering server code, browser-side components, API handlers, and full application flows.

In plain words
What is it for?
It helps configure and use Vitest or Jest for code tests, React Testing Library for components, mocked network requests, and Playwright for end-to-end tests.
Why use it?
It helps select an appropriate test tool and test layer for each part of a Next.js application.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the nextjs-plugin plugin — 5 skills, 1 agent shipped together

Good fit It helps configure and use Vitest or Jest for code tests, React Testing Library for components, mocked network requests, and Playwright for end-to-end tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aratkruglik/claude-sdlc/nextjs-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add AratKruglik/claude-sdlc --skill nextjs-testing
Clone the repo
git clone --depth 1 https://github.com/AratKruglik/claude-sdlc

Made for: Claude Code.

Or install nextjs-plugin, the plugin that ships this one along with the rest of its 5 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nextjs-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/nextjs-testing/github.svg)](https://agentmods.dev/skills/aratkruglik/claude-sdlc/nextjs-testing)
Your own site
<a href="https://agentmods.dev/skills/aratkruglik/claude-sdlc/nextjs-testing"><img src="https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/nextjs-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nextjs-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/aratkruglik/claude-sdlc/nextjs-testing"><img src="https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/nextjs-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 155 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,499 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Data Exfiltration · line 246
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00155 $0.02499
Opus 5.5 $0.00062 $0.01000
Sonnet 5.5 $0.00031 $0.00500
Haiku 4.5 $0.00015 $0.00250

Measured 1mo ago against content hash 097a34dcc5f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nextjs-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/nextjs-plugin/skills/nextjs-testing/SKILL.md · 332 lines

How it starts

The opening of the file, as written. The whole thing — 332 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Next.js Testing Patterns

Next.js testing splits along the same line as the runtime: server-side code runs in Node, client-side in jsdom or a browser. The right tool depends on the layer.

Test framework selection

Layer Framework
Client Components, hooks, plain JS/TS units Vitest (preferred for new projects) or Jest
Server Components Playwright integration tests OR Vitest with the right config
Server Actions Vitest (treat the action body as a pure function — extract logic)
Route Handlers Vitest with mocked NextRequest
End-to-end (full stack) Playwright (Vercel-recommended) or Cypress

For new projects, prefer Vitest + Playwright. Match what exists otherwise.

Vitest setup for Next.js

vitest.config.ts:

import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import path from 'path';

export default defineConfig({
  plugins: [react()],
  test: {
    environment: 'jsdom',
    setupFiles: ['./vitest.setup.ts'],
    globals: true,
    css: true,
  },
  resolve: {
    alias: { '@': path.resolve(__dirname, './') },
  },
});

vitest.setup.ts:

import '@testing-library/jest-dom/vitest';

Install: pnpm add -D vitest @vitejs/plugin-react jsdom @testing-library/react @testing-library/jest-dom @testing-library/user-event.

Testing Client Components (RTL)

// app/users/_components/UserFilter.test.tsx
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { UserFilter } from './UserFilter';

describe('UserFilter', () => {
  it('calls onChange as user types', async () => {
    const onChange = vi.fn();
    const user = userEvent.setup();
    render(<UserFilter onChange={onChange} />);

    await user.type(screen.getByRole('textbox'), 'alice');

    expect(onChange).toHaveBeenLastCalledWith('alice');
  });
});

Query priority: getByRole > getByLabelText > getByText > getByTestId (last resort). Roles match how assistive tech sees the UI.

Read the full file on GitHub · 332 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +2 lines 097a34dcc5f9
  2. 1mo ago First seen · 330 lines · 155 tokens per session scan A d8782524091b

Subscribe to this mod's changes

nextjs-testing is a skill published in the GitHub repository AratKruglik/claude-sdlc (53 stars, last pushed 3d ago), licensed MIT. It adds 155 tokens to every session and 2,499 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

verify-omnigent

Drive Omnigent the way a user does and prove a behavior with recorded evidence, using an isolated server, runner, and mock model plus a feature map of every user entry point. Load before reproducing a user-facing bug, before claiming a fix works, or when reviewing whether a change covered every surface (session vs.…

omnigent-ai/omnigent · 100 tokens

test-master

Generates test files, creates mocking strategies, analyzes code coverage, designs test architectures, and produces test plans and defect reports across functional, performance, and security testing disciplines. Use when writing unit tests, integration tests, or E2E tests; creating test strategies or automation…

Jeffallan/claude-skills · 104 tokens

eval-dataset-design

A guide to creating reliable test sets for AI agents. Each evaluation task includes the request, the simulated user's behaviour, a reset starting state, and a success check that can be independently verified.

bojieli/ai-agent-book · 138 tokens

dogfood

Systematically explore and test a mobile app on iOS/Android with agent-device to find bugs, UX issues, and other problems. Use when asked to dogfood, QA, exploratory test, find issues, bug hunt, or test this app on mobile.

callstack/agent-device · 55 tokens

cua-driver

Use Cua Driver for desktop or browser tasks that are awkward or unavailable through Bash/APIs, or when the user explicitly wants GUI interaction: app testing, visual bug reproduction, form filling, calendar entry, screenshots, and demo recording. Also covers Cua setup; not OpenAI Codex Computer Use or web research.

davidondrej/skills · 68 tokens

test-warp-ui

Guides testing Warp UI features and changes using the computer use tool. Use this skill only when computer-use testing was requested (explicit request or accepted offer) and the computeruse tool is available to the agent. Covers launching Warp and verifying UI behavior.

warpdotdev/warp · 55 tokens