What testing tools do you use?
JavaScriptThe short answer
A typical modern testing setup includes: a test runner (Jest or Vitest), a component testing library (React Testing Library), a mocking library (built into Jest/Vitest), a code coverage tool (built into Jest/Vitest), and optionally an E2E framework (Playwright or Cypress). CI/CD integrates them all to run on every pull request.
A typical React testing stack
- Vitest or Jest — runs tests, provides assertions (
expect), mocking (jest.fn), and coverage - React Testing Library — renders components and queries the DOM like a user would
- user-event — simulates realistic user interactions (typing, clicking)
- MSW (Mock Service Worker) — intercepts network requests in tests without mocking
fetchdirectly - Playwright — end-to-end tests in real browsers
How they work together
// Vitest + React Testing Library + user-eventimport { render, screen } from '@testing-library/react';import userEvent from '@testing-library/user-event';test('submitting the form calls onSubmit', async () => { const handleSubmit = vi.fn(); render(<ContactForm onSubmit={handleSubmit} />); await userEvent.type( screen.getByLabelText('Name'), 'John' ); await userEvent.click(screen.getByText('Submit')); expect(handleSubmit).toHaveBeenCalledWith({ name: 'John', });});MSW for API mocking
import { http, HttpResponse } from 'msw';import { setupServer } from 'msw/node';const server = setupServer( http.get('/api/users', () => { return HttpResponse.json([{ id: 1, name: 'John' }]); }));beforeAll(() => server.listen());afterEach(() => server.resetHandlers());afterAll(() => server.close());MSW intercepts actual network requests, making your tests more realistic than mocking fetch directly.
CI/CD integration
Tests run automatically on every pull request:
# GitHub Actions example- run: npm test -- --coverage- run: npx playwright testInterview Tip
List the tools you actually use and explain how they fit together. Mentioning MSW shows you care about realistic test setups. Knowing about CI integration shows you think about the full development workflow.
Why interviewers ask this
This is a practical experience question. Interviewers want to see if you have a real testing workflow and know how different tools complement each other.