Skip to content

Commit d243f6b

Browse files
committed
add coverage
1 parent 764867b commit d243f6b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/eslint-plugin/src/rules/check-sql.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,21 @@ RuleTester.describe("check-sql", () => {
876876
},
877877
],
878878
},
879+
{
880+
name: "reject heterogeneous array union",
881+
options: withConnection(connections.withTag),
882+
code: `
883+
function foo(mixed: (string | number)[]) {
884+
sql\`INSERT INTO test_insert_array_union_literals (colname) VALUES (\${mixed})\`
885+
}
886+
`,
887+
errors: [{
888+
messageId: "invalidQuery",
889+
data: {
890+
error: "Union types must result in the same PostgreSQL type (found text, int)"
891+
}
892+
}]
893+
}
879894
],
880895
});
881896

0 commit comments

Comments
 (0)