Skip to content
Advertisement

Remove logging the origin line in Jest

Jest has this feature to log the line that outputs to console methods.

In some cases, this can become annoying:

JavaScript

Any idea how I can turn it off?

Advertisement

Answer

None of the above options worked for me.

The (current) simplest solution is this:

1: Create a file with this code (e.g. config.js)

JavaScript

2: Add this line to your jest.config.js

JavaScript

Before:

Remove logging the origin line in Jest

After:

Remove logging the origin line in Jest

Enjoi!

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement