Added missing jsdocs

* Env#execute
* Env#allowRespy
* Enough of Spec to support spec filters
This commit is contained in:
Steve Gravrock
2021-03-31 18:16:58 -07:00
parent 6be2102b64
commit 2fc5182ddc
3 changed files with 110 additions and 6 deletions

View File

@@ -83,12 +83,19 @@ getJasmineRequireObj().Env = function(j$) {
* @default false
*/
oneFailurePerSpec: false,
/**
* A function that takes a spec and returns true if it should be executed
* or false if it should be skipped.
* @callback SpecFilter
* @param {Spec} spec - The spec that the filter is being applied to.
* @return boolean
*/
/**
* Function to use to filter specs
* @name Configuration#specFilter
* @since 3.3.0
* @type function
* @default true
* @type SpecFilter
* @default A function that always returns true.
*/
specFilter: function() {
return true;
@@ -718,7 +725,27 @@ getJasmineRequireObj().Env = function(j$) {
queueRunnerFactory
);
// Both params are optional.
/**
* Executes the specs.
*
* If called with no parameters or with a falsy value as the first parameter,
* all specs will be executed except those that are excluded by a
* [spec filter]{@link Configuration#specFilter} or other mechanism. If the
* first parameter is a list of spec/suite IDs, only those specs/suites will
* be run.
*
* Both parameters are optional, but a completion callback is only valid as
* the second parameter. To specify a completion callback but not a list of
* specs/suites to run, pass null or undefined as the first parameter.
*
* execute should not be called more than once.
*
* @name Env#execute
* @since 2.0.0
* @function
* @param {(string[])=} runnablesToRun IDs of suites and/or specs to run
* @param {Function=} onComplete Function that will be called after all specs have run
*/
this.execute = function(runnablesToRun, onComplete) {
installGlobalErrors();
@@ -910,6 +937,15 @@ getJasmineRequireObj().Env = function(j$) {
}
});
/**
* Configures whether Jasmine should allow the same function to be spied on
* more than once during the execution of a spec. By default, spying on
* a function that is already a spy will cause an error.
* @name Env#allowRespy
* @function
* @since 2.5.0
* @param {boolean} allow Whether to allow respying
*/
this.allowRespy = function(allow) {
spyRegistry.allowRespy(allow);
};