Skip to content

Commit

Permalink
correct docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jereklas committed Aug 10, 2022
1 parent 1f72543 commit c05e18a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/guide/migration.md
Expand Up @@ -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',
+ })
```

Expand Down

0 comments on commit c05e18a

Please sign in to comment.