Don't require --grep to be given on the command line (#9768)

This makes it easier to use the `karma` CLI directly, if desired, and makes it easier to use WebStorm's integrated debugger (which makes up `karma` command-line invocations itself).  Prior to this change, if `--grep` isn't given, Karma looks for `*undefined*.js` and finds no tests to run.
This commit is contained in:
Josh Kelley 2021-10-14 08:35:29 -04:00 committed by GitHub
parent 9a47395010
commit dd78ba0368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ module.exports = function(karma) {
.option('verbose', {default: false}) .option('verbose', {default: false})
.argv; .argv;
const grep = args.grep === true ? '' : args.grep; const grep = (args.grep === true || args.grep === undefined) ? '' : args.grep;
const specPattern = 'test/specs/**/*' + grep + '*.js'; const specPattern = 'test/specs/**/*' + grep + '*.js';
// Use the same rollup config as our dist files: when debugging (npm run dev), // Use the same rollup config as our dist files: when debugging (npm run dev),