In particular our codebase uses underscore in many places, and I never want to mock underscore. I know I can jest.unmock('underscore');
in each test that interacts with underscore. Is there a way to unmock underscore globally?
Asked
Active
Viewed 234 times
0

linuxdan
- 4,476
- 4
- 30
- 41
1 Answers
1
You could add this to package.json.
"jest": {
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
"unmockedModulePathPatterns": [
"enzyme",
"react",
"react-addons-test-utils"
],
"verbose": true
}

J. Mark Stevens
- 4,911
- 2
- 13
- 18