René's URL Explorer Experiment


Title: Regression TestBed.overrideComponent in Angular 17 · Issue #52817 · angular/angular · GitHub

Open Graph Title: Regression TestBed.overrideComponent in Angular 17 · Issue #52817 · angular/angular

X Title: Regression TestBed.overrideComponent in Angular 17 · Issue #52817 · angular/angular

Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description TestBed.overrideComponent doesn't override standalone components if the components have been used in other tests before. Might be related t...

Open Graph Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description TestBed.overrideComponent doesn't override standalone components if the components have been used i...

X Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description TestBed.overrideComponent doesn't override standalone components if the components have been us...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression TestBed.overrideComponent in Angular 17","articleBody":"### Which @angular/* package(s) are the source of the bug?\r\n\r\ncore\r\n\r\n### Is this a regression?\r\n\r\nYes\r\n\r\n### Description\r\n\r\n`TestBed.overrideComponent` doesn't override standalone components if the components have been used in other tests before. Might be related to https://github.com/angular/angular/issues/48432.\r\n\r\nTo reproduce, run the next test in any Angular 17 project.\r\nIt looks like there is a race, something isn't awaited properly.\r\nThe first test is skipped with `x`, remove `x` to reproduce the issue.\r\nIf you've got success, simply add `x` back and remove it again.\r\nIn this case, you can see that the 2nd test fails time to time because `overrideComponent` wasn't applied.\r\n\r\n```ts\r\nimport { TestBed } from '@angular/core/testing';\r\nimport { Component } from '@angular/core';\r\nimport { RouterOutlet } from '@angular/router';\r\n\r\n@Component({\r\n  selector: '\u003crouter-outlet>\u003c/router-outlet>',\r\n  standalone: true,\r\n  template: 'mock',\r\n})\r\nexport class MockRouterOutlet {}\r\n\r\n@Component({\r\n  selector: 'app-root',\r\n  standalone: true,\r\n  imports: [RouterOutlet],\r\n  template: '\u003crouter-outlet>\u003c/router-outlet>',\r\n})\r\nexport class AppComponent {\r\n  title = 'a17';\r\n}\r\n\r\ndescribe('AppComponent with real router', () => {\r\n  beforeEach(async () => {\r\n    await TestBed.configureTestingModule({\r\n      imports: [AppComponent],\r\n    }).compileComponents();\r\n  });\r\n\r\n  // REMOVE \"x\" TO REPRODUCE THE ISSUE\r\n  xit('should create the app', () => {\r\n    const fixture = TestBed.createComponent(AppComponent);\r\n    expect(fixture.nativeElement.innerHTML).toEqual('\u003crouter-outlet>\u003c/router-outlet>\u003c!--container-->');\r\n  });\r\n});\r\n\r\ndescribe('AppComponent with mock router', () => {\r\n  beforeEach(async () => {\r\n    await TestBed.configureTestingModule({\r\n      imports: [AppComponent],\r\n    }).overrideComponent(AppComponent, {\r\n      set: {\r\n        imports: [MockRouterOutlet],\r\n      }\r\n    }).compileComponents();\r\n  });\r\n\r\n  it('should create the app', () => {\r\n    const fixture = TestBed.createComponent(AppComponent);\r\n    expect(fixture.nativeElement.innerHTML).toEqual('\u003crouter-outlet>mock\u003c/router-outlet>');\r\n  });\r\n});\r\n```\r\n\r\n### Please provide a link to a minimal reproduction of the bug\r\n\r\n_No response_\r\n\r\n### Please provide the exception or error you saw\r\n\r\n```true\r\nNo errors, `TestBed.overrideComponent` doesn't simply do anything.\r\n```\r\n\r\n\r\n### Please provide the environment you discovered this bug in (run `ng version`)\r\n\r\n```true\r\nngular CLI: 17.0.0\r\nNode: 20.9.0\r\nPackage Manager: npm 10.1.0\r\nOS: darwin x64\r\n\r\nAngular: 17.0.2\r\n... animations, common, compiler, compiler-cli, core, forms\r\n... platform-browser, platform-browser-dynamic, router\r\n\r\nPackage                         Version\r\n---------------------------------------------------------\r\n@angular-devkit/architect       0.1700.0\r\n@angular-devkit/build-angular   17.0.0\r\n@angular-devkit/core            17.0.0\r\n@angular-devkit/schematics      17.0.0\r\n@angular/cli                    17.0.0\r\n@schematics/angular             17.0.0\r\nrxjs                            7.8.1\r\ntypescript                      5.2.2\r\nzone.js                         0.14.2\r\n```\r\n\r\n\r\n### Anything else?\r\n\r\n_No response_","author":{"url":"https://github.com/satanTime","@type":"Person","name":"satanTime"},"datePublished":"2023-11-11T13:36:07Z","url":"https://github.com/angular/angular/issues/52817"}

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:cd2458a4-10b4-3b4b-a2b3-812b426ba5a1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9068:76F02:36A34A9:45E55AD:6B01E9A8
html-safe-nonce525558d8e841e34d85dd956e23d917db769ade0d779291223b417939ee8211ef
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDY4Ojc2RjAyOjM2QTM0QTk6NDVFNTVBRDo2QjAxRTlBOCIsInZpc2l0b3JfaWQiOiIxNjA5ODY0MjkyNDk5MzE5MjA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb9db8d5c0538eea1257ae88145154fb6d76fb38b6c5b76ca83057e81ab75e94a
hovercard-subject-tagissue:1988951642
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/52817/issue_layout
twitter:imagehttps://opengraph.githubassets.com/336c992a5bb951d79db87f3b9fd20d2db2dd1ab8e6a8a59795451bbb8dbaef06/angular/angular/issues/52817
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/336c992a5bb951d79db87f3b9fd20d2db2dd1ab8e6a8a59795451bbb8dbaef06/angular/angular/issues/52817
og:image:altWhich @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description TestBed.overrideComponent doesn't override standalone components if the components have been used i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesatanTime
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/52817#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F52817
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%2F52817
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/52817
Reloadhttps://github.com/angular/angular/issues/52817
Reloadhttps://github.com/angular/angular/issues/52817
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests143 (143)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/52817
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/52817
Regression TestBed.overrideComponent in Angular 17https://github.com/angular/angular/issues/52817#top
https://github.com/AndrewKushnir
P2The issue is important to a large percentage of users, with a workaroundhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P2%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
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/satanTime
satanTimehttps://github.com/satanTime
on Nov 11, 2023https://github.com/angular/angular/issues/52817#issue-1988951642
#48432https://github.com/angular/angular/issues/48432
Nexthttps://github.com/angular/angular/issues/52817?timeline_page=1
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
area: testingIssues related to Angular testing features, such as TestBedhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20testing%22
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
on Nov 13, 2023https://github.com/angular/angular/issues/52817#event-10941635516
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Nov 13, 2023https://github.com/angular/angular/issues/52817#event-10941635831
AndrewKushnirhttps://github.com/AndrewKushnir
on Nov 13, 2023https://github.com/angular/angular/issues/52817#event-10944424283
AndrewKushnirhttps://github.com/AndrewKushnir
P2The issue is important to a large percentage of users, with a workaroundhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P2%22
on Nov 14, 2023https://github.com/angular/angular/issues/52817#event-10950307506
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
Backloghttps://github.com/angular/angular/milestone/82
on Nov 14, 2023https://github.com/angular/angular/issues/52817#event-10950307647
AndrewKushnirhttps://github.com/AndrewKushnir
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
on Nov 14, 2023https://github.com/angular/angular/issues/52817#event-10950307756
https://github.com/PieterjanDeClippel
PieterjanDeClippelhttps://github.com/PieterjanDeClippel
on Nov 14, 2023https://github.com/angular/angular/issues/52817#issuecomment-1809627610
https://github.com/BarlamEPS
BarlamEPShttps://github.com/BarlamEPS
on Nov 14, 2023https://github.com/angular/angular/issues/52817#issuecomment-1810218759
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Nov 14, 2023https://github.com/angular/angular/issues/52817#issuecomment-1810690706
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Nov 14, 2023https://github.com/angular/angular/issues/52817#issuecomment-1811549099
#52916https://github.com/angular/angular/pull/52916
AndrewKushnirhttps://github.com/AndrewKushnir
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
on Nov 14, 2023https://github.com/angular/angular/issues/52817#event-10961170180
https://github.com/satanTime
satanTimehttps://github.com/satanTime
on Nov 15, 2023https://github.com/angular/angular/issues/52817#issuecomment-1812368666
#48432https://github.com/angular/angular/issues/48432
jessicajaniukhttps://github.com/jessicajaniuk
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
ee892eehttps://github.com/angular/angular/commit/ee892ee294b2fc5ab6186d8434ec5d79a66165e2
on Nov 15, 2023https://github.com/angular/angular/issues/52817#event-10967857891
jessicajaniukhttps://github.com/jessicajaniuk
on Nov 15, 2023https://github.com/angular/angular/issues/52817#event-10967858019
fix(core): reset cached scope for components that were overridden usi…https://github.com/angular/angular/commit/5de7575be83b9829e65ad245034ee7ab1d966044
https://docs.github.com/articles/closing-issues-via-commit-messages
5de7575https://github.com/angular/angular/commit/5de7575be83b9829e65ad245034ee7ab1d966044
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Nov 15, 2023https://github.com/angular/angular/issues/52817#issuecomment-1813151458
#48432https://github.com/angular/angular/issues/48432
@satanTimehttps://github.com/satanTime
#48432https://github.com/angular/angular/issues/48432
#52918https://github.com/angular/angular/pull/52918
#52918https://github.com/angular/angular/pull/52918
https://github.com/AndrewKushnir
AndrewKushnirhttps://github.com/AndrewKushnir
on Nov 15, 2023https://github.com/angular/angular/issues/52817#issuecomment-1813216050
https://github.com/satanTime
satanTimehttps://github.com/satanTime
on Nov 15, 2023https://github.com/angular/angular/issues/52817#issuecomment-1813239975
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Dec 16, 2023https://github.com/angular/angular/issues/52817#issuecomment-1858626899
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 Dec 16, 2023https://github.com/angular/angular/issues/52817#event-11264489606
ChellappanRajanhttps://github.com/ChellappanRajan
on Jan 23, 2024https://github.com/angular/angular/issues/52817#event-11564108056
fix(core): reset cached scope for components that were overridden usi…https://github.com/ChellappanRajan/angular/commit/ab22e2ac6dbf41f23eb6b96d8fc957526931c20e
https://docs.github.com/articles/closing-issues-via-commit-messages
ab22e2ahttps://github.com/ChellappanRajan/angular/commit/ab22e2ac6dbf41f23eb6b96d8fc957526931c20e
rlmestrehttps://github.com/rlmestre
on Jan 26, 2024https://github.com/angular/angular/issues/52817#event-11603833276
fix(core): reset cached scope for components that were overridden usi…https://github.com/rlmestre/angular/commit/ee892ee294b2fc5ab6186d8434ec5d79a66165e2
https://docs.github.com/articles/closing-issues-via-commit-messages
ee892eehttps://github.com/rlmestre/angular/commit/ee892ee294b2fc5ab6186d8434ec5d79a66165e2
fix(core): reset cached scope for components that were overridden usi…https://github.com/rlmestre/angular/commit/43f598488af6571e55b34e16962a9ed584cf819b
https://docs.github.com/articles/closing-issues-via-commit-messages
43f5984https://github.com/rlmestre/angular/commit/43f598488af6571e55b34e16962a9ed584cf819b
amilamenhttps://github.com/amilamen
on Jan 26, 2024https://github.com/angular/angular/issues/52817#event-11608192169
fix(core): reset cached scope for components that were overridden usi…https://github.com/amilamen/angular/commit/3ddca82fb7ffbab19ee49c455b0c5886859b2e7c
https://docs.github.com/articles/closing-issues-via-commit-messages
3ddca82https://github.com/amilamen/angular/commit/3ddca82fb7ffbab19ee49c455b0c5886859b2e7c
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/52817
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/52817
AndrewKushnirhttps://github.com/AndrewKushnir
P2The issue is important to a large percentage of users, with a workaroundhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22P2%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
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%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.