Browser mode
Configuration
Section titled “Configuration”Since 4.3.0 vitest-cucumber works with vitest browser mode
A vitest.config.js example :
export default defineConfig({ plugins: [vue()], test: { name: 'vue', globals: true, browser: { enabled: true, name: 'chromium', provider: 'playwright', }, },})globals: true is required if you want to use env variables like VITEST_INCLUDE_TAGS.
load feature files
Section titled “load feature files”You have same features in browser mode.
Just you have to use /browser module :
import { describeFeature, loadFeature } from '@amiceli/vitest-cucumber/browser'
const feature = await loadFeature('/src/__tests__/ex.feature')
describeFeature(feature, ({ Scenario }) => { // ...})Relative path
Section titled “Relative path”Since 5.2.1 vitest-cucumber allow to load file with relative path :
const feature = await loadFeature('./ex.feature')