Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
QUnit.test("jsrender.tags.clientTemplate", function(assert) {
jsrender.views.settings.delimiters("<%", "%>");
var tmpl = jsrender.compile(
'\n'
+ '\n'
+ '<%clientTemplate "./test/templates/outer.html"/%>\n'
+ '<%clientTemplate "./test/templates/inner.html"/%>\n'
+ '\n'
+ '<div id="result"></div>\n'
+ '');
var html = tmpl({name: "Jo"});
assert.equal(html,
'\n'
+ '\n'
+ '\n'
+ '\n'
+ '\n'
+ '<div id="result"></div>\n'
+ '',
QUnit.test("jsrender.compile", function(assert) {
var tmpl = jsrender.compile('./test/templates/name-template.html');
var html = tmpl({name: "Jo"});
assert.equal(html, "Name: Jo (name-template.html)", 'jsrender.compile("./file.path.html") compiles template');
tmpl = jsrender.compile('Some {{:~upper("Markup")}} Name: {{:~upper(name)}} {{lower:name}}', {helpers: {upper:upper}, converters: {lower:lower}});
html = tmpl({name: "Jo"});
assert.equal(html, "Some MARKUP Name: JO jo", 'jsrender.compile("markup", {helpers: ..., ...}) compiles template with options');
});
QUnit.test("jsrender.compile", function(assert) {
var tmpl = jsrender.compile('./test/templates/name-template.html');
var html = tmpl({name: "Jo"});
assert.equal(html, "Name: Jo (name-template.html)", 'jsrender.compile("./file.path.html") compiles template');
tmpl = jsrender.compile('Some {{:~upper("Markup")}} Name: {{:~upper(name)}} {{lower:name}}', {helpers: {upper:upper}, converters: {lower:lower}});
html = tmpl({name: "Jo"});
assert.equal(html, "Some MARKUP Name: JO jo", 'jsrender.compile("markup", {helpers: ..., ...}) compiles template with options');
});