Declarations

The AppComponent should create the app test is failing. If you observe the error details, you'll see that AppComponent is failing to be created, because 'app-current-weather' is not a known element. Further, the error occurs if pointed out with a [ERROR ->] tag, and the last line spells things out for us, similar to the error originating from line 6 in AppComponent.html.

Include CurrentWeatherComponent in the declarations of app.component.spec.ts:

src/app/app.component.spec.ts...TestBed.configureTestingModule({  declarations: [AppComponent, CurrentWeatherComponent],}).compileComponents()...

Get Angular 6 for Enterprise-Ready Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.