Skip to content

Commit cea1e22

Browse files
committed
rename example formatter in comments
1 parent 1185713 commit cea1e22

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/cucumber-runner.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ export function buildArgs(runCfg: CucumberRunnerConfig, cucumberBin: string) {
6868
*
6969
* For structured inputs (`key:value` or `"key:value"`), returns a string in the
7070
* 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.
7272
*
7373
* @param {string} format - The input format string. Examples include:
7474
* - `"key:value"`
7575
* - `"key":"value"`
7676
* - `key:value`
77-
* - `progress-bar`
77+
* - `usage`
7878
* @param {string} assetDir - The directory to prepend to the value for relative paths.
7979
* @returns {string} The normalized format string. For structured inputs, it returns
8080
* a string in the form `"key":"value"`. For simple inputs, it
@@ -83,8 +83,8 @@ export function buildArgs(runCfg: CucumberRunnerConfig, cucumberBin: string) {
8383
* Example:
8484
* - Input: `"html":"formatter/report.html"`, `"/project/assets"`
8585
* 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"`
8888
*/
8989
export function normalizeFormat(format: string, assetDir: string): string {
9090
// Checks if the format is structured; if not, returns it unchanged.
@@ -94,8 +94,8 @@ export function normalizeFormat(format: string, assetDir: string): string {
9494
}
9595

9696
let [, key, value] = match;
97-
key = key.replace(/^"|"$/g, '');
98-
value = value.replace(/^"|"$/g, '');
97+
key = key.replaceAll('"', '');
98+
value = value.replaceAll('"', '');
9999
const updatedPath = path.join(assetDir, value);
100100
return `"${key}":"${updatedPath}"`;
101101
}

tests/unit/src/cucumber-runner.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ describe('normalizeFormat', () => {
5555
});
5656

5757
it('should return simple strings as-is', () => {
58-
expect(normalizeFormat(`"progress-bar"`, assetDir)).toBe('"progress-bar"');
59-
expect(normalizeFormat(`progress-bar`, assetDir)).toBe('progress-bar');
58+
expect(normalizeFormat(`"usage"`, assetDir)).toBe('"usage"');
59+
expect(normalizeFormat(`usage`, assetDir)).toBe('usage');
6060
});
6161
});

0 commit comments

Comments
 (0)