fix: array output now join with "" instead of ","

This commit is contained in:
Harttle
2022-02-20 13:03:40 +08:00
parent 78ce5662df
commit ab5e245fba
5 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -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 () {
+1 -1
View File
@@ -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}}'