Improved jsdocs for user-specified spec/suite properties

This commit is contained in:
Steve Gravrock
2020-05-05 17:58:16 -07:00
parent 7416c176a7
commit 8a731e17a7
4 changed files with 36 additions and 4 deletions

View File

@@ -716,7 +716,7 @@ getJasmineRequireObj().Spec = function(j$) {
* @property {String} pendingReason - If the spec is {@link pending}, this will be the reason.
* @property {String} status - Once the spec has completed, this string represents the pass/fail status of this spec.
* @property {number} duration - The time in ms used by the spec execution, including any before/afterEach.
* @property {Object} properties - user-supplied key-value pairs.
* @property {Object} properties - User-supplied properties, if any, that were set using {@link Env#setSpecProperty}
*/
this.result = {
id: this.id,
@@ -2075,6 +2075,14 @@ getJasmineRequireObj().Env = function(j$) {
return spec;
};
/**
* Sets a user-defined property that will be provided to reporters as part of {@link SpecResult#properties}
* @name Env#setSpecProperty
* @since 3.6.0
* @function
* @param {String} key The name of the property
* @param {*} value The value of the property
*/
this.setSpecProperty = function(key, value) {
if (!currentRunnable() || currentRunnable() == currentSuite()) {
throw new Error(
@@ -2084,6 +2092,14 @@ getJasmineRequireObj().Env = function(j$) {
currentRunnable().setSpecProperty(key, value);
};
/**
* Sets a user-defined property that will be provided to reporters as part of {@link SuiteResult#properties}
* @name Env#setSuiteProperty
* @since 3.6.0
* @function
* @param {String} key The name of the property
* @param {*} value The value of the property
*/
this.setSuiteProperty = function(key, value) {
if (!currentSuite()) {
throw new Error(
@@ -8373,7 +8389,7 @@ getJasmineRequireObj().Suite = function(j$) {
* @property {Expectation[]} deprecationWarnings - The list of deprecation warnings that occurred on this suite.
* @property {String} status - Once the suite has completed, this string represents the pass/fail status of this suite.
* @property {number} duration - The time in ms for Suite execution, including any before/afterAll, before/afterEach.
* @property {Object} properties - user-supplied key-value pairs.
* @property {Object} properties - User-supplied properties, if any, that were set using {@link Env#setSuiteProperty}
*/
this.result = {
id: this.id,

View File

@@ -1124,6 +1124,14 @@ getJasmineRequireObj().Env = function(j$) {
return spec;
};
/**
* Sets a user-defined property that will be provided to reporters as part of {@link SpecResult#properties}
* @name Env#setSpecProperty
* @since 3.6.0
* @function
* @param {String} key The name of the property
* @param {*} value The value of the property
*/
this.setSpecProperty = function(key, value) {
if (!currentRunnable() || currentRunnable() == currentSuite()) {
throw new Error(
@@ -1133,6 +1141,14 @@ getJasmineRequireObj().Env = function(j$) {
currentRunnable().setSpecProperty(key, value);
};
/**
* Sets a user-defined property that will be provided to reporters as part of {@link SuiteResult#properties}
* @name Env#setSuiteProperty
* @since 3.6.0
* @function
* @param {String} key The name of the property
* @param {*} value The value of the property
*/
this.setSuiteProperty = function(key, value) {
if (!currentSuite()) {
throw new Error(

View File

@@ -48,7 +48,7 @@ getJasmineRequireObj().Spec = function(j$) {
* @property {String} pendingReason - If the spec is {@link pending}, this will be the reason.
* @property {String} status - Once the spec has completed, this string represents the pass/fail status of this spec.
* @property {number} duration - The time in ms used by the spec execution, including any before/afterEach.
* @property {Object} properties - user-supplied key-value pairs.
* @property {Object} properties - User-supplied properties, if any, that were set using {@link Env#setSpecProperty}
*/
this.result = {
id: this.id,

View File

@@ -27,7 +27,7 @@ getJasmineRequireObj().Suite = function(j$) {
* @property {Expectation[]} deprecationWarnings - The list of deprecation warnings that occurred on this suite.
* @property {String} status - Once the suite has completed, this string represents the pass/fail status of this suite.
* @property {number} duration - The time in ms for Suite execution, including any before/afterAll, before/afterEach.
* @property {Object} properties - user-supplied key-value pairs.
* @property {Object} properties - User-supplied properties, if any, that were set using {@link Env#setSuiteProperty}
*/
this.result = {
id: this.id,