
Testing Patterns
Brings together Jest testing patterns with a strong focus on factory functions and TDD workflow. You get reusable getMock functions for props and data, custom render utilities that wrap providers, and clear examples for mocking modules and GraphQL hooks. The TDD emphasis is real: write the failing test first, make it pass, then refactor. Includes practical patterns for React Native Testing Library queries and user interactions. The anti-patterns section is worth reading, especially the bit about testing actual behavior instead of mock behavior. Best when you want consistent test data across your suite and need concrete examples of the red-green-refactor cycle in practice.
- skills.sh installs
- 908
- GitHub stars
- 43.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add sickn33/antigravity-awesome-skills --skill testing-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
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';
Sponsors
Details
- Repository
- github.com/sickn33/antigravity-awesome-skills
- Category
- Testing & QA
- First seen
- Apr 16, 2026
More from sickn33/antigravity-awesome-skills
All 708- Performance Profiling893
- Shopify Apps887
- Concise Planning879
- Code Documentation Code Explain874
- Flutter Expert873
- Security Audit863
- Autonomous Agent Patterns858
- Frontend Ui Dark Ts858
- Kubernetes Architect858
- Backend Security Coder852
- Seo Audit852
- Rag Engineer846
- Computer Use Agents845
- Twilio Communications844
- Ai Product843
- Javascript Mastery843
- Skill Creator838
- Stripe Integration835
- Agent Tool Builder826
- Database Architect826
- Api Design Principles824
- Planning With Files824
- Agent Evaluation815
- Agent Manager Skill814