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:
kpdecker
2013-06-01 23:45:43 -05:00
parent d13ae310d3
commit adda0569e0
26 changed files with 1748 additions and 1906 deletions
+15
View File
@@ -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);
}
};