Skip to content

Commit 30c4fa1

Browse files
committed
wip: resolve stacks
1 parent d27ad09 commit 30c4fa1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/conductor/TestRun/TestResult.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class TestResult {
1212
readonly error
1313
}
1414

15-
class TestResultError extends XError {
15+
export class TestResultError extends XError {
1616
static from(e?: Error|string) {
1717
if (e === undefined) {
1818
return undefined

test/conductor/TestRun.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createTestRun, TestHookType, TestResultType, TestRunState } from '#src/
44
import { TestError } from '#src/conductor/TestRun/TestError'
55
import { TestFunction } from '#src/conductor/TestRun/TestFunction'
66
import { TestGroup } from '#src/conductor/TestRun/TestGroup'
7-
import { TestResult } from '#src/conductor/TestRun/TestResult'
7+
import { TestResult, TestResultError } from '#src/conductor/TestRun/TestResult'
88
import { getSuiteReporter, getTestFunction, getTestGroup, setSuiteState, setupDummyConductor, setupDummySuite, setupRunningSuite } from './_helper'
99
import { createTestElements } from '#src/conductor/TestRun/createTestElements'
1010
import { 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

297297
test('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

Comments
 (0)