agentsclimarketplace

React query test harness fixer

Skill VJDiPaola/skill-forge/react-query-test-harness-fixer

Fix React/Vitest test failures for TanStack React Query components and jsdom side effects. Use when React Query component tests fail under Vitest or jsdom with hangs, act warnings, or side-effect leaks.From its SKILL.md

Install
npx -y skills add VJDiPaola/skill-forge --skill react-query-test-harness-fixer

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

3 things to look at

  • 17 days oldThe repository was created 17 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.8 KB, 361 tokens by cl100k_base, as published. Nobody here has run it

React Query Test Harness Fixer

Use this workflow when test setup has fallen behind the app's React Query and browser dependencies.

Read First

  • The failing test file
  • The page or component under test
  • Shared test setup such as client/tests/setup.ts
  • Any route or data modules the component depends on

Workflow

  1. Identify every useQuery, useMutation, and route dependency used by the rendered component.
  2. Wrap the render path in a fresh QueryClientProvider.
  3. Create a new QueryClient per helper or per test and set retry: false for deterministic failures.
  4. Stub network calls at the boundary the component actually uses. Return stable list and detail responses.
  5. Recreate routing context with the same router the app uses, such as memoryLocation for wouter.
  6. Wait for async UI with findBy... or waitFor after the query resolves.
  7. Neutralize browser-only side effects.

Browser API Rules

  • Mock navigator.clipboard in the test when copy behavior is asserted.
  • Put durable browser shims in shared test setup for matchMedia and HTMLCanvasElement.getContext.
  • Mock side-effect libraries such as canvas-confetti directly when the animation is not part of the assertion.
  • Clear localStorage and reset globals after each test.

Anti-Patterns

  • Do not share one QueryClient across unrelated tests.
  • Do not assert on post-query UI before the fetch promise has resolved.
  • Do not leave broad fetch mocks or global state behind between tests.

Validation

  1. Run the targeted test file first.
  2. Run npm.cmd run test.
  3. Run npm.cmd run check.

What ships with it: 2 files

477 B alongside SKILL.md

agents/

Keep looking

Skills are one crate of 326,696. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.