I have an angularJs controller
angular.module('App.ctrl.guests', []) .controller('guestsController', ['$scope', '$http', '$location', '$timeout', 'guestsService', function ($scope, $http, $location, $timeout, guestsService) { $scope.tiles = []; }])
and jasmine test
/// <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([]); }); })
and every time I run Visual Studio chutzpah, I get:
ReferenceError: cannot find variable: module in File: ///.../JasmineTests/guestsControllerTest.js (line 5)
ReferenceError: cannot find the variable: insert file: ///.../JasmineTests/guestsControllerTest.js (line 12)
Is thera a problem with link angular.js and jasmine, don't know what are modules / keyword injections? This is my first time testing js: /
javascript angularjs visual-studio-2012 jasmine chutzpah
netmajor
source share