tests: Add render.init() to node tests.

This makes sure we are explicit about partials in
individual test modules.  Eventually, we should figure
out a way to make partials automatically compile as
part of the node tests.
This commit is contained in:
Steve Howell 2016-08-24 18:58:13 -07:00 committed by Tim Abbott
parent 8e38503d8c
commit 4dbeb66a4c
3 changed files with 7 additions and 0 deletions

View File

@ -641,6 +641,8 @@ function render(template_name, args) {
}());
(function stream_sidebar_row() {
global.use_template('stream_privacy'); // partial
var args = {
name: "devel",
color: "red",

View File

@ -39,6 +39,7 @@ files.forEach(function (file) {
global.patch_builtin('setInterval', noop);
console.info('running tests for ' + file.name);
render.init();
require(file.full_name);
namespace.restore();
});

View File

@ -10,6 +10,10 @@ function template_dir() {
return __dirname + '/../../static/templates/';
}
exports.init = function () {
Handlebars.templates = {};
};
exports.make_sure_all_templates_have_been_compiled = function () {
var dir = template_dir();
var fns = fs.readdirSync(dir).filter(function (fn) {