โ† All React Flashcard Decks

Testing and Debugging Flashcards

6 cards from real React practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Testing and Debugging flashcards as text
  1. What is React Testing Library?

    Answer: A testing utility that encourages testing components the way users interact with them, focusing on behavior over implementation

    React Testing Library encourages tests that mirror user behavior, using queries like getByText and getByRole rather than testing internal component details.

  2. What is Jest?

    Answer: A JavaScript testing framework commonly used with React that provides assertions, mocking, and code coverage

    Jest is the default testing framework for React projects, offering zero-config setup, snapshot testing, mocking capabilities, and built-in code coverage.

  3. What are React DevTools?

    Answer: A browser extension that lets you inspect React component hierarchy, props, state, and performance

    React DevTools provides a visual interface to inspect component trees, examine props and state, profile performance, and debug React applications.

  4. What is a snapshot test?

    Answer: A test that renders a component and compares the output to a previously saved reference to detect unintended changes

    Snapshot tests capture the rendered output and compare it against a stored snapshot. Differences are flagged, alerting you to unintended UI changes.

  5. What is error boundary in React?

    Answer: A component that catches JavaScript errors in child components, preventing them from crashing the entire app

    Error boundaries catch errors during rendering and display fallback UI instead of crashing. They use componentDidCatch and static getDerivedStateFromError.

  6. What is StrictMode in React?

    Answer: A development tool that highlights potential problems by running additional checks and warnings

    StrictMode activates additional checks in development: detecting unsafe lifecycle methods, legacy APIs, and potential issues like side effects in renders.

Written and edited by , founder of Practice Test Geeks, with AI assistance. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Editorial policy