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
261 // undefined fails encoding (the /api/tools/schema 400), so the key must261 // undefined fails encoding (the /api/tools/schema 400), so the key must
262 // be absent entirely when all required fields were projected away.262 // be absent entirely when all required fields were projected away.
263 expect("required" in (result.inputSchema as Record<string, unknown>)).toBe(false);263 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 );
265 }),267 }),
266 );268 );
267});269});