@@ -96,13 +96,8 @@ const createWorkerObjects = (testGroups, config, testRoot, options, selectedRuns
96
96
const workersToExecute = [ ] ;
97
97
98
98
const currentOutputFolder = config . output ;
99
- let currentMochawesomeReportDir ;
100
- let currentMochaJunitReporterFile ;
101
-
102
- if ( config . mocha . reporterOptions ) {
103
- currentMochawesomeReportDir = config . mocha . reporterOptions ?. mochawesome . options . reportDir ;
104
- currentMochaJunitReporterFile = config . mocha . reporterOptions [ 'mocha-junit-reporter' ] . options . mochaFile ;
105
- }
99
+ const currentMochawesomeReportDir = config . mocha . reporterOptions ?. mochawesome . options . reportDir ;
100
+ const currentMochaJunitReporterFile = config . mocha . reporterOptions [ 'mocha-junit-reporter' ] . options . mochaFile ;
106
101
107
102
collection . createRuns ( selectedRuns , config ) . forEach ( ( worker ) => {
108
103
const separator = path . sep ;
@@ -112,8 +107,8 @@ const createWorkerObjects = (testGroups, config, testRoot, options, selectedRuns
112
107
if ( config . mocha && config . mocha . reporterOptions ) {
113
108
_config . mocha . reporterOptions . mochawesome . options . reportDir = `${ currentMochawesomeReportDir } ${ separator } ${ workerName } ` ;
114
109
115
- let _tempArray = currentMochaJunitReporterFile . split ( separator ) ;
116
- _tempArray = _tempArray . splice ( _tempArray . length - 2 , 0 , workerName ) ;
110
+ const _tempArray = currentMochaJunitReporterFile . split ( separator ) ;
111
+ _tempArray . splice ( _tempArray . findIndex ( item => item . includes ( '.xml' ) ) , 0 , workerName ) ;
117
112
_config . mocha . reporterOptions [ 'mocha-junit-reporter' ] . options . mochaFile = _tempArray . join ( separator ) ;
118
113
}
119
114
workerName = worker . getOriginalName ( ) || worker . getName ( ) ;
0 commit comments