Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocks for nested modules don't work on Windows #4216

Closed
KELiON opened this issue Aug 8, 2017 · 3 comments
Closed

Mocks for nested modules don't work on Windows #4216

KELiON opened this issue Aug 8, 2017 · 3 comments
Labels

Comments

@KELiON
Copy link
Contributor

KELiON commented Aug 8, 2017

Bug

What is the current behavior?

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:

image

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.

@tw0517tw
Copy link

tw0517tw commented Aug 9, 2017

Is this same issue as #4014 ?

@KELiON
Copy link
Contributor Author

KELiON commented Aug 9, 2017

@tw0517tw exactly, closing this one

@KELiON KELiON closed this as completed Aug 9, 2017
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants