Skip to content
Skills Library
Programming · Testing

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.

Licence
MIT
Last repository change
20.07.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 20.07.2026, without references to retired models or APIs.

Licence

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

  1. Purpose
  2. When This Skill Applies
  3. Critical Rules
  4. Test Commands
  5. Test Directory Structure
  6. Evidence Template
  7. Reference
Original SKILL.md headings · 88 lines, 231 words
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

RepositoryScoreLicence
This page · bybren-llc/safe-agentic-workflow100MIT
Reprograme/redevkit100MIT
piomin/claude-ai-spring-boot100Apache-2.0
FrancoStino/opencode-skills-collection100MIT
rootcastleco/rei-skills100MIT
davila7/claude-code-templates100MIT
svngoku/coding-agents-skills100MIT
organvm-iv-taxis/a-i--skills100Apache-2.0
leather-io/mono100MIT

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…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.