From a31e9e0d5902e9697eb9c177c65c0b13dc43d198 Mon Sep 17 00:00:00 2001 From: Yevhen Laichenkov Date: Fri, 1 Oct 2021 15:12:15 +0300 Subject: [PATCH 1/2] fix(create-playwright): add extra -- for the debug script --- packages/create-playwright/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create-playwright/src/index.ts b/packages/create-playwright/src/index.ts index f7806ab8e22f9..ac9dae633263a 100755 --- a/packages/create-playwright/src/index.ts +++ b/packages/create-playwright/src/index.ts @@ -164,8 +164,8 @@ class Generator { ${colors.cyan(commandToRunTests(this.packageManager) + ` -- ${exampleSpecPath}`)} Runs the tests of a specific file. - - ${colors.cyan(`${commandToRunTests(this.packageManager)} --debug`)} + + ${colors.cyan(`${commandToRunTests(this.packageManager)} -- --debug`)} Runs the tests in debug mode. We suggest that you begin by typing: From d7b699ab585fbcfcf87aa17dde746fd92a393ae2 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Mon, 4 Oct 2021 10:47:29 +0200 Subject: [PATCH 2/2] nits --- packages/create-playwright/src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/create-playwright/src/index.ts b/packages/create-playwright/src/index.ts index ac9dae633263a..d74e2aac6001c 100755 --- a/packages/create-playwright/src/index.ts +++ b/packages/create-playwright/src/index.ts @@ -159,13 +159,13 @@ class Generator { ${colors.cyan(commandToRunTests(this.packageManager))} Runs the end-to-end tests. - ${colors.cyan(commandToRunTests(this.packageManager) + ' -- --project="Desktop Chrome"')} + ${colors.cyan(commandToRunTests(this.packageManager, '--project="Desktop Chrome"'))} Runs the tests only on Desktop Chrome. - ${colors.cyan(commandToRunTests(this.packageManager) + ` -- ${exampleSpecPath}`)} + ${colors.cyan(commandToRunTests(this.packageManager, exampleSpecPath))} Runs the tests of a specific file. - ${colors.cyan(`${commandToRunTests(this.packageManager)} -- --debug`)} + ${colors.cyan(`${commandToRunTests(this.packageManager, '--debug')}`)} Runs the tests in debug mode. We suggest that you begin by typing: @@ -182,10 +182,10 @@ Happy hacking! 🎭`); } } -export function commandToRunTests(packageManager: 'npm' | 'yarn') { +export function commandToRunTests(packageManager: 'npm' | 'yarn', args?: string) { if (packageManager === 'yarn') - return `yarn ${PACKAGE_JSON_TEST_SCRIPT_CMD}`; - return `npm run ${PACKAGE_JSON_TEST_SCRIPT_CMD}`; + return `yarn ${PACKAGE_JSON_TEST_SCRIPT_CMD}${args ? (' ' + args) : ''}`; + return `npm run ${PACKAGE_JSON_TEST_SCRIPT_CMD}${args ? (' -- ' + args) : ''}`; } (async () => {