diff --git a/README.md b/README.md index 09fb76256..ee9b2a76a 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ [![NPM version](https://img.shields.io/npm/v/shopify-liquid.svg?style=flat)](https://www.npmjs.org/package/shopify-liquid) [![Build Status](https://travis-ci.org/harttle/shopify-liquid.svg?branch=master)](https://travis-ci.org/harttle/shopify-liquid) -[![Coverage Status](https://coveralls.io/repos/github/harttle/shopify-liquid/badge.svg?branch=master)](https://coveralls.io/github/harttle/shopify-liquid?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/harttle/shopify-liquid/badge.svg?branch=master&ver=1.1.1)](https://coveralls.io/github/harttle/shopify-liquid?branch=master) [![Dependency manager](https://david-dm.org/harttle/shopify-liquid.png)](https://david-dm.org/harttle/shopify-liquid) [Liquid][shopify-liquid] implementation for Node.js. All tags and filters listed in [Shopify Documentation][shopify-liquid] shall be implemented. -> Shopify liquid is used by [Jekyll][jekyll] and [Github Pages][gh]. +> [Shopify liquid][shopify-liquid] is used by [Jekyll][jekyll] and [Github Pages][gh]. ## Operators diff --git a/package.json b/package.json index 45efed133..8a3ec331a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shopify-liquid", - "version": "1.1.0", + "version": "1.1.1", "description": "A Shopify Liquid Implementation in Node.js", "main": "index.js", "scripts": { diff --git a/test/filters.js b/test/filters.js index 8dacb41fa..3ce7f5aaf 100644 --- a/test/filters.js +++ b/test/filters.js @@ -22,12 +22,6 @@ function test(src, dst) { } describe('filters', function() { - it('should output object', function() { - test('{{obj}}', '{"foo":"bar"}'); - }); - it('should output array', function() { - test('{{arr}}', '[-2,"a"]'); - }); it('should support abs', function() { test('{{ -3 | abs }}', '3'); test('{{ arr[0] | abs }}', '2'); diff --git a/test/liquid.js b/test/liquid.js new file mode 100644 index 000000000..067035139 --- /dev/null +++ b/test/liquid.js @@ -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"]'); + }); +}); diff --git a/test/tags.js b/test/tags.js index c190d2f37..27b7c1f9c 100644 --- a/test/tags.js +++ b/test/tags.js @@ -54,8 +54,8 @@ describe('tags', function() { testThrow('{% if false%}yes', /tag {% if false%} not closed/); test('{%if emptyArray%}a{%endif%}', ''); test('{% if 2==3 %}yes{%else%}no{%endif%}', 'no'); - test('{% if 1==2 and one=2 and one