Gherkin
Gherkin validation
vitest-cucumber uses its own feature file parser and validate it before running unit tests.
And check ths tests for all scenario, steps, etc.
Before unit tests run
When you call loadFeature
, vitest-cucumber parses and validates your feature file.
It implements gherkin keywords:
Scenario
Scenario Outline
Feature
Examples
Rule
- Steps :
Given
,When
,Then
,And
,But
Since 3.3.2 version you can use Example
, Scenarios
and Scenario Template
synonyms.
Validation
When vitest-cucumber parses your feature file, it checks that:
- You have an
Examples
in yourScenario Outline
- You use
Examples
variables in yourScenario Outline
steps
After unit tests run
Validation
After all unit tests vitest-cucumber, it checks:
- non tested
Scenario
and/orScenario Outline
- non tested
Scenario
and/orScenario Outline
steps - non tested
Feature
- non tested
Rule
Generate spec file from feature file
If you want to save time, vitest-cucumber is able to generate a spec file automatically via the CLI.
You can use it like this:
Example: