Skip to content

Commit

Permalink
skip null or undefined when passing args
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 committed Apr 5, 2024
1 parent ad8c2d7 commit 0a93d86
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/playwright-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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}`);
Expand Down

0 comments on commit 0a93d86

Please sign in to comment.