Skip to content

Commit 71040ed

Browse files
authored
fix: add missing logger.warning mock and correct executeSql test assertions (#44)
Fixed 16 test failures caused by two issues: 1. Missing logger.warning() method in test mock - production code uses logger.warning() but test setup only mocked logger.warn() 2. Incorrect test assertions in executeSql registration test - test expected 'dangerous' property but code uses 'destructiveHint', and 'requiresAuth' is in _meta not annotations All 290 tests now passing. Signed-off-by: Devansh-Kumar <[email protected]>
1 parent 424082f commit 71040ed

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

server/tests/mcp-server/tools/executeSql/registration.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ describe("Execute SQL Tool Registration", () => {
104104
description: expect.stringContaining("SQL statements"),
105105
annotations: expect.objectContaining({
106106
readOnlyHint: true,
107+
destructiveHint: false,
107108
openWorldHint: false,
108-
dangerous: false,
109+
}),
110+
_meta: expect.objectContaining({
109111
requiresAuth: true,
110112
}),
111113
});

server/tests/setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ vi.mock("../src/utils/internal/logger.js", () => ({
66
info: () => {},
77
debug: () => {},
88
warn: () => {},
9+
warning: () => {}, // MCP-specific log level
910
error: () => {},
1011
trace: () => {},
1112
fatal: () => {},

0 commit comments

Comments
 (0)