Skip to content

Commit 3d22c90

Browse files
committed
Simplify multi-word keywordCase test
1 parent 93f298c commit 3d22c90

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

test/options/keywordCase.ts

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,8 @@ export default function supportsKeywordCase(format: FormatFn) {
6464

6565
// regression test for #356
6666
it('formats multi-word reserved commands into single line', () => {
67-
const input = `
68-
insert
69-
into
70-
Customers (ID, MoneyBalance, Address, City) values (12,-123.4, 'Skagen 2111','Stv');`;
71-
const expected = dedent`
72-
INSERT INTO
73-
Customers (ID, MoneyBalance, Address, City)
74-
VALUES
75-
(12, -123.4, 'Skagen 2111', 'Stv');
76-
`;
77-
78-
expect(format(input, { keywordCase: 'upper' })).toBe(expected);
79-
80-
const inputSelect = `
81-
select * from mytable
67+
const result = format(
68+
`select * from mytable
8269
inner
8370
join
8471
mytable2 on mytable1.col1 = mytable2.col1
@@ -87,8 +74,10 @@ export default function supportsKeywordCase(format: FormatFn) {
8774
bY mytable1.col2
8875
order
8976
by
90-
mytable2.col3;`;
91-
const expectedSelect = dedent`
77+
mytable2.col3;`,
78+
{ keywordCase: 'upper' }
79+
);
80+
expect(result).toBe(dedent`
9281
SELECT
9382
*
9483
FROM
@@ -100,8 +89,6 @@ export default function supportsKeywordCase(format: FormatFn) {
10089
mytable1.col2
10190
ORDER BY
10291
mytable2.col3;
103-
`;
104-
105-
expect(format(inputSelect, { keywordCase: 'upper' })).toBe(expectedSelect);
92+
`);
10693
});
10794
}

0 commit comments

Comments
 (0)