Top "Angular2-testing" questions

Angular unit test input value

I have been reading official Angular2 documentation for unit testing (https://angular.io/docs/ts/latest/guide/testing.html) but …

angular unit-testing angular2-testing
How to unit test a component that depends on parameters from ActivatedRoute?

I am unit testing a component that is used to edit an object. The object has an unique id that …

unit-testing angular angular2-routing angular2-testing
Testing error case with observables in services

Let's say I have a component that subscribes to a service function: export class Component { ... ngOnInit() { this.service.doStuff().subscribe( (…

angular typescript karma-coverage angular2-testing angular2-observables
Cannot read property 'subscribe' of undefined after running npm test (Angular 2 unit testing)

I've created a testing (spec) file for a component I'm testing. But when I run the test, it gives me …

angular angular2-testing
How to test Angular2's router.navigate?

I've run into missing <router-outlet> messages in other unit tests, but just to have a nice isolated example, …

unit-testing angular angular2-testing
Angular 2 unit testing components with routerLink

I am trying to test my component with angular 2 final, but I get an error because the component uses the …

angular typescript angular2-routing angular2-testing
angular2 testing: Can't bind to 'ngModel' since it isn't a known property of 'input'

I am trying to test angular2 two-way binding for control input. Here is the error: Can't bind to 'ngModel' since …

testing angular angular-cli angular2-testing
How to unit test a FormControl in Angular2

My method under test is the following: /** * Update properties when the applicant changes the payment term value. * @return {Mixed} - …

unit-testing angular jasmine angular2-forms angular2-testing
spyOn could not find an object to spy upon for start()

I am using angular-cli testing framework. inside my component , I have used 'ng2-slim-loading-bar' node module. submit(){ this._slimLoadingBarService.start(() =&…

javascript angular typescript jasmine angular2-testing
How to mock Pipe when testing Component

Currently I am overriding providers to use mocked services like this: beforeEach(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { tcb.overrideProviders(AddFieldToObjectDropdownComponent, [ …

unit-testing angular angular2-testing angular2-pipe