Unit Testing + Jasmine + Angular



i am getting all the time "encountered a declaration exception". I am trying to write my first unit test for a factory. It seems like mocking doesn't really work.

The paths to do references look like this:

///<reference path="~/App/js/jasmine/jasmine.js"/>
///<reference path="~/App/js/lib/40_Angular/angular.js"/>
///<reference path="~/App/js/jasmine/angular-mocks.js"/>

///<reference path="~/App/app.js"/>
///<reference path="~/App/services/userService.js"/>

My sample tests look like this:

describe("userService", function () {


describe("userService", function () {

var userService;

beforeEach(inject(function () {
userService = $injector.get('userService');

it('should be true', function () {

it('should have a farbSchema', function () {


My app.js is declared like this:

iss.app = angular.module("issApp", ["ng", "ui.router" ...]);

userService.js is declared like this:

iss.app.factory("userService", function ($q, $http)

This are the version of the tools I use:

Resharper: 8.2.1

Angular: 1.5.8

Visual Studio: 2013

Jasmine: 2.4.1


What am i doing wrong? What means the status question sign (from the screenshot)?

Please sign in to leave a comment.