Skip to content
Skills Library
Programming · Planning

testing-strategy

/testing-strategy

Chooses test pyramid layers, what to mock, and where tests live for fn(args, deps) systems. Use this skill when deciding unit vs integration vs e2e coverage or structuring a test approach for a feature. Do not use when/for the red-green-refactor loop itself (use tdd-workflow) or writing individual test cases (use writing-tests).

Licence
MIT
Last repository change
30.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 30.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

Chooses test pyramid layers, what to mock, and where tests live for fn(args, deps) systems. Use this skill when deciding unit vs integration vs e2e coverage or structuring a test approach for a feature. Do not use when/for the red-green-refactor loop itself (use tdd-workflow) or writing individual test cases (use writing-tests).

Original author description

Chooses test pyramid layers, what to mock, and where tests live for fn(args, deps) systems. Use this skill when deciding unit vs integration vs e2e coverage or structuring a test approach for a feature. Do not use when/for the red-green-refactor loop itself (use tdd-workflow) or writing individual test cases (use writing-tests).

How it works

  1. Critical rules
  2. Workflow
  3. Resources
  4. Validation
  5. Constraints
Original SKILL.md headings · 46 lines, 304 words
SKILL.md preview
---
name: testing-strategy
description: >-
  Chooses test pyramid layers, what to mock, and where tests live for fn(args,
  deps) systems. Use this skill when deciding unit vs integration vs e2e
  coverage or structuring a test approach for a feature. Do not use when/for the
  red-green-refactor loop itself (use tdd-workflow) or writing individual test
  cases (use writing-tests).
version: 1.2.0
libraries: ["vitest", "vitest-mock-extended", "@faker-js/faker", "k6"]
---

# Testing Strategy

## Critical rules

- Pyramid: many fast **unit** tests → fewer **integration** → thin **load/chaos** top.
- Unit tests mock deps with `mock<DepsType>()` / `mockDeep` — **never** `vi.mock` for app modules.
- Integration tests use real localhost DB only; guardrails must throw on non-localhost URLs.
- Name by type: `*.test.ts` (unit), `*.test.int.ts` (integration), `load/*.js`, `chaos/*`.
- Hard to test = design smell (`fn-args-deps` mocks only what the function uses).
- Faker for realistic unique fixtures so tests parallelize without cleanup.
- Before long setup/Prisma/Faker examples, read the matching resource below.

## Workflow

1. Pick the layer by the question:
   - Logic / injectable deps? → **Unit** (mock deps, ms)
   - Crosses real boundary (DB, FS)? → **Integration** (`.test.int.ts`, localhost)
   - Concurrent traffic / SLOs? → **Load** (`performance-testing`)
   - Survive dependency failure? → **Chaos** (`performance-testing`)
2. Unit: typed mocks from the deps interface; assert Results and values (`writing-tests`).
3. Integration: real DB, seed unique Faker data, query only that data.
4. Ensure `vitest.setup.ts` enforces localhost DB + `vi.clearAllMocks()` between tests.
5. Prisma fluent API: `mockDeep<PrismaClient>()` (+ `$transaction` callback helper).
6. Load/chaos: critical paths only — see `performance-testing`.

## Resources

- [references/examples.md](references/examples.md) — unit/integration/Prisma/Faker patterns. Read when implementing a layer.
- [references/setup.md](references/setup.md) — file naming, guardrails, vitest config, load smoke sketch. Read when scaffolding the suite.
- [references/rationalizations.md](references/rationalizations.md) — excuse→reality and red flags. Read when tempted to skip the pyramid.

## Validation

- [ ] Each test at the right pyramid layer
- [ ] Unit: `mock<DepsType>()`, no app-module `vi.mock`
- [ ] Integration: `.test.int.ts` + localhost-only guardrail
- [ ] Prisma via `mockDeep`; Faker unique IDs/emails for parallel runs
- [ ] Setup clears mocks between tests

## Constraints

- Not the red-green-refactor loop (`tdd-workflow`) or assertion craft (`writing-tests`).
- Deep k6 profiles and Toxiproxy live in `performance-testing`.
- Adjacent: `fn-args-deps`, `result-types`.
Files in this package (4)
  • SKILL.md 3 KB
  • references/examples.md 3 KB
  • references/rationalizations.md 1 KB
  • references/setup.md 2 KB

Versions

RepositoryScoreLicence
This page · jagreehal/jagreehal-claude-skills100MIT
komluk/scaffolding100MIT
oborchers/fractional-cto100MIT
anastasiyaw/codex-claude-code-config100MIT
andreibesleaga/gabbe100CC-BY-4.0
organizzolini/codebase100MIT
shinpr/agentic-code100MIT
sagargupta16/claude-code-recipes100MIT
officialdb/TES-SKILLS100Apache-2.0

Database snapshot: 13.11.2026 · package version e2bde9fbbad5 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100writing-tests
    Writes focused unit and integration tests for fn(args, deps) code with explicit deps mocks and clear arrange-act-assert. Use this skill when authoring or refactoring test files for TypeScript functions and modules. Do not use when/for TDD process discipline alone (use…
  • 100testing-guide
    Testing pyramid and test writing standards for UT/IT/ST/E2E. Supports ISTQB and Industry Pyramid frameworks. Use when: writing tests, discussing test coverage, test strategy, or test naming. Not for: driving a Red-Green-Refactor cycle — use /tdd; measuring achieved coverage —…
  • 100testing
    Guides the user through test-first development and test strategy decisions. ALWAYS trigger on "write tests", "TDD", "test coverage", "mock", "test fails", "flaky test", "how to test", "unit test", "integration test", "e2e test", "test structure", "what to test", "test…
  • 100comprehensive-testing
    Complete testing strategy covering TDD workflow, test pyramid, unit/integration/E2E/property testing, framework best practices (Jest, Vitest, pytest), mock strategies, and CI integration. Use when writing tests, reviewing test quality, or establishing testing standards.
  • 100write-tests
    Write unit and integration tests. Use when the user says "write tests for this", "add test coverage", "how do I test this", "TDD", "red green refactor", "unit test this function", "test this module", "I need tests for", or has code that lacks tests - even if they don't explicitly say "write tests".
  • 100tdd
    Test-driven development discipline: the red-green-refactor cycle, the testing pyramid's proportion of unit/integration/e2e, Fowler's test-double taxonomy, and the FIRST properties of a test worth keeping. Use when building a feature or fixing a bug test-first, mentions \"TDD\"…

Feedback and reports

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