Skip to content

Fix for snippets command with a .feature file that has special characters - #1801

Merged
DavertMik merged 3 commits into
codeceptjs:masterfrom
asselin:feature/fix-escapes-in-snippets
Jul 27, 2019
Merged

Fix for snippets command with a .feature file that has special characters#1801
DavertMik merged 3 commits into
codeceptjs:masterfrom
asselin:feature/fix-escapes-in-snippets

Conversation

@asselin

@asselin asselin commented Jul 24, 2019

Copy link
Copy Markdown
Contributor

Fix issue when running snippets command with a .feature file that has steps with Gherkin special characters (any of { } ( ) / )
Instead of creating strings, create regular expressions that will match
This fixes the problem where the generated snippets won't match the steps from the original .feature file

… steps with Gherkin special characters

Instead of creating strings, create regular expressions that will match
This fixes the problem where the generated snippets won't match the steps from the original .feature file
Comment thread lib/command/gherkin/snippets.js Outdated
.map((step) => {
return `
${step.type}('${step}', () => {
${step.type}(${step.regexp ? '/^' + step + '$/' : "'" + step + "'"}, () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected string concatenation prefer-template

@codeceptjs codeceptjs deleted a comment Jul 24, 2019
@codeceptjs codeceptjs deleted a comment Jul 24, 2019
@asselin

asselin commented Jul 24, 2019

Copy link
Copy Markdown
Contributor Author

Note: the CircleCI failure was not due to this PR. CircleCI failed with a timeout.

@DavertMik

Copy link
Copy Markdown
Contributor

Thank you!

@DavertMik
DavertMik merged commit 5befbff into codeceptjs:master Jul 27, 2019
@asselin
asselin deleted the feature/fix-escapes-in-snippets branch July 29, 2019 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants