Tag: Vitest
4 posts
-
Vitest Browser Mode: Running Tests in Real Browsers with Playwright or WebdriverIO
Run Vitest in real browsers: providers, vitest/browser APIs, Playwright vs WebdriverIO, screenshot tests, CI setup, and how Browser Mode differs.
-
Testing React Components Like a User: Queries, user-event, Async Tests, Context and Hooks
Testing React components with React Testing Library: choosing queries, simulating user events, async testing, forms, context providers, custom hooks, and accessibility checks.
-
Mocking APIs with MSW: Handlers for the Browser and Node Tests, Runtime Overrides and GraphQL
Mocking APIs at the network level with Mock Service Worker: defining handlers, browser and Node.js setup, using MSW in tests, runtime handler overrides, GraphQL, and an e-commerce example.
-
Vitest in Practice: Setup, Mocking Pitfalls, React Component Tests and Coverage
Set up Vitest in a Vite project, understand why vi.mock is hoisted and how vi.hoisted fixes it, keep mocks from leaking between tests, test React components with Testing Library, and run coverage in CI.