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

feat(zone.js): jest 29 should ignore uncaught error console log #49325

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/zone.js/lib/jest/jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ Zone.__load_patch('jest', (context: any, Zone: ZoneType, api: _ZonePrivate) => {
return;
}


// From jest 29 and jest-preset-angular v13, the module transform logic
// changed, and now jest-preset-angular use the use the tsconfig target
// other than the hardcoded one, https://github.com/thymikee/jest-preset-angular/issues/2010
// But jest-angular-preset doesn't introduce the @babel/plugin-transform-async-to-generator
// which is needed by angular since `async/await` still need to be transformed
// to promise for ES2017+ target.
// So for now, we disable to output the uncaught error console log for a temp solution,
// until jest-preset-angular find a proper solution.
(Zone as any)[api.symbol('ignoreConsoleErrorUncaughtError')] = true;
AndrewKushnir marked this conversation as resolved.
Show resolved Hide resolved
jest['__zone_patch__'] = true;

const ProxyZoneSpec = (Zone as any)['ProxyZoneSpec'];
Expand Down