@@ -40,10 +40,13 @@ describe('#SumologicPlugin', () => {
40
40
endpointUrl : 'endpoint-url' ,
41
41
} ) ;
42
42
43
- expect ( Object . keys ( plugin . hooks ) ) . toEqual ( [ 'before:deploy:deploy' ] ) ;
43
+ expect ( Object . keys ( plugin . hooks ) ) . toEqual ( [
44
+ 'deploy:sumologic:deploy' ,
45
+ 'before:deploy:deploy' ,
46
+ ] ) ;
44
47
} ) ;
45
48
46
- describe ( '#beforeDeploy ' , ( ) => {
49
+ describe ( '#deploy ' , ( ) => {
47
50
let plugin ;
48
51
49
52
beforeEach ( ( ) => {
@@ -57,12 +60,12 @@ describe('#SumologicPlugin', () => {
57
60
58
61
it ( 'should validate plugin configuration' , async ( ) => {
59
62
const spy = jest . spyOn ( plugin , 'validate' ) ;
60
- await plugin . beforeDeploy ( ) ;
63
+ await plugin . deploy ( ) ;
61
64
expect ( spy ) . toHaveBeenCalled ( ) ;
62
65
} ) ;
63
66
64
67
it ( 'should generate template' , async ( ) => {
65
- await plugin . beforeDeploy ( ) ;
68
+ await plugin . deploy ( ) ;
66
69
expect ( mockGenerateTemplate ) . toHaveBeenCalledWith ( {
67
70
config : {
68
71
endpointUrl : 'endpoint-url' ,
@@ -77,7 +80,7 @@ describe('#SumologicPlugin', () => {
77
80
it ( 'should deploy sumologic stack' , async ( ) => {
78
81
mockGenerateTemplate . mockReturnValue ( 'template' ) ;
79
82
const spy = jest . spyOn ( plugin . cloudformation , 'deploy' ) ;
80
- await plugin . beforeDeploy ( ) ;
83
+ await plugin . deploy ( ) ;
81
84
expect ( spy ) . toHaveBeenCalledWith ( {
82
85
config : {
83
86
endpointUrl : 'endpoint-url' ,
@@ -94,7 +97,7 @@ describe('#SumologicPlugin', () => {
94
97
const spy = jest . spyOn ( plugin , 'validate' ) ;
95
98
spy . mockRejectedValue ( new Error ( 'cannot generate template' ) ) ;
96
99
return plugin
97
- . beforeDeploy ( )
100
+ . deploy ( )
98
101
. then ( ( ) => expect ( false ) . toBeTruthy ( ) )
99
102
. catch ( err => expect ( err ) . toEqual ( 'cannot generate template' ) ) ;
100
103
} ) ;
0 commit comments