Skip to content

Commit 3ab487a

Browse files
committed
test: expand warn, debug capture
1 parent c7ba562 commit 3ab487a

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

src/__tests__/__snapshots__/server.test.ts.snap

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ exports[`runServer should attempt to run server, create transport, connect, and
5858
[
5959
"test-server-4 server running on stdio transport",
6060
],
61+
[
62+
"Server logging enabled: isStderr = undefined isProtocol = undefined;",
63+
],
6164
],
6265
"mcpServer": [
6366
[
@@ -88,6 +91,9 @@ exports[`runServer should attempt to run server, disable SIGINT handler: diagnos
8891
[
8992
"test-server-7 server running on stdio transport",
9093
],
94+
[
95+
"Server logging enabled: isStderr = undefined isProtocol = undefined;",
96+
],
9197
],
9298
"mcpServer": [
9399
[
@@ -113,6 +119,9 @@ exports[`runServer should attempt to run server, enable SIGINT handler explicitl
113119
[
114120
"test-server-8 server running on stdio transport",
115121
],
122+
[
123+
"Server logging enabled: isStderr = undefined isProtocol = undefined;",
124+
],
116125
],
117126
"mcpServer": [
118127
[
@@ -146,6 +155,14 @@ exports[`runServer should attempt to run server, register a tool: diagnostics 1`
146155
[
147156
"test-server-5 server running on stdio transport",
148157
],
158+
[
159+
"Tool "loremIpsum" has a non‑Zod inputSchema.",
160+
"This will cause unexpected issues, such as failure to pass arguments.",
161+
"MCP SDK requires Zod. Kneel before Zod.",
162+
],
163+
[
164+
"Server logging enabled: isStderr = undefined isProtocol = undefined;",
165+
],
149166
],
150167
"mcpServer": [
151168
[
@@ -184,6 +201,19 @@ exports[`runServer should attempt to run server, register multiple tools: diagno
184201
[
185202
"test-server-6 server running on stdio transport",
186203
],
204+
[
205+
"Tool "loremIpsum" has a non‑Zod inputSchema.",
206+
"This will cause unexpected issues, such as failure to pass arguments.",
207+
"MCP SDK requires Zod. Kneel before Zod.",
208+
],
209+
[
210+
"Tool "dolorSit" has a non‑Zod inputSchema.",
211+
"This will cause unexpected issues, such as failure to pass arguments.",
212+
"MCP SDK requires Zod. Kneel before Zod.",
213+
],
214+
[
215+
"Server logging enabled: isStderr = undefined isProtocol = undefined;",
216+
],
187217
],
188218
"mcpServer": [
189219
[
@@ -217,6 +247,9 @@ exports[`runServer should attempt to run server, use custom options: diagnostics
217247
[
218248
"test-server-3 server running on stdio transport",
219249
],
250+
[
251+
"Server logging enabled: isStderr = undefined isProtocol = undefined;",
252+
],
220253
],
221254
"mcpServer": [
222255
[
@@ -256,6 +289,9 @@ exports[`runServer should attempt to run server, use default tools, http: diagno
256289
[
257290
"test-server-2 server running on HTTP transport",
258291
],
292+
[
293+
"Server logging enabled: isStderr = undefined isProtocol = undefined;",
294+
],
259295
],
260296
"mcpServer": [
261297
[
@@ -299,6 +335,9 @@ exports[`runServer should attempt to run server, use default tools, stdio: diagn
299335
[
300336
"test-server-1 server running on stdio transport",
301337
],
338+
[
339+
"Server logging enabled: isStderr = undefined isProtocol = undefined;",
340+
],
302341
],
303342
"mcpServer": [
304343
[

src/__tests__/server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ describe('runServer', () => {
148148
expect(transportMethod).toHaveBeenCalled();
149149
expect(serverInstance.isRunning()).toBe(true);
150150
expect({
151-
events: MockLog.info.mock.calls,
151+
events: [...MockLog.info.mock.calls, ...MockLog.warn.mock.calls, ...MockLog.debug.mock.calls],
152152
registerTool: mockServer.registerTool.mock.calls?.map((call: any) => call?.[0] || []),
153153
mcpServer: MockMcpServer.mock.calls,
154154
process: processOnSpy.mock.calls

0 commit comments

Comments
 (0)