From ef640cc9001146f26057d335d8f1de43cb7480ef Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Sun, 13 Aug 2023 17:19:39 -0700 Subject: [PATCH] Undo autoformatting --- packages/playwright-core/src/cli/cli.ts | 43 ++++++++++--------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/packages/playwright-core/src/cli/cli.ts b/packages/playwright-core/src/cli/cli.ts index cb376123276fea..af951fa914cbda 100755 --- a/packages/playwright-core/src/cli/cli.ts +++ b/packages/playwright-core/src/cli/cli.ts @@ -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") { console.error( `Please install @playwright/test package before running "pnpm exec playwright ${command}"` @@ -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); }); }