Also require setSpecProperty/setSuiteProperty args to be JSON serializable
This commit is contained in:
@@ -80,9 +80,12 @@ getJasmineRequireObj().util = function(j$) {
|
||||
}
|
||||
};
|
||||
|
||||
util.assertStructuredCloneable = function(v, msgPrefix) {
|
||||
util.assertReporterCloneable = function(v, msgPrefix) {
|
||||
try {
|
||||
structuredClone(v);
|
||||
// Reporter events are cloned internally via structuredClone, and it's
|
||||
// common for reporters (including jasmine-browser-runner's) to JSON
|
||||
// serialize them.
|
||||
JSON.stringify(structuredClone(v));
|
||||
} catch (e) {
|
||||
throw new Error(`${msgPrefix} can't be cloned`, { cause: e });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user