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

Make jest-environment-jsdom a peerDependency in jest-environment-enzyme #343

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/jest-environment-enzyme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@
"peerDependencies": {
"enzyme": "3.x",
"jest": ">=22.0.0",
"react": "^0.13.0 || ^0.14.0 || ^15.0.0 || >=16.x"
"react": "^0.13.0 || ^0.14.0 || ^15.0.0 || >=16.x",
"jest-environment-jsdom": ">=22.0.0"
Copy link
Member

@ljharb ljharb Apr 8, 2020

Choose a reason for hiding this comment

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

This shouldn’t use >=, because you can’t guarantee compact with future majors.

Suggested change
"jest-environment-jsdom": ">=22.0.0"
"jest-environment-jsdom": "^25.2.0"

Copy link
Contributor Author

@Methuselah96 Methuselah96 Apr 8, 2020

Choose a reason for hiding this comment

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

I was following the precedent already set by the jest peer dependency in jest-enzyme with using the >=. Should we also change the jest peer dependencies?

Copy link
Member

Choose a reason for hiding this comment

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

Oof, true enough.

Ideally yes, jest should be using ^22 || ^23 etc, and that should probably match this line.

Copy link
Member

Choose a reason for hiding this comment

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

However, changing the jest peer dep like that is a breaking change at this point - but so is adding a new peer dep.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In an idealistic world I completely agree with you. However on a more practical level, it's situations like reduxjs/redux-devtools#473 (one example of many in my experience) that cause me to want to be more permissive.

@blainekasten What do you think? What do you want the the peer dependency ranges to be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ljharb I made a PR to tighten peer dependency ranges: #344. If that PR gets merged before this one, then I'll gladly update the dependency range here. Otherwise, if this PR gets merged first, then I'll fix it in the other PR.

Since the >= is consistent with the status quo, I think it should be fine for this PR to be merged as-is. Conversation about the version ranges can happen on the other PR.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think consistency is as important here as getting the range of a new peer dep correct; while it's not up to me, i wouldn't merge it with >=.

},
"devDependencies": {
"cpy-cli": "^2.0.0"
},
"dependencies": {
"jest-environment-jsdom": "^25.2.0"
}
}