From 1cb169e8862ac9125e12bb48848fe498aeb9680e Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 27 Apr 2021 16:06:59 +0200 Subject: [PATCH] fixed indentation --- test/cds.ql.test.js | 110 ++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/test/cds.ql.test.js b/test/cds.ql.test.js index dfade6b0..3f070111 100644 --- a/test/cds.ql.test.js +++ b/test/cds.ql.test.js @@ -152,69 +152,69 @@ describe('cds.ql → cqn', () => { expect(CQL`SELECT *,a,b from Foo`).to.eql(CQL`SELECT from Foo{*,a,b}`) //> .to.eql... FIXME: see skipped 'should handle * correctly' below expect(SELECT.from(Foo, ['a', 'b', '*'])) - .to.eql(SELECT.from(Foo).columns('a', 'b', '*')) - .to.eql(SELECT.from(Foo).columns(['a', 'b', '*'])) - .to.eql( - SELECT.from(Foo, (foo) => { - foo.a, foo.b, foo('*') - }) - ) - .to.eql({ - SELECT: { - from: { ref: ['Foo'] }, - columns: [{ ref: ['a'] }, { ref: ['b'] }, cdr ? '*' : { ref: ['*'] }], - }, + .to.eql(SELECT.from(Foo).columns('a', 'b', '*')) + .to.eql(SELECT.from(Foo).columns(['a', 'b', '*'])) + .to.eql( + SELECT.from(Foo, (foo) => { + foo.a, foo.b, foo('*') }) + ) + .to.eql({ + SELECT: { + from: { ref: ['Foo'] }, + columns: [{ ref: ['a'] }, { ref: ['b'] }, cdr ? '*' : { ref: ['*'] }], + }, }) + }) - test('from ( ..., => _.expand ( x=>{...}))', () => { - // SELECT from Foo { *, x, bar.*, car{*}, boo { *, moo.zoo } } - expect( - SELECT.from(Foo, (foo) => { - foo('*'), - foo.x, - foo.car('*'), - foo.boo((b) => { - b('*'), b.moo.zoo((x) => x.y.z) - }) - }) - ).to.eql({ - SELECT: { - from: { ref: ['Foo'] }, - columns: [ - cdr ? '*' : { ref: ['*'] }, - { ref: ['x'] }, - { ref: ['car'], expand: ['*'] }, - { - ref: ['boo'], - expand: ['*', { ref: ['moo', 'zoo'], expand: [{ ref: ['y', 'z'] }] }], - }, - ], - }, + test('from ( ..., => _.expand ( x=>{...}))', () => { + // SELECT from Foo { *, x, bar.*, car{*}, boo { *, moo.zoo } } + expect( + SELECT.from(Foo, (foo) => { + foo('*'), + foo.x, + foo.car('*'), + foo.boo((b) => { + b('*'), b.moo.zoo((x) => x.y.z) + }) }) + ).to.eql({ + SELECT: { + from: { ref: ['Foo'] }, + columns: [ + cdr ? '*' : { ref: ['*'] }, + { ref: ['x'] }, + { ref: ['car'], expand: ['*'] }, + { + ref: ['boo'], + expand: ['*', { ref: ['moo', 'zoo'], expand: [{ ref: ['y', 'z'] }] }], + }, + ], + }, }) + }) - test('from ( ..., => _.inline ( _=>{...}))', () => { - // SELECT from Foo { *, x, bar.*, car{*}, boo { *, moo.zoo } } - expect( - SELECT.from(Foo, (foo) => { - foo.bar('*'), - foo.bar('.*'), //> leading dot indicates inline - foo.boo((x) => x.moo.zoo), - foo.boo((_) => _.moo.zoo) //> underscore arg name indicates inline - }) - ).to.eql({ - SELECT: { - from: { ref: ['Foo'] }, - columns: [ - { ref: ['bar'], expand: ['*'] }, - { ref: ['bar'], inline: ['*'] }, - { ref: ['boo'], expand: [{ ref: ['moo', 'zoo'] }] }, - { ref: ['boo'], inline: [{ ref: ['moo', 'zoo'] }] }, - ], - }, + test('from ( ..., => _.inline ( _=>{...}))', () => { + // SELECT from Foo { *, x, bar.*, car{*}, boo { *, moo.zoo } } + expect( + SELECT.from(Foo, (foo) => { + foo.bar('*'), + foo.bar('.*'), //> leading dot indicates inline + foo.boo((x) => x.moo.zoo), + foo.boo((_) => _.moo.zoo) //> underscore arg name indicates inline }) + ).to.eql({ + SELECT: { + from: { ref: ['Foo'] }, + columns: [ + { ref: ['bar'], expand: ['*'] }, + { ref: ['bar'], inline: ['*'] }, + { ref: ['boo'], expand: [{ ref: ['moo', 'zoo'] }] }, + { ref: ['boo'], inline: [{ ref: ['moo', 'zoo'] }] }, + ], + }, }) + }) test('one / distinct ...', () => { expect(SELECT.distinct.from(Foo).SELECT)