Question · JavaScript and TypeScript course · Module 11: Testing with Jest

The jest.fn() Function

What does jest.fn() do in Jest?

Answer options

  • Freezes a function so it cannot be called
  • Creates a mock function that records all calls
  • Creates a new test file
  • Runs a function in debug mode

You can check the correct answer by solving this task in the CodeWorlds game.