diff --git a/.circleci/config.yml b/.circleci/config.yml index 257314c0..d9405e61 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -58,23 +58,11 @@ jobs: equal: [<>, "local"] steps: - run: - name: Override version of jest@<> + name: Override version of jest@<> and jest-environment-jsdom@<> command: | yarn remove jest jest-environment-jsdom -W --dev yarn add jest@<> -W --dev - - when: - condition: - equal: [<>, "26"] - steps: - - run: yarn clean - - run: yarn install - - when: - condition: - or: - - equal: [<>, "28"] - - equal: [<>, "29"] - steps: - - run: yarn add jest-environment-jsdom@<> -W --dev + yarn add jest-environment-jsdom@<> -W --dev - run: name: Run linter command: yarn lint diff --git a/packages/@lwc/jest-preset/package.json b/packages/@lwc/jest-preset/package.json index 6d0203a6..5ea5264a 100644 --- a/packages/@lwc/jest-preset/package.json +++ b/packages/@lwc/jest-preset/package.json @@ -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", diff --git a/packages/@lwc/jest-preset/ssr/jest-preset.js b/packages/@lwc/jest-preset/ssr/jest-preset.js index bf0d1c30..7c35d54b 100644 --- a/packages/@lwc/jest-preset/ssr/jest-preset.js +++ b/packages/@lwc/jest-preset/ssr/jest-preset.js @@ -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')], diff --git a/packages/@lwc/jest-resolver/package.json b/packages/@lwc/jest-resolver/package.json index c65efc5d..4796c364 100644 --- a/packages/@lwc/jest-resolver/package.json +++ b/packages/@lwc/jest-resolver/package.json @@ -25,7 +25,7 @@ "@lwc/jest-shared": "16.1.0" }, "peerDependencies": { - "jest": "^26 || ^27 || ^28 || ^29" + "jest": "^28 || ^29" }, "engines": { "node": ">=10" diff --git a/packages/@lwc/jest-serializer/package.json b/packages/@lwc/jest-serializer/package.json index c17bc5c9..dc8c9800 100644 --- a/packages/@lwc/jest-serializer/package.json +++ b/packages/@lwc/jest-serializer/package.json @@ -22,7 +22,7 @@ "pretty-format": "^29.7.0" }, "peerDependencies": { - "jest": "^26 || ^27 || ^28 || ^29" + "jest": "^28 || ^29" }, "engines": { "node": ">=10" diff --git a/packages/@lwc/jest-transformer/package.json b/packages/@lwc/jest-transformer/package.json index c02e0626..ec28bd9f 100644 --- a/packages/@lwc/jest-transformer/package.json +++ b/packages/@lwc/jest-transformer/package.json @@ -35,7 +35,7 @@ }, "peerDependencies": { "@lwc/compiler": ">=2.48.0", - "jest": "^26 || ^27 || ^28 || ^29" + "jest": "^28 || ^29" }, "engines": { "node": ">=10" diff --git a/packages/@lwc/jest-transformer/src/index.js b/packages/@lwc/jest-transformer/src/index.js index 3fa13573..bc168178 100644 --- a/packages/@lwc/jest-transformer/src/index.js +++ b/packages/@lwc/jest-transformer/src/index.js @@ -168,11 +168,6 @@ module.exports = { // type getCacheKey = (sourceText: string, sourcePath: string, options: { configString: string }) => string; 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; - configString = rest[0]; - transformConfig = rest[1]; } else { throw new Error('Unexpected transform arguments.'); }