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

chore: update peerdependency of jest to ^25.5.4 @W-7689277 #90

Merged
merged 4 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@types/jest": "^25.2.1",
"babel-eslint": "^10.1.0",
"eslint": "^6.8.0",
"jest": "^25.5.0",
"jest": "^25.5.4",
"lerna": "^3.20.2",
"prettier": "^2.0.5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@lwc/jest-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@lwc/jest-resolver": "7.0.0",
"@lwc/jest-serializer": "7.0.0",
"@lwc/jest-transformer": "7.0.0",
"jest-environment-jsdom-fifteen": "^1.0.2"
"jest-environment-jsdom-fifteen": "~1.0.2"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only change is to use the right semver qualifier for dependency. The version in yarn.lock remains the same.

Copy link
Member

Choose a reason for hiding this comment

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

jest-environment-jsdom-fifteen is not needed anymore since jest 25 depends on jsdom 15: https://github.com/facebook/jest/blob/v25.5.4/packages/jest-environment-jsdom/package.json#L25

},
"engines": {
"node": ">=10"
Expand Down
9 changes: 5 additions & 4 deletions packages/@lwc/jest-transformer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@
"@babel/plugin-transform-modules-commonjs": "7.9.0",
"@babel/preset-typescript": "7.9.0",
"@babel/template": "~7.8.6",
"babel-plugin-transform-dynamic-import": "^2.1.0",
"babel-preset-jest": "^25.4.0"
"babel-plugin-transform-dynamic-import": "~2.1.0"
},
"peerDependencies": {
"@lwc/compiler": "*",
"jest": ">= 24.9.0"
"babel-preset-jest": "^25.5.0",
Copy link
Member

Choose a reason for hiding this comment

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

I am not certain if babel-preset-jest should be peer dependency. Since babel-preset-jest is already pulled down by jest, and by using a peer dependency we might run into a version mismatch. What do you think about resolving the babel-preset-jest from the jest module?

Copy link
Contributor

Choose a reason for hiding this comment

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

When we tested it, the babel-preset-jest dependency was in the node_modules of jest-config rather than at the top level. We could dig around node_modules to find it. That feels a bit fragile though, jest-config doesn't even have a README.

Or maybe there's a more reliable way to get the babel-preset-jest from jest?

"jest": "^25.5.4"
},
"devDependencies": {
"@lwc/jest-preset": "7.0.0",
"@lwc/jest-resolver": "7.0.0",
"@lwc/jest-serializer": "7.0.0"
"@lwc/jest-serializer": "7.0.0",
"babel-preset-jest": "^25.5.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding this as a devDependency here as the unit tests in @lwc/jest-transformer rely on this dependency.

},
"engines": {
"node": ">=10"
Expand Down
Loading