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

use mocha as a peer dependency #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jehy
Copy link

@jehy jehy commented Jan 28, 2020

Using mocha as a peer dependency does not break old node (developer will only need to specify mocha version they need in package.json) but allows to use latest version of mocha as requested here #6

Copy link
Collaborator

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

If we're going to support multiple mocha major versions, we need to test on each one.

"prettier": "1.7.4"
},
"peerDependencies": {
"mocha": "*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

* is never an acceptable value on the RHS of package.json; we should explicitly list each major version we support, ie ^3 || ^4 || ^5 || ^6 || ^7 etc.

Copy link
Author

Choose a reason for hiding this comment

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

What about "3+" then? Seems like a pretty legit semver value to me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

>= 3 is valid, but has the same problem that if mocha 8, or 12, or 25 comes out, and doesn't work with us, we'll be falsely claiming it works.

Only explicitly tested mocha versions should be allowed in peer deps (which are a hard install requirement in npm ls, npm 7+, yarn list, and yarn 2+)

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.

None yet

2 participants