Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Tests/MCPTests/ServerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,19 @@ struct ServerTests {
try await server.start(transport: transport)

// Wait for message processing and response
try await Task.sleep(nanoseconds: 10_000_000) // 10ms
try await Task.sleep(nanoseconds: 100_000_000) // 100ms

#expect(await transport.sentMessages.count == 2)

#expect(await transport.sentMessages.count == 1)

let messages = await transport.sentMessages
if let response = messages.first {
#expect(response.contains("serverInfo"))
}

if let noticiation = messages.last {
#expect(noticiation.contains("initialized"))
}

// Clean up
await server.stop()
await transport.disconnect()
Expand Down Expand Up @@ -136,7 +140,7 @@ struct ServerTests {
#expect(response.contains("error"))
#expect(response.contains("Client not allowed"))
}

await server.stop()
await transport.disconnect()
}
Expand Down