I'm facing an issue while trying to set up a basic unit test using angular-mocks.js in my project. Below is the code snippet that outlines my problem.
describe("peconfigApp", function () {
beforeEach(function() {
angular.mock.module('peconfigApp');
});
describe("Binaries Controller", function () {
it("should work", function () {
expect(true).toBe(true);
});
});
});
Error Message from Jasmine:
TypeError: Object #<Object> has no method 'module'
at null.<anonymous> (http://localhost:58141/Tests/js/controller-tests.js:4:22)
at jasmine.Block.execute (http://localhost:58141/Tests/lib/jasmine.js:1064:17)
To make sure that angular-mocks.js is being loaded before running the tests, I have inserted alerts in various sections of the code.
<script type="text/javascript" src="../lib/angular.min.js"></script>
<script type="text/javascript" src="../lib/angular-mocks.js"></script>
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script type="text/javascript" src="../js/controllers.js"></script>
<script type="text/javascript" src="js/controller-tests.js"></script>