You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've setup jest testing with mocks. In my code I've defined webpack resolver, so lib/config and lib/plugins are aliases for /app/lib/config and could be used without ../../../..etc. I wanted to mock these modules and created __mocks__ directory in root folder with structure:
I'm running tests on Travis for mac and linux and on AppVeyor for windows, but mocks work only on mac and linux, not on windows.
I suspect that it is because of using / in module name and I suspect that lib\config will work on windows, but it is wrong
What is the expected behavior? require('lib/config') should be mocked by __mocks__/lib/config on windows
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Bug
What is the current behavior?
I've setup jest testing with mocks. In my code I've defined webpack resolver, so
lib/config
andlib/plugins
are aliases for/app/lib/config
and could be used without../../../..etc
. I wanted to mock these modules and created__mocks__
directory in root folder with structure:I'm running tests on Travis for mac and linux and on AppVeyor for windows, but mocks work only on mac and linux, not on windows.
I suspect that it is because of using
/
in module name and I suspect thatlib\config
will work on windows, but it is wrongWhat is the expected behavior?
require('lib/config')
should be mocked by__mocks__/lib/config
on windowsPlease provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
The text was updated successfully, but these errors were encountered: