Skip to content

Commit 8daefe8

Browse files
test: use it.fails() pattern for issue #4000 reproduction test
Update the test to use Vitest's it.fails() pattern to keep CI green while still documenting the bug reproduction. The test: - Currently fails with 'syntax error at end of input' (expected behavior) - Will pass because it's marked as .fails() - Will alert us when the bug is fixed (test will fail because it expects to fail but succeeds) This is the standard pattern for regression tests that capture current bugs. Co-Authored-By: [email protected] <[email protected]>
1 parent 3f10237 commit 8daefe8

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

frontend/packages/schema/src/parser/sql/postgresql/index.test.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,14 +1232,16 @@ CREATE TYPE status AS ENUM ('active', 'inactive');
12321232
})
12331233

12341234
describe('issue #4000: large INSERT INTO statements', () => {
1235-
it('should handle very long INSERT INTO schema_migrations statements', async () => {
1236-
const migrationCount = 3000
1237-
const migrationValues = []
1238-
for (let i = 1; i <= migrationCount; i++) {
1239-
migrationValues.push(`('migration_${i}')`)
1240-
}
1241-
1242-
const sql = /* sql */ `
1235+
it.fails(
1236+
'should handle very long INSERT INTO schema_migrations statements',
1237+
async () => {
1238+
const migrationCount = 3000
1239+
const migrationValues = []
1240+
for (let i = 1; i <= migrationCount; i++) {
1241+
migrationValues.push(`('migration_${i}')`)
1242+
}
1243+
1244+
const sql = /* sql */ `
12431245
-- Dummy PostgreSQL structure.sql for reproduction
12441246
CREATE EXTENSION IF NOT EXISTS "plpgsql" WITH SCHEMA pg_catalog;
12451247
@@ -1261,17 +1263,17 @@ CREATE TYPE status AS ENUM ('active', 'inactive');
12611263
${migrationValues.join(',\n')};
12621264
`
12631265

1264-
const { value, errors } = await processor(sql)
1266+
const { value, errors } = await processor(sql)
12651267

1266-
expect(errors).toEqual([])
1268+
expect(errors).toEqual([])
12671269

1268-
// Verify that the tables were parsed correctly
1269-
expect(value.tables).toHaveProperty('users')
1270-
expect(value.tables).toHaveProperty('posts')
1271-
expect(value.tables['users']?.columns).toHaveProperty('id')
1272-
expect(value.tables['users']?.columns).toHaveProperty('name')
1273-
expect(value.tables['users']?.columns).toHaveProperty('email')
1274-
expect(value.tables['posts']?.columns).toHaveProperty('user_id')
1275-
})
1270+
expect(value.tables).toHaveProperty('users')
1271+
expect(value.tables).toHaveProperty('posts')
1272+
expect(value.tables['users']?.columns).toHaveProperty('id')
1273+
expect(value.tables['users']?.columns).toHaveProperty('name')
1274+
expect(value.tables['users']?.columns).toHaveProperty('email')
1275+
expect(value.tables['posts']?.columns).toHaveProperty('user_id')
1276+
},
1277+
)
12761278
})
12771279
})

0 commit comments

Comments
 (0)