style: fix code style

This commit is contained in:
Harttle
2023-03-03 00:14:38 +08:00
parent 9c0dc5fa39
commit 771b9b9eba
4 changed files with 10 additions and 8 deletions
+3 -3
View File
@@ -390,7 +390,7 @@ describe('Issues', function () {
const html = await liquid.parseAndRender(tpl, ctx)
expect(html.trim()).to.equal('<a href="https://example.com">Lot more code here</a>')
})
it('#70 strip multiline content of <style>', async() => {
it('#70 strip multiline content of <style>', async () => {
const str = `
<style type="text/css">
.test-one-line {display: none;}
@@ -400,13 +400,13 @@ describe('Issues', function () {
const html = await engine.parseAndRender(template, { str })
expect(html).to.match(/^\s*$/)
})
it('#589 Arrays should compare values', async() => {
it('#589 Arrays should compare values', async () => {
const engine = new Liquid()
const template = `
{% assign people1 = "alice, bob, carol" | split: ", " -%}
{% assign people2 = "alice, bob, carol" | split: ", " -%}
{% if people1 == people2 %}true{%else%}false{% endif %}
`;
`
const html = await engine.parseAndRender(template)
expect(html).to.contain('true')
})
+3 -1
View File
@@ -4,7 +4,9 @@ import { Liquid } from '../../../src/liquid'
describe('filters/html', function () {
let liquid: Liquid
beforeEach(() => liquid = new Liquid())
beforeEach(() => {
liquid = new Liquid()
})
describe('escape', function () {
it('should escape \' and &', function () {
return test('{{ "Have you read \'James & the Giant Peach\'?" | escape }}',
+1 -1
View File
@@ -57,7 +57,7 @@ describe('Expression', function () {
const ctx = new Context({
arr1: [1, 2],
arr2: [1, 2],
arr3: [1, 2, 3],
arr3: [1, 2, 3]
})
expect(await toPromise(create('arr1==arr2').evaluate(ctx, false))).to.equal(true)
expect(await toPromise(create('arr1==arr3').evaluate(ctx, false))).to.equal(false)