mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
feat: show file name in suite error
This commit is contained in:
parent
606ec9c50e
commit
faae94de72
1
packages/ui/client/auto-imports.d.ts
vendored
1
packages/ui/client/auto-imports.d.ts
vendored
@ -59,6 +59,7 @@ declare global {
|
||||
const readonly: typeof import('vue')['readonly']
|
||||
const ref: typeof import('vue')['ref']
|
||||
const refDefault: typeof import('@vueuse/core')['refDefault']
|
||||
const resolveComponent: typeof import('vue')['resolveComponent']
|
||||
const shallowReactive: typeof import('vue')['shallowReactive']
|
||||
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
||||
const shallowRef: typeof import('vue')['shallowRef']
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { performance } from 'perf_hooks'
|
||||
import { relative } from 'pathe'
|
||||
import c from 'picocolors'
|
||||
import type { Reporter, TaskResultPack, UserConsoleLog } from '../types'
|
||||
import type { File, Reporter, TaskResultPack, UserConsoleLog } from '../types'
|
||||
import { getSuites, getTests } from '../utils'
|
||||
import type { Vitest } from '../node'
|
||||
import { printError } from './diff'
|
||||
@ -70,7 +70,8 @@ export class ConsoleReporter implements Reporter {
|
||||
this.ctx.error(c.red(divider(c.bold(c.inverse(` Failed Suites ${failedSuites.length} `)))))
|
||||
this.ctx.error()
|
||||
for (const suite of failedSuites) {
|
||||
this.ctx.error(c.red(`\n- ${getFullName(suite)}`))
|
||||
const filepath = (suite as File)?.filepath || ''
|
||||
this.ctx.error(c.red(`\n- ${getFullName(suite)} ${c.dim(`[ ${this.relative(filepath)} ]`)}`))
|
||||
await printError(suite.result?.error, this.ctx)
|
||||
errorDivider()
|
||||
}
|
||||
|
||||
1
test/vitesse/src/auto-import.d.ts
vendored
1
test/vitesse/src/auto-import.d.ts
vendored
@ -33,6 +33,7 @@ declare global {
|
||||
const reactive: typeof import('vue')['reactive']
|
||||
const readonly: typeof import('vue')['readonly']
|
||||
const ref: typeof import('vue')['ref']
|
||||
const resolveComponent: typeof import('vue')['resolveComponent']
|
||||
const shallowReactive: typeof import('vue')['shallowReactive']
|
||||
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
||||
const shallowRef: typeof import('vue')['shallowRef']
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user