Skip / Only
Since 4.4.0 vitest-cucumber provides .skip and .only for Scenario, Rule and Background.s
Functions like Scenario.skip or Rule.only use vitest skip and only, so you can
check vitest api if you need more details.
Like describe.skip, vitest-cucumber provides :
Scenario.skipandScenarioOutline.skipRuleScenario.skipandRuleScenarioOutline.skipBackground.skipRule.skip
Example with a scenario :
describeFeature(feature, (f) => { f.Scenario.skip('Will be skipped', (s) => { s.Given('I am uncalled', () => { expect.fail('should be skipped') }) }) f.Scenario('Only called scenario', (s) => { s.Given('I use only', () => { expect(true).toBe(true) }) })})Example with a rule :
describeFeature(feature, (f) => { f.Rule.skip('skipped rule', (r) => { r.RuleScenario('skipped rule\'s scenario', (s) => { s.Given('I\'m skipped too', () => { expect.fail('should be skipped') }) }) })})Like describe.only, vitest-cucumber provides :
Scenario.onlyandScenarioOutline.onlyRuleScenario.onlyandRuleScenarioOutline.onlyRule.only
A Background is always linked to Scenario, so you can’t call Background.only.
Example with a scenario :
describeFeature(feature, (f) => { f.Scenario('Will be skipped', (s) => { s.Given('I am uncalled', () => { expect.fail('should be skipped') }) }) f.Scenario.only('Only called scenario', (s) => { s.Given('I use only', () => { expect(true).toBe(true) }) })})Example with a rule :
describeFeature(feature, (f) => { f.Rule.only('Only called rule', (r) => { // ... }) f.Rule('Skipped rule', (r) => { // ... })})