@@ -39,11 +39,7 @@ describe('GoogleDeploy', () => {
3939 let validateStub ;
4040 let setDefaultsStub ;
4141 let setDeploymentBucketNameStub ;
42- let prepareDeploymentStub ;
4342 let createDeploymentStub ;
44- let generateArtifactDirectoryNameStub ;
45- let compileFunctionsStub ;
46- let mergeServiceResourcesStub ;
4743 let uploadArtifactsStub ;
4844 let updateDeploymentStub ;
4945 let cleanupDeploymentBucketStub ;
@@ -55,17 +51,8 @@ describe('GoogleDeploy', () => {
5551 . returns ( BbPromise . resolve ( ) ) ;
5652 setDeploymentBucketNameStub = sinon . stub ( googleDeploy , 'setDeploymentBucketName' )
5753 . returns ( BbPromise . resolve ( ) ) ;
58- prepareDeploymentStub = sinon . stub ( googleDeploy , 'prepareDeployment' )
59- . returns ( BbPromise . resolve ( ) ) ;
6054 createDeploymentStub = sinon . stub ( googleDeploy , 'createDeployment' )
6155 . returns ( BbPromise . resolve ( ) ) ;
62- generateArtifactDirectoryNameStub = sinon
63- . stub ( googleDeploy , 'generateArtifactDirectoryName' )
64- . returns ( BbPromise . resolve ( ) ) ;
65- compileFunctionsStub = sinon . stub ( googleDeploy , 'compileFunctions' )
66- . returns ( BbPromise . resolve ( ) ) ;
67- mergeServiceResourcesStub = sinon . stub ( googleDeploy , 'mergeServiceResources' )
68- . returns ( BbPromise . resolve ( ) ) ;
6956 uploadArtifactsStub = sinon . stub ( googleDeploy , 'uploadArtifacts' )
7057 . returns ( BbPromise . resolve ( ) ) ;
7158 updateDeploymentStub = sinon . stub ( googleDeploy , 'updateDeployment' )
@@ -78,46 +65,29 @@ describe('GoogleDeploy', () => {
7865 googleDeploy . validate . restore ( ) ;
7966 googleDeploy . setDefaults . restore ( ) ;
8067 googleDeploy . setDeploymentBucketName . restore ( ) ;
81- googleDeploy . prepareDeployment . restore ( ) ;
8268 googleDeploy . createDeployment . restore ( ) ;
83- googleDeploy . generateArtifactDirectoryName . restore ( ) ;
84- googleDeploy . compileFunctions . restore ( ) ;
85- googleDeploy . mergeServiceResources . restore ( ) ;
8669 googleDeploy . uploadArtifacts . restore ( ) ;
8770 googleDeploy . updateDeployment . restore ( ) ;
8871 googleDeploy . cleanupDeploymentBucket . restore ( ) ;
8972 } ) ;
9073
91- it ( 'should run "before:deploy:initialize " promise chain' , ( ) => googleDeploy
92- . hooks [ 'before:deploy:initialize ' ] ( ) . then ( ( ) => {
74+ it ( 'should run "before:deploy:deploy " promise chain' , ( ) => googleDeploy
75+ . hooks [ 'before:deploy:deploy ' ] ( ) . then ( ( ) => {
9376 expect ( validateStub . calledOnce ) . toEqual ( true ) ;
9477 expect ( setDefaultsStub . calledAfter ( validateStub ) ) . toEqual ( true ) ;
9578 } ) ) ;
9679
97- it ( 'should run "deploy:initialize" promise chain' , ( ) => googleDeploy
98- . hooks [ 'deploy:initialize' ] ( ) . then ( ( ) => {
99- expect ( setDeploymentBucketNameStub . calledOnce ) . toEqual ( true ) ;
100- expect ( prepareDeploymentStub . calledAfter ( setDeploymentBucketNameStub ) ) . toEqual ( true ) ;
101- } ) ) ;
102-
103- it ( 'it should run "deploy:setupProviderConfiguration" promise chain' , ( ) => googleDeploy
104- . hooks [ 'deploy:setupProviderConfiguration' ] ( ) . then ( ( ) => {
105- expect ( createDeploymentStub . calledOnce ) . toEqual ( true ) ;
106- } ) ,
107- ) ;
108-
109- it ( 'should run "before:deploy:compileFunctions" promise chain' , ( ) => googleDeploy
110- . hooks [ 'before:deploy:compileFunctions' ] ( ) . then ( ( ) => {
111- expect ( generateArtifactDirectoryNameStub . calledOnce ) . toEqual ( true ) ;
112- expect ( compileFunctionsStub . calledAfter ( generateArtifactDirectoryNameStub ) ) . toEqual ( true ) ;
113- } ) ) ;
114-
11580 it ( 'should run "deploy:deploy" promise chain' , ( ) => googleDeploy
11681 . hooks [ 'deploy:deploy' ] ( ) . then ( ( ) => {
117- expect ( mergeServiceResourcesStub . calledOnce ) . toEqual ( true ) ;
118- expect ( uploadArtifactsStub . calledAfter ( mergeServiceResourcesStub ) ) . toEqual ( true ) ;
82+ expect ( setDeploymentBucketNameStub . calledOnce ) . toEqual ( true ) ;
83+ expect ( createDeploymentStub . calledAfter ( setDeploymentBucketNameStub ) ) . toEqual ( true ) ;
84+ expect ( uploadArtifactsStub . calledAfter ( createDeploymentStub ) ) . toEqual ( true ) ;
11985 expect ( updateDeploymentStub . calledAfter ( uploadArtifactsStub ) ) . toEqual ( true ) ;
120- expect ( cleanupDeploymentBucketStub . calledAfter ( updateDeploymentStub ) ) . toEqual ( true ) ;
86+ } ) ) ;
87+
88+ it ( 'should run "after:deploy:deploy" promise chain' , ( ) => googleDeploy
89+ . hooks [ 'after:deploy:deploy' ] ( ) . then ( ( ) => {
90+ expect ( cleanupDeploymentBucketStub . calledOnce ) . toEqual ( true ) ;
12191 } ) ) ;
12292 } ) ;
12393 } ) ;
0 commit comments