Agent skill

Data Client React Testing

by reactive in reactive/data-client

Test @data-client/react with renderDataHook and mountDataClient - jest unit tests, fixtures, interceptors, MockResolver, mock responses, nock HTTP mocking, fake timers for polling/subscription…

Apache-2.0Auto-check passedTesting & QA

Install Data Client React Testing

skills CLI
$ npx skills add reactive/data-client --skill data-client-react-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install reactive/data-client data-client-react-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/reactive/data-client.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/data-client-react-testing .claude/skills/data-client-react-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
data-client-react-testing
GitHub stars
2k
Token cost
~1.5k tokens
SKILL.md length
223 words
Files
9 (incl. references)
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Test @data-client/react with renderDataHook and mountDataClient - jest unit tests, fixtures, interceptors, MockResolver, mock responses, nock HTTP mocking, fake timers for polling/subscription…

  • Debugging tests for hooks
  • SKILL.md covers Hook Testing with…, Fixtures and Interceptors, Testing Mutations and Testing Error States, plus 6 more sections
  • Reaches jsonplaceholder.typicode.com
  • Resources built on @data-client/react

What it does

Data Client React Testing is an agent skill from reactive/data-client. Test @data-client/react with renderDataHook and mountDataClient - jest unit tests, fixtures, interceptors, MockResolver, mock responses, nock HTTP mocking, fake timers for polling/subscription tests, DataProvider test setup, hook and component testing. Use when writing or debugging tests for hooks, components, or resources built on @data-client/react.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including reference files (for example `references.json`, `references/Fixtures.md` and `references/MockResolver.md`).

It sits in Testing & QA, covering Unit testing and Test data and fixtures. It works with React and Jest. The repository describes itself as: Async State Management without the Management. REST, GraphQL, SSE, Websockets. The licence is Apache-2.0.

When your agent uses it

  • Debugging tests for hooks
  • Resources built on @data-client/react

Example prompts

  • “/data-client-react-testing”

What it can do on your machine

Read from SKILL.md and the folder at commit 02c0932. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • jsonplaceholder.typicode.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Data Client React Testing loads about 1.5k tokens when it runs, and up to ~8.5k if it reads all its reference files. Until then it costs about 95 tokens; SKILL.md has 223 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~95
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from reactive/data-client at commit 02c0932, republished under its Apache-2.0 licence (© reactive). 223 words, ~1,529 tokens.

Download SKILL.mdSave it as .claude/skills/data-client-react-testing/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
data-client-react-testing
description
Test @data-client/react with renderDataHook and mountDataClient - jest unit tests, fixtures, interceptors, MockResolver, mock responses, nock HTTP mocking, fake timers for polling/subscription tests, DataProvider test setup, hook and component testing. Use when writing or debugging tests for hooks, components, or resources built on @data-client/react.
license
Apache 2.0

Testing Patterns (@data-client/test)

Hook Testing with renderDataHook()

typescript
import { renderDataHook } from '@data-client/test';

it('useSuspense() should render the response', async () => {
  const { result, waitFor } = renderDataHook(
    () => useSuspense(ArticleResource.get, { id: 5 }),
    {
      initialFixtures: [
        {
          endpoint: ArticleResource.get,
          args: [{ id: 5 }],
          response: { id: 5, title: 'hi ho', content: 'whatever' },
        },
      ],
    },
  );
  expect(result.current.title).toBe('hi ho');
});

Options:

  • initialFixtures - Set up initial state of the store
  • resolverFixtures - Add interceptors for subsequent requests
  • getInitialInterceptorData - Simulate changing server state

Return values:

  • Inherits all renderHook() return values from @testing-library/react
  • controller - Controller instance for manual actions
  • allSettled() - Wait for all async operations to complete

Cleanup is automatic -- an afterEach hook is registered at module load time that drains all active cleanups. No manual renderDataHook.cleanup() calls are needed.

Fixtures and Interceptors

Success Fixture:

typescript
interface SuccessFixture {
  endpoint;
  args;
  response;
  error?;
  delay?;
}

Response Interceptor:

typescript
interface ResponseInterceptor {
  endpoint;
  response(...args);
  delay?;
  delayCollapse?;
}

Testing Mutations

Create operations:

typescript
it('should create a new todo', async () => {
  const { result } = renderDataHook(
    () => useController(),
    {
      initialFixtures: [
        {
          endpoint: TodoResource.getList,
          args: [],
          response: [],
        },
      ],
      resolverFixtures: [
        {
          endpoint: TodoResource.getList.push,
          response: (newTodo) => ({ ...newTodo, id: 1 }),
        },
      ],
    },
  );

  const newTodo = { title: 'Test Todo', completed: false };
  const createdTodo = await result.current.fetch(TodoResource.getList.push, newTodo);
  
  expect(createdTodo.id).toBe(1);
});

Testing Error States

