Documentation
Gherkin validation
vitest-cucumber use its own feature file parser and validate it before run unit tests.
And checl you test all scenario, steps etc.
Before run unit tests
When you call loadFeature
, vitest-cucumber parse and validate 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.
Valisation
When vitest-cucumber parse your feature file, it checks :
- You have an
Examples
in yourScenario Outline
- You use
Examples
variables in yourScenario Outline
steps
After unit tests
After all unit tests vitest-cucumber 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 can generate a spec file.
You can use it like this :
node node_modules/@amiceli/vitest-cucumber/dist/cli-generate.js <path-to-feature> <path-to-spec>
An example :
node node_modules/@amiceli/vitest-cucumber/dist/cli-generate.js features/example.feature src/__tests__/example.spec.ts