Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 committed Nov 21, 2024
1 parent 3cd800e commit 1185713
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cucumber-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ export function buildArgs(runCfg: CucumberRunnerConfig, cucumberBin: string) {
});

runCfg.suite.options.format?.forEach((format) => {
const updatedFormat = normalizeFormat(format, runCfg.assetsDir);
procArgs.push('--format');
procArgs.push(updatedFormat);
procArgs.push(normalizeFormat(format, runCfg.assetsDir));
});

if (runCfg.suite.options.parallel) {
procArgs.push('--parallel');
procArgs.push(runCfg.suite.options.parallel.toString(10));
}

console.log('procArgs: ', procArgs);
return procArgs;
}

Expand Down Expand Up @@ -89,6 +87,7 @@ export function buildArgs(runCfg: CucumberRunnerConfig, cucumberBin: string) {
* Output: `"progress-bar"`
*/
export function normalizeFormat(format: string, assetDir: string): string {
// Checks if the format is structured; if not, returns it unchanged.
const match = format.match(/^"?([^:]+):"?([^"]+)"?$/);
if (!match) {
return format;
Expand Down

0 comments on commit 1185713

Please sign in to comment.