mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 05:50:43 -07:00
coverage
This commit is contained in:
+9
-4
@@ -13,7 +13,12 @@ describe('tokenizer', function() {
|
||||
tokens[0].value.should.equal(html);
|
||||
tokens[0].type.should.equal('html');
|
||||
});
|
||||
it('should handle tag syntax', function(){
|
||||
it('should throw when non-string passed in', function() {
|
||||
expect(function() {
|
||||
tokenizer.parse({});
|
||||
}).to.throw('illegal input type');
|
||||
});
|
||||
it('should handle tag syntax', function() {
|
||||
var html = '<p>{% for p in a[1]%}</p>';
|
||||
var tokens = tokenizer.parse(html);
|
||||
|
||||
@@ -21,7 +26,7 @@ describe('tokenizer', function() {
|
||||
tokens[1].type.should.equal('tag');
|
||||
tokens[1].value.should.equal('for p in a[1]');
|
||||
});
|
||||
it('should handle output syntax', function(){
|
||||
it('should handle output syntax', function() {
|
||||
var html = '<p>{{foo | date: "%Y-%m-%d"}}</p>';
|
||||
var tokens = tokenizer.parse(html);
|
||||
|
||||
@@ -29,7 +34,7 @@ describe('tokenizer', function() {
|
||||
tokens[1].type.should.equal('output');
|
||||
tokens[1].value.should.equal('foo | date: "%Y-%m-%d"');
|
||||
});
|
||||
it('should handle successive outputs and tags', function(){
|
||||
it('should handle successive outputs and tags', function() {
|
||||
var html = '{{foo}}{{bar}}{%foo%}{%bar%}';
|
||||
var tokens = tokenizer.parse(html);
|
||||
|
||||
@@ -40,7 +45,7 @@ describe('tokenizer', function() {
|
||||
tokens[1].value.should.equal('bar');
|
||||
tokens[2].value.should.equal('foo');
|
||||
});
|
||||
it('should keep white spaces and newlines', function(){
|
||||
it('should keep white spaces and newlines', function() {
|
||||
var html = '{{foo}}\n{%bar %} \n {{alice}}';
|
||||
var tokens = tokenizer.parse(html);
|
||||
expect(tokens.length).to.equal(5);
|
||||
|
||||
Reference in New Issue
Block a user