amiceli / vitest-cucumber

Use gherkin in your unit tests with vitest
https://vitest-cucumber.miceli.click
25 stars 2 forks source link

Feature Request: Codegen / Snippet Tool #81

Closed charlieforward9 closed 1 month ago

charlieforward9 commented 1 month ago

It would be incredible to have a tool that takes the .feature file that is written manually, and automatically generate the describeFeature test.

Maybe this would simply be a CLI script?

amiceli commented 1 month ago

You can check on README. I created a CLI to generate spec.ts file from feature file.

Example : node node_modules/@amiceli/vitest-cucumber/dist/cli-generate.js features/example.feature src/__tests__/example.spec.ts

charlieforward9 commented 1 month ago

Small tweak on the path: it's actually in the scripts folder, not dist.

This is exactly what I am looking for though, thank you for building this! Very awesome.

👏🏼

amiceli commented 1 month ago

I'll update README to fix script example.

amiceli commented 1 month ago

script is for version before 3.3.0 ;) Now it's dist and cli-generate supports Background.

charlieforward9 commented 1 month ago

On 3.3.1-beta.1 I cannot find the cli-generate.js folder in node_modules.

amiceli commented 1 month ago

I fixed it in new beta version 3.3.1-beta.2.

charlieforward9 commented 1 month ago

Working, thank you.