Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/advanced/reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class MyReporter implements Reporter {

### Built-in reporters:

1. `BasicReporter`
1. `DefaultReporter`
2. `DotReporter`
3. `JsonReporter`
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/cli-generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Hide logs for skipped tests
- **CLI:** `--reporter <name>`
- **Config:** [reporters](/config/#reporters)

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

### outputFile

Expand Down
16 changes: 16 additions & 0 deletions docs/guide/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ outline: deep

# Migration Guide

## Migrating to Vitest 4.0 {#vitest-4}

### Removed `reporters: 'basic'`

Basic reporter is removed as it is equal to:

```ts
export default defineConfig({
test: {
reporters: [
['default', { summary: false }]
]
}
})
```

## Migrating to Vitest 3.0 {#vitest-3}

### Test Options as a Third Argument
Expand Down
31 changes: 1 addition & 30 deletions docs/guide/reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,35 +141,6 @@ Final output after tests have finished:
Duration 1.26s (transform 35ms, setup 1ms, collect 90ms, tests 1.47s, environment 0ms, prepare 267ms)
```

### Basic Reporter

The `basic` reporter is equivalent to `default` reporter without `summary`.

:::code-group
```bash [CLI]
npx vitest --reporter=basic
```

```ts [vitest.config.ts]
export default defineConfig({
test: {
reporters: ['basic']
},
})
```
:::

Example output using basic reporter:
```bash
✓ __tests__/file1.test.ts (2) 725ms
✓ __tests__/file2.test.ts (2) 746ms

Test Files 2 passed (2)
Tests 4 passed (4)
Start at 12:34:32
Duration 1.26s (transform 35ms, setup 1ms, collect 90ms, tests 1.47s, environment 0ms, prepare 267ms)
```

### Verbose Reporter

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.
Expand Down Expand Up @@ -228,7 +199,7 @@ Example of final terminal output for a passing test suite:

### Dot Reporter

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.
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.

:::code-group
```bash [CLI]
Expand Down
26 changes: 0 additions & 26 deletions packages/vitest/src/node/reporters/basic.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/vitest/src/node/reporters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { DefaultReporterOptions } from './default'
import type { HTMLOptions } from './html'
import type { JsonOptions } from './json'
import type { JUnitOptions } from './junit'
import { BasicReporter } from './basic'
import { BlobReporter } from './blob'
import { DefaultReporter } from './default'
import { DotReporter } from './dot'
Expand All @@ -18,7 +17,6 @@ import { TapFlatReporter } from './tap-flat'
import { VerboseReporter } from './verbose'

export {
BasicReporter,
DefaultReporter,
DotReporter,
GithubActionsReporter,
Expand All @@ -45,7 +43,6 @@ export type {

export const ReportersMap = {
'default': DefaultReporter as typeof DefaultReporter,
'basic': BasicReporter as typeof BasicReporter,
'blob': BlobReporter as typeof BlobReporter,
'verbose': VerboseReporter as typeof VerboseReporter,
'dot': DotReporter as typeof DotReporter,
Expand All @@ -61,7 +58,6 @@ export type BuiltinReporters = keyof typeof ReportersMap

export interface BuiltinReporterOptions {
'default': DefaultReporterOptions
'basic': BaseOptions
'verbose': DefaultReporterOptions
'dot': BaseOptions
'json': JsonOptions
Expand Down
4 changes: 2 additions & 2 deletions packages/vitest/src/node/reporters/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Vitest } from '../core'
import type { ResolvedConfig } from '../types/config'
import type { Reporter } from '../types/reporter'
import type { BlobReporter } from './blob'
import type { BasicReporter, BenchmarkBuiltinReporters, BenchmarkReporter, BuiltinReporters, DefaultReporter, DotReporter, GithubActionsReporter, HangingProcessReporter, JsonReporter, JUnitReporter, TapReporter } from './index'
import type { BenchmarkBuiltinReporters, BenchmarkReporter, BuiltinReporters, DefaultReporter, DotReporter, GithubActionsReporter, HangingProcessReporter, JsonReporter, JUnitReporter, TapReporter } from './index'
import { BenchmarkReportsMap, ReportersMap } from './index'

async function loadCustomReporterModule<C extends Reporter>(
Expand Down Expand Up @@ -35,7 +35,7 @@ async function loadCustomReporterModule<C extends Reporter>(
function createReporters(
reporterReferences: ResolvedConfig['reporters'],
ctx: Vitest,
): Promise<Array<Reporter | DefaultReporter | BasicReporter | BlobReporter | DotReporter | JsonReporter | TapReporter | JUnitReporter | HangingProcessReporter | GithubActionsReporter>> {
): Promise<Array<Reporter | DefaultReporter | BlobReporter | DotReporter | JsonReporter | TapReporter | JUnitReporter | HangingProcessReporter | GithubActionsReporter>> {
const runner = ctx.runner
const promisedReporters = reporterReferences.map(
async (referenceOrInstance) => {
Expand Down
1 change: 0 additions & 1 deletion packages/vitest/src/public/reporters.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export {
BasicReporter,
BenchmarkReporter,
BenchmarkReportsMap,
DefaultReporter,
Expand Down
1 change: 0 additions & 1 deletion test/config/test/retry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ function run(testNamePattern: string) {
return runVitest({
include: ['fixtures/retry/retry.test.ts'],
config: 'fixtures/retry/vitest.config.ts',
reporters: ['basic'],
testNamePattern,
})
}
Expand Down
2 changes: 0 additions & 2 deletions test/core/test/exports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ it('exports snapshot', async ({ skip, task }) => {
"viteVersion": "string",
},
"./reporters": {
"BasicReporter": "function",
"BenchmarkReporter": "function",
"BenchmarkReportsMap": "object",
"DefaultReporter": "function",
Expand Down Expand Up @@ -278,7 +277,6 @@ it('exports snapshot', async ({ skip, task }) => {
"viteVersion": "string",
},
"./reporters": {
"BasicReporter": "function",
"BenchmarkReporter": "function",
"BenchmarkReportsMap": "object",
"DefaultReporter": "function",
Expand Down
2 changes: 0 additions & 2 deletions test/reporters/tests/configuration-options.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ type NarrowToTestConfig<T> = T extends { test?: any } ? NonNullable<T['test']> :
type Configuration = NonNullable<NarrowToTestConfig<(Parameters<typeof defineConfig>[0])>>

test('reporters, single', () => {
assertType<Configuration>({ reporters: 'basic' })
assertType<Configuration>({ reporters: 'default' })
assertType<Configuration>({ reporters: 'dot' })
assertType<Configuration>({ reporters: 'hanging-process' })
Expand All @@ -24,7 +23,6 @@ test('reporters, single', () => {
test('reporters, multiple', () => {
assertType<Configuration>({
reporters: [
'basic',
'default',
'dot',
'hanging-process',
Expand Down
1 change: 0 additions & 1 deletion test/watch/test/reporter-failed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { editFile, runVitest } from '../../test-utils'
describe.each([
['default', true],
['default', false],
['basic', false],
])('%s reporter with %s tty', (reporter, isTTY) => {
it('prints previously failed tests on rerun', async () => {
const { vitest } = await runVitest({
Expand Down
Loading