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
I've been starting a new project and follow this docs. Here's some suggestion:
Since vitest-dev/vitest#565, `global` is deprecated. I propose a section to add a config for TypeScript.
// (requires installing happy-dom as a peer dependency)
150
150
environment: 'happy-dom'
151
151
}
152
152
})
153
153
```
154
154
155
+
:::tip
156
+
If you are using TypeScript, add `vitest/globals` to the `types` field in your `tsconfig.json`.
157
+
158
+
```json
159
+
// tsconfig.json
160
+
161
+
{
162
+
"compileroptions": {
163
+
"types": ["vitest/globals"]
164
+
}
165
+
}
166
+
```
167
+
:::
168
+
155
169
Then create a file ending in `*.test.js` in your project. You can place all test files in a test directory in project root, or in test directories next to your source files. Vitest will automatically search for them using the naming convention.
0 commit comments