Fake service class

We can create a fake CityService, which just returns whatever we want for our test. Once done, we can import it in the .spec.ts class and add it to the TestBed's providers list so that it will be called by our Component just like the real one.

Get ASP.NET Core 3 and Angular 9 - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.