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
It is getting mocked which I can confirm by adding console.log after the mock but as soon as I am using another module where this mocked function is being called, the tests just hang, I don't see any error so I have to again stop the tests are rerun and its the same result.
For reference this is the file where its being used - https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L1 and as you can see the first line imports are what is being mocked above
import {
exportToCanvas as _exportToCanvas,
exportToSvg as _exportToSvg,
} from "../scene/export";
Probably it could be related to #546 so my guess is when I am using the mocked module in some other file, it just goes in to a recursion loop and hangs the tests.
I have also tried doMock, importActual, hoisted and none of them work.
Any help would really be appreciated.
Thank you!
Unfortunately the codesandbox integration with repo isn't working rn so I am not able to attach the link here, as soon as thats fixed, I can link here as well.
If there is any info which you need please let me know
Describe the bug
Hi I am trying to migrate Excalidraw tests currently using Jest to Vitest in excalidraw/excalidraw#6713 and running to issues when mocking
For this equivalent
vite
I am usingIt is getting mocked which I can confirm by adding
console.log
after the mock but as soon as I am using another module where this mocked function is being called, the tests just hang, I don't see any error so I have to again stop the tests are rerun and its the same result.For reference this is the file where its being used - https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L1 and as you can see the first line imports are what is being mocked above
Probably it could be related to #546 so my guess is when I am using the mocked module in some other file, it just goes in to a recursion loop and hangs the tests.
I have also tried
doMock
,importActual
,hoisted
and none of them work.Any help would really be appreciated.
Thank you!
Reproduction
its the same issue mentioned above and reproducible in my PR excalidraw/excalidraw#6713
This is the file where I am trying to mock it https://github.com/excalidraw/excalidraw/blob/master/src/tests/packages/utils.test.ts#L6
Unfortunately the codesandbox integration with repo isn't working rn so I am not able to attach the link here, as soon as thats fixed, I can link here as well.
If there is any info which you need please let me know
System Info
#
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: