Agent skill

Data Client Vue Testing

by reactive in reactive/data-client

Test @data-client/vue composables and components - renderDataCompose, mountDataClient, fixtures, jest, nock HTTP mocking, polling/subscription tests with fake timers, useSuspense, useLive…

Apache-2.0Auto-check passedTesting & QA

Install Data Client Vue Testing

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

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

GitHub CLI
$ gh skill install reactive/data-client data-client-vue-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-vue-testing .claude/skills/data-client-vue-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-vue-testing
GitHub stars
2k
Token cost
~2.7k tokens
SKILL.md length
515 words
Files
8 (incl. references)
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Test @data-client/vue composables and components - renderDataCompose, mountDataClient, fixtures, jest, nock HTTP mocking, polling/subscription tests with fake timers, useSuspense, useLive…

  • Works in 4 steps: jest.useFakeTimers() before mount/render… → Render, then… → Mutate the response (e.g.… → …
  • Debugging tests for composables
  • SKILL.md covers Composable Testing with…, Component Testing with…, Async Waiting Patterns and Reactive Props Testing, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Data Client Vue Testing is an agent skill from reactive/data-client. Test @data-client/vue composables and components - renderDataCompose, mountDataClient, fixtures, jest, nock HTTP mocking, polling/subscription tests with fake timers, useSuspense, useLive, useSubscription, Vue 3 reactive props. Use when writing or debugging tests for composables or components built on @data-client/vue.

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

It sits in Testing & QA, covering Unit testing and Test data and fixtures. It works with Vue.js 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 composables
  • Components built on @data-client/vue

Example prompts

  • “/data-client-vue-testing”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. jest.useFakeTimers() before mount/render (so the interval is created under fake timers).
  2. Render, then jest.advanceTimersByTime(frequency) to drive the initial fetch.
  3. Mutate the response (e.g. responseMock.mockReturnValue(...)), advance time again, await allSettled() and await nextTick().
  4. Restore real timers in afterEach: jest.useRealTimers().

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

    No URLs in SKILL.md.

    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 Vue Testing loads about 2.7k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 86 tokens; SKILL.md has 515 words of instructions outside code blocks.

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

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). 515 words, ~2,724 tokens.

Download SKILL.mdSave it as .claude/skills/data-client-vue-testing/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
data-client-vue-testing
description
Test @data-client/vue composables and components - renderDataCompose, mountDataClient, fixtures, jest, nock HTTP mocking, polling/subscription tests with fake timers, useSuspense, useLive, useSubscription, Vue 3 reactive props. Use when writing or debugging tests for composables or components built on @data-client/vue.
license
Apache 2.0

Vue Testing Patterns (@data-client/vue)

Composable Testing with renderDataCompose()

typescript
import { renderDataCompose } from '@data-client/vue/test';
import { reactive, computed } from 'vue';

it('useQuery() should return cached data', async () => {
  const { result } = await renderDataCompose(
    () => useQuery(Article, { id: 5 }),
    {
      initialFixtures: [
        {
          endpoint: ArticleResource.get,
          args: [{ id: 5 }],
          response: { id: 5, title: 'hi ho', content: 'whatever' },
        },
      ],
    },
  );
  expect(result.value).toEqual(Article.fromJS({ id: 5, title: 'hi ho', content: 'whatever' }));
});

Options:

  • initialFixtures - Pre-populate store state (static fixtures)
  • resolverFixtures - Intercept requests with dynamic responses
  • props - Reactive props object (use reactive())
  • managers, initialState, gcPolicy - Custom configuration

Return values (renderDataCompose() is async; always await it):

  • result - Whatever the composable returned: useQuery/useCache give a ComputedRef (.value is undefined when not in the store); useSuspense gives a Promise of one, so await result once, then read .value, which stays reactive
  • controller - Controller instance for manual actions
  • wrapper - Vue Test Utils wrapper
  • cleanup() - Cleanup function (always call in afterEach/after test)
  • allSettled() - Wait for all in-flight fetches (including ones a prop change just started) and the re-render
  • waitForNextUpdate() - Deprecated: it gives up silently after 1 second, so a test can pass while still suspended, and can hang under fake timers. Use await result for a Promise result, and await allSettled() after changing props or calling the controller

Component Testing with mountDataClient()

typescript
import { mountDataClient } from '@data-client/vue/test';
import { defineComponent, h, reactive } from 'vue';

it('should render article component', async () => {
  const ArticleComp = defineComponent({
    props: { id: Number },
    async setup(props) {
      const article = await useSuspense(ArticleResource.get, () => ({ id: props.id }));
      return () => h('div', [
        h('h3', article.value.title),
        h('p', article.value.content),
      ]);
    },
  });

  const props = reactive({ id: 5 });
  const { wrapper, cleanup } = mountDataClient(ArticleComp, {
    props,
    initialFixtures: [
      {
        endpoint: ArticleResource.get,
        args: [{ id: 5 }],
        response: { id: 5, title: 'hi ho', content: 'whatever' },
      },
    ],
  });

  await flushUntil(() => wrapper.find('h3').exists());
  expect(wrapper.find('h3').text()).toBe('hi ho');
  cleanup();
});

Features:

  • Suspense is automatically integrated (shows fallback while loading)
  • Use data-testid="suspense-fallback" to test loading state
  • Synchronous; returns wrapper, controller, app, cleanup() and allSettled()

Async Waiting Patterns

flushUntil(predicate) (for component tests): copy the helper from waiting for renders; it throws if the condition never holds.

typescript
await flushUntil(() => wrapper.find('h3').exists());
await flushUntil(() => wrapper.find('h3').text() === 'Expected Title');

Reactive Props Testing

Pattern 1: Testing prop changes:

typescript
const props = reactive({ id: 1 });
const { result } = await renderDataCompose(
  () => useQuery(Article, computed(() => ({ id: props.id }))),
  {
    initialFixtures: [
      { endpoint: ArticleResource.get, args: [{ id: 1 }], response: { id: 1, title: 'First' } },
      { endpoint: ArticleResource.get, args: [{ id: 2 }], response: { id: 2, title: 'Second' } },
    ],
  },
);

expect(result.value?.title).toBe('First');

// Change props - result updates after a tick
props.id = 2;
await nextTick();
expect(result.value?.title).toBe('Second');

Pattern 2: Conditional arguments (null handling):

typescript
const props = reactive({ id: 1 as number | null });
const { result } = await renderDataCompose(
  (props: { id: number | null }) => 
    useSuspense(ArticleResource.get, computed(() => props.id !== null ? { id: props.id } : null)),
  { props },
);

const articleRef = await result;
expect(articleRef.value).toBeDefined();

// Set to null - becomes undefined
props.id = null;
await nextTick();
expect(articleRef.value).toBeUndefined();

Fixtures and Interceptors

Static Fixture:

typescript
{
  endpoint: ArticleResource.get,
  args: [{ id: 5 }],
  response: { id: 5, title: 'hi ho', content: 'whatever' },
}

Dynamic Interceptor:

typescript
resolverFixtures: [
  {
    endpoint: ArticleResource.get,
    response: ({ id }) => ({ id, title: `Article ${id}`, content: 'dynamic' }),
  },
]

Error Fixture:

typescript
{
  endpoint: ArticleResource.get,
  args: [{ id: 5 }],
  response: new Error('Not found'),
  error: true,
}

Testing Mutations

typescript
it('should update collection when pushed', async () => {
  const { result, controller } = await renderDataCompose(
    () => useQuery(ArticleResource.getList.schema, {}),
    {
      initialFixtures: [
        { endpoint: ArticleResource.getList, args: [], response: [{ id: 1, title: 'First' }] },
      ],
      resolverFixtures: [
        { endpoint: ArticleResource.getList.push, response: (body) => body },
      ],
    },
  );

  expect(result.value?.length).toBe(1);

  await controller.fetch(ArticleResource.getList.push, {
    id: 2,
    title: 'Second',
    content: 'new',
  });
  await nextTick();

  expect(result.value?.length).toBe(2);
});

