mirror of
https://github.com/denoland/deno.git
synced 2025-02-01 20:25:12 -05:00
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:
parent
ddfba7d8ca
commit
2dbc8fb3d5
1 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
||||||
const { serializePermissions } = window.__bootstrap.permissions;
|
const { serializePermissions } = window.__bootstrap.permissions;
|
||||||
const { assert } = window.__bootstrap.util;
|
const { assert } = window.__bootstrap.util;
|
||||||
const {
|
const {
|
||||||
|
AggregateError,
|
||||||
ArrayPrototypeFilter,
|
ArrayPrototypeFilter,
|
||||||
ArrayPrototypePush,
|
ArrayPrototypePush,
|
||||||
ArrayPrototypeSome,
|
ArrayPrototypeSome,
|
||||||
|
@ -297,7 +298,7 @@ finishing test case.`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatError(error) {
|
function formatError(error) {
|
||||||
if (error.errors) {
|
if (error instanceof AggregateError) {
|
||||||
const message = error
|
const message = error
|
||||||
.errors
|
.errors
|
||||||
.map((error) =>
|
.map((error) =>
|
||||||
|
|
Loading…
Add table
Reference in a new issue