Description
Do you want to request a feature or report a bug? Bug
What is the current behavior? jest-resolve
or some other module does not honor require.cache
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install
and yarn test
.
https://github.com/OzairP/jest-require-cache-no-honor
What is the expected behavior?
Tests should pass
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
node: v8.6.0
npm: 5.3.0
yarn: 1.3.2
jest: 22.0.0
My current project hosts a tiny dependency injection container that is a singleton. When the app is setup it registers dependencies but in my tests I'm unable to mock my dependencies through my own container since the singleton is not shared between the test and the app.
Console screenshot: Note "index.js has someDep" line, this is from the setup
Activity