Skip to content

Commit 82fcf5d

Browse files
authored
fix!: remove 'basic' reporter (#7884)
1 parent c666d14 commit 82fcf5d

File tree

12 files changed

+20
-71
lines changed

12 files changed

+20
-71
lines changed

docs/advanced/reporters.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ class MyReporter implements Reporter {
9393

9494
### Built-in reporters:
9595

96-
1. `BasicReporter`
9796
1. `DefaultReporter`
9897
2. `DotReporter`
9998
3. `JsonReporter`

docs/guide/cli-generated.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Hide logs for skipped tests
8989
- **CLI:** `--reporter <name>`
9090
- **Config:** [reporters](/config/#reporters)
9191

92-
Specify reporters (default, basic, blob, verbose, dot, json, tap, tap-flat, junit, hanging-process, github-actions)
92+
Specify reporters (default, blob, verbose, dot, json, tap, tap-flat, junit, hanging-process, github-actions)
9393

9494
### outputFile
9595

docs/guide/migration.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ outline: deep
55

66
# Migration Guide
77

8+
## Migrating to Vitest 4.0 {#vitest-4}
9+
10+
### Removed `reporters: 'basic'`
11+
12+
Basic reporter is removed as it is equal to:
13+
14+
```ts
15+
export default defineConfig({
16+
test: {
17+
reporters: [
18+
['default', { summary: false }]
19+
]
20+
}
21+
})
22+
```
23+
824
## Migrating to Vitest 3.0 {#vitest-3}
925

1026
### Test Options as a Third Argument

docs/guide/reporters.md

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -141,35 +141,6 @@ Final output after tests have finished:
141141
Duration 1.26s (transform 35ms, setup 1ms, collect 90ms, tests 1.47s, environment 0ms, prepare 267ms)
142142
```
143143

144-
### Basic Reporter
145-
146-
The `basic` reporter is equivalent to `default` reporter without `summary`.
147-
148-
:::code-group
149-
```bash [CLI]
150-
npx vitest --reporter=basic
151-
```
152-
153-
```ts [vitest.config.ts]
154-
export default defineConfig({
155-
test: {
156-
reporters: ['basic']
157-
},
158-
})
159-
```
160-
:::
161-
162-
Example output using basic reporter:
163-
```bash
164-
✓ __tests__/file1.test.ts (2) 725ms
165-
✓ __tests__/file2.test.ts (2) 746ms
166-
167-
Test Files 2 passed (2)
168-
Tests 4 passed (4)
169-
Start at 12:34:32
170-
Duration 1.26s (transform 35ms, setup 1ms, collect 90ms, tests 1.47s, environment 0ms, prepare 267ms)
171-
```
172-
173144
### Verbose Reporter
174145

175146
Verbose reporter is same as `default` reporter, but it also displays each individual test after the suite has finished. It also displays currently running tests that are taking longer than [`slowTestThreshold`](/config/#slowtestthreshold). Similar to `default` reporter, you can disable the summary by configuring the reporter.
@@ -228,7 +199,7 @@ Example of final terminal output for a passing test suite:
228199

229200
### Dot Reporter
230201

231-
Prints a single dot for each completed test to provide minimal output while still showing all tests that have run. Details are only provided for failed tests, along with the `basic` reporter summary for the suite.
202+
Prints a single dot for each completed test to provide minimal output while still showing all tests that have run. Details are only provided for failed tests, along with the summary for the suite.
232203

233204
:::code-group
234205
```bash [CLI]

packages/vitest/src/node/reporters/basic.ts

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

packages/vitest/src/node/reporters/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type { DefaultReporterOptions } from './default'
55
import type { HTMLOptions } from './html'
66
import type { JsonOptions } from './json'
77
import type { JUnitOptions } from './junit'
8-
import { BasicReporter } from './basic'
98
import { BlobReporter } from './blob'
109
import { DefaultReporter } from './default'
1110
import { DotReporter } from './dot'
@@ -18,7 +17,6 @@ import { TapFlatReporter } from './tap-flat'
1817
import { VerboseReporter } from './verbose'
1918

2019
export {
21-
BasicReporter,
2220
DefaultReporter,
2321
DotReporter,
2422
GithubActionsReporter,
@@ -45,7 +43,6 @@ export type {
4543

4644
export const ReportersMap = {
4745
'default': DefaultReporter as typeof DefaultReporter,
48-
'basic': BasicReporter as typeof BasicReporter,
4946
'blob': BlobReporter as typeof BlobReporter,
5047
'verbose': VerboseReporter as typeof VerboseReporter,
5148
'dot': DotReporter as typeof DotReporter,
@@ -61,7 +58,6 @@ export type BuiltinReporters = keyof typeof ReportersMap
6158

6259
export interface BuiltinReporterOptions {
6360
'default': DefaultReporterOptions
64-
'basic': BaseOptions
6561
'verbose': DefaultReporterOptions
6662
'dot': BaseOptions
6763
'json': JsonOptions

packages/vitest/src/node/reporters/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Vitest } from '../core'
33
import type { ResolvedConfig } from '../types/config'
44
import type { Reporter } from '../types/reporter'
55
import type { BlobReporter } from './blob'
6-
import type { BasicReporter, BenchmarkBuiltinReporters, BenchmarkReporter, BuiltinReporters, DefaultReporter, DotReporter, GithubActionsReporter, HangingProcessReporter, JsonReporter, JUnitReporter, TapReporter } from './index'
6+
import type { BenchmarkBuiltinReporters, BenchmarkReporter, BuiltinReporters, DefaultReporter, DotReporter, GithubActionsReporter, HangingProcessReporter, JsonReporter, JUnitReporter, TapReporter } from './index'
77
import { BenchmarkReportsMap, ReportersMap } from './index'
88

99
async function loadCustomReporterModule<C extends Reporter>(
@@ -35,7 +35,7 @@ async function loadCustomReporterModule<C extends Reporter>(
3535
function createReporters(
3636
reporterReferences: ResolvedConfig['reporters'],
3737
ctx: Vitest,
38-
): Promise<Array<Reporter | DefaultReporter | BasicReporter | BlobReporter | DotReporter | JsonReporter | TapReporter | JUnitReporter | HangingProcessReporter | GithubActionsReporter>> {
38+
): Promise<Array<Reporter | DefaultReporter | BlobReporter | DotReporter | JsonReporter | TapReporter | JUnitReporter | HangingProcessReporter | GithubActionsReporter>> {
3939
const runner = ctx.runner
4040
const promisedReporters = reporterReferences.map(
4141
async (referenceOrInstance) => {

packages/vitest/src/public/reporters.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export {
2-
BasicReporter,
32
BenchmarkReporter,
43
BenchmarkReportsMap,
54
DefaultReporter,

test/config/test/retry.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ function run(testNamePattern: string) {
55
return runVitest({
66
include: ['fixtures/retry/retry.test.ts'],
77
config: 'fixtures/retry/vitest.config.ts',
8-
reporters: ['basic'],
98
testNamePattern,
109
})
1110
}

test/core/test/exports.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ it('exports snapshot', async ({ skip, task }) => {
121121
"viteVersion": "string",
122122
},
123123
"./reporters": {
124-
"BasicReporter": "function",
125124
"BenchmarkReporter": "function",
126125
"BenchmarkReportsMap": "object",
127126
"DefaultReporter": "function",
@@ -278,7 +277,6 @@ it('exports snapshot', async ({ skip, task }) => {
278277
"viteVersion": "string",
279278
},
280279
"./reporters": {
281-
"BasicReporter": "function",
282280
"BenchmarkReporter": "function",
283281
"BenchmarkReportsMap": "object",
284282
"DefaultReporter": "function",

0 commit comments

Comments
 (0)