testing-patterns

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

A set of Jest testing patterns and utilities for JavaScript or TypeScript projects. It explains unit tests, reusable test data factories, mocking, and TDD, which means writing a failing test before the code that makes it pass.

In plain words
What is it for?
Use it to write unit tests, create test factories, mock dependencies, test React Native components, and follow the red-green-refactor TDD cycle.
Why use it?
It helps make tests clearer and easier to maintain while reducing repeated setup code. It also gives a consistent workflow for checking code behavior before refactoring.

Skill for Claude Code

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

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

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

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/iradoweck/antigravity-awesome-skills/testing-patterns
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 iradoweck/antigravity-awesome-skills --skill testing-patterns
Clone the repo
git clone --depth 1 https://github.com/iradoweck/antigravity-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, 2 plugins.

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/iradoweck/antigravity-awesome-skills/testing-patterns/github.svg)](https://agentmods.dev/skills/iradoweck/antigravity-awesome-skills/testing-patterns)
Your own site
<a href="https://agentmods.dev/skills/iradoweck/antigravity-awesome-skills/testing-patterns"><img src="https://agentmods.dev/badge/skills/iradoweck/antigravity-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/iradoweck/antigravity-awesome-skills/testing-patterns"><img src="https://agentmods.dev/badge/skills/iradoweck/antigravity-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.
Origin 100% copy Near-identical to another mod 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 5d 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 5d 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

This is a copy

100% identical to testing-patterns — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

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. 5d 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 iradoweck/antigravity-awesome-skills (31 stars, last pushed 5d ago), 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. It is 100% identical to testing-patterns, differing in 0 lines, and is treated as a copy.

Related

testing-patterns compared with skills from other repositories

testing-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
testing-patternsiradoweck/antigravity-awesome-skillsSkill315d agoMITA40Claude Code
write-vibe-testsmistralai/mistral-vibeSkill5.6ktodayApache-2.0A80Claude Code, Codex
nw-fp-haskellnWave-ai/nWaveSkill63712d agoMITA22Claude Code
nw-fp-clojurenWave-ai/nWaveSkill63712d agoMITA25Claude Code
nw-fp-fsharpnWave-ai/nWaveSkill63712d agoMITA21Claude Code
nw-test-organization-conventionsnWave-ai/nWaveSkill63712d agoMITA33Claude Code
nw-pbt-gonWave-ai/nWaveSkill63712d agoMITA15Claude Code