feat: zod v4 with backwards compatibility for v3.25+ (#1040)
This commit is contained in:
parent
7fca1f2b15
commit
418b7f9b85
1 changed files with 14723 additions and 1002 deletions
|
|
@ -6,7 +6,7 @@ import { StreamableHTTPClientTransport } from '../client/streamableHttp.js';
|
|||
import { McpServer } from '../server/mcp.js';
|
||||
import { StreamableHTTPServerTransport } from '../server/streamableHttp.js';
|
||||
import { CallToolResultSchema, LoggingMessageNotificationSchema } from '../types.js';
|
||||
import { z } from 'zod';
|
||||
import * as z from 'zod/v4';
|
||||
import { InMemoryEventStore } from '../examples/shared/inMemoryEventStore.js';
|
||||
|
||||
describe('Transport resumability', () => {
|
||||
|
|
@ -193,8 +193,14 @@ describe('Transport resumability', () => {
|
|||
}
|
||||
);
|
||||
|
||||
// Wait for some notifications to arrive (not all) - shorter wait time
|
||||
await new Promise(resolve => setTimeout(resolve, 20));
|
||||
// Fix for node 18 test failures, allow some time for notifications to arrive
|
||||
const maxWaitTime = 2000; // 2 seconds max wait
|
||||
const pollInterval = 10; // Check every 10ms
|
||||
const startTime = Date.now();
|
||||
while (notifications.length === 0 && Date.now() - startTime < maxWaitTime) {
|
||||
// Wait for some notifications to arrive (not all) - shorter wait time
|
||||
await new Promise(resolve => setTimeout(resolve, pollInterval));
|
||||
}
|
||||
|
||||
// Verify we received some notifications and lastEventId was updated
|
||||
expect(notifications.length).toBeGreaterThan(0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue