1
1
/// <reference types="vitest" />
2
2
import { defineConfig } from 'vite'
3
+ // 🐨 Import `defaultConfig` from `vitest/config`
4
+ // 💰 import { foo } from 'bar'
3
5
import react from '@vitejs/plugin-react'
4
6
5
7
export default defineConfig ( {
@@ -14,11 +16,19 @@ export default defineConfig({
14
16
//
15
17
// 🐨 In the unit test workspace, set `globals` to true
16
18
// and `environment` to "node".
19
+ // 💰 globals: true
20
+ // 💰 environment: 'node'
17
21
//
18
- // 🐨 Finally, declare `include` and `exclude` properties
19
- // that decide which test suites to run.
20
- // Use the "**/*.test.ts" pattern for `include`
21
- // and "**/*.browser.test.ts(x)?" pattern for `exclude.
22
+ // 🐨 Add the `include` property and set it to an array
23
+ // with the only entry "**/*.test.ts".
24
+ //
25
+ // 🐨 Since "**/*.test.ts" will match ALL tests, exclude
26
+ // the browser tests by providing the `exclude` property
27
+ // and including the browser test pattern there.
28
+ // 🦉 Vitest workspaces override the default configuration,
29
+ // which means that the `exclude` array must include the
30
+ // default values to ignore tests from `node_modules`, for example.
31
+ // 💰 exclude: [...defaultConfig.exclude, '**/*.browser.test.ts(x)?']
22
32
//
23
33
// 🐨 Now, switch to the second entry in the `workspace`
24
34
// array. There, give it the following properties:
0 commit comments