All Questions
Tagged with angular-controller unit-testing
7 questions
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 ...
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 ...
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(){
...
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) { ...
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 ...
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 ...
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 ...