fix(test): do not throw on error.errors.map (#12810)

In tests, the function to format errors would assume that any error with
a property `errors` would be an `AggregateError`, and therefore the
property `errors` would contain an error. This is not necessarily the
case.
This commit is contained in:
Yacine Hmito 2021-11-20 15:43:40 +01:00 committed by GitHub
parent ddfba7d8ca
commit 2dbc8fb3d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,7 @@
const { serializePermissions } = window.__bootstrap.permissions;
const { assert } = window.__bootstrap.util;
const {
AggregateError,
ArrayPrototypeFilter,
ArrayPrototypePush,
ArrayPrototypeSome,
@ -297,7 +298,7 @@ finishing test case.`;
}
function formatError(error) {
if (error.errors) {
if (error instanceof AggregateError) {
const message = error
.errors
.map((error) =>