Skip to content

Commit

Permalink
test: Do not print skipped tests when filtering (shaka-project#6635)
Browse files Browse the repository at this point in the history
Using --filter naturally causes a bunch of tests to be skipped. Only
print skipped tests when we are not explicitly filtering tests on the
command-line.
  • Loading branch information
joeyparrish committed May 18, 2024
1 parent 0d5648b commit 6dafcdb
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -916,9 +916,12 @@ WebDriverScreenshotMiddlewareFactory.$inject = ['launcher'];
* was clearer in some ways than using a fork of a now-extinct project.
*
* @param {karma.Launcher} launcher
* @param {string} settingsJson
* @return {karma.Middleware}
*/
function AugmentReportersFactory(reporters) {
function AugmentReportersFactory(reporters, settingsJson) {
const settings = JSON.parse(settingsJson);

// Augment each reporter in the list.
for (const reporter of reporters) {
// Shim the renderBrowser function to add the number of test cases not yet
Expand All @@ -932,13 +935,16 @@ function AugmentReportersFactory(reporters) {
return orig(browser) + ` (${left} left)`;
};

reporter.specSkipped = (browser, result) => {
reporter.writeCommonMsg(result.fullName + ' SKIPPED\n');
};
// If we're not filtering explicitly, log any skipped tests.
if (!settings.filter) {
reporter.specSkipped = (browser, result) => {
reporter.writeCommonMsg(result.fullName + ' SKIPPED\n');
};
}
}

// Return a dummy middleware that does nothing and chains to the next
// middleware.
return (request, response, next) => next();
}
AugmentReportersFactory.$inject = ['reporter._reporters'];
AugmentReportersFactory.$inject = ['reporter._reporters', 'config.settings'];

0 comments on commit 6dafcdb

Please sign in to comment.