AI SummaryFor components requiring Router, ThemeProvider, etc., include them in : Create a test store with for Redux-connected components: Use Mock Service Worker for API mocking:
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "RedisInsight — Cursor Rules" prompt rules to my project. Repository: https://github.com/redis/RedisInsight Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
Jest and Testing Library standards, test patterns, faker usage, renderComponent helper, and mocking
Core Principles
• Write tests for all new features • Follow AAA pattern: Arrange, Act, Assert • Use descriptive test names: "should do X when Y" • CRITICAL: Never use fixed time waits - tests must be deterministic • CRITICAL: Use faker library (@faker-js/faker) for test data
Test Organization
`typescript describe('FeatureService', () => { describe('findById', () => { it('should return entity when found', () => {}); it('should throw NotFoundException when not found', () => {}); }); describe('create', () => { it('should create entity with valid data', () => {}); it('should throw error with invalid data', () => {}); }); }); `
Run a specific test file
node 'node_modules/.bin/jest' 'redisinsight/ui/src/path/to/Component.spec.tsx' -c 'jest.config.cjs'
Run a specific test by name (use -t flag)
node 'node_modules/.bin/jest' 'redisinsight/ui/src/path/to/Component.spec.tsx' -c 'jest.config.cjs' -t 'test name pattern'
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts