Skip to content

Use yargs parser in unit tests for greater fidelity - #990

Merged
evocateur merged 9 commits into
lerna:masterfrom
evocateur:yargs-runner
Aug 27, 2017
Merged

evocateur merged 9 commits into
lerna:masterfrom
evocateur:yargs-runner

Conversation

@evocateur

@evocateur evocateur commented Aug 27, 2017 •

Copy link
Copy Markdown
Member

Description

Use the actual arg parser that creates actual command instances when run via the CLI during unit tests, an amazing concept.

Motivation and Context

Our artificial constructor arguments have led to several bugs, most recently (and egregiously) #989 (from #960).

This also drastically simplifies the tests and makes them much more readable.

How Has This Been Tested?

a whole bunch (the first push will intentionally fail with a #989 repro)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@evocateur evocateur self-assigned this Aug 27, 2017
alias: "c",
type: "string",
// NOTE: this type must remain undefined, as it is too overloaded to make sense
// type: "string",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix. The rest is just window-dressing so I could actually make the existing tests fail correctly.

@evocateur
evocateur merged commit f6fc7ca into lerna:master Aug 27, 2017
@evocateur
evocateur deleted the yargs-runner branch August 27, 2017 06:08
@Jmsa

Jmsa commented Aug 28, 2017

Copy link
Copy Markdown

Nice! Accurately failing tests = 👍

When do you envision these changes make their way into a new release?

@evocateur

evocateur commented Aug 28, 2017 via email

Copy link
Copy Markdown
Member Author

@evocateur

Copy link
Copy Markdown
Member Author

Released in v2.1.1

@lock

lock Bot commented Dec 27, 2018

Copy link
Copy Markdown

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants