From c05e18ad86088652f241edc30bcad60a321a3e09 Mon Sep 17 00:00:00 2001 From: Jeremy Klas Date: Tue, 9 Aug 2022 22:44:00 -0700 Subject: [PATCH] correct docs --- docs/guide/migration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/migration.md b/docs/guide/migration.md index 0d2b887af4bb..17d52b49c4fb 100644 --- a/docs/guide/migration.md +++ b/docs/guide/migration.md @@ -16,12 +16,12 @@ If you decide to keep globals disabled, be aware that common libraries like [`te **Module mocks** -When mocking a module in Jest, if the factory argument returned a primitive, the mock would implicitly mock the default export. In Vitest, the factory argument has to return an object where each export is explicitly defined. For example, the following `jest.mock` would have to be updated as follows: +When mocking a module in Jest, the factory argument's return value is the default export. In Vitest, the factory argument has to return an object with each export explicitly defined. For example, the following `jest.mock` would have to be updated as follows: ```diff - jest.mock('./some-path', () => 'hello') + vi.mock('./some-path', () => ({ -+ default: 'hello'; ++ default: 'hello', + }) ```