History

Assert projection output stays JSON-encodable without JSON.parse

Rhys Sullivan committed 4 months ago

Commit 472b3261 parent b1e39ae1 file · +3 −1Browse files

Unified · Split

packages/plugins/apps/src/plugin/apps-plugin.test.ts+3−1
@@ -261,7 +261,9 @@ describe("apps plugin schema projection", () => { · 260 unmodified lines
261261 // undefined fails encoding (the /api/tools/schema 400), so the key must
262262 // be absent entirely when all required fields were projected away.
263263 expect("required" in (result.inputSchema as Record<string, unknown>)).toBe(false);
264− expect(JSON.parse(JSON.stringify(result.inputSchema))).toEqual(result.inputSchema);
264+ expect(Object.values(result.inputSchema as Record<string, unknown>).includes(undefined)).toBe(
265+ false,
266+ );
265267 }),
266268 );
267269 });