@@ -68,13 +68,13 @@ export function buildArgs(runCfg: CucumberRunnerConfig, cucumberBin: string) {
68
68
*
69
69
* For structured inputs (`key:value` or `"key:value"`), returns a string in the
70
70
* form `"key":"value"`, with the asset directory prepended to relative paths.
71
- * For simple inputs (e.g., `progress-bar `), returns the input as-is.
71
+ * For simple inputs (e.g., `usage `), returns the input as-is.
72
72
*
73
73
* @param {string } format - The input format string. Examples include:
74
74
* - `"key:value"`
75
75
* - `"key":"value"`
76
76
* - `key:value`
77
- * - `progress-bar `
77
+ * - `usage `
78
78
* @param {string } assetDir - The directory to prepend to the value for relative paths.
79
79
* @returns {string } The normalized format string. For structured inputs, it returns
80
80
* a string in the form `"key":"value"`. For simple inputs, it
@@ -83,8 +83,8 @@ export function buildArgs(runCfg: CucumberRunnerConfig, cucumberBin: string) {
83
83
* Example:
84
84
* - Input: `"html":"formatter/report.html"`, `"/project/assets"`
85
85
* Output: `"html":"/project/assets/formatter/report.html"`
86
- * - Input: `"progress-bar "`, `"/project/assets"`
87
- * Output: `"progress-bar "`
86
+ * - Input: `"usage "`, `"/project/assets"`
87
+ * Output: `"usage "`
88
88
*/
89
89
export function normalizeFormat ( format : string , assetDir : string ) : string {
90
90
// Checks if the format is structured; if not, returns it unchanged.
@@ -94,8 +94,8 @@ export function normalizeFormat(format: string, assetDir: string): string {
94
94
}
95
95
96
96
let [ , key , value ] = match ;
97
- key = key . replace ( / ^ " | " $ / g , '' ) ;
98
- value = value . replace ( / ^ " | " $ / g , '' ) ;
97
+ key = key . replaceAll ( '"' , '' ) ;
98
+ value = value . replaceAll ( '"' , '' ) ;
99
99
const updatedPath = path . join ( assetDir , value ) ;
100
100
return `"${ key } ":"${ updatedPath } "` ;
101
101
}
0 commit comments