Skip to content

fix(@angular-devkit/build-angular): expand jest and jest-environment-jsdom to allow version 30 #30761

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"@angular/ssr": "^0.0.0-PLACEHOLDER",
"@web/test-runner": "^0.20.0",
"browser-sync": "^3.0.2",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest": "^29.5.0 || ^30.0.5",
"jest-environment-jsdom": "^29.5.0 || ^30.0.5",
"karma": "^6.3.0",
"ng-packagr": "0.0.0-NG-PACKAGR-PEER-DEP",
"protractor": "^7.0.0",
Expand Down
13 changes: 13 additions & 0 deletions tests/legacy-cli/e2e/tests/jest/basic-version-29.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { applyJestBuilder } from '../../utils/jest';
import { ng, silentNpm } from '../../utils/process';

export default async function (): Promise<void> {
await applyJestBuilder();
await silentNpm('install', 'jest@29.5.0', 'jest-environment-jsdom@29.5.0', '--save-dev');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Question: Do we need to continue to support v29? Since this is still experimental, I don't think we're on the hook for backwards compatibility yet and it's probably reasonable to limit this to the latest major unless we have reason to believe that will be exceptionally difficult for users to adopt.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So it seems that this would need further investigation to get version 30 to work. Let's have a chat about this offline to see the next steps for this builder.


const { stderr } = await ng('test');

if (!stderr.includes('Jest builder is currently EXPERIMENTAL')) {
throw new Error(`No experimental notice in stderr.\nSTDERR:\n\n${stderr}`);
}
}
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/utils/jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function applyJestBuilder(
polyfills: ['zone.js', 'zone.js/testing'],
},
): Promise<void> {
await silentNpm('install', 'jest@29.5.0', 'jest-environment-jsdom@29.5.0', '--save-dev');
await silentNpm('install', 'jest@30.0.5', 'jest-environment-jsdom@30.0.5', '--save-dev');

await updateJsonFile('angular.json', (json) => {
const projects = Object.values(json['projects']);
Expand Down
Loading