test-patterns

Solid

Applies proven testing patterns — Arrange-Act-Assert (AAA), Given-When-Then, Test Data Builders, Object Mother, parameterized tests, fixtures, spies, and test doubles — to help write maintainable, reliable, and readable test suites. Use when the user asks about writing unit tests, integration tests, or end-to-end tests; structuring test cases or test suites; applying TDD or BDD practices; working with mocks, stubs, spies, or fakes; improving test coverage or reducing flakiness; or needs guidance on test organization, naming conventions, or assertions in frameworks like Jest, Vitest, pytest, or similar.

Testing & QA 1,177 stars 108 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Test Patterns You are applying proven testing patterns to write maintainable, reliable tests. These patterns help ensure tests are readable, focused, and trustworthy. ## Pattern Selection Guide Use this to choose the right pattern for your situation: - **Structuring a single test?** → Arrange-Act-Assert (AAA) or Given-When-Then - **Writing behavior/feature specs?** → Given-When-Then (BDD style) - **Repeating test setup data?** → Test Data Builders - **Many variations of complex objects?** → Object Mother - **Testing same logic with many inputs?** → Parameterized Tests - **Shared setup/teardown across tests?** → Test Fixtures - **Verifying a dependency was called?** → Spy - **Replacing an external dependency?** → Test Doubles (Stub / Mock / Fake) --- ## Pattern Combination Workflows Patterns rarely stand alone — here's how to combine them for common scenarios: **Unit tests (isolated logic):** Fixtures for setup → AAA structure → Stubs/Mocks for dependencies → Parameterized Tests for multiple input cases **Integration tests (service + external dependencies):** Fixtures for setup → AAA structure → Fakes for external services (e.g. in-memory DB) → Spies to verify interaction points **BDD / feature specs:** Given-When-Then → Object Mother or Test Data Builders for scenario data → Fakes for infrastructure **High-variation logic (validators, calculators, formatters):** Parameterized Tests → Test Data Builders to construct each case → AAA structure within each case --- ...

Details

Author
rohitg00
Repository
rohitg00/skillkit
Created
4 months ago
Last Updated
today
Language
TypeScript
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Listed

javascript-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 implementing TDD/BDD workflows.

335 Updated today
aiskillstore
Testing & QA Listed

testing

Testing strategies, patterns, and best practices

0 Updated today
murtazatouqeer
Testing & QA Listed

nfs-testing-patterns

Test-writing patterns for projects scaffolded with nextjs-fullstack-starter. Use whenever the user is writing or reviewing tests in such a project, asks 'how do I test X', wants to add test coverage for a new module, or needs to debug a failing test. Covers service-layer unit tests (the high-value layer where most coverage lives), integration tests with a real Postgres (Testcontainers), Server Action tests via direct invocation, route-handler tests, and Playwright e2e. Each section explains WHAT to test at that layer and HOW so test effort lands where it pays off.

0 Updated 1 weeks ago
juncoding
Testing & QA Solid

python-testing-patterns

Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

27,705 Updated today
davila7
Testing & QA Listed

python-testing-patterns

Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

335 Updated today
aiskillstore