I am working with an AngularJS controller
angular.module('App.ctrl.guests', [])
.controller('guestsController', ['$scope', '$http', '$location', '$timeout', 'guestsService', function ($scope, $http, $location, $timeout, guestsService) {
$scope.tiles = [];
}])
and I have a jasmine test set up as well
/// <reference path="~/Scripts/angular.js" />
/// <reference path="../../ProjectWeb/Scripts/app/guests/guestsCtrl.js" />
/// <reference path="~/Scripts/angular-mocks.js" />
/// <reference path="~/Scripts/jasmine.js" />
'use strict';
describe('App.ctrl.guests', function () {
var scope, controller;
beforeEach(function () {
module('App.ctrl.guests')
});
beforeEach(inject(function ($rootScope, $controller) {
scope = $rootScope.$new();
controller = $controller('guestsController', {
$scope: scope
});
}));
it('should have empty array', function () {
expect(scope.tiles).toBe([]);
});
})
However, whenever I run the tests in Visual Studio using Chutzpah, I encounter the following errors:
ReferenceError: Can't find variable: module in file:///.../JasmineTests/guestsControllerTest.js (line 5)
ReferenceError: Can't find variable: inject in file:///.../JasmineTests/guestsControllerTest.js (line 12)
Could it be that there is an issue with referencing angular.js and jasmine not recognizing the `module` and `inject` keywords? This is my first time delving into JavaScript testing :/