fix: some filters on undefined variable throws, #140

This commit is contained in:
harttle
2019-07-22 16:48:48 +08:00
committed by Jun Yang
parent dc9a6e019e
commit 6e6ea0ae58
8 changed files with 228 additions and 80 deletions
-6
View File
@@ -27,12 +27,6 @@ describe('util/underscore', function () {
})
})
describe('.stringify()', function () {
it('should respect to toLiquid() method', function () {
expect(_.stringify({ toLiquid: () => 'foo' })).to.equal('foo')
})
it('should recursively call toLiquid()', function () {
expect(_.stringify({ toLiquid: () => ({ toLiquid: () => 'foo' }) })).to.equal('foo')
})
it('should return "" for null', function () {
expect(_.stringify(null)).to.equal('')
})