# Typescript React Cursorrules Prompt File

> Apply for typescript-react-cursorrules-prompt-file. --- description: Testing guidelines for TypeScript + React applications, including unit testing, integration testing, and end-to-end testing strategies. globs: src/**/*

- Skill: `tryboy869/typescript-react-cursorrules-prompt-file` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add tryboy869/typescript-react-cursorrules-prompt-file`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tryboy869/typescript-react-cursorrules-prompt-file/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: Tryboy869 (https://skillmd.com/u/tryboy869)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/tryboy869/typescript-react-cursorrules-prompt-file

---


# typescript-react-cursorrules-prompt-file

---
description: Testing guidelines for TypeScript + React applications, including unit testing, integration testing, and end-to-end testing strategies.
globs: src/**/*
---
- Use Jest for unit testing React components and utility functions.
- Use React Testing Library for component testing with a focus on user behavior.
- Use Cypress or Playwright for end-to-end testing of user flows.
- Implement proper test coverage targets (aim for 80%+ coverage).
- Use mocking for external dependencies and API calls in unit tests.
- Test both success and error states for components and hooks.
- Use snapshot testing sparingly and only for simple, stable components.
- Implement proper test data setup and teardown with beforeEach/afterEach.
- Use describe blocks to group related tests for better organization.
- Test asynchronous behavior with proper async/await patterns.
- Use data-testid attributes for selecting elements in tests when necessary.
- Implement proper environment setup for different test types (unit, integration, e2e).
- Use factory functions for creating test data to reduce duplication.
- Test edge cases and boundary conditions for components and functions.
- Use page objects pattern for end-to-end tests to improve maintainability.
- Implement visual regression testing for critical UI components.
- Use code coverage tools to identify untested code paths.
- Test accessibility with tools like axe-core in Jest tests.
- Implement proper error boundary testing for React components.
- Use parameterized tests for testing multiple similar scenarios.
- Test responsive behavior with different viewport sizes.
- Implement proper cleanup between tests to prevent test interdependence.
- Use realistic data in tests rather than dummy data when possible.
- Test loading states, empty states, and error states for data-driven components.

