Skip to content

Testing Strategy

Tests that give genuine confidence. Testing philosophy, the testing trophy, unit tests with Vitest, component tests with Testing Library, integration tests with MSW, and E2E with Playwright.

1
Testing Philosophy and the Testing Trophy
intermediate

Why the testing pyramid is outdated, how the testing trophy gives you better confidence per dollar, and the mental framework for deciding what to test, how to test it, and when to skip tests entirely.

16 min read
2
Vitest Setup and Unit Testing
intermediate

Why Vitest replaced Jest as the default for modern projects, how to set it up with TypeScript, and every matcher and pattern you need to write fast, reliable unit tests.

18 min read
3
React Testing Library and Queries
intermediate

Test components the way users interact with them. Master query priority, async patterns, user events, and debugging — the complete guide to writing tests that actually catch bugs.

18 min read
4
Testing Custom Hooks
intermediate

How to test custom React hooks with renderHook, handle async behavior with waitFor, provide context with wrappers, and know when to test hooks directly vs through components.

16 min read
5
Mocking Strategies with vi
intermediate

Master vi.fn(), vi.spyOn(), vi.mock(), timer mocks, and partial mocking in Vitest — and learn when NOT to mock.

18 min read
6
MSW for API Mocking
intermediate

Intercept requests at the network level with Mock Service Worker. No implementation coupling, works in tests and browser, and makes your integration tests actually trustworthy.

18 min read
7
Integration Testing Patterns
intermediate

How to test multiple units working together. Render pages, interact like a user, assert real outcomes. Patterns for providers, forms, data fetching with MSW, navigation, error boundaries, and loading states.

18 min read
8
Playwright E2E Testing
intermediate

How to write reliable end-to-end tests with Playwright — auto-waiting, cross-browser testing, locator strategies, page objects, authentication reuse, and CI configuration.

18 min read
9
Visual Regression Testing
intermediate

Catch pixel-level UI regressions that unit and integration tests completely miss — using Playwright screenshots, Storybook + Chromatic, and smart CI pipelines.

18 min read
10
Performance Testing in CI
intermediate

Catch performance regressions before they reach production. Set up Lighthouse CI, performance budgets, custom Playwright assertions, and automated alerting in your GitHub Actions pipeline.

18 min read
11
Quiz: Write the Right Test
intermediate

12 scenario-based questions covering query priority, mocking strategies, test isolation, async patterns, and choosing the right test type. The capstone challenge for the Testing Strategy module.

12 min read