-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(main): problems with Scenario Outline rendering
- Loading branch information
Showing
5 changed files
with
46 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"quickpickle": patch | ||
--- | ||
|
||
Fixed problems with Scenario Outline rendering; under the following conditions, | ||
and probably some others, the renderer would fail. | ||
|
||
- If a parameter were named "context" | ||
- Any regex characters (e.g. *) in a parameter name | ||
- Having a ton of examples | ||
- If a parameter name started with a number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
import { expect, test } from 'vitest' | ||
import { expect, test, describe } from 'vitest' | ||
import { renderGherkin } from '../src/render' | ||
import { defaultConfig, normalizeTags } from '../src' | ||
import fs from 'node:fs' | ||
|
||
const featureFile = fs.readFileSync(__dirname + '/../gherkin-example/example.feature', 'utf8') | ||
const jsFile = fs.readFileSync(__dirname + '/../gherkin-example/example.feature.js', 'utf8') | ||
|
||
test('rendering the example feature file', () => { | ||
expect(jsFile).toEqual(renderGherkin(featureFile, {...defaultConfig, failTags: normalizeTags('fail, fails'), explodeTags: [normalizeTags('1a,1b'),normalizeTags('2a,2b')] })) | ||
}) | ||
const featureFile = fs.readFileSync(__dirname + '/../gherkin-example/example.feature', 'utf8') | ||
const jsFile = fs.readFileSync(__dirname + '/../gherkin-example/example.feature.js', 'utf8') | ||
const testJs = renderGherkin(featureFile, {...defaultConfig, failTags: normalizeTags('fail, fails'), explodeTags: [normalizeTags('1a,1b'),normalizeTags('2a,2b')] }) | ||
try { | ||
expect(jsFile).toEqual(testJs) | ||
} | ||
catch(e) { | ||
fs.writeFileSync(__dirname + '/../gherkin-example/example.feature.diff.js', testJs) | ||
throw e | ||
} | ||
}) |