@@ -101,6 +101,15 @@ describe('Unit: Commands > Setup', function () {
101
101
} catch ( error ) {
102
102
expect ( error . message ) . to . equal ( 'Take a break' ) ;
103
103
expect ( argVSpy ) . to . deep . equal ( argvB ) ;
104
+ argVSpy = { local : true , start : false } ;
105
+ }
106
+
107
+ try {
108
+ setup . run ( argVSpy ) ;
109
+ expect ( false , 'An error should have been thrown' ) . to . be . true ;
110
+ } catch ( error ) {
111
+ expect ( error . message ) . to . equal ( 'Take a break' ) ;
112
+ expect ( argVSpy ) . to . deep . equal ( Object . assign ( argvB , { start : false } ) ) ;
104
113
}
105
114
} ) ;
106
115
@@ -452,7 +461,7 @@ describe('Unit: Commands > Setup', function () {
452
461
const system = { hook : ( ) => Promise . resolve ( ) } ;
453
462
const setup = new SetupCommand ( ui , system ) ;
454
463
let tasks ;
455
- setup . runCommand = ( ) => Promise . resolve ( ) ;
464
+ const runCommand = sinon . stub ( setup , 'runCommand' ) . resolves ( ) ;
456
465
457
466
setup . addStage ( 'zest' , ( ) => true , null , 'Zesty' ) ;
458
467
setup . addStage ( 'test' , ( ) => true , null , 'Test' ) ;
@@ -470,6 +479,7 @@ describe('Unit: Commands > Setup', function () {
470
479
expect ( ui . confirm . calledTwice ) . to . be . true ;
471
480
expect ( ui . confirm . args [ 0 ] [ 0 ] ) . to . match ( / Z e s t y / ) ;
472
481
expect ( ui . confirm . args [ 1 ] [ 0 ] ) . to . match ( / T e s t / ) ;
482
+ expect ( runCommand . calledOnce ) . to . be . true ;
473
483
} ) ;
474
484
} ) ;
475
485
} ) ;
0 commit comments