Updating js plugins

This commit is contained in:
ahwelp
2023-01-24 20:31:23 +00:00
parent b1eb0a7a56
commit 2b6ddf9569
602 changed files with 109412 additions and 18 deletions
@@ -0,0 +1,38 @@
require('./helper');
describe('Mustache.render', function () {
beforeEach(function () {
Mustache.clearCache();
});
it('requires template to be a string', function () {
assert.throws(function () {
Mustache.render(['dummy template'], ['foo', 'bar']);
}, TypeError, 'Invalid template! Template should be a "string" but ' +
'"array" was given as the first argument ' +
'for mustache#render(template, view, partials)');
});
var i;
var tests = {{{.}}};
for (i = 0; i < tests.length; i++) {
(function indexClosure(test) {
var view = eval(test.view);
it('knows how to render ' + test.name, function () {
var output;
if (test.partial) {
output = Mustache.render(test.template, view, { partial: test.partial });
} else {
output = Mustache.render(test.template, view);
}
assert.equal(output, test.expect);
});
})(tests[i]);
}
});