mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-20 06:50:47 -07:00
Coverage
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
const chai = require("chai");
|
||||
const expect = chai.expect;
|
||||
|
||||
var liquid = require('..')(),
|
||||
ctx;
|
||||
|
||||
function test(src, dst) {
|
||||
ctx = {
|
||||
date: new Date(),
|
||||
foo: 'bar',
|
||||
arr: [-2, 'a'],
|
||||
obj: {
|
||||
foo: 'bar'
|
||||
},
|
||||
posts: [{
|
||||
category: 'foo'
|
||||
}, {
|
||||
category: 'bar'
|
||||
}]
|
||||
};
|
||||
expect(liquid.render(src, ctx)).to.equal(dst);
|
||||
}
|
||||
|
||||
describe('liquid', function() {
|
||||
it('should output object', function() {
|
||||
test('{{obj}}', '{"foo":"bar"}');
|
||||
});
|
||||
it('should output array', function() {
|
||||
test('{{arr}}', '[-2,"a"]');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user