File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,14 @@ import { FormatFn } from '../../src/sqlFormatter.js';
5
5
export default function supportsCase ( format : FormatFn ) {
6
6
it ( 'formats CASE ... WHEN with a blank expression' , ( ) => {
7
7
const result = format (
8
- "CASE WHEN option = 'foo' THEN 1 WHEN option = 'bar' THEN 2 WHEN option = 'baz' THEN 3 ELSE 4 END;"
8
+ "CASE WHEN opt = 'foo' THEN 1 WHEN opt = 'bar' THEN 2 WHEN opt = 'baz' THEN 3 ELSE 4 END;"
9
9
) ;
10
10
11
11
expect ( result ) . toBe ( dedent `
12
12
CASE
13
- WHEN option = 'foo' THEN 1
14
- WHEN option = 'bar' THEN 2
15
- WHEN option = 'baz' THEN 3
13
+ WHEN opt = 'foo' THEN 1
14
+ WHEN opt = 'bar' THEN 2
15
+ WHEN opt = 'baz' THEN 3
16
16
ELSE 4
17
17
END;
18
18
` ) ;
@@ -53,11 +53,11 @@ export default function supportsCase(format: FormatFn) {
53
53
} ) ;
54
54
55
55
it ( 'recognizes lowercase CASE ... END' , ( ) => {
56
- const result = format ( "case when option = 'foo' then 1 else 2 end;" ) ;
56
+ const result = format ( "case when opt = 'foo' then 1 else 2 end;" ) ;
57
57
58
58
expect ( result ) . toBe ( dedent `
59
59
case
60
- when option = 'foo' then 1
60
+ when opt = 'foo' then 1
61
61
else 2
62
62
end;
63
63
` ) ;
Original file line number Diff line number Diff line change @@ -138,8 +138,8 @@ describe('TransactSqlFormatter', () => {
138
138
` ) ;
139
139
} ) ;
140
140
141
- it ( 'formats SELECT ... OPTIONS ()' , ( ) => {
142
- const result = format ( 'SELECT col OPTIONS (MAXRECURSION 5)' ) ;
141
+ it ( 'formats SELECT ... OPTION ()' , ( ) => {
142
+ const result = format ( 'SELECT col OPTION (MAXRECURSION 5)' ) ;
143
143
expect ( result ) . toBe ( dedent `
144
144
SELECT
145
145
col
You can’t perform that action at this time.
0 commit comments