79264745

Date: 2024-12-09 11:14:01
Score: 1
Natty:
Report link

It's now documented here: https://www.angulararchitects.io/en/blog/testing-angular-standalone-components/

You can replace the standalone component with overrideComponent directly like this:

await TestBed.configureTestingModule({
  imports: [ AskComponent, HttpClientTestingModule]
})
  .overrideComponent(EditComponent, {
        remove: { imports: [EditComponent] },
        add: { imports: [EditStubComponent] },
  })
  .compileComponents();
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: b.fiss