File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -404,7 +404,7 @@ exports.isValidTimezone = (timezone) => {
404
404
exports . setTimezone = ( bsConfig , args ) => {
405
405
let timezone = undefined ;
406
406
if ( this . isTimezoneArgPassed ( ) ) {
407
- if ( ! this . isUndefined ( args . timezone ) ) {
407
+ if ( this . isNotUndefined ( args . timezone ) ) {
408
408
if ( this . isValidTimezone ( args . timezone ) ) {
409
409
timezone = args . timezone ;
410
410
} else {
@@ -413,7 +413,7 @@ exports.setTimezone = (bsConfig, args) => {
413
413
process . exit ( 1 ) ;
414
414
}
415
415
}
416
- } else if ( ! this . isUndefined ( bsConfig . run_settings . timezone ) ) {
416
+ } else if ( this . isNotUndefined ( bsConfig . run_settings . timezone ) ) {
417
417
if ( this . isValidTimezone ( bsConfig . run_settings . timezone ) ) {
418
418
timezone = bsConfig . run_settings . timezone ;
419
419
} else {
@@ -591,6 +591,8 @@ exports.fixCommaSeparatedString = (string) => {
591
591
592
592
exports . isUndefined = value => ( value === undefined || value === null ) ;
593
593
594
+ exports . isNotUndefined = value => ! this . isUndefined ( value ) ;
595
+
594
596
exports . isPositiveInteger = ( str ) => {
595
597
if ( typeof str !== 'string' ) {
596
598
return false ;
Original file line number Diff line number Diff line change @@ -192,6 +192,20 @@ describe('utils', () => {
192
192
} ) ;
193
193
} ) ;
194
194
195
+ describe ( 'isNotUndefined' , ( ) => {
196
+ it ( 'should return false for a undefined value' , ( ) => {
197
+ expect ( utils . isNotUndefined ( undefined ) ) . to . be . equal ( false ) ;
198
+ expect ( utils . isNotUndefined ( null ) ) . to . be . equal ( false ) ;
199
+ } ) ;
200
+
201
+ it ( 'should return true for a defined value' , ( ) => {
202
+ expect ( utils . isNotUndefined ( 1.234 ) ) . to . be . equal ( true ) ;
203
+ expect ( utils . isNotUndefined ( '1.234' ) ) . to . be . equal ( true ) ;
204
+ expect ( utils . isNotUndefined ( 100 ) ) . to . be . equal ( true ) ;
205
+ expect ( utils . isNotUndefined ( - 1 ) ) . to . be . equal ( true ) ;
206
+ } ) ;
207
+ } ) ;
208
+
195
209
describe ( 'setParallels' , ( ) => {
196
210
var sandbox ;
197
211
beforeEach ( ( ) => {
You can’t perform that action at this time.
0 commit comments