Category · 5 articles
Testing
Using Vitest, MSW, and Faker in TypeScript
Three tools that changed how I write tests: Vitest for speed, MSW for API mocking, and Faker for realistic data. How to wire them together in TypeScript.
17 May 2024
Testing SetInterval in React Components
I built a live clock component. It updated every second using setInterval. Worked perfectly in the browser. In tests, it was a disaster. Tests hung, leake...
29 Apr 2024
Testing setTimeout Functions in React Components
I had a component that showed a success message for 3 seconds, then hid it. Simple feature. The test? It passed locally, failed in CI, passed again when I...
29 Apr 2024
Testing React Components in Storybook Using Testing Library
I used to treat Storybook and tests as two separate things. Stories for visual review. Tests for logic. Then I realized I was duplicating work. Every stor...
29 Apr 2024
Writing Tests with Vitest and React Testing Library
I switched from Jest to Vitest on a large React project. The test suite went from 45 seconds to 8 seconds. Same tests, same assertions, dramatically less ...
17 Apr 2024