Skip to content

Commit 707e5e2

Browse files
committed
docs: clarify
1 parent 9a2eeeb commit 707e5e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/guide/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ See also new guides:
8787

8888
### `spyOn` Supports Constructors
8989

90-
Previously, if you tried to spy on a constructor with `vi.spyOn`, you would get an error like `Constructor <name> requires 'new'`. Since Vitest 4, all mocks called with a `new` keyword construct the instance instead of callying `mock.apply`. This means that the mock implementation has to use either the `function` or the `class` keyword:
90+
Previously, if you tried to spy on a constructor with `vi.spyOn`, you would get an error like `Constructor <name> requires 'new'`. Since Vitest 4, all mocks called with a `new` keyword construct the instance instead of callying `mock.apply`. This means that the mock implementation has to use either the `function` or the `class` keyword in these cases:
9191

9292
```ts {12-14,16-20}
9393
const cart = {

0 commit comments

Comments
 (0)