@@ -4,7 +4,7 @@ import { createTestRun, TestHookType, TestResultType, TestRunState } from '#src/
44import { TestError } from '#src/conductor/TestRun/TestError'
55import { TestFunction } from '#src/conductor/TestRun/TestFunction'
66import { TestGroup } from '#src/conductor/TestRun/TestGroup'
7- import { TestResult } from '#src/conductor/TestRun/TestResult'
7+ import { TestResult , TestResultError } from '#src/conductor/TestRun/TestResult'
88import { getSuiteReporter , getTestFunction , getTestGroup , setSuiteState , setupDummyConductor , setupDummySuite , setupRunningSuite } from './_helper'
99import { createTestElements } from '#src/conductor/TestRun/createTestElements'
1010import { TestNodeData } from '#src/conductor/TestReporter'
@@ -291,7 +291,7 @@ test('report errors', async () => {
291291 expect ( onSuiteError ) . toHaveBeenNthCalledWith ( 1 , { type : 'error' , node : suite , error : new TestError ( 'foo' ) } )
292292 expect ( onSuiteError ) . toHaveBeenNthCalledWith ( 3 , { type : 'error' , node : suite , error : new TestError ( 'baz' ) } )
293293 expect ( onGroupError ) . toBeCalledTimes ( 1 )
294- expect ( onGroupError ) . toBeCalledWith ( { type : 'error' , node : group , error : expect . objectContaining ( { error : 'bar' } ) } )
294+ expect ( onGroupError ) . toBeCalledWith ( { type : 'error' , node : group , error : new TestError ( 'bar' , { type : TestHookType . beforeEach , name : 'some hook' , index : 30 , cleanup : true } ) } )
295295} )
296296
297297test ( 'throw error when reporting error on function' , async ( ) => {
@@ -311,7 +311,7 @@ test('report results', async () => {
311311
312312 expect ( testfunc . result . get ( ) ) . toEqual ( {
313313 type : TestResultType . fail ,
314- error : 'some error' ,
314+ error : TestResultError . from ( 'some error' ) ,
315315 duration : 456 ,
316316 } )
317317
0 commit comments