@@ -4,7 +4,7 @@ import type { ErrorWithDiff, File, Reporter, Task, TaskResultPack, UserConsoleLo
4
4
import { clearInterval , getFullName , getSuites , getTests , getTypecheckTests , hasFailed , hasFailedSnapshot , isNode , relativePath , setInterval } from '../../utils'
5
5
import type { Vitest } from '../../node'
6
6
import { F_RIGHT } from '../../utils/figures'
7
- import { divider , formatTimeString , getStateString , getStateSymbol , pointer , renderSnapshotSummary } from './renderers/utils'
7
+ import { divider , formatProjectName , formatTimeString , getStateString , getStateSymbol , pointer , renderSnapshotSummary } from './renderers/utils'
8
8
9
9
const BADGE_PADDING = ' '
10
10
const HELP_HINT = `${ c . dim ( 'press ' ) } ${ c . bold ( 'h' ) } ${ c . dim ( ' to show help' ) } `
@@ -39,7 +39,6 @@ export abstract class BaseReporter implements Reporter {
39
39
40
40
onInit ( ctx : Vitest ) {
41
41
this . ctx = ctx
42
-
43
42
ctx . logger . printBanner ( )
44
43
this . start = performance . now ( )
45
44
}
@@ -321,11 +320,12 @@ export abstract class BaseReporter implements Reporter {
321
320
for ( const [ error , tasks ] of errorsQueue ) {
322
321
for ( const task of tasks ) {
323
322
const filepath = ( task as File ) ?. filepath || ''
323
+ const projectName = ( task as File ) ?. projectName || task . file ?. projectName
324
324
let name = getFullName ( task )
325
325
if ( filepath )
326
326
name = `${ name } ${ c . dim ( `[ ${ this . relative ( filepath ) } ]` ) } `
327
327
328
- this . ctx . logger . error ( `${ c . red ( c . bold ( c . inverse ( ' FAIL ' ) ) ) } ${ name } ` )
328
+ this . ctx . logger . error ( `${ c . red ( c . bold ( c . inverse ( ' FAIL ' ) ) ) } ${ formatProjectName ( projectName ) } ${ name } ` )
329
329
}
330
330
await this . ctx . logger . printError ( error )
331
331
errorDivider ( )
0 commit comments