typescript
it('should handle fetch errors', async () => {
  const { result, waitFor } = renderDataHook(
    () => useSuspense(TodoResource.get, { id: 1 }),
    {
      initialFixtures: [
        {
          endpoint: TodoResource.get,
          args: [{ id: 1 }],
          response: null,
          error: new Error('Not found'),
        },
      ],
    },
  );

  await waitFor(() => {
    expect(result.current).toBeUndefined();
  });
});

Testing Components

Use MockResolver to provide fixture data when rendering components with DataProvider:

typescript
import { render } from '@testing-library/react';
import { DataProvider } from '@data-client/react';
import { MockResolver } from '@data-client/test';

it('should render todo list', async () => {
  const fixtures = [
    {
      endpoint: TodoResource.getList,
      args: [],
      response: [{ id: 1, title: 'Test Todo', completed: false }],
    },
  ];

  const { getByText } = render(
    <DataProvider>
      <MockResolver fixtures={fixtures}>
        <TodoList />
      </MockResolver>
    </DataProvider>,
  );

  expect(getByText('Test Todo')).toBeInTheDocument();
});

Testing with nock (HTTP Endpoint Testing)

typescript
import nock from 'nock';

it('should fetch data from API', async () => {
  const scope = nock('https://jsonplaceholder.typicode.com')
    .get('/todos/1')
    .reply(200, { id: 1, title: 'Test', completed: false });

  const result = await TodoResource.get({ id: 1 });
  
  expect(result.title).toBe('Test');
  scope.done();
});

Testing Managers

typescript
it('should handle manager middleware', async () => {
  const mockManager = {
    middleware: (controller) => (next) => async (action) => {
      if (action.type === 'FETCH') {
        console.log('Fetch action:', action);
      }
      return next(action);
    },
    cleanup: jest.fn(),
  };

  const { controller } = renderDataHook(
    () => useController(),
    { managers: [mockManager] },
  );

  await controller.fetch(TodoResource.get, { id: 1 });
  expect(mockManager.cleanup).not.toHaveBeenCalled();
});

Test File Organization

Keep tests under packages/*/src/**/__tests__:

packages/react/src/hooks/__tests__/useSuspense.test.ts
packages/react/src/components/__tests__/DataProvider.test.tsx

Test naming:

  • Node-only: *.node.test.ts[x]
  • React Native: *.native.test.ts[x]
  • Regular: *.test.ts[x]

Best Practices

  • Use renderDataHook() for testing hooks that use @data-client/react hooks
  • Use fixtures or interceptors when testing hooks or components
  • Use nock when testing networking definitions
  • Test both success and error scenarios
  • Test mutations and their side effects
  • Don't mock @data-client internals directly
  • Don't use raw fetch in tests when fixtures are available
  • Don't manually call renderDataHook.cleanup() in afterEach -- cleanup is automatic

References

For detailed API documentation, see the references directory:

© reactive, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (references) in .agents/skills/data-client-react-testing of reactive/data-client.

  • SKILL.md
  • references.json
  • references/Fixtures.md
  • references/MockResolver.md
  • references/makeRenderDataHook.md
  • references/mockInitialState.md
  • references/renderDataHook.md
  • references/unit-testing-components.md
  • references/unit-testing-hooks.md

Open the folder on GitHubat commit 02c0932

Compare with similar skills

Data Client React Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Data Client React Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Data Client React Testing this skillreactive/data-client2k—~1.5kAutomated safety check: PassApache-2.0
Jest Testing PatternsChrisWiles/claude-code-showcase6.1k7 repos~1.5kAutomated safety check: PassNone
Unit TestsKhan/wonder-blocks163—~4.2kAutomated safety check: PassMIT
React Testinggetsentry/sentry45k—~2.2kAutomated safety check: PassCustom licence
Menu Testing Ssrasmyshlyaev177/react-horizontal-scrolling-menu790—~3.5kAutomated safety check: PassMIT
Testingredis/RedisInsight8.9k—~3.3kAutomated safety check: PassCustom licence

