我正在尝试测试主干应用程序。
当我需要测试一个简单的backbone.view 时,我没有问题。
如果我需要测试使用Backbone.Marionette
(ItemView 或 CompositeView)制作的主干视图,Handlebars template
我会收到以下消息:
NoTemplateError: Could not find template:
function(context, options) {
if (!compiled) {
compiled = compile();
}
return compiled.call(this, context, options);
};
关于的代码function(context, options)
来自handlebars-1.0.0.beta.6.js
.
知道如何修复代码吗?
这是我正在执行的测试:
describe("AppViewMarionette", function() {
beforeEach(function(){
this.view = new AppViewMarionette();
});
describe("Rendering", function () {
it("returns the view object", function () {
expect(this.view.render()).toEqual(this.view);
});
});
});