Skip to content

Commit ae79d46

Browse files
committed
fix: auto-topup occasional test failures due to missing mock
1 parent beb2a47 commit ae79d46

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

backend/src/__tests__/auto-topup.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ describe('Auto Top-up System', () => {
2424
let grantCreditsMock: ReturnType<typeof mock>
2525

2626
beforeEach(() => {
27+
// Mock logger for auto-topup functionality
28+
mockModule('@codebuff/common/util/logger', () => ({
29+
logger: {
30+
debug: () => {},
31+
error: () => {},
32+
info: () => {},
33+
warn: () => {},
34+
},
35+
withLoggerContext: async (context: any, fn: () => Promise<any>) => fn(),
36+
}))
37+
2738
// Set up default mocks
2839
dbMock = mock(() =>
2940
Promise.resolve({

0 commit comments

Comments
 (0)