TypeScript | Testing with TypeScript | Question10

Last Updated :
Discuss
Comments

What does the following mock do?

TypeScript
jest.spyOn(console, "log").mockImplementation(() => {});


Logs all console messages to the test output.

Replaces the console.log function with a mocked implementation.

Prevents console messages from being logged.

Deletes the console.log method entirely.

Share your thoughts in the comments