()
| 2087 | // stacked. A `toJSON` probe counts full `JSON.stringify` walks of the value. |
| 2088 | describe("formatMcpExecutionOutcome serialization cost", () => { |
| 2089 | const instrumented = () => { |
| 2090 | let walks = 0; |
| 2091 | const probe = { |
| 2092 | toJSON: () => { |
| 2093 | walks += 1; |
| 2094 | return "probe"; |
| 2095 | }, |
| 2096 | }; |
| 2097 | return { value: { data: [1, 2, 3], probe }, walks: () => walks }; |
| 2098 | }; |
| 2099 | |
| 2100 | it("stringifies the result value once for a plain completed outcome", () => { |
| 2101 | const fixture = instrumented(); |