Skip to content

Commit 4e6e35d

Browse files
committed
transform
1 parent 244b4dd commit 4e6e35d

File tree

1 file changed

+2
-45
lines changed

1 file changed

+2
-45
lines changed

packages/transform/__test__/transform.test.ts

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,6 @@ import { transformPG13ToPG17 } from '../src/index';
22
import { Node as PG13Node } from '../src/13/types';
33
import { Node as PG17Node } from '../src/17/types';
44

5-
const describe = (name: string, fn: () => void) => {
6-
console.log(`\n=== ${name} ===`);
7-
fn();
8-
};
9-
10-
const test = (name: string, fn: () => void) => {
11-
try {
12-
fn();
13-
console.log(`✓ ${name}`);
14-
} catch (error) {
15-
console.log(`✗ ${name}: ${error}`);
16-
}
17-
};
18-
19-
const expect = (actual: any) => ({
20-
toEqual: (expected: any) => {
21-
const actualStr = JSON.stringify(actual, null, 2);
22-
const expectedStr = JSON.stringify(expected, null, 2);
23-
if (actualStr !== expectedStr) {
24-
throw new Error(`Expected ${expectedStr} but got ${actualStr}`);
25-
}
26-
},
27-
toBe: (expected: any) => {
28-
if (actual !== expected) {
29-
throw new Error(`Expected ${expected} but got ${actual}`);
30-
}
31-
},
32-
toBeUndefined: () => {
33-
if (actual !== undefined) {
34-
throw new Error(`Expected undefined but got ${actual}`);
35-
}
36-
},
37-
toHaveLength: (length: number) => {
38-
if (!actual || actual.length !== length) {
39-
throw new Error(`Expected length ${length} but got ${actual?.length}`);
40-
}
41-
}
42-
});
43-
445
describe('PG13 to PG17 transformer', () => {
456
test('transforms basic string node', () => {
467
const pg13Node: PG13Node = {
@@ -167,11 +128,9 @@ describe('PG13 to PG17 transformer', () => {
167128
test('handles PG17-only node types by passing through', () => {
168129
const pg17OnlyNode = {
169130
WindowFuncRunCondition: {
170-
xpr: undefined,
171131
opno: 123,
172132
inputcollid: 456,
173-
wfunc_left: true,
174-
arg: undefined
133+
wfunc_left: true
175134
}
176135
};
177136

@@ -244,6 +203,4 @@ describe('PG13 to PG17 transformer', () => {
244203
}
245204
}
246205
});
247-
});
248-
249-
console.log('Running PG13 to PG17 transformer tests...');
206+
});

0 commit comments

Comments
 (0)