From 1683fe561de0d615e7401ee5f6fa5ae0f5623033 Mon Sep 17 00:00:00 2001 From: sand4rt Date: Tue, 28 Mar 2023 22:27:55 +0200 Subject: [PATCH] chore(ct): throw error when props are not json serializable --- packages/playwright-test/src/mount.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/playwright-test/src/mount.ts b/packages/playwright-test/src/mount.ts index 5a2a9364bd88b8..e564a753fdd244 100644 --- a/packages/playwright-test/src/mount.ts +++ b/packages/playwright-test/src/mount.ts @@ -65,7 +65,10 @@ export const fixtures: Fixtures< }); }, update: async (options: JsxComponent | Omit) => { - if (isJsxApi(options)) return await innerUpdate(page, options); + if (options?.props && !isJson(options.props)) + throw new Error('The update function props are not JSON serializable.'); + if (isJsxApi(options)) + return await innerUpdate(page, options); await innerUpdate(page, component, options); } });