Skip to content

Commit 32643be

Browse files
fix(test): use case-insensitive comparison in colorizeSql property test
@sentry/sqlish uppercases SQL keywords (e.g. "by" → "BY"), so identifiers that happen to match keywords fail the strict equality check. Compare lowercased strings instead.
1 parent b6e7734 commit 32643be

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/lib/formatters/sql.property.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,14 @@ describe("property: isDbSpanOp", () => {
126126
});
127127

128128
describe("property: colorizeSql", () => {
129-
test("stripping ANSI preserves original text content", () => {
129+
test("stripping ANSI preserves original text content (case-insensitive)", () => {
130130
process.env.SENTRY_PLAIN_OUTPUT = "0";
131131
fcAssert(
132132
property(sqlStringArb, (sql) => {
133133
const colorized = colorizeSql(sql);
134134
const stripped = stripAnsi(colorized);
135-
expect(stripped).toBe(sql);
135+
// Case-insensitive: @sentry/sqlish uppercases SQL keywords (e.g. "by" → "BY")
136+
expect(stripped.toLowerCase()).toBe(sql.toLowerCase());
136137
}),
137138
{ numRuns: DEFAULT_NUM_RUNS }
138139
);

0 commit comments

Comments
 (0)