This commit is contained in:
harttle
2016-10-26 02:50:41 +08:00
parent 34f5cfa34d
commit 377c805230
14 changed files with 418 additions and 337 deletions
+7 -1
View File
@@ -13,7 +13,7 @@ var Template = require('../src/parser.js');
describe('template', function() {
var scope, template, add = (l, r) => l + r;
beforeEach(function(){
beforeEach(function() {
filter.clear();
filter.register('add', add);
@@ -21,6 +21,12 @@ describe('template', function() {
template = Template(tag, filter);
});
it('should throw when output string illegal', function() {
expect(function() {
template.parseOutput('/');
}).to.throw(/illegal output string/);
});
it('should parse output string', function() {
var tpl = template.parseOutput('foo');
expect(tpl.type).to.equal('output');