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

Mock file actual import is not respected #1195

Closed
6 tasks done
underfisk opened this issue Apr 26, 2022 · 0 comments · Fixed by #1204
Closed
6 tasks done

Mock file actual import is not respected #1195

underfisk opened this issue Apr 26, 2022 · 0 comments · Fixed by #1204
Assignees

Comments

@underfisk
Copy link

Describe the bug

When importing a module that's going to be mocked, the import actual is not respected therefore it goes into an infinite loop, this is pretty simple to replicate, using the official zustand testing example to reset the state between tests

Reproduction

Simply use the zustand testing example https://docs.pmnd.rs/zustand/testing

Going a little but further, the first import inside the mock file is respected but after we override, the actual import is no longer respected, even using `vi.importActual' doesn't work as expected

System Info

System:
    OS: macOS 12.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 21.84 GB / 64.00 GB
    Shell: 3.2.2 - /usr/local/bin/fish
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
  Browsers:
    Chrome: 100.0.4896.127
    Safari: 15.4

Used Package Manager

yarn

Validations

@sheremet-va sheremet-va self-assigned this Apr 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants