Top "Karma-jasmine" questions

Karma-Jasmine is an adapter for the Jasmine testing framework,which is shipped with Karma by default.

Updating the version of Jasmine used in karma-jasmine

Questions How can I update the version of Jasmine used when running Jasmine via Karma using the karma-jasmine plugin? Will …

jasmine karma-runner karma-jasmine
expected a spy but got undefined?

Trying to get my head around jasmine spies, this is what my test looks like: $scope.switchTurns = function () { $scope.playerTurn = !$…

angularjs tdd jasmine karma-jasmine spy
How to mock an @Input() object in angular2?

I have looked on the angular2 website, as well as checked many SO posts and I could not find an …

angular karma-jasmine
Jasmine + AngularJS: How to test $rootScope.$broadcast being called with arguments?

I am trying to write a unit test that verifies that $rootScope.$broadcast('myApiPlay', { action : 'play' }); is called. Here is …

javascript angularjs jasmine karma-jasmine yeoman-generator-angular
how to return rejected/failure promise to through jasmine spy to an angular controller in a unit test

I am using jasmine for testing my angular controllers. I am catching errors and success in the .then(successCallback, errorCallback) …

javascript angularjs unit-testing angularjs-controller karma-jasmine
Angular2 how to unit test a custom validator directive?

I wrote a very simple custom validor for an input field: import { Directive } from '@angular/core'; import { AbstractControl, NG_…

unit-testing angular karma-jasmine angular2-forms angular2-testing
Unit testing with private service injected using jasmine angular2

I have a problem trying to unit test an angular service. I want to verify that this service is properly …

angular karma-jasmine angular-services injectable spyon
Angular / Karma: unknown provider

I am new to testing in Angular and finding difficult to understand how to do a simple test on my …

angularjs karma-jasmine
Karma --auto-watch no longer works

My Karma installation used to auto-watch - when I saved a .js file, it'd re-run the tests. It's been a …

javascript angularjs jasmine karma-runner karma-jasmine
Failed: Can't resolve all parameters for MatDialogRef: (?, ?, ?). unit testing Angular project

I am new to angular development and more new towards unit testing using jasmine. I have created a component to …

angular unit-testing jasmine angular-material karma-jasmine