mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
chore(TypeScript): refactor objects into classes
fix: `Nil`(null, undefined) now renders as empty string change: `parser.parseValue()` renamed to `parser.parseOutput` change: registered tags/filters become static and shared across different liquid instances
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { resolve } from '../../src/parser/template'
|
||||
import * as mock from 'mock-fs'
|
||||
import * as chai from 'chai'
|
||||
import * as path from 'path'
|
||||
import * as chaiAsPromised from 'chai-as-promised'
|
||||
|
||||
const expect = chai.expect
|
||||
chai.use(chaiAsPromised)
|
||||
|
||||
describe('template', function () {
|
||||
before(function () {
|
||||
mock({
|
||||
'/foo/bar.html': 'bar'
|
||||
})
|
||||
})
|
||||
describe('#resolve()', function () {
|
||||
it('should resolve based on root', function () {
|
||||
const filepath = resolve('bar.html', '/foo', { root: [] })
|
||||
const expected = path.resolve('/foo/bar.html')
|
||||
return expect(filepath).to.eventually.equal(expected)
|
||||
})
|
||||
it('should resolve based on root', function () {
|
||||
return expect(resolve('foo.html', '/foo', { root: [] }))
|
||||
.to.rejectedWith(/Failed to lookup foo.html in: \/foo/)
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user