I am attempting to run some Jasmine unit tests for a Backbone view, mocking out dependencies in Squire.
The dependencies of my view are a Baseview
, an ICanHaz template and an i18n translation.
I mock out the dependencies after defining Squire and Backbone, and then use a Squire injector to require my view. However, when I run the tests through Grunt, I get the warning message:
Warning: No specs executed, is there a configuration error? Use --force to continue.
Here is my spec:
define(['squire', 'backbone'], function (Squire, Backbone) {
var injector = new Squire();
mocks = {
'views/baseview': function () {
return Backbone.View.extend({
grabTemplate: function (options) { }
});
},
'text!templates/menu.htm': '',
'i18n!nls/menu': {}
};
injector.mock(mocks);
injector.require(['menu'], function (Menu) {
describe('Menu View', function () {
it('should be initialisable', function () {
var menu = new Menu();
expect(menu).toBeDefined();
});
});
});
});
Does anyone know why my basic unit test is not getting picked up?