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

@W-16676971: drop support for Jest v.26 and v.27 #300

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Changes from 1 commit
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
8 changes: 1 addition & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2.1

supported-jest-versions: &supported-jest-versions ["local", "26", "27", "28", "29"]
supported-jest-versions: &supported-jest-versions ["local", "28", "29"]

deploy_filters: &deploy_filters
filters:
@@ -62,12 +62,6 @@ jobs:
command: |
yarn remove jest jest-environment-jsdom -W --dev
yarn add jest@<<parameters.jest-version>> -W --dev
- when:
condition:
equal: [<<parameters.jest-version>>, "26"]
steps:
- run: yarn clean
- run: yarn install
Copy link
Contributor

Choose a reason for hiding this comment

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

The condition below is no longer needed since jest 28/29 is now implied (if the jest version is not "local"):

            - when:
                condition:
                  or:
                    - equal: [<<parameters.jest-version>>, "28"]
                    - equal: [<<parameters.jest-version>>, "29"]

- when:
condition:
or:
2 changes: 1 addition & 1 deletion packages/@lwc/jest-preset/package.json
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
"@lwc/engine-dom": ">=5.0.0",
"@lwc/engine-server": ">=5.0.0",
"@lwc/synthetic-shadow": ">=5.0.0",
"jest": "^26 || ^27 || ^28 || ^29"
"jest": "^28 || ^29"
},
"dependencies": {
"@lwc/jest-resolver": "16.1.0",
1 change: 0 additions & 1 deletion packages/@lwc/jest-preset/ssr/jest-preset.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
module.exports = {
// Jest 26 default testEnvironment is jsdom: https://jestjs.io/blog/2021/05/25/jest-27#flipping-defaults
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'js', 'html'],
snapshotSerializers: [require.resolve('../src/ssr/html-serializer.js')],
2 changes: 1 addition & 1 deletion packages/@lwc/jest-resolver/package.json
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
"@lwc/jest-shared": "16.1.0"
},
"peerDependencies": {
"jest": "^26 || ^27 || ^28 || ^29"
"jest": "^28 || ^29"
},
"engines": {
"node": ">=10"
2 changes: 1 addition & 1 deletion packages/@lwc/jest-serializer/package.json
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
"pretty-format": "^29.7.0"
},
"peerDependencies": {
"jest": "^26 || ^27 || ^28 || ^29"
"jest": "^28 || ^29"
},
"engines": {
"node": ">=10"
2 changes: 1 addition & 1 deletion packages/@lwc/jest-transformer/package.json
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
},
"peerDependencies": {
"@lwc/compiler": ">=2.48.0",
"jest": "^26 || ^27 || ^28 || ^29"
"jest": "^28 || ^29"
},
"engines": {
"node": ">=10"
2 changes: 0 additions & 2 deletions packages/@lwc/jest-transformer/src/index.js
Original file line number Diff line number Diff line change
@@ -169,8 +169,6 @@ module.exports = {
transformConfig = rest[0];
configString = transformConfig.configString;
} else if (rest.length === 2) {
// Handle jest@26 arguments
// type getCacheKey = (sourceText: string, sourcePath: string, configStr: string, options: any) => string;
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the whole else if block can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I missed this. The comment is harmless but yes I guess it is redundant now.

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'll remove it .

configString = rest[0];
transformConfig = rest[1];
} else {