Skip to content

Commit 6e21fc5

Browse files
authored
05/01: mention @vitest/browser/matchers (#11)
1 parent fe62899 commit 6e21fc5

File tree

1 file changed

+19
-1
lines changed
  • exercises/05.extras/01.problem.vitest-4.0

1 file changed

+19
-1
lines changed

exercises/05.extras/01.problem.vitest-4.0/README.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,31 @@ npm remove @vitest/browser
1616

1717
### Imports
1818

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):
2020

2121
```ts remove=1 add=2 nocopy
2222
-import { page } from '@vitest/browser/context'
2323
+import { page } from 'vitest/browser'
2424
```
2525

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+
2644
### Providers
2745

2846
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

Comments
 (0)