testing-patterns
/testing-patterns
Testing patterns for Jest and Playwright. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions.
- Author
- bybren-llc ↗
- Repository
- safe-agentic-workflow ↗
- Licence
- MIT
- Last repository change
- 20.07.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 20.07.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Testing patterns for Jest and Playwright. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions.
Original author description
Testing patterns for Jest and Playwright. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions.
How it works
- Purpose
- When This Skill Applies
- Critical Rules
- Test Commands
- Test Directory Structure
- Evidence Template
- Reference
SKILL.md preview
---
name: testing-patterns
description: Testing patterns for Jest and Playwright. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions.
---
# Testing Patterns Skill
## Purpose
Guide consistent and effective testing. Routes to existing test patterns and provides evidence templates.
## When This Skill Applies
- Writing unit or integration tests
- Setting up test fixtures with RLS
- Running test suites
- Packaging test evidence
## Critical Rules
### ❌ FORBIDDEN
```typescript
// Direct Prisma calls bypass RLS
const user = await prisma.user.findUnique({ where: { user_id } });
// Shared test state causes flaky tests
let sharedUser: User;
beforeAll(() => { sharedUser = createUser(); });
```
### ✅ CORRECT
```typescript
// Use RLS context helpers
const user = await withSystemContext(prisma, "test", async (client) => {
return client.user.findUnique({ where: { user_id } });
});
// Isolated test state
beforeEach(() => {
const testUser = createTestUser();
});
// Unique identifiers
const userId = `user-${crypto.randomUUID()}`;
```
## Test Commands
```bash
yarn test:unit # Unit tests
yarn test:integration # Integration tests
yarn test:e2e # E2E tests (Playwright)
yarn ci:validate # Full validation
```
## Test Directory Structure
```
__tests__/
├── unit/ # Fast, isolated tests
├── integration/ # API and database tests
├── e2e/ # End-to-end tests
└── setup.ts # Global setup
```
## Evidence Template
```markdown
**Test Execution Evidence**
**Test Suite**: [unit/integration/e2e]
**Files Changed**: [list files]
**Test Results:**
- Total Tests: [X]
- Passed: [X]
- Failed: [0]
**Commands Run:**
```bash
yarn test:unit --coverage
```
```
## Reference
- **Jest Config**: `jest.config.js`
- **RLS Context**: `lib/rls-context.ts`
Files in this package (2)
- README.md 2 KB
- SKILL.md 2 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · bybren-llc/safe-agentic-workflow | 100 | MIT |
| Reprograme/redevkit | 100 | MIT |
| piomin/claude-ai-spring-boot | 100 | Apache-2.0 |
| FrancoStino/opencode-skills-collection | 100 | MIT |
| rootcastleco/rei-skills | 100 | MIT |
| davila7/claude-code-templates | 100 | MIT |
| svngoku/coding-agents-skills | 100 | MIT |
| organvm-iv-taxis/a-i--skills | 100 | Apache-2.0 |
| leather-io/mono | 100 | MIT |
Database snapshot: 13.11.2026 · package version 97e80e1f3214 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100senior-qa
This skill should be used when the user asks to "generate tests", "write unit tests", "analyze test coverage", "scaffold E2E tests", "set up Playwright", "configure Jest", "implement testing patterns", or "improve test quality". Use for React/Next.js testing with Jest, React… - 100javascript-testing-patterns
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or… - 100python-testing-patterns
Guide pytest patterns and testing strategies when the user asks about Python testing, fixtures, mocking, or test organization - 100qa
This skill should be used when the user asks to "generate tests", "write unit tests", "analyze test coverage", "scaffold E2E tests", "set up Playwright", "configure Jest", "implement testing patterns", or "improve test quality". - 95javascript-testing-patterns
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or… - 100playwright-testing
Use when writing Playwright E2E tests — browser automation, visual regression testing, Page Objects, fixtures, and reliable test patterns.