Skip to content

Commit d17dbc5

Browse files
committed
chore: remove more!
1 parent ea3d83d commit d17dbc5

File tree

6 files changed

+129
-172
lines changed

6 files changed

+129
-172
lines changed

docs/config/index.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,20 +2362,6 @@ Relevant only when using with `shouldAdvanceTime: true`. increment mocked time b
23622362

23632363
Tells fake timers to clear "native" (i.e. not fake) timers by delegating to their respective handlers. When disabled, it can lead to potentially unexpected behavior if timers existed prior to starting fake timers session.
23642364

2365-
### workspace<NonProjectOption /> {#workspace}
2366-
2367-
::: danger DEPRECATED
2368-
This options is deprecated and will be removed in the next major. Please, use [`projects`](#projects) instead.
2369-
:::
2370-
2371-
- **Type:** `string | TestProjectConfiguration[]`
2372-
- **CLI:** `--workspace=./file.js`
2373-
- **Default:** `vitest.{workspace,projects}.{js,ts,json}` close to the config file or root
2374-
2375-
Path to a [workspace](/guide/projects) config file relative to [root](#root).
2376-
2377-
Since Vitest 3, you can also define the workspace array in the root config. If the `workspace` is defined in the config manually, Vitest will ignore the `vitest.workspace` file in the root.
2378-
23792365
### projects<NonProjectOption /> {#projects}
23802366

23812367
- **Type:** `TestProjectConfiguration[]`

docs/guide/cli-generated.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,6 @@ High and low watermarks for functions in the format of `<high>,<low>`
272272

273273
Override Vite mode (default: `test` or `benchmark`)
274274

275-
### workspace
276-
277-
- **CLI:** `--workspace <path>`
278-
- **Config:** [workspace](/config/#workspace)
279-
280-
[deprecated] Path to a workspace configuration file
281-
282275
### isolate
283276

284277
- **CLI:** `--isolate`

test/config/fixtures/workspace/browser/workspace-with-browser.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/coverage-test/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"type": "module",
44
"private": true,
55
"scripts": {
6-
"test": "vitest --workspace=vitest.workspace.custom.ts",
7-
"vitest": "vitest"
6+
"test": "vitest"
87
},
98
"devDependencies": {
109
"@ampproject/remapping": "^2.3.0",

test/coverage-test/vitest.config.ts

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,137 @@
11
import { defineConfig } from 'vitest/config'
22

3+
const GENERIC_TESTS = 'test/**.test.ts'
4+
const V8_TESTS = 'test/**.v8.test.ts'
5+
const ISTANBUL_TESTS = 'test/**.istanbul.test.ts'
6+
const CUSTOM_TESTS = 'test/**.custom.test.ts'
7+
const UNIT_TESTS = 'test/**.unit.test.ts'
8+
const BROWSER_TESTS = 'test/**.browser.test.ts'
9+
10+
const config = defineConfig({
11+
test: {
12+
pool: 'threads',
13+
setupFiles: ['./setup.ts'],
14+
},
15+
})
16+
317
export default defineConfig({
418
test: {
519
reporters: 'verbose',
620
isolate: false,
21+
projects: [
22+
// Test cases for v8-provider
23+
{
24+
test: {
25+
...config.test,
26+
name: { label: 'v8', color: 'green' },
27+
env: { COVERAGE_PROVIDER: 'v8' },
28+
include: [GENERIC_TESTS, V8_TESTS],
29+
exclude: [
30+
ISTANBUL_TESTS,
31+
UNIT_TESTS,
32+
CUSTOM_TESTS,
33+
BROWSER_TESTS,
34+
],
35+
},
36+
},
37+
38+
// Test cases for istanbul-provider
39+
{
40+
test: {
41+
...config.test,
42+
name: { label: 'istanbul', color: 'magenta' },
43+
env: { COVERAGE_PROVIDER: 'istanbul' },
44+
include: [GENERIC_TESTS, ISTANBUL_TESTS],
45+
exclude: [
46+
V8_TESTS,
47+
UNIT_TESTS,
48+
CUSTOM_TESTS,
49+
BROWSER_TESTS,
50+
],
51+
},
52+
},
53+
54+
// Test cases for custom-provider
55+
{
56+
test: {
57+
...config.test,
58+
name: { label: 'custom', color: 'yellow' },
59+
env: { COVERAGE_PROVIDER: 'custom' },
60+
include: [CUSTOM_TESTS],
61+
},
62+
},
63+
64+
// Test cases for browser. Browser mode itself is activated by COVERAGE_BROWSER env var.
65+
{
66+
test: {
67+
...config.test,
68+
name: { label: 'istanbul-browser', color: 'blue' },
69+
env: { COVERAGE_PROVIDER: 'istanbul', COVERAGE_BROWSER: 'true' },
70+
include: [
71+
BROWSER_TESTS,
72+
73+
// Other non-provider-specific tests that should be run on browser mode as well
74+
'**/all.test.ts',
75+
'**/isolation.test.ts',
76+
'**/include-exclude.test.ts',
77+
'**/allow-external.test.ts',
78+
'**/ignore-hints.test.ts',
79+
'**/import-attributes.test.ts',
80+
'**/pre-transpiled-source.test.ts',
81+
'**/multi-suite.test.ts',
82+
'**/setup-files.test.ts',
83+
'**/results-snapshot.test.ts',
84+
'**/reporters.test.ts',
85+
'**/temporary-files.test.ts',
86+
'**/test-reporter-conflicts.test.ts',
87+
'**/vue.test.ts',
88+
'**/in-source.test.ts',
89+
],
90+
},
91+
},
92+
{
93+
test: {
94+
...config.test,
95+
name: { label: 'v8-browser', color: 'red' },
96+
env: { COVERAGE_PROVIDER: 'v8', COVERAGE_BROWSER: 'true' },
97+
include: [
98+
BROWSER_TESTS,
99+
100+
// Other non-provider-specific tests that should be run on browser mode as well
101+
'**/all.test.ts',
102+
'**/isolation.test.ts',
103+
'**/include-exclude.test.ts',
104+
'**/allow-external.test.ts',
105+
'**/ignore-hints.test.ts',
106+
'**/import-attributes.test.ts',
107+
'**/pre-transpiled-source.test.ts',
108+
'**/multi-suite.test.ts',
109+
'**/setup-files.test.ts',
110+
'**/results-snapshot.test.ts',
111+
'**/reporters.test.ts',
112+
'**/temporary-files.test.ts',
113+
'**/test-reporter-conflicts.test.ts',
114+
'**/vue.test.ts',
115+
'**/in-source.test.ts',
116+
],
117+
},
118+
},
119+
120+
// Test cases that aren't provider specific
121+
{
122+
test: {
123+
...config.test,
124+
name: { label: 'unit', color: 'cyan' },
125+
include: [UNIT_TESTS],
126+
typecheck: {
127+
enabled: true,
128+
include: ['**/test/*.test-d.ts'],
129+
tsconfig: '../../tsconfig.check.json',
130+
ignoreSourceErrors: true,
131+
},
132+
},
133+
},
134+
],
7135
poolOptions: {
8136
threads: {
9137
// Tests may have side effects, e.g. writing files to disk,

test/coverage-test/vitest.workspace.custom.ts

Lines changed: 0 additions & 136 deletions
This file was deleted.

0 commit comments

Comments
 (0)