@@ -97,6 +97,7 @@ import {
9797 restoreSdkMocksToDefault ,
9898} from '../util/mock-sdk' ;
9999import { asIoHelper } from '../../../@aws-cdk/tmp-toolkit-helpers/src/api/io/private' ;
100+ import { StackActivityProgress } from '../../lib/commands/deploy' ;
100101
101102markTesting ( ) ;
102103
@@ -615,7 +616,6 @@ describe('deploy', () => {
615616 expect ( mockSynthesize ) . not . toHaveBeenCalled ( ) ;
616617 } ) ;
617618
618-
619619 describe ( 'readCurrentTemplate' , ( ) => {
620620 let template : any ;
621621 let mockCloudExecutable : MockCloudExecutable ;
@@ -1009,6 +1009,36 @@ describe('deploy', () => {
10091009 ) ;
10101010 } ) ;
10111011 } ) ;
1012+
1013+ test ( 'can set progress via options' , async ( ) => {
1014+ const ioHost = CliIoHost . instance ( ) ;
1015+
1016+ // Ensure environment allows StackActivityProgress.BAR
1017+ ioHost . stackProgress = StackActivityProgress . BAR ;
1018+ ioHost . isTTY = true ;
1019+ ioHost . isCI = false ;
1020+ expect ( ioHost . stackProgress ) . toBe ( 'bar' ) ;
1021+
1022+ const toolkit = new CdkToolkit ( {
1023+ ioHost,
1024+ cloudExecutable,
1025+ configuration : cloudExecutable . configuration ,
1026+ sdkProvider : cloudExecutable . sdkProvider ,
1027+ deployments : new FakeCloudFormation ( { } ) ,
1028+ } ) ;
1029+
1030+ // check this hasn't changed yet
1031+ expect ( ioHost . stackProgress ) . toBe ( 'bar' ) ;
1032+
1033+ await toolkit . deploy ( {
1034+ progress : StackActivityProgress . EVENTS ,
1035+ selector : { patterns : [ "**" ] } ,
1036+ hotswap : HotswapMode . FALL_BACK
1037+ } ) ;
1038+
1039+ // now expect it to be updated
1040+ expect ( ioHost . stackProgress ) . toBe ( 'events' ) ;
1041+ } ) ;
10121042} ) ;
10131043
10141044describe ( 'destroy' , ( ) => {
0 commit comments