Skip to content

Commit

Permalink
chore(ct): throw error when props are not json serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
sand4rt committed Mar 28, 2023
1 parent 9663be8 commit 1683fe5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/playwright-test/src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export const fixtures: Fixtures<
});
},
update: async (options: JsxComponent | Omit<MountOptions, 'hooksConfig'>) => {
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);
}
});
Expand Down

0 comments on commit 1683fe5

Please sign in to comment.