Skip to content

Commit 8f2e701

Browse files
betegonclaude
andcommitted
fix(tests): mock getAuthConfig in log list tests after auth guard (#611)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1b360cf commit 8f2e701

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

test/commands/log/list.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ import * as resolveTarget from "../../../src/lib/resolve-target.js";
4545
import * as traceTarget from "../../../src/lib/trace-target.js";
4646
// biome-ignore lint/performance/noNamespaceImport: needed for spyOn mocking
4747
import * as versionCheck from "../../../src/lib/version-check.js";
48+
// biome-ignore lint/performance/noNamespaceImport: needed for spyOn mocking
49+
import * as dbAuth from "../../../src/lib/db/auth.js";
4850
import type { SentryLog, TraceLog } from "../../../src/types/sentry.js";
4951

5052
// ============================================================================
@@ -237,6 +239,23 @@ const newerLogs: SentryLog[] = [
237239
},
238240
];
239241

242+
// ============================================================================
243+
// Auth setup — mock getAuthConfig for all tests (auth guard added in #611)
244+
// ============================================================================
245+
246+
let getAuthConfigSpy: ReturnType<typeof spyOn>;
247+
248+
beforeEach(() => {
249+
getAuthConfigSpy = spyOn(dbAuth, "getAuthConfig").mockReturnValue({
250+
token: "sntrys_test",
251+
source: "config",
252+
});
253+
});
254+
255+
afterEach(() => {
256+
getAuthConfigSpy.mockRestore();
257+
});
258+
240259
// ============================================================================
241260
// Standard mode (project-scoped, no trace-id positional)
242261
// ============================================================================

0 commit comments

Comments
 (0)