does bun test support https://cucumber.io/docs/guides/10-minute-tutorial?lang=javascript ?
- User
does bun test support https://cucumber.io/docs/guides/10-minute-tutorial?lang=javascript ?
Assistant
No. Bun's built-in test runner (
bun test) does not support Cucumber/Gherkin.featurefiles. It uses a Jest/Vitest-compatible API (describe/it/expect).Cucumber.js has its own CLI runner (
cucumber-js) that parses.featurefiles and matches steps. You'd run it separately:bashbun --bun npx cucumber-jsThis uses Bun as the runtime but Cucumber's own test runner, not
bun test. The two are independent — you can't mix Gherkin scenarios intobun testsuites.If you want BDD-style acceptance tests that run under
bun test, the typical approach is to write Given/When/Then as plain functions called from regulardescribe/itblocks — no Gherkin parser, but the same structure.- User
can't we just write our own compatible .feature gherkin parser that works with bun or vitest?
- User
[Request interrupted by user]
- User
Assistant
Let me check what that project offers.
Assistant
That's exactly what you're looking for.
vitest-cucumberparses.featurefiles and maps Gherkin steps to vitest'sdescribe/testunder the hood.Since Bun's test runner is Jest/Vitest-compatible at the API level, there's a good chance it works with
bun testtoo — but it depends on whether the library relies on vitest-specific internals (transforms, config hooks) or just usesdescribe/test/expect.Quick compatibility check: the library calls vitest's
describeandtestfunctions internally. If those are the only vitest APIs it touches,bun testwould work. If it uses vitest's plugin system or custom reporters, it won't.Want me to dig into the source to confirm Bun compatibility, or are you evaluating this for the Brain project's acceptance tests?
- User
create github issue for migrating from bun to vitest + cucumber
Assistant
Let me check the current test setup first.
Assistant
Now I have a good picture. I notice vitest is already in
package.json("vitest": "^4.0.18"). Let me create the issue.Assistant
Created #193 — Migrate test runner from bun:test to vitest-cucumber.
Three phases:
- vitest runner migration — swap
bun:testimports to vitest across ~357 test files, migrate config tovitest.config.tsworkspaces - vitest-cucumber adoption — add
.featurefiles as executable Gherkin specs for acceptance tests using@amiceli/vitest-cucumber - cleanup — remove bun test config artifacts, update docs
vitest is already in your deps so phase 1 is mostly mechanical import swaps +
mock.module→vi.mock.- vitest runner migration — swap