11/// <reference types="vitest" />
22import { defineConfig } from 'vite'
3+ // 🐨 Import `defaultConfig` from `vitest/config`
4+ // 💰 import { foo } from 'bar'
35import react from '@vitejs/plugin-react'
46
57export default defineConfig ( {
@@ -14,11 +16,19 @@ export default defineConfig({
1416 //
1517 // 🐨 In the unit test workspace, set `globals` to true
1618 // and `environment` to "node".
19+ // 💰 globals: true
20+ // 💰 environment: 'node'
1721 //
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)?']
2232 //
2333 // 🐨 Now, switch to the second entry in the `workspace`
2434 // array. There, give it the following properties:
0 commit comments