check-cucumber
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -7,2 +7,3 @@ const Gherkin = require('gherkin').default; | ||
let workDir; | ||
const invalidKeys = ['And', 'But']; | ||
@@ -39,2 +40,3 @@ const getLocation = scenario => (scenario.tags.length ? scenario.tags[0].location.line - 1 : scenario.location.line - 1); | ||
const steps = []; | ||
let previousValidStep = ''; | ||
const scenarioJson = { name: getTitle(scenario), file: fileName }; | ||
@@ -44,3 +46,9 @@ const start = getLocation(scenario); | ||
for (const step of scenario.steps) { | ||
steps.push({ title: step.text, keyword: step.keyword.trim() }); | ||
let keyword = step.keyword.trim(); | ||
if (invalidKeys.includes(keyword)) { | ||
keyword = previousValidStep; | ||
} else { | ||
previousValidStep = keyword; | ||
} | ||
steps.push({ title: step.text, keyword }); | ||
} | ||
@@ -47,0 +55,0 @@ scenarioJson.code = sourceArray.slice(start, end).join('\n'); |
{ | ||
"name": "check-cucumber", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:testomatio/check-cucumber.git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10393
260