Similar skills

  • Jest Testing Patterns

    ChrisWiles/claude-code-showcase

    Jest patterns for React Native style tests: TDD discipline, mock factory functions, module and GraphQL hook mocking, custom render helpers and anti-patterns to avoid.

    6.1k GitHub starsUsed in 7 repos~1.5k tokens
    Testing & QAAuto-check passed
  • Unit Tests

    Khan/wonder-blocks

    Jest + React Testing Library best practices for Wonder Blocks unit tests.

    163 GitHub stars~4.2k tokensUpdated today
    Testing & QAAuto-check passed
  • React Testing

    getsentry/sentry

    Official

    Write and review React/TypeScript tests for Sentry's frontend using Jest and React Testing Library.

    45k GitHub stars~2.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Menu Testing Ssr

    asmyshlyaev177/react-horizontal-scrolling-menu

    Server rendering and testing for react-horizontal-scrolling-menu: the library is client-only ('use client' required in React Server Components, else "createContext is not a function"), SSR first…

    790 GitHub stars~3.5k tokensUpdated 5 days ago
    Testing & QAAuto-check passed
  • Testing

    redis/RedisInsight

    Official

    Unit/integration testing standards for RedisInsight using Jest and Testing Library: test structure, the renderComponent helper, faker for test data, mocking patterns, and waitFor instead of fixed…

    8.9k GitHub stars~3.3k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Test Patterns

    rohitg00/skillkit

    Applies proven testing patterns — Arrange-Act-Assert (AAA), Given-When-Then, Test Data Builders, Object Mother, parameterized tests, fixtures, spies, and test doubles — to help write maintainable…

    1.5k GitHub stars~1.8k tokensUpdated 4 mo ago
    Testing & QAAuto-check passed

More from reactive/data-client

All 17 skills in this repo
  • Data Client REST Setup

    reactive/data-client

    Set up and migrate to @data-client/rest for REST APIs. An agent skill from reactive/data-client.

    2k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Data Client Manager

    reactive/data-client

    Implement @data-client Managers for global/background side effects - websocket, SSE, polling, real-time updates, subscriptions, logging, analytics, metrics/timing, error reporting (Sentry), toast…

    2k GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Data Client React

    reactive/data-client

    Use @data-client/react hooks for data fetching, mutations, and rendering - useSuspense, useFetch, useQuery, useCache, useLive, useDLE, useSubscription, useController, DataProvider, AsyncBoundary…

    2k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Data Client REST

    reactive/data-client

    Define REST APIs with @data-client/rest - resource(), RestEndpoint, CRUD (GET/POST/PUT/PATCH/DELETE), HTTP fetch, normalize, cache, urlPrefix, path-to-regexp parameters, searchParams, pagination…

    2k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Data Client Schema

    reactive/data-client

    Model data with @data-client schemas (Entity, EntityMixin, Collection, Union, Query, Values, All, Invalidate, Lazy, Scalar) for atomic, consistent, referentially-equal async data via normalization…

    2k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Data Client Vue

    reactive/data-client

    Use @data-client/vue composables for data fetching, mutations, and rendering - useSuspense, useFetch, useQuery, useCache, useLive, useDLE, useSubscription, useController, useLoading, useDebounce…

    2k GitHub stars~2.5k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Data Client React Testing

What does Data Client React Testing do?

Test @data-client/react with renderDataHook and mountDataClient - jest unit tests, fixtures, interceptors, MockResolver, mock responses, nock HTTP mocking, fake timers for polling/subscription…. Data Client React Testing is an agent skill from reactive/data-client. Test @data-client/react with renderDataHook and mountDataClient - jest unit tests, fixtures, interceptors, MockResolver, mock responses, nock HTTP mocking, fake timers for polling/subscription tests, DataProvider test setup, hook and component testing.

When should I use Data Client React Testing?

Data Client React Testing fits situations like: debugging tests for hooks; resources built on @data-client/react.

How do I install Data Client React Testing in Claude Code?

Run `npx skills add reactive/data-client --skill data-client-react-testing -a claude-code`. Or copy the skill folder (.agents/skills/data-client-react-testing in reactive/data-client) into .claude/skills/data-client-react-testing in your project. Claude Code loads it when a task matches its description.

How do I install Data Client React Testing in Codex?

Run `npx skills add reactive/data-client --skill data-client-react-testing -a codex`. Or copy the skill folder (.agents/skills/data-client-react-testing in reactive/data-client) into .agents/skills/data-client-react-testing in your project. Codex loads it when a task matches its description.

Can I use Data Client React Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add reactive/data-client --skill data-client-react-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/data-client-react-testing, .gemini/skills/data-client-react-testing, .github/skills/data-client-react-testing and .opencode/skills/data-client-react-testing in your project.

What does Data Client React Testing need to run?

SKILL.md names no scripts, command-line tools or credentials: Data Client React Testing is instructions for the agent only.

Does Data Client React Testing access the network?

SKILL.md names 1 domain. In commands or code: jsonplaceholder.typicode.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Data Client React Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Data Client React Testing use?

Data Client React Testing is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Data Client React Testing use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7k tokens, read only when the agent opens those files.

What are the alternatives to Data Client React Testing?

Skills that share tags, products or a category with Data Client React Testing: Jest Testing Patterns (ChrisWiles/claude-code-showcase, 6.1k stars), Unit Tests (Khan/wonder-blocks, 163 stars), React Testing (getsentry/sentry, 45k stars) and Menu Testing Ssr (asmyshlyaev177/react-horizontal-scrolling-menu, 790 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Data Client React Testing?

reactive (a GitHub organization) maintains it in reactive/data-client, which has 2,037 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: reactive/data-client on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.