Refactor qunit unit tests
Allows for testing node, browser, and precompiled modes in the node tests. Also reorganizes the qunit spec file to provide better organization.
This commit is contained in:
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
require('./common');
|
||||
|
||||
global.Handlebars = require('../../dist/handlebars.runtime');
|
||||
|
||||
var compiler = require('../../lib/handlebars');
|
||||
|
||||
global.CompilerContext = {
|
||||
compile: function(template, options) {
|
||||
var templateSpec = compiler.precompile(template, options);
|
||||
return Handlebars.template(eval('(' + templateSpec + ')'));
|
||||
},
|
||||
compileWithPartial: function(template, options) {
|
||||
return compiler.compile(template, options);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user