Merge branch 'main' into 3.99

This commit is contained in:
Steve Gravrock
2021-04-02 11:35:30 -07:00
135 changed files with 5808 additions and 3380 deletions

View File

@@ -54,7 +54,7 @@ getJasmineRequireObj().Env = function(j$) {
* Null causes the seed to be determined randomly at the start of execution.
* @name Configuration#seed
* @since 3.3.0
* @type function
* @type (number|string)
* @default null
*/
seed: null,
@@ -84,12 +84,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;
@@ -463,6 +470,9 @@ getJasmineRequireObj().Env = function(j$) {
resources.customAsyncMatchers = j$.util.clone(
runnableResources[parentRunnableId].customAsyncMatchers
);
resources.customObjectFormatters = j$.util.clone(
runnableResources[parentRunnableId].customObjectFormatters
);
resources.defaultStrategyFn =
runnableResources[parentRunnableId].defaultStrategyFn;
}
@@ -777,7 +787,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();
@@ -969,6 +999,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);
};