node tests: Remove requirement to test all templates.

We have less urgency to test all templates now.  The
most common error is probably unbalanced tags, and our
python-based template checker catches those problems
pretty well.

It's still possible to create bad templates, of course,
but the node tests have never been super deep at finding
semantic errors.
This commit is contained in:
Steve Howell 2018-05-24 16:00:39 +00:00 committed by Tim Abbott
parent d018995409
commit 84c9be45af
3 changed files with 0 additions and 19 deletions

View File

@ -1620,7 +1620,3 @@ run_test('handlebars_bug', () => {
assert.equal(last_message_text, 'This is message two.');
}());
// By the end of this test, we should have compiled all our templates. Ideally,
// we will also have exercised them to some degree, but that's a little trickier
// to enforce.
global.make_sure_all_templates_have_been_compiled();

View File

@ -36,8 +36,6 @@ global.with_stub = stub.with_stub;
// Set up helpers to render templates.
var render = require('./render.js');
global.make_sure_all_templates_have_been_compiled =
render.make_sure_all_templates_have_been_compiled;
global.find_included_partials = render.find_included_partials;
global.compile_template = render.compile_template;
global.render_template = render.render_template;

View File

@ -14,19 +14,6 @@ exports.init = function () {
Handlebars.templates = {};
};
exports.make_sure_all_templates_have_been_compiled = function () {
var files = exports.template_finder.get_all();
_.each(files, function (file) {
if (file.name.indexOf('widget') >= 0) {
return;
}
if (!Handlebars.templates[file.name]) {
throw "The file " + file.url + " has no test coverage.";
}
});
};
exports.render_template = function (name, args) {
exports.compile_template(name);
return global.templates.render(name, args);