testing-patterns
/testing-patterns
Testing patterns for unit, integration, and end-to-end tests. 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
- 4
- 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 unit, integration, and end-to-end tests. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions.
Original author description
Testing patterns for unit, integration, and end-to-end tests. 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 unit, integration, and end-to-end tests. 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
{{TEST_UNIT_COMMAND}} # Unit tests
{{TEST_INTEGRATION_COMMAND}} # Integration tests
{{TEST_E2E_COMMAND}} # E2E tests (Playwright)
{{CI_VALIDATE_COMMAND}} # 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
{{TEST_UNIT_COMMAND}} --coverage
```
```
## Reference
- **Jest Config**: `jest.config.js`
- **RLS Context**: `lib/rls-context.ts`
- **Pattern Library**: `patterns_library/testing/`
Files in this package (4)
- SKILL.md 2 KB
- assets/.gitkeep 1 KB
- references/.gitkeep 1 KB
- scripts/.gitkeep 1 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 032839106766 (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
- 100testing-strategy
Testing strategies and best practices for unit, integration, and end-to-end tests. Use when setting up test infrastructure, writing test cases, or deciding what to test. Covers test pyramid, mocking strategies, and coverage guidelines. - 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… - 95testing
Testing patterns for behavior-driven tests. Use when writing tests, creating test factories, structuring test files, or deciding what to test. Do NOT use for UI-specific testing (see front-end-testing or react-testing skills). - 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… - 100testing
Apply comprehensive testing best practices including unit, integration, and e2e tests. Use when writing tests, reviewing test coverage, designing testable code, or setting up test infrastructure. - 91javascript-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…