-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test improvements #35
Conversation
|
||
export const cliArgs = program; | ||
export const parseArgs = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had considered doing this when I wrote this code; the reason I elected to not use a function because in the case where the code runs from cli.ts
, this parse will run twice, once again from inside the main run
function.
It's probably not a big deal, but I wanted to avoid the redundancy. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not worried about perf here, it's very fast
} | ||
`); | ||
it('uses undefined options when none specified', async () => { | ||
await run({ params: {}, environment: 'debug' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I should've realized await
was missing when I wrote the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved my concern via messaging, we decided that it was ok to have CLI runs perform a redundant args parse to keep the module easier to mock.
This PR:
parse_args
module to be more mockableIn other needs we really need to get CI up and running to fix these issues