agentsclimarketplace

Typescript testing frontend

Skill LazyIsEfficient/agentic-os/.claude/skills/typescript-testing-frontend

Agentic Framework for Modern Development

Install
npx -y skills add LazyIsEfficient/agentic-os --skill typescript-testing-frontend

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

One thing to look at

  • 15 stars15 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

Use when writing or reviewing TypeScript frontend tests — Jest unit/integration tests for React components and hooks built with Chakra UI, React Query, Zustand, and Next.js App Router. Triggers on edits to `*.test.tsx`, React component/hook test files (`.tsx`, not `.ts`) under `**/__tests__/`, custom test render helpers, or mentions of "frontend test", "component test", "hook test", "React test", "UI test".

SKILL.md

5.3 KB, 930 tokens by cl100k_base, as published. Nobody here has run it

TypeScript Testing — Frontend

You are operating as a frontend test engineer. Test what the user sees and does — accessibility-first queries, real interactions, no implementation-detail assertions.

Reference stack: Jest 29 with @swc/jest, React Testing Library 16, jest-dom matchers, jest-canvas-mock, in jsdom. All tests import from a custom render helper (e.g. @/test-utils/render) that wraps children in ChakraProvider + QueryClientProvider (with retries disabled). Tests are co-located in __tests__/ folders next to source files.

Mock Zustand stores via the selector pattern, services at the module boundary, and Next.js next/link / next/image / next/navigation modules. Prefer accessibility-first queries.

Universal Rules

  1. Import from your custom render helper — never directly from @testing-library/react.
  2. React Query retries disabled in test wrappers — prevents flaky async behavior.
  3. Accessibility-first queriesgetByRole > getByText > getByLabelText > getByTestId.
  4. userEvent.setup() over fireEvent for realistic interactions.
  5. Mock at the module boundary — services, stores, Next.js modules.
  6. Use const React = require('react') inside jest.mock() factories.
  7. waitFor() for async, act() for sync state updates — never sleep().
  8. No snapshot tests — behavioral assertions only.
  9. Never test.skip() — fix or delete.
  10. Every it() asserts at least one observable behavior.
  11. Tests-only default — unless the user explicitly asked for production work, change tests only (no refactors, no public API or prop-surface changes, no new exports). When testability pain appears, capture it under Refactor opportunities (not in scope) (see below); do not implement those ideas unless instructed.

Tests-only default and refactor callouts

When writing or reviewing tests, default scope is tests only. Unless the user explicitly asks you to refactor production code or change public contracts (props, exports, module APIs), ship tests only. Do not rename props, split components, extract hooks, or change runtime behavior as part of test work.

Hard-to-test UI remains a useful design feedback signal — but feedback belongs in your response, not in silent production edits. When you notice testability issues, add a final section in your response titled Refactor opportunities (not in scope) with short bullets (what you observed, what would help). Omit the section if nothing is worth flagging.

Examples of when to flag: untestable or awkward seams (no stable boundary to mock/fake); heavy or nested mocks to assert one behavior; large wrapper/setup cost for a supposedly small unit; missing stable accessible names (roles, labels) so tests depend on getByTestId or brittle copy; business logic or I/O bundled in a component or hook so focused assertions are awkward.

Do not implement those refactors in the same turn unless instructed — hand off for follow-up. Record the signal; acting on it is a separate, explicit scope.

References

What ships with it: 8 files

14.1 KB alongside SKILL.md

Keep looking

Skills are one crate of 326,984. 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.