Skip to content

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 committed Nov 22, 2024
1 parent ced147d commit 850315d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/cucumber-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,25 @@ export function buildArgs(runCfg: CucumberRunnerConfig, cucumberBin: string) {
* Normalizes a Cucumber-js format string.
*
* For structured inputs (`key:value` or `"key:value"`), returns a string in the
* form `"key":"value"`, with the asset directory prepended to relative paths.
* For simple inputs (e.g., `usage`), returns the input as-is.
* form `"key":"value"`. If the value starts with `file://`, it is treated as an
* absolute path and no asset directory is prepended. Otherwise, the asset
* directory is prepended to relative paths.
*
* For simple inputs (e.g., `usage`), the input is returned unchanged.
*
* @param {string} format - The input format string. Examples include:
* - `"key:value"`
* - `"key":"value"`
* - `key:value`
* - `usage`
* @param {string} assetDir - The directory to prepend to the value for relative paths.
* @returns {string} The normalized format string. For structured inputs, it returns
* a string in the form `"key":"value"`. For simple inputs, it
* returns the input unchanged.
* @returns {string} The normalized format string.
*
* Example:
* - Input: `"html":"formatter/report.html"`, `"/project/assets"`
* Output: `"html":"/project/assets/formatter/report.html"`
* - Input: `"html":"file://formatter/report.html"`, `"/project/assets"`
* Output: `"html":"file://formatter/report.html"`
* - Input: `"usage"`, `"/project/assets"`
* Output: `"usage"`
*/
Expand Down

0 comments on commit 850315d

Please sign in to comment.