Difference in __mocks__ automocks with Jest #466
-
In Jest, when you have automocks like this:
This mock gets auto loaded for all tests. However, in Vitest it only gets automocked if you also add Curious, is this by design? In some ways I like it because it's more explicit, but it does make migrating from Jest to Vitest more difficult. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This was done by design. We don't support automockig at this stage of development. Two main reasons are: it's more explicit and it gives better performance, since we don't need to resolve every request and try to find a mock. I personally don't think we should support automocking. I asked people in Discord, when implemented |
Beta Was this translation helpful? Give feedback.
This was done by design. We don't support automockig at this stage of development. Two main reasons are: it's more explicit and it gives better performance, since we don't need to resolve every request and try to find a mock.
I personally don't think we should support automocking. I asked people in Discord, when implemented
vi.mock
, and the people voted to not includid right now. If you think it's needed, you can start a discussion in Discord 👍🏻