July 2018
Intermediate to advanced
420 pages
8h 46m
English
Open ./Client/src/app/pages/auth/_guards/auth.guard.spec.ts and replace the contents with the following code:
import { RouterTestingModule } from '@angular/router/testing'; import { TestBed, async, inject } from '@angular/core/testing'; import { HttpClient, HttpHandler } from '@angular/common/http'; import { Router } from '@angular/router'; // App imports import { AuthGuard } from './auth.guard'; import { AuthService } from '../_services/auth.service'; describe('AuthGuard Tests: ', () => { const router = { navigate: jasmine.createSpy('navigate') }; beforeEach(async(() => { TestBed.configureTestingModule({ imports: [ RouterTestingModule.withRoutes([ {path: 'bikes:id'} ]) ], providers: [AuthGuard, AuthService, HttpClient, ...Read now
Unlock full access