From 42cd2bfbcbe623210f552273616ce2e7cc3c26c5 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Tue, 7 May 2024 21:56:49 +0200 Subject: [PATCH] runapptests - Refine assertValue --- bin/runapptests.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/bin/runapptests.js b/bin/runapptests.js index ffb6a4c30..409695edd 100755 --- a/bin/runapptests.js +++ b/bin/runapptests.js @@ -83,16 +83,13 @@ function assertArray(step){ function assertValue(step){ let isOK; - let value = step.js; - if (value === undefined) - value = step.value; switch (step.is.toLowerCase()){ - case "truthy": isOK = getValue(`!!${value}`); break; - case "falsy": isOK = getValue(`!${value}`); break; - case "true": isOK = getValue(`${value} === true`); break; - case "false": isOK = getValue(`${value} === false`); break; - case "equal": isOK = getValue(`${value} == ${step.to}`); break; - case "function": isOK = getValue(`typeof ${value} === "function"`); break; + case "truthy": isOK = getValue(`!!${step.js}`); break; + case "falsy": isOK = getValue(`!${step.js}`); break; + case "true": isOK = getValue(`${step.js} === true`); break; + case "false": isOK = getValue(`${step.js} === false`); break; + case "equal": isOK = getValue(`${step.js} == ${step.to}`); break; + case "function": isOK = getValue(`typeof ${step.js} === "function"`); break; } if (isOK)