Skip to content

Commit

Permalink
Undo autoformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhacks committed Aug 14, 2023
1 parent de65a8d commit ef640cc
Showing 1 changed file with 17 additions and 26 deletions.
43 changes: 17 additions & 26 deletions packages/playwright-core/src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,25 @@

/* eslint-disable no-console */

import { getPackageManager, gracefullyProcessExitDoNotHang } from "../utils";
import program from "./program";
import { getPackageManager, gracefullyProcessExitDoNotHang } from '../utils';
import program from './program';

function printPlaywrightTestError(command: string) {
const packages: string[] = [];
for (const pkg of [
"playwright",
"playwright-chromium",
"playwright-firefox",
"playwright-webkit",
]) {
for (const pkg of ['playwright', 'playwright-chromium', 'playwright-firefox', 'playwright-webkit']) {
try {
require.resolve(pkg);
packages.push(pkg);
} catch (e) {}
} catch (e) {
}
}
if (!packages.length) packages.push("playwright");
if (!packages.length)
packages.push('playwright');
const packageManager = getPackageManager();
if (packageManager === "yarn") {
console.error(
`Please install @playwright/test package before running "yarn playwright ${command}"`
);
console.error(` yarn remove ${packages.join(" ")}`);
console.error(" yarn add -D @playwright/test");
if (packageManager === 'yarn') {
console.error(`Please install @playwright/test package before running "yarn playwright ${command}"`);
console.error(` yarn remove ${packages.join(' ')}`);
console.error(' yarn add -D @playwright/test');
} else if (packageManager === "pnpm") {

Check failure on line 40 in packages/playwright-core/src/cli/cli.ts

View workflow job for this annotation

GitHub Actions / docs & lint

Strings must use singlequote
console.error(
`Please install @playwright/test package before running "pnpm exec playwright ${command}"`

Check failure on line 42 in packages/playwright-core/src/cli/cli.ts

View workflow job for this annotation

GitHub Actions / docs & lint

Expected indentation of 8 spaces but found 6
Expand All @@ -64,23 +59,19 @@ function printPlaywrightTestError(command: string) {
}

{
const command = program.command("test").allowUnknownOption(true);
command.description(
"Run tests with Playwright Test. Available in @playwright/test package."
);
const command = program.command('test').allowUnknownOption(true);
command.description('Run tests with Playwright Test. Available in @playwright/test package.');
command.action(async () => {
printPlaywrightTestError("test");
printPlaywrightTestError('test');
gracefullyProcessExitDoNotHang(1);
});
}

{
const command = program.command("show-report").allowUnknownOption(true);
command.description(
"Show Playwright Test HTML report. Available in @playwright/test package."
);
const command = program.command('show-report').allowUnknownOption(true);
command.description('Show Playwright Test HTML report. Available in @playwright/test package.');
command.action(async () => {
printPlaywrightTestError("show-report");
printPlaywrightTestError('show-report');
gracefullyProcessExitDoNotHang(1);
});
}
Expand Down

0 comments on commit ef640cc

Please sign in to comment.