Testing with Controller

setResponse() for instant updates:

typescript
const { result, controller } = await renderDataCompose(() => useSuspense(...));
const dataRef = await result;

expect(dataRef.value.title).toBe('Original');

controller.setResponse(
  ArticleResource.get,
  { id: 5 },
  { id: 5, title: 'Updated', content: 'new content' }
);

await nextTick();
expect(dataRef.value.title).toBe('Updated'); // Reactive!

Testing with nock (HTTP Mocking)

Use nock when a test must exercise the real fetch path — verifying URL construction, headers, request bodies, retries, or anything in your RestEndpoint/Resource networking layer. For pure store/state behavior, prefer initialFixtures/resolverFixtures (lighter and faster).

Minimal shape:

typescript
import nock from 'nock';

beforeAll(() => {
  nock(/.*/)
    .persist()
    .defaultReplyHeaders({ 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json' })
    .options(/.*/).reply(200)            // CORS preflight (required in JSDOM)
    .get('/article/5').reply(200, { id: 5, title: 'hi ho' });
});

afterAll(() => nock.cleanAll());

For dynamic server state, mutating-closure replies, request spying with jest.fn(), error responses, and mixing nock with fixtures, see references/nock-http-mocking.md.

Show full SKILL.md (227 more words)Show less

Testing Polling and Subscriptions

For composables with pollFrequency, useLive, or useSubscription, use fake timers so polls fire deterministically. Core flow:

  1. jest.useFakeTimers() before mount/render (so the interval is created under fake timers).
  2. Render, then jest.advanceTimersByTime(frequency) to drive the initial fetch.
  3. Mutate the response (e.g. responseMock.mockReturnValue(...)), advance time again, await allSettled() and await nextTick().
  4. Restore real timers in afterEach: jest.useRealTimers().

Quick example:

typescript
jest.useFakeTimers();
const responseMock = jest.fn(() => payload);

const { result, allSettled, cleanup } = await renderDataCompose(
  () => useSuspense(PollingArticleResource.get, { id: payload.id }),
  { resolverFixtures: [{ endpoint: PollingArticleResource.get, response: responseMock }] },
);

jest.advanceTimersByTime(frequency);
await allSettled();
const articleRef = await result;

responseMock.mockReturnValue({ ...payload, title: 'updated' });
jest.advanceTimersByTime(frequency);
await allSettled();
await nextTick();

expect(articleRef!.value.title).toBe('updated');
jest.useRealTimers();
cleanup();

For unsubscribe patterns, component-level polling tests, fake-timer-safe flushUntil, polling via nock, and common pitfalls, see references/polling-subscriptions.md.

Best Practices

  • Always call cleanup() - Prevents memory leaks and test pollution
  • Use reactive() for props - Enables testing prop changes
  • Use flushUntil() in component tests - More reliable than fixed delays
  • Remember nextTick() - After mutations/setResponse to allow Vue reactivity to propagate
  • Use initialFixtures for initial state - Pre-populate the store
  • Use resolverFixtures for dynamic responses - Intercept requests with functions
  • Test both empty and populated states - Verify undefined behavior
  • Pass prop-derived args as getters or computed() - Async setup runs once, so useSuspense(Resource.get, () => ({ id: props.id })) follows prop changes; a plain { id: props.id } is read once

References

For detailed API documentation, see the references directory:

Common Patterns

Empty state test:

typescript
const { result } = await renderDataCompose(() => useQuery(Article, { id: 5 }));
expect(result.value).toBe(undefined);

Testing nested collections:

typescript
const userTodos = new Collection(new schema.Array(Todo), {
  argsKey: ({ userId }) => ({ userId }),
});

const { result } = await renderDataCompose(
  () => useQuery(userTodos, { userId: '1' }),
  { initialFixtures: [/* ... */] },
);

expect(result.value?.length).toBe(2);
expect(result.value?.[0]).toBeInstanceOf(Todo);

© 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 7 other files (references) in .agents/skills/data-client-vue-testing of reactive/data-client.

  • SKILL.md
  • references.json
  • references/Fixtures.md
  • references/mockInitialState.md
  • references/nock-http-mocking.md
  • references/polling-subscriptions.md
  • references/unit-testing-components.md
  • references/unit-testing-composables.md

Open the folder on GitHubat commit 02c0932

Compare with similar skills

Data Client Vue 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 Vue Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Data Client Vue Testing this skillreactive/data-client2k—~2.7kAutomated safety check: PassApache-2.0
Jest Testing PatternsChrisWiles/claude-code-showcase6.1k7 repos~1.5kAutomated safety check: PassNone
Write Jest Testsrundeck/rundeck6.3k—~486Automated safety check: NotesApache-2.0
Testingredis/RedisInsight8.9k—~3.3kAutomated safety check: PassCustom licence
Test Patternsrohitg00/skillkit1.5k—~1.8kAutomated safety check: PassApache-2.0
Testing Patternsbybren-llc/safe-agentic-workflow421—~1.5kAutomated safety check: NotesMIT

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
  • Write Jest Tests

    rundeck/rundeck

    Write Vue component unit tests. An agent skill from rundeck/rundeck.

    6.3k GitHub stars~486 tokensUpdated today
    Testing & QAAuto-check: notes
  • 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
  • Testing Patterns

    bybren-llc/safe-agentic-workflow

    Testing patterns for Jest and Playwright. An agent skill from bybren-llc/safe-agentic-workflow.

    421 GitHub stars~1.5k tokensUpdated 2 mo ago
    Testing & QAAuto-check: notes
  • Testing Patterns

    bybren-llc/safe-agentic-workflow

    Testing patterns for Jest and Playwright. An agent skill from bybren-llc/safe-agentic-workflow.

    421 GitHub stars~478 tokensUpdated 2 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 React Testing

    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…

    2k GitHub stars~1.5k 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

Works with

Categories

Questions about Data Client Vue Testing

What does Data Client Vue Testing do?

Test @data-client/vue composables and components - renderDataCompose, mountDataClient, fixtures, jest, nock HTTP mocking, polling/subscription tests with fake timers, useSuspense, useLive…. Data Client Vue Testing is an agent skill from reactive/data-client. Test @data-client/vue composables and components - renderDataCompose, mountDataClient, fixtures, jest, nock HTTP mocking, polling/subscription tests with fake timers, useSuspense, useLive, useSubscription, Vue 3 reactive props.

When should I use Data Client Vue Testing?

Data Client Vue Testing fits situations like: debugging tests for composables; components built on @data-client/vue.

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

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

How do I install Data Client Vue Testing in Codex?

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

Can I use Data Client Vue 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-vue-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-vue-testing, .gemini/skills/data-client-vue-testing, .github/skills/data-client-vue-testing and .opencode/skills/data-client-vue-testing in your project.

What does Data Client Vue Testing need to run?

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

Does Data Client Vue Testing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Data Client Vue 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 Vue Testing use?

Data Client Vue 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 Vue Testing use?

About 2.7k tokens (SKILL.md is roughly 11k 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 8.5k tokens, read only when the agent opens those files.

What are the alternatives to Data Client Vue Testing?

Skills that share tags, products or a category with Data Client Vue Testing: Jest Testing Patterns (ChrisWiles/claude-code-showcase, 6.1k stars), Write Jest Tests (rundeck/rundeck, 6.3k stars), Testing (redis/RedisInsight, 8.9k stars) and Test Patterns (rohitg00/skillkit, 1.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Data Client Vue 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.