refactor: static strict_filters, disable settigns when rendering

This commit is contained in:
harttle
2016-11-09 02:37:52 +08:00
parent 4bdc169d0f
commit cb3378b648
7 changed files with 41 additions and 41 deletions
+8 -8
View File
@@ -130,14 +130,6 @@ describe('error', function() {
expect(e.message).to.contain('undefined variable: a');
});
});
it('should throw RenderError when filter not defined', function() {
return expect(strictEngine.parseAndRender('{{1 | a}}')).to.eventually
.be.rejected
.then(function(e) {
expect(e).to.have.property('name', 'RenderError');
expect(e.message).to.contain('undefined filter: a');
});
});
it('should contain template content in err.message', function() {
var html = ['1st', '2nd', '3rd', 'X{%throwingTag%} Y', '5th', '6th', '7th'];
var message = [
@@ -207,6 +199,14 @@ describe('error', function() {
}
});
});
it('should throw RenderError when filter not defined', function() {
return expect(strictEngine.parseAndRender('{{1 | a}}')).to.eventually
.be.rejected
.then(function(e) {
expect(e).to.have.property('name', 'ParseError');
expect(e.message).to.contain('undefined filter: a');
});
});
it('should throw ParseError when tag not closed', function() {
return expect(engine.parseAndRender('{% if %}')).to.eventually
.be.rejected