diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index e3a62a7c..9c4df766 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2008-2022 Pivotal Labs +Copyright (c) 2008-2023 Pivotal Labs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -8619,11 +8619,15 @@ getJasmineRequireObj().Runner = function(j$) { * @typedef JasmineStartedInfo * @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. + * @property {Boolean} parallel - Whether Jasmine is being run in parallel mode. * @since 2.0.0 */ await this.reporter_.jasmineStarted({ + // In parallel mode, the jasmineStarted event is separately dispatched + // by jasmine-npm. This event only reaches reporters in non-parallel. totalSpecsDefined, - order: order + order: order, + parallel: false }); this.currentlyExecutingSuites_.push(this.topSuite_); diff --git a/spec/core/integration/EnvSpec.js b/spec/core/integration/EnvSpec.js index a4aa0566..e96e8326 100644 --- a/spec/core/integration/EnvSpec.js +++ b/spec/core/integration/EnvSpec.js @@ -1888,7 +1888,8 @@ describe('Env integration', function() { expect(reporter.jasmineStarted).toHaveBeenCalledWith({ totalSpecsDefined: 1, - order: jasmine.any(jasmineUnderTest.Order) + order: jasmine.any(jasmineUnderTest.Order), + parallel: false }); expect(reporter.specDone).toHaveBeenCalledWith( @@ -1922,7 +1923,8 @@ describe('Env integration', function() { expect(reporter.jasmineStarted).toHaveBeenCalledWith({ totalSpecsDefined: 1, - order: jasmine.any(jasmineUnderTest.Order) + order: jasmine.any(jasmineUnderTest.Order), + parallel: false }); expect(reporter.specDone).toHaveBeenCalledWith( @@ -1970,7 +1972,8 @@ describe('Env integration', function() { expect(reporter.jasmineStarted).toHaveBeenCalledWith({ totalSpecsDefined: 5, - order: jasmine.any(jasmineUnderTest.Order) + order: jasmine.any(jasmineUnderTest.Order), + parallel: false }); expect(reporter.specDone.calls.count()).toBe(5); @@ -2152,7 +2155,8 @@ describe('Env integration', function() { expect(reporter.jasmineStarted).toHaveBeenCalledWith({ totalSpecsDefined: 1, - order: jasmine.any(jasmineUnderTest.Order) + order: jasmine.any(jasmineUnderTest.Order), + parallel: false }); expect(reporter.specDone).toHaveBeenCalledWith( diff --git a/src/core/Runner.js b/src/core/Runner.js index 43b9a3a6..850fae7f 100644 --- a/src/core/Runner.js +++ b/src/core/Runner.js @@ -129,11 +129,15 @@ getJasmineRequireObj().Runner = function(j$) { * @typedef JasmineStartedInfo * @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. + * @property {Boolean} parallel - Whether Jasmine is being run in parallel mode. * @since 2.0.0 */ await this.reporter_.jasmineStarted({ + // In parallel mode, the jasmineStarted event is separately dispatched + // by jasmine-npm. This event only reaches reporters in non-parallel. totalSpecsDefined, - order: order + order: order, + parallel: false }); this.currentlyExecutingSuites_.push(this.topSuite_);