mirror of https://github.com/zulip/zulip.git
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:
parent
8e38503d8c
commit
4dbeb66a4c
|
@ -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",
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue