@@ -76,8 +76,7 @@ function configureDefaults(options) {
76
76
updateOptionsForJenkinsMode ( config ) ;
77
77
}
78
78
79
- config . suiteTitleSeparedBy = config . suiteTitleSeparedBy || ' ' ;
80
- config . suiteTitleSeparatedBy = config . suiteTitleSeparatedBy || config . suiteTitleSeparedBy ;
79
+ config . suiteTitleSeparatedBy = config . suiteTitleSeparatedBy || config . suiteTitleSeparedBy || ' ' ;
81
80
82
81
return config ;
83
82
}
@@ -98,8 +97,8 @@ function updateOptionsForJenkinsMode(options) {
98
97
if ( options . testCaseSwitchClassnameAndName === undefined ) {
99
98
options . testCaseSwitchClassnameAndName = true ;
100
99
}
101
- if ( options . suiteTitleSeparedBy === undefined ) {
102
- options . suiteTitleSeparedBy = '.' ;
100
+ if ( options . suiteTitleSeparatedBy === undefined ) {
101
+ options . suiteTitleSeparatedBy = '.' ;
103
102
}
104
103
}
105
104
@@ -177,15 +176,15 @@ function generateProperties(options) {
177
176
} , [ ] ) ;
178
177
}
179
178
180
- function getJenkinsClassname ( test ) {
179
+ function getJenkinsClassname ( test , options ) {
181
180
debug ( 'Building jenkins classname for' , test ) ;
182
181
var parent = test . parent ;
183
182
var titles = [ ] ;
184
183
while ( parent ) {
185
184
parent . title && titles . unshift ( parent . title ) ;
186
185
parent = parent . parent ;
187
186
}
188
- return titles . join ( '.' ) ;
187
+ return titles . join ( options . suiteTitleSeparatedBy ) ;
189
188
}
190
189
191
190
/**
@@ -295,7 +294,7 @@ MochaJUnitReporter.prototype.getTestsuiteData = function(suite) {
295
294
MochaJUnitReporter . prototype . getTestcaseData = function ( test , err ) {
296
295
var jenkinsMode = this . _options . jenkinsMode ;
297
296
var flipClassAndName = this . _options . testCaseSwitchClassnameAndName ;
298
- var name = stripAnsi ( jenkinsMode ? getJenkinsClassname ( test ) : test . fullTitle ( ) ) ;
297
+ var name = stripAnsi ( jenkinsMode ? getJenkinsClassname ( test , this . _options ) : test . fullTitle ( ) ) ;
299
298
var classname = stripAnsi ( test . title ) ;
300
299
var testcase = {
301
300
testcase : [ {
0 commit comments