cherry-pick(#21976): chore(ui): do not print global setup epilogue
This commit is contained in:
parent
1869bd28d6
commit
847b546794
|
|
@ -124,6 +124,8 @@ export class BaseReporter implements Reporter {
|
|||
protected generateStartingMessage() {
|
||||
const jobs = Math.min(this.config.workers, this.config._internal.maxConcurrentTestGroups);
|
||||
const shardDetails = this.config.shard ? `, shard ${this.config.shard.current} of ${this.config.shard.total}` : '';
|
||||
if (!this.totalTestCount)
|
||||
return '';
|
||||
return '\n' + colors.dim('Running ') + this.totalTestCount + colors.dim(` test${this.totalTestCount !== 1 ? 's' : ''} using `) + jobs + colors.dim(` worker${jobs !== 1 ? 's' : ''}${shardDetails}`);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,8 +47,11 @@ class ListReporter extends BaseReporter {
|
|||
|
||||
override onBegin(config: FullConfig, suite: Suite) {
|
||||
super.onBegin(config, suite);
|
||||
console.log(this.generateStartingMessage());
|
||||
console.log();
|
||||
const startingMessage = this.generateStartingMessage();
|
||||
if (startingMessage) {
|
||||
console.log(startingMessage);
|
||||
console.log();
|
||||
}
|
||||
}
|
||||
|
||||
onTestBegin(test: TestCase, result: TestResult) {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import { createTaskRunnerForList, createTaskRunnerForWatch, createTaskRunnerForW
|
|||
import { chokidar } from '../utilsBundle';
|
||||
import type { FSWatcher } from 'chokidar';
|
||||
import { open } from '../utilsBundle';
|
||||
import ListReporter from '../reporters/list';
|
||||
|
||||
class UIMode {
|
||||
private _config: FullConfigInternal;
|
||||
|
|
@ -66,7 +67,7 @@ class UIMode {
|
|||
}
|
||||
|
||||
async runGlobalSetup(): Promise<FullResult['status']> {
|
||||
const reporter = await createReporter(this._config, 'run');
|
||||
const reporter = new Multiplexer([new ListReporter()]);
|
||||
const taskRunner = createTaskRunnerForWatchSetup(this._config, reporter);
|
||||
reporter.onConfigure(this._config);
|
||||
const context: TaskRunnerState = {
|
||||
|
|
|
|||
|
|
@ -163,7 +163,6 @@ test('should exit with code 0 with --pass-with-no-tests', async ({ runInlineTest
|
|||
`,
|
||||
}, undefined, undefined, { additionalArgs: ['--pass-with-no-tests'] });
|
||||
expect(result.exitCode).toBe(0);
|
||||
expect(result.output).toContain(`Running 0 tests using 0 workers`);
|
||||
});
|
||||
|
||||
test('should exit with code 1 when config is not found', async ({ runInlineTest }) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue