Breaking change: support for -npm reporter handling in parallel mode
* The `boot` function exported by the core module returns the same object every time it's called. * Removed node_boot.js. Use the exported `boot` function instead * JasmineStartedInfo does not have totalSpecsDefined or order in parallel mode * JasmineDoneInfo does not have order in parallel mode * Added incompleteCode and numWorkers to JasmineDoneInfo
This commit is contained in:
@@ -7409,6 +7409,15 @@ getJasmineRequireObj().makePrettyPrinter = function(j$) {
|
||||
};
|
||||
|
||||
getJasmineRequireObj().QueueRunner = function(j$) {
|
||||
/*
|
||||
QueueRunner isn't part of the public interface, but it is used by
|
||||
jasmine-npm. -core and -npm version in lockstep at the major and minor
|
||||
levels but version independently at the patch level. Any changes that
|
||||
would break -npm should be done in a major or minor release, never a
|
||||
patch release, and accompanied by a change to -npm that's released in
|
||||
the same version.
|
||||
*/
|
||||
|
||||
let nextid = 1;
|
||||
|
||||
function StopExecutionError() {}
|
||||
@@ -7699,6 +7708,15 @@ getJasmineRequireObj().QueueRunner = function(j$) {
|
||||
};
|
||||
|
||||
getJasmineRequireObj().ReportDispatcher = function(j$) {
|
||||
/*
|
||||
ReportDispatcher isn't part of the public interface, but it is used by
|
||||
jasmine-npm. -core and -npm version in lockstep at the major and minor
|
||||
levels but version independently at the patch level. Any changes that
|
||||
would break -npm should be done in a major or minor release, never a
|
||||
patch release, and accompanied by a change to -npm that's released in
|
||||
the same version.
|
||||
*/
|
||||
|
||||
function ReportDispatcher(methods, queueRunnerFactory, onLateError) {
|
||||
const dispatchedMethods = methods || [];
|
||||
|
||||
@@ -8495,8 +8513,8 @@ getJasmineRequireObj().Runner = function(j$) {
|
||||
/**
|
||||
* Information passed to the {@link Reporter#jasmineStarted} event.
|
||||
* @typedef JasmineStartedInfo
|
||||
* @property {Int} totalSpecsDefined - The total number of specs defined in this suite.
|
||||
* @property {Order} order - Information about the ordering (random or not) of this execution of the suite.
|
||||
* @property {Int} totalSpecsDefined - The total number of specs defined in this suite. Note that this property is not present when Jasmine is run in parallel mode.
|
||||
* @property {Order} order - Information about the ordering (random or not) of this execution of the suite. Note that this property is not present when Jasmine is run in parallel mode.
|
||||
* @since 2.0.0
|
||||
*/
|
||||
await this.reporter_.jasmineStarted({
|
||||
@@ -8515,7 +8533,7 @@ getJasmineRequireObj().Runner = function(j$) {
|
||||
|
||||
this.runableResources_.clearForRunable(this.topSuite_.id);
|
||||
this.currentlyExecutingSuites_.pop();
|
||||
let overallStatus, incompleteReason;
|
||||
let overallStatus, incompleteReason, incompleteCode;
|
||||
|
||||
if (
|
||||
this.hasFailures ||
|
||||
@@ -8525,9 +8543,11 @@ getJasmineRequireObj().Runner = function(j$) {
|
||||
} else if (this.focusedRunables_().length > 0) {
|
||||
overallStatus = 'incomplete';
|
||||
incompleteReason = 'fit() or fdescribe() was found';
|
||||
incompleteCode = 'focused';
|
||||
} else if (totalSpecsDefined === 0) {
|
||||
overallStatus = 'incomplete';
|
||||
incompleteReason = 'No specs found';
|
||||
incompleteCode = 'noSpecsFound';
|
||||
} else {
|
||||
overallStatus = 'passed';
|
||||
}
|
||||
@@ -8537,8 +8557,10 @@ getJasmineRequireObj().Runner = function(j$) {
|
||||
* @typedef JasmineDoneInfo
|
||||
* @property {OverallStatus} overallStatus - The overall result of the suite: 'passed', 'failed', or 'incomplete'.
|
||||
* @property {Int} totalTime - The total time (in ms) that it took to execute the suite
|
||||
* @property {IncompleteReason} incompleteReason - Explanation of why the suite was incomplete.
|
||||
* @property {Order} order - Information about the ordering (random or not) of this execution of the suite.
|
||||
* @property {String} incompleteReason - Human-readable explanation of why the suite was incomplete.
|
||||
* @property {String} incompleteCode - Machine-readable explanation of why the suite was incomplete: 'focused', 'noSpecsFound', or undefined.
|
||||
* @property {Order} order - Information about the ordering (random or not) of this execution of the suite. Note that this property is not present when Jasmine is run in parallel mode.
|
||||
* @property {Int} numWorkers - Number of parallel workers. Note that this property is only present when Jasmine is run in parallel mode.
|
||||
* @property {Expectation[]} failedExpectations - List of expectations that failed in an {@link afterAll} at the global level.
|
||||
* @property {Expectation[]} deprecationWarnings - List of deprecation warnings that occurred at the global level.
|
||||
* @since 2.4.0
|
||||
@@ -8547,6 +8569,7 @@ getJasmineRequireObj().Runner = function(j$) {
|
||||
overallStatus: overallStatus,
|
||||
totalTime: jasmineTimer.elapsed(),
|
||||
incompleteReason: incompleteReason,
|
||||
incompleteCode: incompleteCode,
|
||||
order: order,
|
||||
failedExpectations: this.topSuite_.result.failedExpectations,
|
||||
deprecationWarnings: this.topSuite_.result.deprecationWarnings
|
||||
@@ -10134,6 +10157,15 @@ getJasmineRequireObj().SuiteBuilder = function(j$) {
|
||||
};
|
||||
|
||||
getJasmineRequireObj().Timer = function() {
|
||||
/*
|
||||
Timer isn't part of the public interface, but it is used by
|
||||
jasmine-npm. -core and -npm version in lockstep at the major and minor
|
||||
levels but version independently at the patch level. Any changes that
|
||||
would break -npm should be done in a major or minor release, never a
|
||||
patch release, and accompanied by a change to -npm that's released in
|
||||
the same version.
|
||||
*/
|
||||
|
||||
const defaultNow = (function(Date) {
|
||||
return function() {
|
||||
return new Date().getTime();
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2008-2022 Pivotal Labs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
module.exports = function(jasmineRequire) {
|
||||
const jasmine = jasmineRequire.core(jasmineRequire);
|
||||
|
||||
const env = jasmine.getEnv({ suppressLoadErrors: true });
|
||||
|
||||
const jasmineInterface = jasmineRequire.interface(jasmine, env);
|
||||
|
||||
extend(global, jasmineInterface);
|
||||
|
||||
function extend(destination, source) {
|
||||
for (const property in source) destination[property] = source[property];
|
||||
return destination;
|
||||
}
|
||||
|
||||
return jasmine;
|
||||
};
|
||||
Reference in New Issue
Block a user