You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/05.extras/01.problem.vitest-4.0/README.mdx
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,13 +16,31 @@ npm remove @vitest/browser
16
16
17
17
### Imports
18
18
19
-
You should now import the `page` object directly from the `vitest` package (its `/browser` export):
19
+
You can now import the `page` object directly from the `vitest` package (its `/browser` export):
20
20
21
21
```ts remove=1 add=2 nocopy
22
22
-import { page } from'@vitest/browser/context'
23
23
+import { page } from'vitest/browser'
24
24
```
25
25
26
+
### Matcher types
27
+
28
+
With the `@vitest/browser` package gone, there is nowhere to reference the matcher types from in your TypeScript configuration for tests. Luckily, that is no longer needed in Vitest 4.0!
29
+
30
+
Remove the `@vitest/browser/matchers` type references from your TypeScript:
31
+
32
+
```json filename=tsconfig.test.json remove=5
33
+
{
34
+
"compilerOptions": {
35
+
"types": [
36
+
"vitest/globals",
37
+
"@vitest/browser/matchers"
38
+
]
39
+
}
40
+
}
41
+
```
42
+
43
+
26
44
### Providers
27
45
28
46
Browser automation providers now have to be installed as separate dependencies. This is done to simplify provider options and their type-safety.
0 commit comments