summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYacine Hmito <yacinehmito@users.noreply.github.com>2021-11-20 15:43:40 +0100
committerGitHub <noreply@github.com>2021-11-20 09:43:40 -0500
commit2dbc8fb3d589fd7351c0ac853d6a38bdef4c18a4 (patch)
treea83ae9b83e26defbf0337c80016487b40d063d60
parentddfba7d8ca2ba65c3952b79b8f7677bcf410348e (diff)
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.
-rw-r--r--runtime/js/40_testing.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/js/40_testing.js b/runtime/js/40_testing.js
index b4f7c847c..e07d54a1a 100644
--- a/runtime/js/40_testing.js
+++ b/runtime/js/40_testing.js
@@ -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) =>