From d6dd6a44c16eec017db1d7f9d07c03e756e2c4d5 Mon Sep 17 00:00:00 2001 From: Sander Bruens Date: Wed, 20 Sep 2023 16:11:37 -0400 Subject: [PATCH] Invert `--ci` to a `--watch` flag instead. --- .github/workflows/build_and_test_debug.yml | 2 +- src/www/test.action.mjs | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_and_test_debug.yml b/.github/workflows/build_and_test_debug.yml index 11656fd4c8..e028a99bd4 100644 --- a/.github/workflows/build_and_test_debug.yml +++ b/.github/workflows/build_and_test_debug.yml @@ -38,7 +38,7 @@ jobs: run: npm run action www/build - name: Test Web App - run: npm run action www/test -- --ci + run: npm run action www/test - uses: codecov/codecov-action@v3 with: diff --git a/src/www/test.action.mjs b/src/www/test.action.mjs index ccd549a1c7..2d68cd48e9 100644 --- a/src/www/test.action.mjs +++ b/src/www/test.action.mjs @@ -21,16 +21,6 @@ import {getRootDir} from '../build/get_root_dir.mjs'; const KARMA_CONFIG_PATH = ['src', 'www', 'karma.conf.js']; -/** - * Parses the action parameters and returns whether to run as part of CI. - * @param {string[]} parameters The list of action arguments passed in. - * @returns {Object} Object containing whether to run as part of CI. - */ -function getActionParameters(cliArguments) { - const {ci = false} = minimist(cliArguments); - return {ci}; -} - /** * @description Runs the Karma tests against the web UI. * @@ -41,7 +31,7 @@ export async function main(...parameters) { // stays alive in the background. process.on('SIGINT', process.exit); - const {ci} = getActionParameters(parameters); + const {watch = false} = minimist(parameters); const runKarma = config => new Promise((resolve, reject) => { @@ -59,7 +49,7 @@ export async function main(...parameters) { const config = await karma.config.parseConfig( path.resolve(getRootDir(), ...KARMA_CONFIG_PATH), - {singleRun: ci}, + {singleRun: !watch}, { promiseConfig: true, throwErrors: true,