Title: Unhandled promise rejections aren't properly reported in tests · Issue #30861 · angular/angular-cli · GitHub
Open Graph Title: Unhandled promise rejections aren't properly reported in tests · Issue #30861 · angular/angular-cli
X Title: Unhandled promise rejections aren't properly reported in tests · Issue #30861 · angular/angular-cli
Description: Which @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? Yes Description In an Angular project that uses zone.js, unhandled promise rejections are not reported. In a zoneless Angular project, they ...
Open Graph Description: Which @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? Yes Description In an Angular project that uses zone.js, unhandled promise rejections are not report...
X Description: Which @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? Yes Description In an Angular project that uses zone.js, unhandled promise rejections are not re...
Opengraph URL: https://github.com/angular/angular-cli/issues/30861
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unhandled promise rejections aren't properly reported in tests","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nDon't known / other\n\n### Is this a regression?\n\nYes\n\n### Description\n\nIn an Angular project that uses zone.js, unhandled promise rejections are not reported. In a zoneless Angular project, they are reported twice.\n\nSteps to reproduce:\n\n1. Create a new Angular project.\n2. Paste the code below into a spec file.\n3. `npm t`\n\n```\nit('triggers an unhandled rejection', function(done) {\n\tPromise.reject(new Error('nope'));\n\n\t// Make sure the unhandled rejection event has plenty of time to fire before\n\t// Jasmine finishes running. This helps distinguish between timing issues\n\t// (event is firing a bit later than usual) and the event not firing at all.\n\tsetTimeout(done, 1000);\n});\n```\n\nExpected result: The spec should fail with a single \"Unhandled promise\nrejection: Error: nope\" error.\n\nObserved:\n* If the project was set up zoneless, the spec fails with two copies of the expected error.\n* Otherwise, the spec passes.\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://github.com/sgravrock/ng-unhandled-rejection\n\n### Please provide the exception or error you saw\n\n```true\n\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\n_ _ ____ _ ___\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | |\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\n /_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\n |___/\n \n\nAngular CLI: 20.1.5\nNode: 20.19.0\nPackage Manager: npm 10.8.2\nOS: darwin arm64\n\nAngular: 20.1.6\n... common, compiler, compiler-cli, core, forms\n... platform-browser, router\n\nPackage Version\n------------------------------------------------------\n@angular-devkit/architect 0.2001.5\n@angular-devkit/core 20.1.5\n@angular-devkit/schematics 20.1.5\n@angular/build 20.1.5\n@angular/cli 20.1.5\n@schematics/angular 20.1.5\nrxjs 7.8.2\ntypescript 5.8.3\nzone.js 0.15.1\n```\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/sgravrock","@type":"Person","name":"sgravrock"},"datePublished":"2025-08-09T17:20:37Z","url":"https://github.com/angular/angular-cli/issues/30861"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ebc35d9f-6311-b82c-cdf1-61dc9a401244 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E716:2454CC:34F4DCF:4333BF2:6B01E2CD |
| html-safe-nonce | 3021d5d3534f8f2c54a2810122f60b302636b8b17de1011560ad5fc711d04b54 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzE2OjI0NTRDQzozNEY0RENGOjQzMzNCRjI6NkIwMUUyQ0QiLCJ2aXNpdG9yX2lkIjoiODA5NTIyMjE0NDQ2OTk1MTE4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 89fe3717cc628c2f4ae493d60705a0f821ac1e89888251d59f64efb7e714d9ee |
| hovercard-subject-tag | issue:3308243946 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/30861/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b7618016194c936aa4706fc4062686501ac7eccd1ca042d5cc857992e603f363/angular/angular-cli/issues/30861 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b7618016194c936aa4706fc4062686501ac7eccd1ca042d5cc857992e603f363/angular/angular-cli/issues/30861 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? Don't known / other Is this a regression? Yes Description In an Angular project that uses zone.js, unhandled promise rejections are not report... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sgravrock |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width