HTHyperTransformer AI

Study cards › Testing

TestingInterview questions and answers

← Topics1 / 100
1 / 100 viewed
Question

What is Jest?

Answer

Jest is the most popular JavaScript test runner — comes bundled with an assertion library (expect), mocking, snapshot testing, parallel execution, and watch mode. Created by Facebook for React but used across the JS ecosystem. Zero-config for most projects.

Question

What is React Testing Library?

Answer

React Testing Library is a testing tool that encourages tests mimicking real user behavior — query by accessible roles, labels, and text content rather than internal class names or component state. Tests stay green through refactors that don't change behavior.

Question

Unit vs integration vs E2E?

Answer

Unit: tests one function or module in isolation. Integration: tests several units working together (often with a real DB). E2E: tests the full application through its real UI and network calls. Each level finds different bugs; a healthy suite has all three in different ratios.

Question

What is the test pyramid?

Answer

A classic guide: many fast unit tests at the base, fewer integration tests in the middle, very few slow E2E tests at the top. Optimizes for speed, stability, and maintainability. The pyramid keeps test runs short enough to actually run on every change.

Question

What is a test double?

Answer

Generic term for any stand-in for a real dependency in tests — includes fake, mock, stub, and spy. Test doubles let you isolate the code under test from slow, flaky, or hard-to-control collaborators like databases, APIs, and the clock.

95 more Testing cards

Sign in with Google to study the whole deck, flag tricky answers and track your progress.

Continue with Google

More topics: React & Frontend JavaScript & TypeScript Backend Engineering Databases System Design AI & Agentic AI DevOps & Cloud Security DSA Coding Problems (Python)