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
All file resolution is done by Vite - here I assume this is how your package manager resolves it. Also, you provided zero information about your system configuration. What version of yarn? What Node version? Why should I care that you use osx? (I will put a label for reproduction, but I need system info). We provide you with a command to run because we need this information.
Hello @Firfi. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.
Thank you for your response @sheremet-va . I overlooked the command npx envinfo --system --npmPackages '{vitest,@vitest/*,vite,@vitejs/*}' --binaries --browsers indeed! It was in too fine print for how late it is on my side of the globe 😅
I updated the system information, assuming this is what you are trying to tell me.
Describe the bug
If we have a module A and a module B
Where module A has devDependencies of module C and module B
and, if these conditions are true:
vi.doMock
for module C is called inside module Bvitest run
in module Avi.doMock
of module B is calledthen, callback of
vi.doMock
never fires, with no error, andimport module C
returns a real module Cnow, if we remove module C from devDependencies of module A, we have
vi.doMock
called andimport module C
returns the mocked valuethis discrepancy is what makes me think it's a bug or undefined behaviour: I'd expect either both cases fail, or, hopefully, both cases success
Reproduction
https://github.com/Firfi/vittest-base - serves as "module A"
https://github.com/Firfi/vittest-dependency - serves as "module B"
uuid
(https://www.npmjs.com/package/uuid) - serves as "module C" (but it's true with every module I tested with)yarn install in both and link them together with
yarn link
(in readme) to see the effectI have the same effect with a published module, therefore I rule out
yarn link
issuesSystem Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: