testing-patterns

testing-patterns is a skill for Claude Code from sickn33/agentic-awesome-skills. It costs 40 tokens per session (1,526 once invoked), scanned A, original, MIT.

A collection of JavaScript and React testing patterns using Jest, mocks, reusable test data, and test-driven development. Jest is a tool for running JavaScript tests; TDD means writing a failing test before the implementation.

In plain words
What is it for?
Use it to write unit tests, create mock data, test React components, mock dependencies, and follow the TDD red-green-refactor cycle.
Why use it?
It helps keep tests focused on observable behaviour rather than internal details. Reusable factories and rendering helpers reduce repeated setup in test files.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the agentic-awesome-skills plugin — 197 skills, 1 plugin shipped together

Good fit Use it to write unit tests, create mock data, test React components, mock dependencies, and follow the TDD red-green-refactor cycle.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sickn33/agentic-awesome-skills/testing-patterns
About the project

AAS Core is a local control plane for coding agents that lets them search a large catalogue of skills, choose a stack, validate it, and create a reproducible plan. It is used to assemble and review agent workflows through its CLI, local MCP server, catalogue, plugins, and Workbench. The catalogue add-ons provide the skills, plugins, bundles, and workflows that AAS Core helps agents select and validate.

sickn33/agentic-awesome-skills · 50,681 stars · on GitHub · aaskills.tech

Install

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.

Any agent
npx skills add sickn33/agentic-awesome-skills --skill testing-patterns
Clone the repo
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills

Made for: Claude Code.

Or install agentic-awesome-skills, the plugin that ships this one along with the rest of its 197 skills, 1 plugin.

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 testing-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/sickn33/agentic-awesome-skills/testing-patterns/github.svg)](https://agentmods.dev/skills/sickn33/agentic-awesome-skills/testing-patterns)
Your own site
<a href="https://agentmods.dev/skills/sickn33/agentic-awesome-skills/testing-patterns"><img src="https://agentmods.dev/badge/skills/sickn33/agentic-awesome-skills/testing-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/sickn33/agentic-awesome-skills/testing-patterns"><img src="https://agentmods.dev/badge/skills/sickn33/agentic-awesome-skills/testing-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,526 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. Third-party audits
  • Socket pass 22 Oct 2026
  • Snyk pass 22 Oct 2026
How audits are shown
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.00040 $0.01526
Opus 5.5 $0.00016 $0.00610
Sonnet 5.5 $0.00008 $0.00305
Haiku 4.5 $0.00004 $0.00153

Measured 20d ago against content hash 6c3bc0d7f84c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testing-patterns 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 20d 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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

plugins/aasb-aas-qa-test-automation/skills/testing-patterns/SKILL.md · 271 lines

How it starts

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

Testing Patterns and Utilities

Testing Philosophy

Test-Driven Development (TDD):

  • Write failing test FIRST
  • Implement minimal code to pass
  • Refactor after green
  • Never write production code without a failing test

Behavior-Driven Testing:

  • Test behavior, not implementation
  • Focus on public APIs and business requirements
  • Avoid testing implementation details
  • Use descriptive test names that describe behavior

Factory Pattern:

  • Create getMockX(overrides?: Partial<X>) functions
  • Provide sensible defaults
  • Allow overriding specific properties
  • Keep tests DRY and maintainable

Test Utilities

Custom Render Function

Create a custom render that wraps components with required providers:

// src/utils/testUtils.tsx
import { render } from '@testing-library/react-native';
import { ThemeProvider } from './theme';

export const renderWithTheme = (ui: React.ReactElement) => {
  return render(
    <ThemeProvider>{ui}</ThemeProvider>
  );
};

Usage:

import { renderWithTheme } from 'utils/testUtils';
import { screen } from '@testing-library/react-native';

it('should render component', () => {
  renderWithTheme(<MyComponent />);
  expect(screen.getByText('Hello')).toBeTruthy();
});

Factory Pattern

Component Props Factory

import { ComponentProps } from 'react';

const getMockMyComponentProps = (
  overrides?: Partial<ComponentProps<typeof MyComponent>>
) => {
  return {
    title: 'Default Title',
    count: 0,
    onPress: jest.fn(),
    isLoading: false,
    ...overrides,
  };
};

// Usage in tests
it('should render with custom title', () => {
  const props = getMockMyComponentProps({ title: 'Custom Title' });
  renderWithTheme(<MyComponent {...props} />);
  expect(screen.getByText('Custom Title')).toBeTruthy();
});

Data Factory

interface User {
  id: string;
  name: string;
  email: string;
  role: 'admin' | 'user';
}

const getMockUser = (overrides?: Partial<User>): User => {
  return {
    id: '123',
    name: 'John Doe',
    email: '[email protected]',
    role: 'user',
    ...overrides,
  };
};

// Usage
it('should display admin badge for admin users', () => {
  const user = getMockUser({ role: 'admin' });
  renderWithTheme(<UserCard user={user} />);
  expect(screen.getByText('Admin')).toBeTruthy();
});

Read the full file on GitHub · 271 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. 20d ago First seen · 271 lines · 40 tokens per session scan A 6c3bc0d7f84c

Subscribe to this mod's changes

testing-patterns is a skill published in the GitHub repository sickn33/agentic-awesome-skills (50,681 stars, last pushed today), licensed MIT. It adds 40 tokens to every session and 1,526 once invoked, about $0.0002 per session on Opus 5.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-11-12.

Related

testing-patterns compared with skills from other repositories

testing-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
testing-patternssickn33/agentic-awesome-skillsSkill51ktodayMITA40Claude Code
unit-test-writerAtulPurohit/Antigravity-Awesome-SkillsSkill64mo agononeA32Claude Code, Codex
snapshot-testerAtulPurohit/Antigravity-Awesome-SkillsSkill64mo agononeA24Claude Code, Codex
test-data-builderAtulPurohit/Antigravity-Awesome-SkillsSkill64mo agononeA24Claude Code, Codex
build-nitro-modulesMarshanda14816/agent-skillsSkill21mo agononeA84Claude Code, Codex
laravel-apiAtulPurohit/Antigravity-Awesome-SkillsSkill64mo agononeA34Claude Code, Codex
laravel-architectAtulPurohit/Antigravity-Awesome-SkillsSkill64mo agononeA31Claude Code, Codex