Top "Angular2-testing" questions

What is TestBed in Jasmine

I am new to Jasmine with Angular 2, I am frequently working with the TestBed object when writting a Testcase and …

angular jasmine karma-jasmine angular2-testing
How do I check if my element has been focused in a unit test in angular 4?

I have following function to unit test. I have taken element which is text box with view child in component …

angular angular2-testing
How to test if my method throws an observable error in angular2?

I am creating unit-testcases for my angular2 components. so far test cases are running correctly. but I am facing issues …

javascript angular jasmine angular2-testing
Test pipe with dependencies on services

I have a pipe that sanatises HTML as below: import { Pipe, PipeTransform } from '@angular/core'; import { DomSanitizer } from '@…

angular typescript dependency-injection angular2-testing angular-test
Cannot read property 'injector' of null jasmine angular 2

I'm getting this error when running a jasmine spec in angular 2: Cannot read property 'injector' of null jasmine angular 2 stack …

angular jasmine angular2-testing
Angular 2 - test for change in route params

I have a component in angular 2 which responds to changes in the route parameters (the component doesn't reload from scratch …

angular jasmine angular2-routing angular2-testing angular2-observables
Cannot read property unsubscribe of undefined: Angular2 testing

I am trying to test a component which has ngOnDestroy() method which has all the unsubscribe() method calls. But, while …

angular angular2-testing
NG2 RC5: HTTP_PROVIDERS is deprecated

So, in version RC5 of Angular2, they deprecated the HTTP_PROVIDERS and introduced the HttpModule. For my application code, this …

angular angular2-testing
Angular2 - Unit testing Observable error "Cannot read property 'subscribe' of undefined"

I have a service function which is returning Observable and I am consuming that service inside one of my components. …

angular angular2-testing
How to fix beforeEachProviders (deprecated on RC4)

Ive just upgraded Angular2 from RC3 to RC4 ... import { expect, it, iit, xit, describe, ddescribe, xdescribe, beforeEach, beforeEachProviders, withProviders, async, …

unit-testing angular jasmine angular2-testing