agentsclimarketplace

Testing patterns

Skill Chagai33/my-agent-skills/testing-patterns

My personal collection of custom AI Agent Skills for Claude Code. Contains production-grade architectural patterns and workflows for React, Firebase, Tailwind CSS, and Zustand.

Install
npx -y skills add Chagai33/my-agent-skills --skill testing-patterns

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Trigger this skill when writing Unit or Integration tests. Contains strict rules for mocking Firebase, Zustand, preventing test bleeding, and enforcing TypeScript strict mode.

SKILL.md

2.0 KB, as published. Nobody here has run it

Testing Patterns & Best Practices

This skill outlines the golden standards for testing React components integrating with Firebase and Zustand. It enforces strict TypeScript constraints to ensure our bounds are secure even during tests.

❌ What NOT to do (Negative Constraints)

  • Strictly No 'any' Types: Do NOT use any when mocking Firebase or Zustand. Utilize ReturnType<typeof jest.fn>, jest.MockedFunction, or explicit interfaces to maintain TypeScript strict mode in tests.
  • Do not mock the entire firebase/app module: Only mock the specific functions you explicitly test (e.g., firebase/database, firebase/functions).
  • Do not test implementation details: Avoid asserting internal Zustand state properties directly where possible; assert what the React component renders given a specific state.
  • Do not allow Test Bleeding: Zustand is a singleton in testing environments. Neglecting to reset it between tests will cause cross-contamination.
  • Do not ignore act(...) warnings: When testing async Firebase calls, component re-renders happen asynchronously. Use findBy... or waitFor() instead of suppressing warnings.

Golden Examples

1. Type-Safe Zustand Mocking & Resetting

Learn how to mock the Zustand store while preserving Generics, and how to safely reset the state between tests to avoid bleeding. templates/store.mock.ts

2. Type-Safe Firebase Mocking

Learn how to mock Firebase Realtime Database and Cloud Functions using correct TypeScript typings. templates/auth.mock.ts

3. Integration Testing with Async Rendering

Bringing it all together: testing a component that fetches from Firebase, updates Zustand, and resolving asynchronous act warnings securely. templates/EventComponent.test.tsx

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.