From 107727ce6bc9f8936e25273b6df0c46bcd2af580 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Mon, 13 May 2024 18:00:46 +0200 Subject: [PATCH] runapptests - Set an initial value for the timeOffset --- bin/runapptests.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/runapptests.js b/bin/runapptests.js index 8187d869d..5eefa4905 100755 --- a/bin/runapptests.js +++ b/bin/runapptests.js @@ -311,11 +311,12 @@ function runStep(step, subtest, test, state){ break; case "sleep" : p = p.then(()=>{ - console.log("> SLEEP FOR", step.ms); + console.log("> SLEEP FOR", step.ms + "ms"); if (!subtest.wrappedDateNow){ emu.tx(`Date.now = (o)=>{return ()=>{ return o() + global.APPTESTS.timeOffset; - };}(Date.now);\n`); + };}(Date.now); + global.APPTESTS.timeOffset = 0;\n`); subtest.wrappedDateNow = true; } emu.tx(`global.APPTESTS.timeOffset += ${step.ms};