From 0a93d869ea845cd31880420701ca87ca3ef8a678 Mon Sep 17 00:00:00 2001 From: Tian Feng Date: Fri, 5 Apr 2024 14:06:26 -0700 Subject: [PATCH] skip null or undefined when passing args --- src/playwright-runner.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/playwright-runner.ts b/src/playwright-runner.ts index 7046956d..c325e970 100644 --- a/src/playwright-runner.ts +++ b/src/playwright-runner.ts @@ -301,8 +301,6 @@ async function runPlaywright( utils.replaceLegacyKeys(suite.param), ); - console.log('args: ', args); - // There is a conflict if the playwright project has a `browser` defined, // since the job is launched with the browser set by saucectl, which is now set as the job's metadata. const isRunProject = Object.keys(args).find((k) => k === 'project'); @@ -313,7 +311,11 @@ async function runPlaywright( // eslint-disable-next-line prefer-const for (let [key, value] of Object.entries(args)) { key = utils.toHyphenated(key); - if (excludeParams.includes(key.toLowerCase()) || value === false) { + if ( + excludeParams.includes(key.toLowerCase()) || + value === undefined || + value === null + ) { continue; } procArgs.push(`--${key}`);