vitest-cucumber-plugin icon indicating copy to clipboard operation
vitest-cucumber-plugin copied to clipboard

Plugin can't parse a `.feature` file

Open matthew-dean opened this issue 1 year ago • 2 comments

I added the simple example from the Cucumber setup instructions:

Feature: Is it Friday yet?
  Everybody wants to know when it's Friday

  Scenario: Sunday isn't Friday
    Given today is Sunday
    When I ask whether it's Friday yet
    Then I should be told "Nope"

I've configured the plugin per the instructions in this repo's readme.

The error when running tests is: Unexpected end of file. I did some debugging and the parser is definitely getting the file contents, but simply can't parse it. 🤷‍♂️

Here's a reproduction: https://stackblitz.com/edit/vitest-dev-vitest-ymdex6?file=vite.config.ts,test%2Ftest.feature

matthew-dean avatar Mar 26 '24 23:03 matthew-dean

A related question -- given that Cucumber has an officially-supported parser in JavaScript, why does this plugin do the work of parsing at all?

matthew-dean avatar Mar 26 '24 23:03 matthew-dean

I made quickpickle, which uses the official Gherkin parser (and also sticks much closer to CucumberJS usage). Many thanks to @samuel-ziegler for this brilliant idea.

dnotes avatar Oct 19 '24 21:10 dnotes