From c51ffbedd2ef0aeab59ca9fa2694fdae46b5f207 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Tue, 7 May 2024 23:22:06 +0200 Subject: [PATCH] runapptests - Allow filterung for demo app --- bin/runapptests.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/runapptests.js b/bin/runapptests.js index 4e6a8ff37..28884247b 100755 --- a/bin/runapptests.js +++ b/bin/runapptests.js @@ -446,6 +446,9 @@ emu.init({ console.log("Loading tests"); let p = Promise.resolve(); let apps = apploader.apps; + + apps.push(DEMOAPP); + if (process.argv.includes("--id")) { let f = process.argv[process.argv.indexOf("--id") + 1]; apps = apps.filter(e=>e.id==f); @@ -455,17 +458,14 @@ emu.init({ } } - apps.push(DEMOAPP); - - p = p.then(()=>{ - return runTest(DEMOTEST, testState); - }); - apps.forEach(app => { - var testFile = APP_DIR+"/"+app.id+"/test.json"; + let test = DEMOTEST; + if (app.id != DEMOAPP.id){ + let testFile = APP_DIR+"/"+app.id+"/test.json"; if (!require("fs").existsSync(testFile)) return; - var test = JSON.parse(require("fs").readFileSync(testFile).toString()); + test = JSON.parse(require("fs").readFileSync(testFile).toString()); test.app = app.id; + } p = p.then(()=>{ return runTest(test, testState); });