Version
1.58.2
Steps to reproduce
test('aggregate', async () => {
throw new AggregateError(
[new Error('cleanup 1 failed'), new Error('cleanup 2 failed')],
'teardown failed'
);
});
Expected behavior
Reporter shows teardown failed. The two sub-errors are gone.
Actual behavior
Would love if the .errors[] property gets injected into testInfo.errors[] or serialized in some way how the .cause property is serialized.
Additional context
AggregateError has been stable since Node 15 / ES2021 and is the idiomatic way to
surface multiple failures from a single operation (e.g. Promise.allSettled, fixture
teardown collecting cleanup errors). When one is thrown, Playwright's reporter shows
only the message — the errors[] array is silently dropped.
Root cause: filterStackTrace in util.ts explicitly recurses through e.cause
but never walks e.errors[]. One property is handled, the other isn't.
Environment
Platform: Windows 11
Node Package Manager: pnpm
Playwright: "@playwright/test": "1.58.2"
Version
1.58.2
Steps to reproduce
Expected behavior
Reporter shows
teardown failed. The two sub-errors are gone.Actual behavior
Would love if the
.errors[]property gets injected intotestInfo.errors[]or serialized in some way how the.causeproperty is serialized.Additional context
AggregateErrorhas been stable since Node 15 / ES2021 and is the idiomatic way tosurface multiple failures from a single operation (e.g.
Promise.allSettled, fixtureteardown collecting cleanup errors). When one is thrown, Playwright's reporter shows
only the
message— theerrors[]array is silently dropped.Root cause:
filterStackTraceinutil.tsexplicitly recurses throughe.causebut never walks
e.errors[]. One property is handled, the other isn't.Environment