--:--









Quiz for Jest Basics

Course: REACT | Subject: React | Topic: Testing in React



Logo

Q1: What is Jest primarily used for in React development?

Logo

Q2: Which command runs tests using Jest in a React project?

Logo

Q3: Which function is used to group related tests in Jest?

Logo

Q4: How do you write a single test case in Jest?

Logo

Q5: Which function asserts the expected outcome in Jest?

Logo

Q6: What does the Jest matcher .toBe() check?

Logo

Q7: Which Jest function is used to clean up mocks between tests?

Logo

Q8: How do you mock a module in Jest?

Logo

Q9: What is a snapshot test in Jest?

Logo

Q10: How do you update a Jest snapshot?

Logo

Q11: Which of these is a common testing utility used with Jest in React?

Logo

Q12: What does the .toHaveBeenCalled() matcher verify?

Logo

Q13: What is the purpose of jest.fn()?

Logo

Q14: Which lifecycle method is commonly tested with Jest in class components?

Logo

Q15: How do you test asynchronous code with Jest?

Logo

Q16: What Jest configuration file is commonly used to customize Jest?

Logo

Q17: How can you run only one test in Jest?

Logo

Q18: What is the role of jest.setup.js?

Logo

Q19: Which command runs Jest tests in watch mode?

Logo

Q20: What does the .toContain() matcher do?

Are you ready to start test? Set your time limit