Skip to content

Commit 579cda1

Browse files
Bill Leoutsakoscursoragent
authored andcommitted
fix(pi): drop the banned JSON round-trip from the search parity test
`check:utils` bans `JSON.parse(JSON.stringify(...))`. The round-trip was normalizing the host body to its wire form, which buys nothing here: the bodies are plain JSON and `toEqual` already ignores undefined members. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4638b26 commit 579cda1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/sim/executor/handlers/pi/search/parity.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ describe.each(Object.keys(TOOLS) as PiSearchProvider[])('%s request parity', (pr
117117

118118
expect(sandbox.url).toBe(host.url)
119119
expect(sandbox.headers).toEqual(host.headers)
120-
expect(sandbox.body).toEqual(JSON.parse(JSON.stringify(host.body)))
120+
// `sandbox.body` is already parsed off the wire; `toEqual` ignores members set to undefined, so
121+
// comparing the host's object directly still compares what each path would send.
122+
expect(sandbox.body).toEqual(host.body)
121123
expect(TOOLS[provider].request.method).toBe('POST')
122124
})
123125
})

0 commit comments

Comments
 (0)