Skip to content

Commit

Permalink
Only allow one of --playwright/--cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Jan 13, 2024
1 parent e854c4b commit 4729958
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions node-src/lib/getConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const configurationSchema = z

buildScriptName: z.string(),
playwright: z.boolean(),
cypress: z.boolean(),
outputDir: z.string(),

storybookBuildDir: z.string(),
Expand Down
6 changes: 5 additions & 1 deletion node-src/lib/getOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default function getOptions({

buildScriptName: undefined,
playwright: undefined,
cypress: undefined,
outputDir: undefined,
allowConsoleErrors: undefined,
storybookBuildDir: undefined,
Expand Down Expand Up @@ -130,6 +131,7 @@ export default function getOptions({

buildScriptName: flags.buildScriptName,
playwright: trueIfSet(flags.playwright),
cypress: trueIfSet(flags.cypress),
outputDir: takeLast(flags.outputDir),
allowConsoleErrors: flags.allowConsoleErrors,
storybookBuildDir: takeLast(flags.storybookBuildDir),
Expand Down Expand Up @@ -204,6 +206,8 @@ export default function getOptions({
const singularOpts = {
buildScriptName: '--build-script-name',
storybookBuildDir: '--storybook-build-dir',
playwright: '--playwright',
cypress: '--cypress',
};
const foundSingularOpts = Object.keys(singularOpts).filter((name) => !!options[name]);

Expand Down Expand Up @@ -256,7 +260,7 @@ export default function getOptions({
return options;
}

if (options.playwright) {
if (options.playwright || options.cypress) {
return options;
}

Expand Down

0 comments on commit 4729958

Please sign in to comment.