Skip to content

Commit

Permalink
feat: update test reporting default (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
devpow112 authored Jul 25, 2024
1 parent 1c643c5 commit 54ad3f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/server/cli/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,6 @@ async function getTestRunnerOptions(argv = []) {
type: Boolean,
description: 'Run tests in Webkit',
order: 4
},
{
name: 'test-reporting',
type: Boolean,
defaultOption: false,
description: 'Enables generating a D2L Test Reporting format JSON file',
order: 14
}
];

Expand Down
6 changes: 3 additions & 3 deletions src/server/wtr-config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { defaultReporter } from '@web/test-runner';
import { env } from 'node:process';
import { headedMode } from './headed-mode-plugin.js';
import { playwrightLauncher } from '@web/test-runner-playwright';
import { reporter as testReportingReporter } from 'd2l-test-reporting/reporters/web-test-runner.js';
import { visualDiff } from './visual-diff-plugin.js';
import { visualDiffReporter } from './visual-diff-reporter.js';

const DEFAULT_PATTERN = type => `./test/**/*.${type}.js`;
const DEFAULT_TEST_REPORTING = !!env['CI'];
const BROWSER_MAP = {
chrome: 'chromium',
chromium: 'chromium',
Expand Down Expand Up @@ -182,7 +184,7 @@ export class WTRConfig {
pattern = DEFAULT_PATTERN,
slow,
timeout,
testReporting,
testReporting = DEFAULT_TEST_REPORTING,
...passthroughConfig
} = {}) {

Expand Down Expand Up @@ -215,8 +217,6 @@ export class WTRConfig {
});
}

testReporting = !!testReporting || this.#cliArgs['test-reporting'];

if (group === 'vdiff' || testReporting) {
config.reporters ??= [ defaultReporter() ];
}
Expand Down

0 comments on commit 54ad3f5

Please sign in to comment.