Commit dcfeb05
fix: stdio tests failing due to Zod v4 key reordering
The stdio tests were timing out because Zod v4 reconstructs objects
with keys in schema definition order, causing JSON.stringify-based
message comparisons to fail.
Root cause:
- Tests sent messages with keys: {jsonrpc, method, ...}
- Zod parsed and returned: {method, jsonrpc, ...}
- String comparison failed: JSON.stringify(received) !== JSON.stringify(expected)
- Promise never resolved, tests timed out
Fix:
- Replace fragile JSON.stringify comparisons with property-based comparison
- Compare actual message content (method, jsonrpc) instead of serialized strings
- Key order doesn't matter for semantic equality
This is not a breaking change - JSON-RPC doesn't mandate key order,
and the SDK handles messages correctly. Only test assertions needed updating.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent b35bfa6 commit dcfeb05
2 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
0 commit comments