Skip to main content
Shape the future of the Stack Exchange API - get early access to what’s new!

All Questions

Filter by
Sorted by
Tagged with
1 vote
0 answers
119 views

error while unit testing angular controller

Can someone help me solve this. Tried to create a single page app using angular in front end and node in the back end. Tried to install karma and jasmine and wrote a simple test spec to check the ...
janavvi's user avatar
  • 19
1 vote
0 answers
497 views

How to test a $uibModal instance controller?

I'm trying to test a certain controller functionality with Jasmine unit testing. I have a function which opens a modal instance with a new controller: function openFilterModal(data) { var ...
lior1990's user avatar
0 votes
2 answers
498 views

How to test self. angularjs controller functions in jasmine

I have the below code inside my controller Controller: self.DoSomething = function () { self.x="hai"; self.y = function (id, data) { self.x="hello"; } } $scope.Call=function(){ ...
aditya's user avatar
  • 595
0 votes
3 answers
2k views

testing .success and .error of service in controller jasmine

I have a call to service's function in a controller. Below is the code Service (function () { 'use strict'; angular.module('MyApp') .service('MyService', ['$http', function ($http) { ...
aditya's user avatar
  • 595
0 votes
1 answer
186 views

Angular 1.* unable to access controller in karma unit test (webpack)

I'm trying to set up a unit test in karma to test an angular 1.* controller. Each time I run the code I get [ng:areq] Argument 'MoviesListCtrl' is not a function, got undefined When I have checked ...
Dave Richan's user avatar
1 vote
2 answers
42 views

Proper way to write code for Angular to allow unit testing

I'm struggling to understand how should I write the methods for the Angular.js controllers to allow the unit testing to be done. All the tutorials on the Internet are simple and don't show how it is ...
Hamabama's user avatar
  • 253
3 votes
0 answers
42 views

Angular - Unit Testing Controllers

I have written some unit tests for a simple controller that has a service that makes a http request, both unit tests are working but I am not sure which is the most appropriate or if I would want to ...
berimbolo's user avatar
  • 3,899