Skip to content

Commit 5e6a255

Browse files
committed
chore: add unit tests for cli options.
1 parent 01ab830 commit 5e6a255

22 files changed

+311
-13
lines changed

bin/handlebars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ delete argv._;
111111

112112
const Precompiler = require('../dist/cjs/precompiler');
113113
Precompiler.loadTemplates(argv, function(err, opts) {
114+
114115
if (err) {
115116
throw err;
116117
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{#someHelper true}}
2+
<div>Some known helper</div>
3+
{{#anotherHelper true}}
4+
<div>Another known helper</div>
5+
{{/anotherHelper}}
6+
{{/someHelper}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div>This is a test</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<div>Test Partial</div>

spec/artifacts/source.map.amd.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":3,"sources":["test"],"names":["compiler","main","container","depth0","helpers","partials","data","useData"],"mappings":"kHAAA,CAAAA,SAAA,CAAA,EAAA,YAAAC,KAAA,SAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GAAA,MAAA,gBAAAC,SAAA"}

spec/expected/compiled.string.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
2+
return "<div>Test String</div>";
3+
},"useData":true}

spec/expected/empty.amd.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/expected/empty.amd.namespace.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
define(['handlebars.runtime'], function(Handlebars) {
2+
Handlebars = Handlebars["default"]; var template = Handlebars.template, templates = CustomNamespace.templates = CustomNamespace.templates || {};
3+
return templates['empty'] = template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
4+
return "";
5+
},"useData":true});
6+
});

spec/expected/empty.amd.simple.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
2+
return "";
3+
},"useData":true}

spec/expected/empty.common.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(function() {
2+
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
3+
templates['empty'] = template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
4+
return "";
5+
},"useData":true});
6+
})();

0 commit comments

Comments
 (0)