aboutsummaryrefslogtreecommitdiff
path: root/js/test/template.js
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2018-09-10 23:18:11 -0400
committerPaul Duncan <pabs@pablotron.org>2018-09-10 23:18:11 -0400
commitc5f5795bef35f48b44d105168e7bbe353c71ecc8 (patch)
tree45046c7aa9d8f434b1a605369e277f2a204379ca /js/test/template.js
parent07ad63c1b2d3cc8128b238b19be192ffb6d1a44a (diff)
downloadluigi-template-c5f5795bef35f48b44d105168e7bbe353c71ecc8.tar.bz2
luigi-template-c5f5795bef35f48b44d105168e7bbe353c71ecc8.zip
js: add cache callback, template callback, and singleton run callback tests
Diffstat (limited to 'js/test/template.js')
-rw-r--r--js/test/template.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/test/template.js b/js/test/template.js
index a364c61..ebab447 100644
--- a/js/test/template.js
+++ b/js/test/template.js
@@ -30,4 +30,29 @@
assert.equal(r, 'foofoofoo');
});
+
+ it('run with callback', function() {
+ var t = new Luigi.Template("%{bar}foo%{bar}"),
+ r = [];
+
+ t.run({
+ bar: 'foo',
+ }, function(s) {
+ r.push(s);
+ });
+
+ assert.equal(r.join(''), 'foofoofoo');
+ });
+
+ it('run singleton with callback', function() {
+ var r = [];
+
+ Luigi.run('%{bar}foo%{bar}', {
+ bar: 'foo',
+ }, null, function(s) {
+ r.push(s);
+ });
+
+ assert.equal(r.join(''), 'foofoofoo');
+ });
})();