Angular2, testing and resolved data: How to test ngOnInit?
What is the behavior or the ngOnInit method? All it does is assign the value of the org when the route data is resolved. So that’s all you really need to test. let routeStub; beforeEach(() => { routeStub = { data: null } TestBed.configureTestingModule({ providers: [ { provide: ActivatedRoute, useValue: routeStub } ] }) }) … Read more