mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
fix: array output now join with "" instead of ","
This commit is contained in:
@@ -36,7 +36,7 @@ describe('filters/array', function () {
|
||||
describe('map', () => {
|
||||
it('should support map', function () {
|
||||
const posts = [{ category: 'foo' }, { category: 'bar' }]
|
||||
return test('{{posts | map: "category"}}', { posts }, 'foo,bar')
|
||||
return test('{{posts | map: "category"}}', { posts }, 'foobar')
|
||||
})
|
||||
it('should normalize non-array input', function () {
|
||||
const post = { category: 'foo' }
|
||||
@@ -53,7 +53,7 @@ describe('filters/array', function () {
|
||||
describe('compact', () => {
|
||||
it('should compact array', function () {
|
||||
const posts = [{ category: 'foo' }, { category: 'bar' }, { foo: 'bar' }]
|
||||
return test('{{posts | map: "category" | compact}}', { posts }, 'foo,bar')
|
||||
return test('{{posts | map: "category" | compact}}', { posts }, 'foobar')
|
||||
})
|
||||
})
|
||||
describe('reverse', function () {
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('tags/assign', function () {
|
||||
it('should assign as array', async function () {
|
||||
const src = '{% assign foo=(1..3) %}{{foo}}'
|
||||
const html = await liquid.parseAndRender(src)
|
||||
return expect(html).to.equal('1,2,3')
|
||||
return expect(html).to.equal('123')
|
||||
})
|
||||
it('should assign as filter result', async function () {
|
||||
const src = '{% assign foo="a b" | capitalize | split: " " | first %}{{foo}}'
|
||||
|
||||
Reference in New Issue
Block a user