mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 12:50:38 -07:00
refactor: use camelCase for JavaScript APIs
BREAKING CHANGE: Options and method names in JavaScript API are now renamed to cammelCase, for a complete list see #109
This commit is contained in:
@@ -85,15 +85,6 @@ describe('scope', function () {
|
||||
it("should throw when '' unbalanced", async function () {
|
||||
expect(scope.get("foo['bar]")).to.be.rejectedWith(/unbalanced '/)
|
||||
})
|
||||
|
||||
it('should respect to to_liquid', async function () {
|
||||
const scope = new Scope({ foo: {
|
||||
to_liquid: () => ({ bar: 'BAR' }),
|
||||
bar: 'bar'
|
||||
} })
|
||||
expect(await scope.get('foo.bar')).to.equal('BAR')
|
||||
})
|
||||
|
||||
it('should respect to toLiquid', async function () {
|
||||
const scope = new Scope({ foo: {
|
||||
toLiquid: () => ({ bar: 'BAR' }),
|
||||
|
||||
@@ -11,14 +11,6 @@ describe('Output', function () {
|
||||
Filter.clear()
|
||||
})
|
||||
|
||||
it('should respect to .to_liquid() method', async function () {
|
||||
const scope = new Scope({
|
||||
bar: { to_liquid: () => 'custom' }
|
||||
})
|
||||
const output = new Output({ value: 'bar' } as OutputToken, false)
|
||||
const html = await output.render(scope)
|
||||
return expect(html).to.equal('custom')
|
||||
})
|
||||
it('should stringify objects', async function () {
|
||||
const scope = new Scope({
|
||||
foo: { obj: { arr: ['a', 2] } }
|
||||
@@ -39,12 +31,6 @@ describe('Output', function () {
|
||||
const str = await output.render(scope)
|
||||
return expect(str).to.equal('FOO')
|
||||
})
|
||||
it('should respect to .to_s()', async () => {
|
||||
const scope = new Scope({ obj: { to_s: () => 'FOO' } })
|
||||
const output = new Output({ value: 'obj' } as OutputToken, false)
|
||||
const str = await output.render(scope)
|
||||
return expect(str).to.equal('FOO')
|
||||
})
|
||||
it('should respect to .toString()', async () => {
|
||||
const scope = new Scope({ obj: { toString: () => 'FOO' } })
|
||||
const output = new Output({ value: 'obj' } as OutputToken, false)
|
||||
|
||||
@@ -19,9 +19,6 @@ describe('util/underscore', function () {
|
||||
})
|
||||
})
|
||||
describe('.stringify()', function () {
|
||||
it('should respect to to_liquid() method', function () {
|
||||
expect(_.stringify({ to_liquid: () => 'foo' })).to.equal('foo')
|
||||
})
|
||||
it('should respect to toLiquid() method', function () {
|
||||
expect(_.stringify({ toLiquid: () => 'foo' })).to.equal('foo')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user