node tests: Avoid re-compiling templates.

This is a minor optimization to avoid re-compiling templates
that have already encountered.
This commit is contained in:
Steve Howell
2016-11-04 08:14:48 -07:00
committed by Tim Abbott
parent dd4a8eeebd
commit 0085164ad9

View File

@@ -40,6 +40,11 @@ exports.use_template = function (name) {
Handlebars.templates = {};
}
if (_.has(Handlebars.template, name)) {
// we already compile the template
return;
}
var flag = false,
counter = 0,
data;