ekino / veggies

:sparkles: :rocket: Veggies is an awesome cucumberjs library for API/CLI testing. Great for testing APIs built upon Express, Koa, HAPI, Loopback and others. It's also the perfect companion for testing CLI applications built with commander, meow & Co.
https://ekino.github.io/veggies/
MIT License
90 stars 18 forks source link

feat(cliWrapper): wrap the cucumber CLI to keep the use of custom opt… #68

Closed fthouraud closed 3 years ago

fthouraud commented 3 years ago

This is an attempt to maintain our custom CLI options while preventing the @cucumbere/cucumber CLI to reject our custom options.

⚠️ This is a work in progress. I want your feeling about this before going further. ⚠️

It uses yargs to parse the process.argv then removes any options that veggies has use of (I think it's better to be loose here in the event of a new cucumber CLI option added).

It rebuild an array of command-line arguments as it could have been passed on the original command before programmatically launching the CLI with those options.

This should launch the CLI without any issue:

$ yarn veggies examples/**/*.feature --cleanSnapshots
UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

Failures:

1) Scenario: Running an invalid command # examples/features/cli/yarn.feature:4
   ? When I run command node -z
[...]

An unknown option is passed to the cucumber CLI:

$ yarn veggies examples/**/*.feature --cleanSnapshots --foo
error: unknown option '--foo'
Crow-EH commented 3 years ago

Users will be able to run it with a simple yarn veggies or npx veggies since it'll be in their projects' node_modules/.bin folders. 👍

fthouraud commented 3 years ago

I close this PR in favor of #69