Skip to content

Commit

Permalink
Invert --ci to a --watch flag instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Sep 20, 2023
1 parent 352f49e commit d6dd6a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 2 additions & 12 deletions src/www/test.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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) => {
Expand All @@ -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,
Expand Down

0 comments on commit d6dd6a4

Please sign in to comment.