Skip to content
Agentmart
Submit a tool

js-testing

Write, review, debug, or refactor automated tests for code.

Skill by faridz974

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/faridz974-js-testing

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Write, review, debug, or refactor automated tests for code. Use when user needs to add test coverage, choose test boundaries, improve flaky or brittle tests, test React or browser UI behavior, decide between unit/integration/end-to-end/component tests, work with Vitest/Jest/Testing Library/Playwright/MSW mocks, clean up test state, or review whether tests assert user or domain intent instead of implementation details.

Use cases: design, frontend, testing, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/js-testing

What's inside

Skill name
js-testing
Description
Write, review, debug, or refactor automated tests for code. Use when user needs to add test coverage, choose test boundaries, improve flaky or brittle tests, test React or browser UI behavior, decide between unit/integration/end-to-end/component tests, work with Vitest/Jest/Testing Library/Playwright/MSW mocks, clean up test state, or review whether tests assert user or domain intent instead of implementation details.
License
MIT
Instructions
53 lines in SKILL.md · view on GitHub

Files (6)

  • SKILL.md
  • better-test-setup-with-disposable-objects.md · references/
  • mocking-and-advanced-vitest-patterns.md · references/
  • react-component-testing-with-vitest.md · references/
  • react-e2e-testing-with-playwright.md · references/
  • testing-principles.md · references/

SKILL.md (first lines)

# Testing Code

## Core Workflow

1. Identify the intention behind the code before choosing assertions.
   - State the behavior the system exists to provide.
   - Make every important assertion fail if, and only if, that intention is not met.

2. Choose the test boundary deliberately.
   - Keep inside the boundary the code whose collaboration matters for the behavior.
   - Mock only dependencies that add irrelevant failure modes or belong to another responsibility.
   - Do not mock so much that the test no longer executes meaningful behavior.

3. Match the environment to the behavior.
   - Use Node tests for pure logic.
   - Use a real browser runner for browser APIs, layout, user interaction, accessibility, and component behavior.
   - Treat JSDOM-style environments as simulations; verify browser-sensitive behavior in a browser.

4. Structure tests as setup, action, assertion.
   - Keep essential setup visible in the test case.
   - Prefer flat tests over nested hooks when hooks hide prerequisites.
   - Use helpers to express domain setup, not to obscure the scenario.

5. Assert outcomes, not mechanics.
   - In UI tests, assert visible user-facing state rather than API calls.
   - Put request details in mock setup only when they define the scenario.
   - Prefer accessible queries and visibility assertions for UI presence.

6. Isolate and clean up state.
   - Avoid shared mutable mocks, timers, servers, DOM, files, database rows, and module state.
   - Use framework cleanup, mock clearing/resetting/restoring, and disposable resources as appropriate.
   - Validate that a test can fail for the intended reason before trusting a new green test.

## Decision Points

- If a test asserts a request happened, ask what user or domain outcome the request enables.
- If a negative assertion checks absence immediately after an action, wait for the relevant side-effect window or completion signal.
- If a test is flaky, isolate reproduction first, then classify the cause: async race, shared state, environment mismatch, external dependency, timing, or unclear assertion.
- If coverage is low, use it as a map to inspect risk. Do not write tests only to raise the percentage.

## Reference

Read [testing-principles.md](references/testing-principles.md) when the task involves nontrivial test design, flaky tests, mocks, browser/component tests, coverage policy, or review feedback that needs testing rationale.

Read [better-test-setup-with-disposable-objects.md](references/better-test-setup-with-disposable-objects.md) when tests need explicit per-test setup, reliable cleanup, flat setup without nested hooks, TypeScript `using` / `await using`, `Symbol.dispose`, `Symbol.asyncDispose`, or resource helpers for servers, databases, files, browser contexts, timers, subscriptions, or mock infrastructure.

Read [react-component-testing-with-vitest.md](references/react-component-testing-with-vitest.md) when working with React component tests, Vitest Browser Mode, `vitest-browser-react`, browser locators, MSW in component tests, or JSDOM migration.

Read [mocking-and-advanced-vitest-patterns.md](references/mocking-and-advanced-vitest-patterns.md) when working with Vitest mocks, timers, globals, environment variables, MSW in Node tests, module mocking, fixtures, custom matchers, retryable assertions, coverage, concurrency, isolation, or sharding.

Read [react-e2e-testing-with-playwright.md](references/react-e2e-testing-with-playwright.md) when working with React end-to-end tests, Playwright config, web servers, authentication flows, E2E fixtures, test data, API mocking, UI mode, or trace viewer.

From faridz974/skills, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Jul 24, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from faridz974

Cite this page

js-testing skill. Agent Mart. https://agentmart.dev/skills/faridz974-js-testing (last updated 2026-10-24)