···20282028- **Default:** `false`
2029202920302030Tells fake timers to clear "native" (i.e. not fake) timers by delegating to their respective handlers. These are not cleared by default, leading to potentially unexpected behavior if timers existed prior to starting fake timers session.
20312031+20322032+### workspace
20332033+20342034+- **Type:** `string`
20352035+- **CLI:** `--workspace=./file.js`
20362036+- **Default:** `vitest.{workspace,projects}.{js,ts,json}` close to the config file or root
20372037+- **Version:** Since Vitest 1.1.0
20382038+20392039+Path to a [workspace](/guide/workspace) config file relative to [root](#root).
+1-1
docs/guide/cli.md
···7878| `--outputFile <filename/-s>` | Write test results to a file when the `--reporter=json` or `--reporter=junit` option is also specified <br /> Via [cac's dot notation] you can specify individual outputs for multiple reporters |
7979| `--coverage` | Enable coverage report |
8080| `--run` | Do not watch |
8181-| `--mode` | Override Vite mode (default: `test`) |
8281| `--mode <name>` | Override Vite mode (default: `test`) |
8282+| `--workspace <path>` | Path to a workspace configuration file |
8383| `--globals` | Inject APIs globally |
8484| `--dom` | Mock browser API with happy-dom |
8585| `--browser [options]` | Run tests in [the browser](/guide/browser) (default: `false`) |
···11-import { dirname, relative } from 'pathe'
11+import { basename, dirname, relative } from 'pathe'
22import type { UserConfig as ViteConfig, Plugin as VitePlugin } from 'vite'
33import { configDefaults } from '../../defaults'
44import { generateScopedClassName } from '../../integrations/css/css-modules'
···3636 let name = testConfig.name
3737 if (!name) {
3838 if (typeof options.workspacePath === 'string')
3939- name = dirname(options.workspacePath).split('/').pop()
3939+ name = basename(options.workspacePath.endsWith('/') ? options.workspacePath.slice(0, -1) : dirname(options.workspacePath))
4040 else
4141 name = options.workspacePath.toString()
4242 }