-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
As im working with jest-cucumber for some time, i was asking myself if it is really usefull if i need to allways define the scenarios and its related steps in defineFeature callback because that leads to duplicated code.
If i want to avoid this i need a hack like this:
const feature = loadFeature(featureFile, tagFilter)
defineFeature(feature, test => {
feature.scenarios.forEach((scenario) => {
test(scenario.title, (stepName) => {
scenario.steps.forEach((step) => {
stepName[step.keyword](step.stepText, Steps.get(step.stepText))
})
})
})
})Is my understanding correct ? Because every Scenario must be defined with its steps, i need to define them more then once.. ?
If there is another way and i am wrong, i would be very happy to know about it
Btw im reading your source code, because im working on cucumbers "Background" problem. Since its not implemented yet, everyone just uses beforeEach instead right?!
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request