I just installed Chutzpah to run Jasmine based unit tests for Javascript. I'm new to Jasmine as well as Chutzpah and angular. I have created a test file for an angular filter. The test file is called filters.spec.js and cointains the following code
/// <reference path="c:\users\octaviane.cvuintelligence\documents\visual studio 2013\Projects\PersonalTrainer\PersonalTrainer\Scripts/jasmine.js" />
/// <reference path="c:\users\octaviane.cvuintelligence\documents\visual studio 2013\Projects\PersonalTrainer\PersonalTrainer\Scripts/angular.js" />
/// <reference path="../app.js" />
describe("Filters", function () {
beforeEach(function () { module('7minWorkout') });
describe("secondsToTime filter", function () {
it('should convert integer to time format',
inject(function ($filter) {
expect($filter("secondsToTime")(5)).toBe("00:00:05");
expect($filter("secondsToTime")(65)).toBe("00:01:05");
expect($filter("secondsToTime")(3610))
.toBe("01:00:10");
}));
});
});
As you can see I referenced angular.js, jasmine.js and the js file where the 7minWorkout module is created. I'm brand new to this, so please don't get mad with me. While running this test file (right-click the file contents in Visual Studio - Run JS Tests), I get the following errors: Can't find variable: module and Can't find variable: inject. Please help me out. Thanks.