Skip to content

Commit e4ae377

Browse files
committed
chore: add unit test for -e.
1 parent 4e14487 commit e4ae377

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed
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: 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 = Handlebars.templates = Handlebars.templates || {};
3+
return templates['non.default.extension'] = template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
4+
return "<div>This is a test</div>";
5+
},"useData":true});
6+
});

spec/precompiler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,9 @@ describe('precompiler', function() {
307307
Precompiler.loadTemplates(
308308
{ files: [__dirname + '/artifacts'], extension: 'hbs' },
309309
function(err, opts) {
310-
equal(opts.templates.length, 1);
310+
equal(opts.templates.length, 2);
311311
equal(opts.templates[0].name, 'example_2');
312+
312313
done(err);
313314
}
314315
);

tasks/test-bin.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,14 @@ const testCases = [
7777
expectedOutputSpec: './spec/expected/version.txt'
7878
},
7979
{
80-
binInputParameters: ['-i', '<div>Test String</div>'],
80+
binInputParameters: [
81+
'-a',
82+
'-e',
83+
'hbs',
84+
'./spec/artifacts/non.default.extension.hbs'
85+
],
8186
outputLocation: 'stdout',
82-
expectedOutputSpec: './spec/expected/compiled.string.txt'
87+
expectedOutputSpec: './spec/expected/non.default.extension.amd.js'
8388
}
8489
];
8590

0 commit comments

Comments
 (0)