I've included jasmine in an angular project and I'm trying to hook up a spec file to a file that has my angular controllers (so I can do unit tests). The problem is that I'm not entirely sure how to wire this up.
This is what the folder hierarchy for my project looks like:
project_folder/index.html
project_folder/js/controllers.js
project_folder/lib/jasmine/jasmine-standalone-2.3.4/spec/challengeSpec.js
Currently I want the tests for the controllers.js file (with the Angular code) to be in the challengeSpec.js file. How can I bring in the modules from the controllers.js file and use them in my tests? This is what some of the code from each of the files looks like:
controllers.js file:
var siteControllers = angular.module('siteControllers', []);
fibonacciControllers.controller('pageController', ['$scope','$http', function ($scope, $http) {
...
});
challengeSpec.js file:
describe('siteControllers', function() {
beforeEach(module('siteControllers'));
});
I know in the challengeSpec.js file I need to bring in the modules from the controllers.js file, but I'm not sure how this can be done. I've been doing some research that suggests I use Karma, but I'm not quite sure how this fits into the equation here. Thanks in advance.