setup-test

A setup tool for frontend testing with Jest or Vitest, React Testing Library, and MSW. MSW is a tool for replacing network requests with test responses.

In plain words
What is it for?
Use it to prepare tests in Next.js, Vite, Create React App, or other React projects. It can configure test scripts, custom rendering, provider support, and MSW structures.
Why use it?
It removes the repetitive work of detecting the framework, choosing a test runner, configuring providers, and creating shared test utilities and request handlers.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/ggombee/code-forge/setup-test
Any agent
npx skills add ggombee/code-forge --skill setup-test
Clone the repo
git clone --depth 1 https://github.com/ggombee/code-forge

Made for: Claude Code, Codex.

Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,056 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00039 $0.01056
Opus 5 $0.00019 $0.00528
Sonnet 5 $0.00008 $0.00211
Haiku 4.5 $0.00004 $0.00106

Measured yesterday against content hash a4127b0a4e23, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

setup-test 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 yesterday.

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.

skills/setup-test/SKILL.md · 138 lines

How it starts

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

/setup-test

테스트 환경이 없는 프로젝트에 초기 세팅을 수행합니다.

실행 워크플로우

Step 1: 프로젝트 분석

다음을 자동 감지합니다:

  1. 프레임워크 감지:

    • next.config.* -> Next.js
    • vite.config.* -> Vite
    • react-scripts in package.json -> CRA
    • 기타 -> 일반 React
  2. 기존 테스트 환경 확인:

    • jest.config.* / vitest.config.* 존재 여부
    • package.json에 test 스크립트 존재 여부
    • @testing-library/react 설치 여부
    • MSW 설치 여부
  3. 상태 관리 / Provider 구조 분석:

    • _app.tsx / _app.js 읽기 -> Provider 트리 파악
    • Provider/ 디렉토리 탐색
    • package.json에서 jotai, recoil, zustand, react-query 등 확인
  4. 사용자에게 분석 결과 보고 후 진행 여부 확인:

    프로젝트 분석 결과:
    - 프레임워크: Next.js 13 (Pages Router)
    - 테스트 러너: 미설정 -> jest 권장
    - 상태 관리: jotai, react-query
    - Provider: QueryClientProvider, JotaiProvider
    
    다음 항목을 세팅하겠습니다:
    1. jest + @testing-library/react + MSW 패키지 설치
    2. jest.config.js 생성
    3. jest.setup.js 생성
    4. customRender 유틸리티 생성
    5. MSW 핸들러 구조 생성
    6. package.json test 스크립트 추가
    
    진행할까요?
    

Step 2: 패키지 설치

jest 기반 (Next.js, CRA):

yarn add -D jest @testing-library/react @testing-library/jest-dom @testing-library/user-event jest-environment-jsdom @types/jest msw identity-obj-proxy

Next.js 프로젝트 추가:

yarn add -D jest-next-dynamic

vitest 기반 (Vite):

yarn add -D vitest @testing-library/react @testing-library/jest-dom @testing-library/user-event jsdom @types/jest msw

Step 3: 설정 파일 생성

jest.config.js (Next.js 예시):

  • moduleNameMapper: path alias (@/, @shared/ 등) 매핑
  • testEnvironment: jsdom
  • setupFilesAfterSetup: jest.setup.js
  • transformIgnorePatterns: node_modules 중 ESM 모듈 처리
  • moduleFileExtensions: js, jsx, ts, tsx

jest.setup.js:

  • @testing-library/jest-dom import
  • 전역 mock 설정 (next/router, next/dynamic, SVG, CSS 등)
  • MSW server setup/teardown
  • window.matchMedia mock

Step 4: customRender 생성

__tests__/utils/customRender.tsx (또는 src/test/customRender.tsx):

프로젝트의 Provider 구조를 분석하여 생성합니다:

  • QueryClientProvider (react-query 사용 시)
  • RecoilRoot (recoil 사용 시)
  • JotaiProvider (jotai 사용 시, 필요한 경우)
  • FormProvider (react-hook-form 사용 시)
  • 기타 프로젝트 커스텀 Provider

Read the full file on GitHub · 138 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. yesterday First seen · 138 lines · 39 tokens per session scan A a4127b0a4e23

Subscribe to this mod's changes

setup-test is a skill published in the GitHub repository ggombee/code-forge (13 stars, last pushed 2mo ago), licensed MIT. It adds 39 tokens to every session and 1,056 once invoked, about $0.0002 per session on Opus 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-08-30.

Related

Other skills, from other repositories

digital-health-clinical-asr-setup

Stage 1 of Clinical ASR Flywheel. Use when bootstrapping a cycle: NVCF+MW disclosure, NVIDIAAPIKEY check, deps install, TTS+ASR smoke test.

NVIDIA/skills · 51 tokens

scaffold

Use when starting hyperflow in a new project, refreshing the .hyperflow/ cache, or installing auto-detection shims (AGENTS.md, CLAUDE.md). One-shot project setup; does not start the spec → scope → dispatch chain. Trigger with /hyperflow:scaffold, "init hyperflow", "set up hyperflow", "refresh hyperflow", "install…

jeremylongshore/tons-of-skills-marketplace · 86 tokens

install-openviking-memory

Install and configure the OpenViking long-term memory plugin for OpenClaw via natural conversation. Once installed, the plugin automatically captures facts from chats and recalls relevant context before each reply (auto-capture + auto-recall, cross-session). Covers prerequisites, install through OpenClaw's plugin…

volcengine/OpenViking · 191 tokens

environment-discovery

Systematic exploration of unknown environments before starting work.

vstorm-co/pydantic-deepagents · 13 tokens

forgetful-cli-setup

Set up the Forgetful CLI and connect from a terminal — install, local or remote mode, auth, and verification. Use when connecting a human or headless agent via shell, wiring CI with token auth, or operating a local server (serve, database selection, feature flags, re-embedding). Also covers the machine contract…

ScottRBK/forgetful · 84 tokens

forgetful-mcp-setup

Set up an MCP client for Forgetful — wire Claude Code, Cursor, Copilot, Codex, Gemini, or OpenCode to the server and verify the connection behaves. Covers stdio vs HTTP transport, auth and scopes, the three meta-tools every client sees, and delegation to subagents.

ScottRBK/forgetful · 67 tokens