I note your comment about whether the dependencies have been included in the test harness.
I am using gulp and from what i can tell all the required files have been loaded into specs.html - routerHelperProvider and routerHelper.
There are other tests that rely on these being there.
The only thing i can think is that I am doing something differetly with the test for this specific module:-
/* jshint -W117, -W030 */
describe('UploadController', function() {
var controller;
beforeEach(function() {
bard.appModule('app.upload');
bard.inject('$controller', '$log', '$rootScope');
});
beforeEach(function () {
controller = $controller('UploadController');
$rootScope.$apply();
});
bard.verifyNoOutstandingHttpRequests();
describe('Upload controller', function() {
it('should be created successfully', function () {
expect(controller).to.be.defined;
});
describe('after activate', function() {
it('should have title of Upload', function() {
expect(controller.title).to.equal('Upload');
});
it('should have logged "Activated"', function() {
expect($log.info.logs).to.match(/Activated/);
});
});
});
});
If i understand correctly i dont need to pass dependencies to the module being tested within the spec - as they are instantiated by the module. Only dependencies to be passed are ones used in the spec.
I have a similar issue to "cannot test my routes using bardjs #14'
PhantomJS 1.9.8 (Mac OS X 0.0.0) UploadController "before each" hook for "should be created successfully" FAILED Error: [$injector:unpr] Unknown provider: routerHelperProvider <- routerHelper http://errors.angularjs.org/1.4.7/$injector/unpr?p0=routerHelperProvider%20%3C-%20routerHelper
I note your comment about whether the dependencies have been included in the test harness. I am using gulp and from what i can tell all the required files have been loaded into specs.html - routerHelperProvider and routerHelper. There are other tests that rely on these being there.
The only thing i can think is that I am doing something differetly with the test for this specific module:-
Controller looks like:-
(function () { 'use strict';
})();
Spec looks like:-
/* jshint -W117, -W030 */ describe('UploadController', function() { var controller;
});
If i understand correctly i dont need to pass dependencies to the module being tested within the spec - as they are instantiated by the module. Only dependencies to be passed are ones used in the spec.
Appreciate any thoughts you may have.