Skip to content

Commit c17f8e7

Browse files
committed
fix: update utils tests to handle pretty:true default
- Add explicit pretty: false option to deparse calls in utils tests - Fixes CI failure in parser-tests utils step - Maintains backward compatibility for tests expecting compact SQL output Co-Authored-By: Dan Lynch <[email protected]>
1 parent 71eba83 commit c17f8e7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/utils/__test__/utils.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ it('simple SelectStmt', () => {
2525
(stmt.SelectStmt.fromClause[0] as {RangeVar: RangeVar}).RangeVar.relname = 'another_table';
2626

2727
expect(stmt).toMatchSnapshot();
28-
expect(deparse(stmt)).toMatchSnapshot();
28+
expect(deparse(stmt, { pretty: false })).toMatchSnapshot();
2929
});
3030

3131
it('SelectStmt with WHERE clause', () => {
@@ -68,7 +68,7 @@ it('SelectStmt with WHERE clause', () => {
6868
op: 'SETOP_NONE'
6969
});
7070

71-
expect(deparse(selectStmt, {})).toEqual(`SELECT * FROM myschema.mytable WHERE a = CAST('t' AS boolean)`);
71+
expect(deparse(selectStmt, { pretty: false })).toEqual(`SELECT * FROM myschema.mytable WHERE a = CAST('t' AS boolean)`);
7272
});
7373

7474
it('queries', () => {
@@ -106,7 +106,7 @@ it('queries', () => {
106106
op: 'SETOP_NONE'
107107
});
108108

109-
expect(deparse(query, {})).toEqual(`SELECT name, email FROM users WHERE age > 18`);
109+
expect(deparse(query, { pretty: false })).toEqual(`SELECT name, email FROM users WHERE age > 18`);
110110

111111
});
112112
it('dynamic creation of tables', () => {
@@ -142,6 +142,6 @@ it('dynamic creation of tables', () => {
142142
});
143143

144144
// `deparse` function converts AST to SQL string
145-
const sql = deparse(createStmt);
145+
const sql = deparse(createStmt, { pretty: false });
146146
expect(sql).toMatchSnapshot();
147-
})
147+
})

0 commit comments

Comments
 (0)