Skip to content

Commit 0a4023d

Browse files
authored
fix(standalone-apis): import in test host component (#16)
1 parent b7f9c21 commit 0a4023d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docs/standalone-apis/testing-a-standalone-component-using-the-angular-testbed.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ No need to call `TestBed.configureTestingModule` before creating a component fix
2929

3030
## Creating a test host component for a standalone component
3131

32-
To interact with a standalone component through its component API, we add it to the Angular testing module's `imports` array:
32+
To interact with a standalone component through its component API, we add it to the test host component's `imports` array:
3333

3434
```ts
3535
import { Component } from "@angular/core";
@@ -40,6 +40,7 @@ import { DailyForecastComponent } from "./daily-forecast.component";
4040

4141
describe(DailyForecastComponent.name, () => {
4242
@Component({
43+
imports: [DailyForecastComponent],
4344
standalone: true,
4445
template: `<weather-daily-forecast [temperatureCelsius]="temperatureCelsius"></weather-daily-forecast>`,
4546
})
@@ -49,9 +50,6 @@ describe(DailyForecastComponent.name, () => {
4950
}
5051

5152
beforeEach(() => {
52-
TestBed.configureTestingModule({
53-
imports: [DailyForecastComponent],
54-
});
5553
hostFixture = TestBed.createComponent(TestHostComponent);
5654
hostFixture.autoDetectChanges();
5755
});

0 commit comments

Comments
 (0)