Skip to main content

Quiz: Mocking & Spies

Test what you learned in this lesson before moving on.

Lesson Quiz

Pass with 80% to complete this lesson.

1. What is the key difference between `jest.fn()` and `jest.spyOn()`?

2. What does `jest.mock('./database')` do when called in a test file?

3. According to best practices, where should you draw the line for mocking in tests?