Require spec/suite property keys to be strings, not just anything that's cloneable and serializable
This matches the jsdoc.
This commit is contained in:
@@ -849,8 +849,11 @@ getJasmineRequireObj().Spec = function(j$) {
|
||||
// Key and value will eventually be cloned during reporting. The error
|
||||
// thrown at that point if they aren't cloneable isn't very helpful.
|
||||
// Throw a better one now.
|
||||
j$.private.util.assertReporterCloneable(key, 'Key');
|
||||
if (!j$.private.isString(key)) {
|
||||
throw new Error('Key must be a string');
|
||||
}
|
||||
j$.private.util.assertReporterCloneable(value, 'Value');
|
||||
|
||||
this.#executionState.properties = this.#executionState.properties || {};
|
||||
this.#executionState.properties[key] = value;
|
||||
}
|
||||
@@ -10851,8 +10854,11 @@ getJasmineRequireObj().Suite = function(j$) {
|
||||
// Key and value will eventually be cloned during reporting. The error
|
||||
// thrown at that point if they aren't cloneable isn't very helpful.
|
||||
// Throw a better one now.
|
||||
j$.private.util.assertReporterCloneable(key, 'Key');
|
||||
if (!j$.private.isString(key)) {
|
||||
throw new Error('Key must be a string');
|
||||
}
|
||||
j$.private.util.assertReporterCloneable(value, 'Value');
|
||||
|
||||
this.#result.properties = this.#result.properties || {};
|
||||
this.#result.properties[key] = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user