You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a few options on how to call the CLI from an e2e test suite:
Go through the shell. Use child_process.exec to call the CLI directly through the shell in the context of a jest test suite and parse the output. It's as e2endy as you can get, but cumbersome (and brittle) due to the parsing.
Get an instance of the configured program from commander and manually call program.parse with whatever arguments we want. We'd be running the CLI on the same process as the tests (which is probably faster? or at least removes the inconveniences of having to locate the CLI binary), but we'd still have the same issues with parsing output.
Split out the CLI logic, so yarn-project/aztec-cli/src/index.ts only declares the commands, and we keep separate functions with the actual logic that map 1:1 to each command. These functions can return stuff (instead of or in addition to) logging it, and we test these functions.
After discussing with @PhilWindle we're leaning towards option 2.
The text was updated successfully, but these errors were encountered:
We have a few options on how to call the CLI from an e2e test suite:
After discussing with @PhilWindle we're leaning towards option 2.
The text was updated successfully, but these errors were encountered: