Skip to content

Commit

Permalink
chore: add unit test for -e.
Browse files Browse the repository at this point in the history
  • Loading branch information
aorinevo committed Mar 29, 2020
1 parent 4e14487 commit e4ae377
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions spec/artifacts/non.default.extension.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div>This is a test</div>
6 changes: 6 additions & 0 deletions spec/expected/non.default.extension.amd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
define(['handlebars.runtime'], function(Handlebars) {
Handlebars = Handlebars["default"]; var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
return templates['non.default.extension'] = template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
return "<div>This is a test</div>";
},"useData":true});
});
3 changes: 2 additions & 1 deletion spec/precompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ describe('precompiler', function() {
Precompiler.loadTemplates(
{ files: [__dirname + '/artifacts'], extension: 'hbs' },
function(err, opts) {
equal(opts.templates.length, 1);
equal(opts.templates.length, 2);
equal(opts.templates[0].name, 'example_2');

done(err);
}
);
Expand Down
9 changes: 7 additions & 2 deletions tasks/test-bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,14 @@ const testCases = [
expectedOutputSpec: './spec/expected/version.txt'
},
{
binInputParameters: ['-i', '<div>Test String</div>'],
binInputParameters: [
'-a',
'-e',
'hbs',
'./spec/artifacts/non.default.extension.hbs'
],
outputLocation: 'stdout',
expectedOutputSpec: './spec/expected/compiled.string.txt'
expectedOutputSpec: './spec/expected/non.default.extension.amd.js'
}
];

Expand Down

0 comments on commit e4ae377

Please sign in to comment.