Skip to content

Commit

Permalink
fix(test): do not throw on error.errors.map (denoland#12810)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yacinehmito authored Nov 20, 2021
1 parent ddfba7d commit 2dbc8fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion runtime/js/40_testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
const { serializePermissions } = window.__bootstrap.permissions;
const { assert } = window.__bootstrap.util;
const {
AggregateError,
ArrayPrototypeFilter,
ArrayPrototypePush,
ArrayPrototypeSome,
Expand Down Expand Up @@ -297,7 +298,7 @@ finishing test case.`;
}

function formatError(error) {
if (error.errors) {
if (error instanceof AggregateError) {
const message = error
.errors
.map((error) =>
Expand Down

0 comments on commit 2dbc8fb

Please sign in to comment.