@@ -102,11 +102,11 @@ exports.setUserSpecs = (bsConfig, args) => {
102102 let bsConfigSpecs = bsConfig . run_settings . specs ;
103103
104104 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 ) ;
106106 } else if ( ! this . isUndefined ( bsConfigSpecs ) && Array . isArray ( bsConfigSpecs ) ) {
107107 bsConfig . run_settings . specs = bsConfigSpecs . join ( ',' ) ;
108108 } 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 ) ;
110110 } else {
111111 bsConfig . run_settings . specs = null ;
112112 }
@@ -115,12 +115,16 @@ exports.setUserSpecs = (bsConfig, args) => {
115115// env option must be set only from command line args as a string
116116exports . setTestEnvs = ( bsConfig , args ) => {
117117 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 ) ;
119119 } else {
120120 bsConfig . run_settings . env = null ;
121121 }
122122}
123123
124+ exports . fixCommaSeparatedString = ( string ) => {
125+ return string . split ( / \s { 0 , } , \s + / ) . join ( ',' ) ;
126+ }
127+
124128exports . isUndefined = value => ( value === undefined || value === null ) ;
125129
126130exports . isFloat = value => ( Number ( value ) && Number ( value ) % 1 !== 0 ) ;
0 commit comments