From c03fbb3c1f58868e079a9bf21f8351ad599ea7b5 Mon Sep 17 00:00:00 2001 From: AEtheve <30652308+AEtheve@users.noreply.github.com> Date: Wed, 13 Apr 2022 14:18:12 +0200 Subject: [PATCH] fix(test): Don't error on missing op details (#14184) --- runtime/js/40_testing.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/js/40_testing.js b/runtime/js/40_testing.js index 0b75daa240..c4321c7481 100644 --- a/runtime/js/40_testing.js +++ b/runtime/js/40_testing.js @@ -198,7 +198,7 @@ } ArrayPrototypePush(details, message); } else if (dispatchedDiff < completedDiff) { - const [name] = OP_DETAILS[key]; + const [name, hint] = OP_DETAILS[key] || [key, null]; const count = completedDiff - dispatchedDiff; ArrayPrototypePush( details, @@ -206,7 +206,8 @@ count === 1 ? "was" : "were" } started before this test, but ${ count === 1 ? "was" : "were" - } completed during the test. Async operations should not complete in a test if they were not started in that test.`, + } completed during the test. Async operations should not complete in a test if they were not started in that test. + ${hint ? `This is often caused by not ${hint}.` : ""}`, ); } }