Skip to content
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

Merged
merged 3 commits into from
Sep 9, 2020
Merged

Test improvements #35

merged 3 commits into from
Sep 9, 2020

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented Sep 9, 2020

This PR:

In other needs we really need to get CI up and running to fix these issues


export const cliArgs = program;
export const parseArgs = () => {
Copy link
Contributor

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?

Copy link
Contributor Author

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' });
Copy link
Contributor

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.

Copy link
Contributor

@justinkambic justinkambic left a 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.

@andrewvc andrewvc merged commit c70d5bc into elastic:master Sep 9, 2020
@andrewvc andrewvc deleted the test-improvements branch September 9, 2020 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants