Create global spy/mock for jest #28400
Unanswered
cspritchard
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to create a global spy for console.log so that I do not see its output in my unit tests from services.
I have created a
jest.setup.js
file:And in my
jest.config.ts
i added:However, when I run the unit tests for the project, the spy does not get used and console.log is called normally.
What am i missing in order to make global spy/mocks in jest that will be applied to all unit tests across my libs?
Beta Was this translation helpful? Give feedback.
All reactions