Cucumber / Gherkin plugin for Vitest - with official @cucumber/cucumber runtime #10481
matus-sabo
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I've built a Vitest plugin that lets you run Cucumber/Gherkin
.featurefiles as first-class Vitest tests, using the official@cucumber/cucumberruntime under the hood.GitHub: https://github.com/lotun-io/vitest-cucumber
npm: https://www.npmjs.com/package/@lotun/vitest-cucumber
What makes it different
Unlike other cucumber-vitest integrations, this one doesn't reimplement the Cucumber runtime — it delegates execution entirely to
@cucumber/cucumber's API. This means everything Cucumber supports works out of the box: Scenario Outlines, Backgrounds, Rules, Tags, Hooks, custom Worlds,CUCUMBER_OPTIONS, etc.Key features
.featurefiles appear as regular test files in Vitest's output with clickable error locationsCUCUMBER_WORKER_IDis synced withVITEST_WORKER_ID)@cucumber/cucumberimports — no custom API to learnCUCUMBER_OPTIONS="--tags @smoke" npx vitest runnpx vitest run features/simple.feature:5)Example
vitest.config.tsfeatures/arithmetic.featurefeatures/support/world.tsfeatures/step_definitions/arithmetic.tsWould love feedback from the community!
Beta Was this translation helpful? Give feedback.
All reactions