Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/madappgang/claude-code/testing-frontendnpx skills add MadAppGang/claude-code --skill testing-frontendgit clone --depth 1 https://github.com/MadAppGang/claude-codeWrote 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.
[](https://agentmods.dev/skills/madappgang/claude-code/testing-frontend)<a href="https://agentmods.dev/skills/madappgang/claude-code/testing-frontend"><img src="https://agentmods.dev/badge/skills/madappgang/claude-code/testing-frontend.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00034 | $0.02899 |
| Opus 5 | $0.00017 | $0.01450 |
| Sonnet 5 | $0.00007 | $0.00580 |
| Haiku 4.5 | $0.00003 | $0.00290 |
Grade A, and why
testing-frontend 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 502 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Frontend Testing Patterns
Overview
Testing patterns for frontend applications using Vitest and React Testing Library / Vue Test Utils.
Testing Philosophy
User-Centric Testing
Test behavior, not implementation. Query elements the way users would find them.
// BAD: Testing implementation
expect(wrapper.state('isOpen')).toBe(true);
expect(wrapper.find('.modal-class').exists()).toBe(true);
// GOOD: Testing behavior
expect(screen.getByRole('dialog')).toBeInTheDocument();
expect(screen.getByText('Modal Title')).toBeVisible();
Query Priority
Use queries in this order (most to least preferred):
getByRole- Accessible to everyonegetByLabelText- Form elementsgetByPlaceholderText- InputsgetByText- Non-interactive elementsgetByDisplayValue- Form current valuesgetByAltText- ImagesgetByTestId- Last resort
Component Testing (React)
Basic Component Test
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { UserCard } from './UserCard';
describe('UserCard', () => {
const user = { id: '1', name: 'John Doe', email: '[email protected]' };
it('renders user information', () => {
render(<UserCard user={user} />);
expect(screen.getByText('John Doe')).toBeInTheDocument();
expect(screen.getByText('[email protected]')).toBeInTheDocument();
});
it('calls onSelect when clicked', async () => {
const onSelect = vi.fn();
const userEvt = userEvent.setup();
render(<UserCard user={user} onSelect={onSelect} />);
await userEvt.click(screen.getByRole('button'));
expect(onSelect).toHaveBeenCalledWith(user);
});
});
Testing Async Components
import { render, screen, waitFor } from '@testing-library/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { UserList } from './UserList';
// Mock API
vi.mock('@/api', () => ({
getUsers: vi.fn(),
}));
describe('UserList', () => {
const queryClient = new QueryClient({
defaultOptions: { queries: { retry: false } },
});
const wrapper = ({ children }) => (
<QueryClientProvider client={queryClient}>
{children}
</QueryClientProvider>
);
beforeEach(() => {
queryClient.clear();
});
it('shows loading state', () => {
api.getUsers.mockImplementation(() => new Promise(() => {}));
render(<UserList />, { wrapper });
expect(screen.getByText('Loading...')).toBeInTheDocument();
});
it('shows users when loaded', async () => {
api.getUsers.mockResolvedValue([
{ id: '1', name: 'John' },
{ id: '2', name: 'Jane' },
]);
render(<UserList />, { wrapper });
await waitFor(() => {
expect(screen.getByText('John')).toBeInTheDocument();
expect(screen.getByText('Jane')).toBeInTheDocument();
});
});
it('shows error message on failure', async () => {
api.getUsers.mockRejectedValue(new Error('Network error'));
render(<UserList />, { wrapper });
await waitFor(() => {
expect(screen.getByText(/error/i)).toBeInTheDocument();
});
});
});
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.
- 2d ago First seen · 502 lines · 34 tokens per session scan A 0d9816cc2066
testing-frontend is a skill published in the GitHub repository MadAppGang/claude-code (279 stars, last pushed 5mo ago), licensed MIT. It adds 34 tokens to every session and 2,899 once invoked, about $0.0002 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-09-03.
Other skills, from other repositories
mk:vue-testing-best-practices
Use for Vue 3 testing best-practices review and recommendations — designing and auditing Vitest + Vue Test Utils tests for components, composables, Pinia stores, Vue Router, async/Suspense, Teleport, forms, and accessibility, plus Playwright E2E test-design strategy. Advisory/review only — recommends patterns and…
Component Test Scaffold (Vue.js)
Generate Vue.js component test skeletons (Vue Test Utils) from specifications.
test-unit-generator
Activate when writing, generating, or refactoring unit test suites in TypeScript, JavaScript, or Python using Vitest, Jest, or Pytest — trigger phrasings include "write unit tests for this function", "create a Vitest test suite", "test edge cases for this utility", "mock this API in Jest", "increase test coverage to…
testing-llm
LLM and AI testing patterns — mock responses, evaluation with DeepEval/RAGAS, structured output validation, and agentic test patterns (generator, healer, planner). Use when testing AI features, validating LLM outputs, or building evaluation pipelines.
storybook-testing
Storybook 10 testing patterns with Vitest integration, ESM-only distribution, CSF3 typesafe factories, play() interaction tests, Chromatic TurboSnap visual regression, module automocking, accessibility addon testing, and autodocs generation. Use when writing component stories, setting up visual regression testing…
testing-unit
Unit testing patterns for isolated business logic tests — AAA pattern, parametrized tests (test.each, @pytest.mark.parametrize), fixture scoping (function/module/session), mocking with MSW/VCR at network level, and test data management with factories (FactoryBoy, faker-js). Use when writing unit tests, setting up…