hiptest-publisher icon indicating copy to clipboard operation
hiptest-publisher copied to clipboard

Single quotes within steps aren't handled properly in Cucumber/TypeScript preset

Open x4th opened this issue 3 years ago • 0 comments

Describe the bug When hiptest-publisher is used to generate Cucumber/TypeScript test stubs, single quotes aren't properly handled which results in syntax errors in the newly generated step_definitions file.

To Reproduce

  1. Have a feature file containing a step with a single quote inside e.g. Then they're logged in
  2. Run hiptest-publisher with the config file containing
language = cucumber
framework = typescript
  1. Generated code uses single quotes for strings and doesn't escape the quotes within Gherkin steps.
Then('they're logged in', async () => {
    actionWords.theyreLoggedIn();
});

Expected behavior Generated code doesn't contain syntax errors.

Context & Motivation It affected me deeply. Jk but it affected me enough to report the bug.

Your Environment

  • hiptest-publisher version: 3.1.0

x4th avatar Nov 25 '21 14:11 x4th