@@ -102,11 +102,11 @@ exports.setUserSpecs = (bsConfig, args) => {
102
102
let bsConfigSpecs = bsConfig . run_settings . specs ;
103
103
104
104
if ( ! this . isUndefined ( args . specs ) ) {
105
- bsConfig . run_settings . specs = args . specs . split ( / \s { 0 , } , \s + / ) . join ( ',' ) ;
105
+ bsConfig . run_settings . specs = this . fixCommaSeparatedString ( args . specs ) ;
106
106
} else if ( ! this . isUndefined ( bsConfigSpecs ) && Array . isArray ( bsConfigSpecs ) ) {
107
107
bsConfig . run_settings . specs = bsConfigSpecs . join ( ',' ) ;
108
108
} else if ( ! this . isUndefined ( bsConfigSpecs ) && typeof ( bsConfigSpecs ) == "string" ) {
109
- bsConfig . run_settings . specs = bsConfigSpecs . split ( / \s { 0 , } , \s + / ) . join ( ',' ) ;
109
+ bsConfig . run_settings . specs = this . fixCommaSeparatedString ( bsConfigSpecs ) ;
110
110
} else {
111
111
bsConfig . run_settings . specs = null ;
112
112
}
@@ -115,12 +115,16 @@ exports.setUserSpecs = (bsConfig, args) => {
115
115
// env option must be set only from command line args as a string
116
116
exports . setTestEnvs = ( bsConfig , args ) => {
117
117
if ( ! this . isUndefined ( args . env ) ) {
118
- bsConfig . run_settings . env = args . env . split ( / \s { 0 , } , \s + / ) . join ( ',' ) ;
118
+ bsConfig . run_settings . env = this . fixCommaSeparatedString ( args . env ) ;
119
119
} else {
120
120
bsConfig . run_settings . env = null ;
121
121
}
122
122
}
123
123
124
+ exports . fixCommaSeparatedString = ( string ) => {
125
+ return string . split ( / \s { 0 , } , \s + / ) . join ( ',' ) ;
126
+ }
127
+
124
128
exports . isUndefined = value => ( value === undefined || value === null ) ;
125
129
126
130
exports . isFloat = value => ( Number ( value ) && Number ( value ) % 1 !== 0 ) ;
0 commit comments