unit-testing

Listed

Unit testing patterns: Vitest config with v8 coverage, Testing Library behavior testing, MSW for HTTP mocking (vs jest.mock), it.each parametrized tests, spies vs mocks vs stubs, testing async code, snapshot testing guidelines. Use when writing unit and component tests.

Testing & QA 11 stars 1 forks Updated 1 months ago MIT

Install

View on GitHub

Quality Score: 65/100

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

Skill Content

# Unit Testing Patterns ## When to use - Setting up Vitest or Jest for a new project - Writing unit tests for business logic - Component testing with Testing Library - Mocking HTTP requests with MSW - Parametrized tests with it.each ## Core principles 1. **Test behavior, not implementation** — what does it return/do, not how 2. **MSW over jest.mock** — mock at network level, not module level 3. **One assertion per test** — single reason to fail per test 4. **Arrange-Act-Assert** — consistent structure in every test 5. **No test interdependence** — each test must run independently ## References available - `references/vitest-config.md` — globals, environment, coverage thresholds, thread pool, MSW setup - `references/business-logic-testing.md` — pure function tests, AAA pattern, it.each parametrized tests - `references/msw-http-mocking.md` — handlers setup, server lifecycle, per-test handler overrides - `references/async-testing.md` — await patterns, rejected promise assertions, try/catch error checks - `references/testing-library-react.md` — render, screen queries, userEvent vs fireEvent, role queries

Details

Author
rnavarych
Repository
rnavarych/alpha-engineer
Created
1 months ago
Last Updated
1 months ago
Language
Shell
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Solid

playwright-core

Battle-tested Playwright patterns for E2E, API, component, visual, accessibility, and security testing. Covers locators, assertions, fixtures, network mocking, auth flows, debugging, and framework recipes for React, Next.js, Vue, and Angular. TypeScript and JavaScript.

185 Updated 1 weeks ago
testdino-hq
Testing & QA Featured

swift-testing-expert

Expert guidance for Swift Testing: test structure, #expect/#require macros, traits and tags, parameterized tests, test plans, parallel execution, async waiting patterns, and XCTest migration. Use when writing new Swift tests, modernizing XCTest suites, debugging flaky tests, or improving test quality and maintainability in Apple-platform or Swift server projects.

334 Updated 6 days ago
AvdLee
Testing & QA Solid

angular-testing

Write Angular component tests using TestBed, ComponentHarness, and HttpTestingController with proper signal input handling. Use when writing component tests, mocking HTTP calls, or testing signal inputs. (triggers: **/*.spec.ts, TestBed, ComponentFixture, TestHarness, provideHttpClientTesting)

387 Updated 1 weeks ago
HoangNguyen0403
Testing & QA Listed

testing-tauri-apps

Guides developers through testing Tauri applications including unit testing with mock runtime, mocking Tauri APIs, WebDriver end-to-end testing with Selenium and WebdriverIO, and CI integration with GitHub Actions.

13 Updated 2 months ago
dchuk
Testing & QA Solid

playwright-skill

Battle-tested Playwright patterns for E2E, API, component, visual, accessibility, and security testing. Covers locators, fixtures, POM, network mocking, auth flows, debugging, CI/CD (GitHub Actions, GitLab, CircleCI, Azure, Jenkins), framework recipes (React, Next.js, Vue, Angular), and migration guides from Cypress/Selenium. TypeScript and JavaScript.

185 Updated 1 weeks ago
testdino-hq