From 0c2ab13c485a4349d95106f880f21c3d4f524f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20L=C3=B8vdal?= Date: Sat, 23 Sep 2023 22:05:37 +0200 Subject: [PATCH] Print all delta values in case of error, not just the last value Which might not even be the one triggering the error condition. --- test/nodes/core/function/10-function_spec.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/nodes/core/function/10-function_spec.js b/test/nodes/core/function/10-function_spec.js index d5d35d77e..d11d67b11 100644 --- a/test/nodes/core/function/10-function_spec.js +++ b/test/nodes/core/function/10-function_spec.js @@ -1734,9 +1734,10 @@ describe('function node', function() { msg.delta = Date.now() - msg.payload; receivedMsgs.push(msg) if (receivedMsgs.length === 5) { - var errors = receivedMsgs.filter(msg => msg.delta < timeout_ms) + let deltas = receivedMsgs.map(msg => msg.delta); + var errors = deltas.filter(delta => delta < timeout_ms) if (errors.length > 0) { - done(new Error(`Message received before init completed - was ${msg.delta} expected >${timeout_ms}`)) + done(new Error(`Message received before init completed - delta values ${JSON.stringify(deltas)} expected to be > ${timeout_ms}`)) } else { done(); }