-
-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
🏦 debtTech debtTech debt
Description
🤔 What's the problem you've observed?
The java implementation currently doesn't test itself against the examples in testdata/good.
✨ Do you have a proposal for making it better?
Copy the Javascript implementation
gherkin-utils/javascript/test/prettyTest.ts
Lines 243 to 258 in 840e19f
| const featureFiles = fg.sync(`${__dirname}/../../testdata/good/*.feature`) | |
| for (const featureFile of featureFiles) { | |
| const relativePath = path.relative(__dirname, featureFile) | |
| it(`renders ${relativePath}`, () => { | |
| const gherkinSource = fs.readFileSync(featureFile, 'utf-8') | |
| const gherkinDocument = parse(gherkinSource, new GherkinClassicTokenMatcher()) | |
| const formattedGherkinSource = pretty(gherkinDocument, 'gherkin') | |
| const language = gherkinDocument.feature?.language || 'en' | |
| const newGherkinDocument = checkGherkinToAstToGherkin(formattedGherkinSource, language) | |
| assert(newGherkinDocument) | |
| // TODO: comments | |
| if (gherkinDocument.comments.length === 0) { | |
| assert.deepStrictEqual(neutralize(newGherkinDocument), neutralize(gherkinDocument)) | |
| } | |
| }) | |
| } |
This can be done with JUnit 5's Parameterized tests. For example see:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🏦 debtTech debtTech debt