diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 63fa4b59..ace5df87 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -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, diff --git a/src/core/Env.js b/src/core/Env.js index 1135aee7..60025850 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -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( diff --git a/src/core/Spec.js b/src/core/Spec.js index f369ac7a..83d389d4 100644 --- a/src/core/Spec.js +++ b/src/core/Spec.js @@ -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, diff --git a/src/core/Suite.js b/src/core/Suite.js index 5cbb9555..e660d1f1 100644 --- a/src/core/Suite.js +++ b/src/core/Suite.js @@ -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,