Skip to content

mock reset #6193

Closed Answered by sheremet-va
wChenonly asked this question in Q&A
Jul 22, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

vi.mock is hoisted: https://vitest.dev/api/vi.html#vi-mock

vi.mock is hoisted (in other words, moved) to top of the file. It means that whenever you write it (be it inside beforeEach or test), it will actually be called before that.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wChenonly
Comment options

Answer selected by wChenonly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants