René's URL Explorer Experiment


Title: "Navigation triggered outside Angular zone" warning in unit tests · Issue #25837 · angular/angular · GitHub

Open Graph Title: "Navigation triggered outside Angular zone" warning in unit tests · Issue #25837 · angular/angular

X Title: "Navigation triggered outside Angular zone" warning in unit tests · Issue #25837 · angular/angular

Description: I'm submitting a... [x] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submi...

Open Graph Description: I'm submitting a... [x] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ...

X Description: I'm submitting a... [x] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or reques...

Opengraph URL: https://github.com/angular/angular/issues/25837

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Navigation triggered outside Angular zone\" warning in unit tests","articleBody":"## I'm submitting a...\r\n\u003c!-- Check one of the following options with \"x\" -->\r\n\u003cpre>\u003ccode>\r\n[x] Regression (a behavior that used to work and stopped working in a new release)\r\n[ ] Bug report  \u003c!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Performance issue\r\n[ ] Feature request\r\n[ ] Documentation issue or request\r\n[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n[ ] Other... Please describe:\r\n\u003c/code>\u003c/pre>\r\n\r\n## Current behavior\r\n\r\nUsing the last Angular `6.1.7` which introduced a warning if a navigation is triggered outside a zone (see https://github.com/angular/angular/commit/010e35d99596e1b35808aaaeecfc32f3b247a7d8),\r\na simple unit test calling `router.navigate` yields the warning (resulting in hundreds of warnings in the console).\r\n\r\n\r\n## Expected behavior\r\n\r\nThe warning should not be emitted in unit tests.\r\nIt's currently possible to remove it by using `zone.run` or using `NoopNgZone`, but this is cumbersome. A way to disable it in unit tests would be great.\r\n\r\n\r\n## Minimal reproduction of the problem with instructions\r\n\r\nBuild a minimal app with the CLI\r\n\r\n```\r\nng new router-warning --routing\r\n```\r\n\r\nThen replace the default unit test with:\r\n\r\n```typescript\r\nimport { TestBed, async } from '@angular/core/testing';\r\nimport { RouterTestingModule } from '@angular/router/testing';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { AppComponent } from './app.component';\r\n\r\ndescribe('AppComponent', () => {\r\n  beforeEach(async(() => {\r\n    TestBed.configureTestingModule({\r\n      imports: [\r\n        RouterTestingModule\r\n      ],\r\n      declarations: [\r\n        AppComponent\r\n      ],\r\n    }).compileComponents();\r\n  }));\r\n\r\n  it('should create the app', async(() => {\r\n    const router = TestBed.get(Router) as Router;\r\n    router.navigateByUrl('/');\r\n    const fixture = TestBed.createComponent(AppComponent);\r\n    const app = fixture.debugElement.componentInstance;\r\n    expect(app).toBeTruthy();\r\n  }));\r\n});\r\n```\r\n\r\nRun `ng test`, and the following warning should appear:\r\n\r\n```\r\nWARN: 'Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?'\r\n```\r\n\r\n## Environment\r\n\r\n\u003cpre>\u003ccode>\r\nAngular version: 6.1.7 or 7.0.0-beta.5\r\n\r\nBrowser:\r\n- [x] Chrome (desktop) version XX\r\n- [ ] Chrome (Android) version XX\r\n- [ ] Chrome (iOS) version XX\r\n- [ ] Firefox version XX\r\n- [ ] Safari (desktop) version XX\r\n- [ ] Safari (iOS) version XX\r\n- [ ] IE version XX\r\n- [ ] Edge version XX\r\n \r\nFor Tooling issues:\r\n- Node version: 8.11.3\r\n- Platform:  Mac\r\n\r\n\u003c/code>\u003c/pre>\r\n\r\ncc @trotyl ","author":{"url":"https://github.com/cexbrayat","@type":"Person","name":"cexbrayat"},"datePublished":"2018-09-06T07:33:12Z","url":"https://github.com/angular/angular/issues/25837"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0c57164a-533c-d003-719c-4ed4ddfd04bf
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9388:3C21B:183DEF5:1F02D92:6B0130B7
html-safe-nonceb08db7705f6a0847d3b1eb97b67c02a1bb2b9968ff6815ba22f9c41cc2edbf5b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Mzg4OjNDMjFCOjE4M0RFRjU6MUYwMkQ5Mjo2QjAxMzBCNyIsInZpc2l0b3JfaWQiOiI3OTQxMDE3NjgzMDc4NzU0NDg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacc69ca5416987eda3f4d7afc77b35783044c1221085e3326f1ae1fa889e87878f
hovercard-subject-tagissue:357530468
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/25837/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c9c88b628b4f5c044bd35125eae79a4e75a18d2f9acdb22722303332f5a0acd6/angular/angular/issues/25837
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c9c88b628b4f5c044bd35125eae79a4e75a18d2f9acdb22722303332f5a0acd6/angular/angular/issues/25837
og:image:altI'm submitting a... [x] Regression (a behavior that used to work and stopped working in a new release) [ ] Bug report [ ] Performance issue [ ] Feature request [ ] Documentation issue or request [ ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecexbrayat
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/25837#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F25837
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F25837
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/25837
Reloadhttps://github.com/angular/angular/issues/25837
Reloadhttps://github.com/angular/angular/issues/25837
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/25837
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/25837
"Navigation triggered outside Angular zone" warning in unit testshttps://github.com/angular/angular/issues/25837#top
https://github.com/JiaLiPassion
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
area: testingIssues related to Angular testing features, such as TestBedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20testing%22
area: zonesIssues related to zone.jshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20zones%22
freq3: highhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
state: confirmedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20confirmed%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/cexbrayat
cexbrayathttps://github.com/cexbrayat
on Sep 6, 2018https://github.com/angular/angular/issues/25837#issue-357530468
010e35dhttps://github.com/angular/angular/commit/010e35d99596e1b35808aaaeecfc32f3b247a7d8
@trotylhttps://github.com/trotyl
Nexthttps://github.com/angular/angular/issues/25837?timeline_page=1
https://github.com/trotyl
trotylhttps://github.com/trotyl
on Sep 6, 2018https://github.com/angular/angular/issues/25837#issuecomment-418997998
#24181https://github.com/angular/angular/issues/24181
#24185https://github.com/angular/angular/pull/24185
@JiaLiPassionhttps://github.com/JiaLiPassion
trotylhttps://github.com/trotyl
on Sep 6, 2018https://github.com/angular/angular/issues/25837#event-1829818264
fix(router): better ngZone checking for warninghttps://github.com/trotyl/angular/commit/c56e5a7eed322a1dd6c41a3ea6831bd3df28cde1
https://docs.github.com/articles/closing-issues-via-commit-messages
c56e5a7https://github.com/trotyl/angular/commit/c56e5a7eed322a1dd6c41a3ea6831bd3df28cde1
IgorMinarhttps://github.com/IgorMinar
area: testingIssues related to Angular testing features, such as TestBedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20testing%22
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
area: zonesIssues related to zone.jshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20zones%22
on Sep 6, 2018https://github.com/angular/angular/issues/25837#event-1831589320
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Sep 6, 2018https://github.com/angular/angular/issues/25837#event-1831589395
https://github.com/vasiliy0s
vasiliy0shttps://github.com/vasiliy0s
on Sep 7, 2018https://github.com/angular/angular/issues/25837#issuecomment-419455345
https://github.com/JiaLiPassion
JiaLiPassionhttps://github.com/JiaLiPassion
on Sep 16, 2018https://github.com/angular/angular/issues/25837#issuecomment-421848932
@trotylhttps://github.com/trotyl
https://github.com/webben-de
webben-dehttps://github.com/webben-de
on Sep 28, 2018https://github.com/angular/angular/issues/25837#issuecomment-425359166
https://github.com/iotshaman
iotshamanhttps://github.com/iotshaman
on Oct 3, 2018https://github.com/angular/angular/issues/25837#issuecomment-426777524
https://github.com/orjandesmet
orjandesmethttps://github.com/orjandesmet
on Oct 9, 2018https://github.com/angular/angular/issues/25837#issuecomment-428177961
https://github.com/dhhyi
dhhyihttps://github.com/dhhyi
on Oct 20, 2018https://github.com/angular/angular/issues/25837#issuecomment-431556407
https://github.com/samuelt1
samuelt1https://github.com/samuelt1
on Oct 29, 2018https://github.com/angular/angular/issues/25837#issuecomment-434028457
https://github.com/ItzhakBokris
ItzhakBokrishttps://github.com/ItzhakBokris
on Oct 29, 2018https://github.com/angular/angular/issues/25837#issuecomment-434049467
https://github.com/CharlyRipp
CharlyRipphttps://github.com/CharlyRipp
on Oct 30, 2018https://github.com/angular/angular/issues/25837#issuecomment-434355538
scottophersonhttps://github.com/scottopherson
on Oct 4, 2019https://github.com/angular/angular/issues/25837#event-2686494449
Reduce unit test noisehttps://github.com/chef/automate/commit/2fd465e00f05d5cff70db898b0482b886e50510f
2fd465ehttps://github.com/chef/automate/commit/2fd465e00f05d5cff70db898b0482b886e50510f
msorenshttps://github.com/msorens
on Oct 7, 2019https://github.com/angular/angular/issues/25837#event-2693173164
[automate-1640] Automate-ui version bump from Angular 6 -> Angu… (#1707)https://github.com/chef/automate/commit/6b3840d29126d224a816ac118666193cfb3fb131
#1707https://github.com/chef/automate/pull/1707
6b3840dhttps://github.com/chef/automate/commit/6b3840d29126d224a816ac118666193cfb3fb131
https://github.com/alainkaiser
alainkaiserhttps://github.com/alainkaiser
on Jan 27, 2020https://github.com/angular/angular/issues/25837#issuecomment-578857145
https://github.com/kygoh
kygohhttps://github.com/kygoh
on Feb 22, 2020https://github.com/angular/angular/issues/25837#issuecomment-589955580
https://github.com/whimzyLive
whimzyLivehttps://github.com/whimzyLive
on Mar 14, 2020https://github.com/angular/angular/issues/25837#issuecomment-599066287
@fpellandahttps://github.com/fpellanda
JiaLiPassionhttps://github.com/JiaLiPassion
triage #1https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22triage%20%231%22
state: confirmedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20confirmed%22
on May 28, 2020https://github.com/angular/angular/issues/25837#event-3382914530
JiaLiPassionhttps://github.com/JiaLiPassion
on May 28, 2020https://github.com/angular/angular/issues/25837#event-3382915026
jelbournhttps://github.com/jelbourn
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
severity2: inconvenienthttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22severity2%3A%20inconvenient%22
on Oct 1, 2020https://github.com/angular/angular/issues/25837#event-3830208304
atscotthttps://github.com/atscott
on Dec 29, 2020https://github.com/angular/angular/issues/25837#event-4155349495
fix(router): better ngZone checking for warninghttps://github.com/trotyl/angular/commit/7ab7aa74d632a455ad969e3843abf3c8f2510791
https://docs.github.com/articles/closing-issues-via-commit-messages
7ab7aa7https://github.com/trotyl/angular/commit/7ab7aa74d632a455ad969e3843abf3c8f2510791
atscotthttps://github.com/atscott
on Jan 11, 2021https://github.com/angular/angular/issues/25837#event-4192281559
fix(router): better ngZone checking for warning (#25839)https://github.com/angular/angular/commit/adf42daed6f37ecbd9b2ec911f34ccd96b626ad9
#25839https://github.com/angular/angular/pull/25839
https://docs.github.com/articles/closing-issues-via-commit-messages
adf42dahttps://github.com/angular/angular/commit/adf42daed6f37ecbd9b2ec911f34ccd96b626ad9
atscotthttps://github.com/atscott
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
7695468https://github.com/angular/angular/commit/76954688b18f1509d4c9cca41b8e113ee423d4db
on Jan 11, 2021https://github.com/angular/angular/issues/25837#event-4192281693
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Feb 11, 2021https://github.com/angular/angular/issues/25837#issuecomment-777624560
automatic conversation locking policyhttps://github.com/angular/angular/blob/8f24bc9443b3872fe095d9f7f77b308a361a13b4/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Feb 11, 2021https://github.com/angular/angular/issues/25837#event-4320813206
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/25837
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/25837
JiaLiPassionhttps://github.com/JiaLiPassion
P4A relatively minor issue that is not relevant to core functionshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P4%22
area: routerhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20router%22
area: testingIssues related to Angular testing features, such as TestBedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20testing%22
area: zonesIssues related to zone.jshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20zones%22
freq3: highhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
state: confirmedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20confirmed%22
type: bug/fixhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.