From c3f306d7782a30440435d4b3493a9f681bb31e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 23 Mar 2022 00:24:45 +0100 Subject: fix(test): don't error on missing op details (#14074) --- runtime/js/40_testing.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'runtime/js') diff --git a/runtime/js/40_testing.js b/runtime/js/40_testing.js index 2ec60ca44..2c2b55d56 100644 --- a/runtime/js/40_testing.js +++ b/runtime/js/40_testing.js @@ -173,13 +173,16 @@ preOp.opsCompletedAsync; if (dispatchedDiff > completedDiff) { - const [name, hint] = OP_DETAILS[key]; + const [name, hint] = OP_DETAILS[key] || [key, null]; const count = dispatchedDiff - completedDiff; let message = `${count} async operation${ count === 1 ? "" : "s" } to ${name} ${ count === 1 ? "was" : "were" - } started in this test, but never completed. This is often caused by not ${hint}.`; + } started in this test, but never completed.`; + if (hint) { + message += ` This is often caused by not ${hint}.`; + } const traces = []; for (const [id, { opName, stack }] of postTraces) { if (opName !== key) continue; -- cgit v1.2.3