rstest

rstest is a skill for Claude Code, Codex from weAAAre/a11y-agents-kit. It costs 222 tokens per session (5,384 once invoked), scanned A, original, MIT.

A guide to Rstest, a JavaScript and TypeScript test framework built around Rspack, a JavaScript build tool. It covers setup, configuration, mocks, timers, snapshots, and browser-like testing.

In plain words
What is it for?
Use it to write and run unit and interface tests for JavaScript or TypeScript projects. It also covers module mocking, spies, fake timers, snapshots, and test configuration.
Why use it?
It helps developers configure tests correctly and avoid mistakes when moving from tools such as Vitest or Jest, especially around mocks and watch mode.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import App from '../src/App.vue';.

Good fit Use it to write and run unit and interface tests for JavaScript or TypeScript projects. It also covers module mocking, spies, fake timers, snapshots, and test configuration.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/weAAAre/a11y-agents-kit
agentmods
npx agentmods add skills/weaaare/a11y-agents-kit/rstest

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rstest

README.md
[![agentmods](https://agentmods.dev/badge/skills/weaaare/a11y-agents-kit/rstest.svg)](https://agentmods.dev/skills/weaaare/a11y-agents-kit/rstest)
Your own site
<a href="https://agentmods.dev/skills/weaaare/a11y-agents-kit/rstest"><img src="https://agentmods.dev/badge/skills/weaaare/a11y-agents-kit/rstest.svg" alt="Measured on agentmods" height="20"></a>
Per session 222 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,384 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00222 $0.05384
Opus 5 $0.00111 $0.02692
Sonnet 5 $0.00044 $0.01077
Haiku 4.5 $0.00022 $0.00538

Measured 8d ago against content hash 9275ba92b106, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

rstest 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 8d ago.

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.

.agents/skills/rstest/SKILL.md · 732 lines

How it starts

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

Rstest

Rstest is a testing framework powered by Rspack. It provides Jest-compatible APIs with native TypeScript and ESM support, and integrates directly into the Rstack toolchain (Rspack, Rsbuild, Rslib, Rspress).

Key things that distinguish Rstest from Jest/Vitest:

  • Build tooling is Rspack, not Babel or Vite — it reuses your existing Rsbuild/Rspack config
  • Two separate utility namespaces: rs for module-level operations (mocking modules), and rstest for runtime utilities (fn, spyOn, timers). Both are imported from @rstest/core
  • rs.mock() without a factory is NOT auto-mock — it looks for __mocks__/ directory only. For auto-mocking, pass { mock: true }. This is the biggest gotcha when migrating from Vitest
  • Mock factories cannot be async — use import ... with { rstest: 'importActual' } for partial mocks instead
  • No --run flagrstest already runs once and exits. Use rstest --watch or rstest watch for watch mode
  • Node.js ≥ 20.19.0 required

Setup

Install

# npm / pnpm / yarn / bun
pnpm add @rstest/core -D

package.json scripts

{
  "scripts": {
    "test": "rstest",
    "test:watch": "rstest watch"
  }
}

Configuration file

Rstest auto-discovers config files in the project root in this order: rstest.config.mjs, .ts, .js, .cjs, .mts, .cts.

// rstest.config.ts
import { defineConfig } from '@rstest/core';

export default defineConfig({
  // Test config is at the top level — NOT nested under a `test` key (unlike Vitest)
  include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)'],
  exclude: ['**/node_modules/**', '**/dist/**'],
  testEnvironment: 'node', // 'node' | 'jsdom' | 'happy-dom'
  globals: false,          // set true to skip imports in test files
  setupFiles: [],          // runs before each test file
  testTimeout: 5000,
  retry: 0,
});

If your project already uses Rsbuild or Rslib, use the official adapters to avoid config duplication — see "Rsbuild / Rslib integration" below.

Read the full file on GitHub · 732 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. 8d ago First seen · 732 lines · 222 tokens per session scan A 9275ba92b106

Subscribe to this mod's changes

rstest is a skill published in the GitHub repository weAAAre/a11y-agents-kit (33 stars, last pushed 4mo ago), licensed MIT. It adds 222 tokens to every session and 5,384 once invoked, about $0.0011 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

accessibility-testing-axe

Use when testing accessibility with axe.

LoopyLuci/Skills · 13 tokens

press-clip

Turn a live article URL into a press clip that looks like the real coverage — the publication's own logo, fonts, photos and layout kept intact, the ads and clutter removed, and (for a roundup) just the client's section. Renders to PDF. You inspect each site and tailor the removal; the bundled script carries no…

elvisun/newsjack · 74 tokens

story-origin-check

Recover the first public timestamp and canonical major coverage for a newsjacking signal, then decide whether newer coverage is the same story, a different story, or a materially new development.

elvisun/newsjack · 40 tokens

coverage-tracker

Run a Google Alerts-style keyword coverage tracker. Uses news-search for recent keyword queries, lets the LLM dedupe and classify real features versus junk, stores decisions in SQLite, and alerts only on new real coverage.

elvisun/newsjack · 47 tokens

prompt-proximity-architecture

Turn an approved measurement charter, ICPs, and buyer jobs into a budget-aware prompt coverage blueprint across proximity bands, aided status, information acts, journey states, roles, locales, evidence grades, partitions, and measurement lanes. Use before prompt wording to define required, optional, and prohibited…

elvisun/newsjack · 67 tokens

coverage-tracker-setup

Set up a lightweight Google Alerts-style coverage tracker for any number of keywords. Creates a tracker config with each keyword and what it actually means, then hands recurrence to the user's agent harness.

elvisun/newsjack · 43 tokens