Skip to content

Commit aa85d93

Browse files
chargomeclaude
andcommitted
fix(deno): Use globalThis.console to avoid lint errors in warn tests
Oxlint flags bare console.* references as errors. Use globalThis.console to bypass the rule while still intercepting the integration's warnings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 40a7122 commit aa85d93

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

packages/deno/test/deno-runtime-metrics.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ Deno.test('attaches correct sentry.origin attribute', async () => {
121121

122122
Deno.test('warns and clamps collectionIntervalMs below 1000ms', () => {
123123
const warnings: string[] = [];
124-
const originalWarn = console.warn;
125-
console.warn = (msg: string) => warnings.push(msg);
124+
const originalWarn = globalThis.console.warn;
125+
globalThis.console.warn = (msg: string) => warnings.push(msg);
126126

127127
try {
128128
denoRuntimeMetricsIntegration({ collectionIntervalMs: 100 });
129129
} finally {
130-
console.warn = originalWarn;
130+
globalThis.console.warn = originalWarn;
131131
}
132132

133133
assertEquals(warnings.length, 1);
@@ -137,13 +137,13 @@ Deno.test('warns and clamps collectionIntervalMs below 1000ms', () => {
137137

138138
Deno.test('warns and clamps collectionIntervalMs when NaN', () => {
139139
const warnings: string[] = [];
140-
const originalWarn = console.warn;
141-
console.warn = (msg: string) => warnings.push(msg);
140+
const originalWarn = globalThis.console.warn;
141+
globalThis.console.warn = (msg: string) => warnings.push(msg);
142142

143143
try {
144144
denoRuntimeMetricsIntegration({ collectionIntervalMs: NaN });
145145
} finally {
146-
console.warn = originalWarn;
146+
globalThis.console.warn = originalWarn;
147147
}
148148

149149
assertEquals(warnings.length, 1);

0 commit comments

Comments
 (0)