May 2018
Intermediate to advanced
512 pages
11h 3m
English
We need to implement an AuthServiceFake so that our unit tests pass and use a pattern similar to commonTestingModules mentioned in Chapter 7, Create a Router-First Line-of-Business App, to conveniently provider this fake across our spec files.
To ensure that our fake will have the same public functions and properties as the actual AuthService, let's first start with creating an interface:
src/app/auth/auth.service.tsexport interface IAuthService { authStatus: BehaviorSubject<IAuthStatus> login(email: string, password: string): Observable<IAuthStatus> logout() getToken(): string}
Read now
Unlock full access