This folder contains practical examples of how to use the co-gherkin library.
This example demonstrates the basics:
- Feature:
simple-calculator/calculator.featuredefines the scenarios in Gherkin. - Steps:
simple-calculator/calculator.steps.tsimplements the logic usingGiven,When,Then. - Test:
simple-calculator/calculator.test.tsconnects everything and runs the test with Vitest.
From the root of the co-gherkin project:
npx vitest run examplesThis will automatically execute the calculator.test.ts file.