chore(TypeScript): fix linting and generate .d.ts

This commit is contained in:
harttle
2019-02-17 18:20:04 +08:00
parent 7ee87008c7
commit fc9ebdb90f
79 changed files with 809 additions and 820 deletions
+5 -7
View File
@@ -1,11 +1,8 @@
import Liquid from '../../../src/liquid'
import { expect } from 'chai'
import Liquid from 'src/liquid'
import * as mock from 'mock-fs'
import * as chai from 'chai'
import * as path from 'path'
const expect = chai.expect
chai.use(require('chai-as-promised'))
let engine = new Liquid()
const strictEngine = new Liquid({
strict_variables: true,
@@ -111,8 +108,9 @@ describe('error', function () {
expect(err.name).to.equal('RenderError')
expect(err.message).to.contain('throwed by filter')
})
it('should not throw when variable undefined by default', function () {
return expect(engine.parseAndRender('X{{a}}Y')).to.eventually.equal('XY')
it('should not throw when variable undefined by default', async function () {
const html = await engine.parseAndRender('X{{a}}Y')
return expect(html).to.equal('XY')
})
it('should throw RenderError when variable not defined', async function () {
const err = await expect(strictEngine.parseAndRender('{{a}}')).be.rejected