【发布时间】:2012-08-11 01:18:48
【问题描述】:
我正在尝试测试主干应用程序。
当我需要测试一个简单的主干视图时,我没有问题。
如果我需要测试使用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);
});
});
});
【问题讨论】:
-
你用的是什么版本的木偶?
-
嗨@DerickBailey。我正在使用
Backbone.Marionette v0.9.1。
标签: javascript backbone.js jasmine handlebars.js marionette