From 2dbc8fb3d589fd7351c0ac853d6a38bdef4c18a4 Mon Sep 17 00:00:00 2001 From: Yacine Hmito Date: Sat, 20 Nov 2021 15:43:40 +0100 Subject: 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. --- runtime/js/40_testing.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/js/40_testing.js') 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) => -- cgit v1.2.3