@@ -24,6 +24,7 @@ const mockPushProcessors = {
24
24
checkIfWaitingAuth : sinon . stub ( ) ,
25
25
pullRemote : sinon . stub ( ) ,
26
26
writePack : sinon . stub ( ) ,
27
+ preReceive : sinon . stub ( ) ,
27
28
getDiff : sinon . stub ( ) ,
28
29
clearBareClone : sinon . stub ( ) ,
29
30
scanDiff : sinon . stub ( ) ,
@@ -38,6 +39,7 @@ mockPushProcessors.checkUserPushPermission.displayName = 'checkUserPushPermissio
38
39
mockPushProcessors . checkIfWaitingAuth . displayName = 'checkIfWaitingAuth' ;
39
40
mockPushProcessors . pullRemote . displayName = 'pullRemote' ;
40
41
mockPushProcessors . writePack . displayName = 'writePack' ;
42
+ mockPushProcessors . preReceive . displayName = 'preReceive' ;
41
43
mockPushProcessors . getDiff . displayName = 'getDiff' ;
42
44
mockPushProcessors . clearBareClone . displayName = 'clearBareClone' ;
43
45
mockPushProcessors . scanDiff . displayName = 'scanDiff' ;
@@ -63,7 +65,7 @@ describe('proxy chain', function () {
63
65
// Re-require the chain module after stubbing processors
64
66
chain = require ( '../src/proxy/chain' ) ;
65
67
66
- chain . chainPluginLoader = new PluginLoader ( [ ] )
68
+ chain . chainPluginLoader = new PluginLoader ( [ ] ) ;
67
69
} ) ;
68
70
69
71
afterEach ( ( ) => {
@@ -108,7 +110,11 @@ describe('proxy chain', function () {
108
110
mockPushProcessors . checkUserPushPermission . resolves ( continuingAction ) ;
109
111
110
112
// this stops the chain from further execution
111
- mockPushProcessors . checkIfWaitingAuth . resolves ( { type : 'push' , continue : ( ) => false , allowPush : false } ) ;
113
+ mockPushProcessors . checkIfWaitingAuth . resolves ( {
114
+ type : 'push' ,
115
+ continue : ( ) => false ,
116
+ allowPush : false ,
117
+ } ) ;
112
118
const result = await chain . executeChain ( req ) ;
113
119
114
120
expect ( mockPreProcessors . parseAction . called ) . to . be . true ;
@@ -136,7 +142,11 @@ describe('proxy chain', function () {
136
142
mockPushProcessors . checkAuthorEmails . resolves ( continuingAction ) ;
137
143
mockPushProcessors . checkUserPushPermission . resolves ( continuingAction ) ;
138
144
// this stops the chain from further execution
139
- mockPushProcessors . checkIfWaitingAuth . resolves ( { type : 'push' , continue : ( ) => true , allowPush : true } ) ;
145
+ mockPushProcessors . checkIfWaitingAuth . resolves ( {
146
+ type : 'push' ,
147
+ continue : ( ) => true ,
148
+ allowPush : true ,
149
+ } ) ;
140
150
const result = await chain . executeChain ( req ) ;
141
151
142
152
expect ( mockPreProcessors . parseAction . called ) . to . be . true ;
@@ -166,6 +176,7 @@ describe('proxy chain', function () {
166
176
mockPushProcessors . checkIfWaitingAuth . resolves ( continuingAction ) ;
167
177
mockPushProcessors . pullRemote . resolves ( continuingAction ) ;
168
178
mockPushProcessors . writePack . resolves ( continuingAction ) ;
179
+ mockPushProcessors . preReceive . resolves ( continuingAction ) ;
169
180
mockPushProcessors . getDiff . resolves ( continuingAction ) ;
170
181
mockPushProcessors . clearBareClone . resolves ( continuingAction ) ;
171
182
mockPushProcessors . scanDiff . resolves ( continuingAction ) ;
@@ -182,6 +193,7 @@ describe('proxy chain', function () {
182
193
expect ( mockPushProcessors . checkIfWaitingAuth . called ) . to . be . true ;
183
194
expect ( mockPushProcessors . pullRemote . called ) . to . be . true ;
184
195
expect ( mockPushProcessors . writePack . called ) . to . be . true ;
196
+ expect ( mockPushProcessors . preReceive . called ) . to . be . true ;
185
197
expect ( mockPushProcessors . getDiff . called ) . to . be . true ;
186
198
expect ( mockPushProcessors . clearBareClone . called ) . to . be . true ;
187
199
expect ( mockPushProcessors . scanDiff . called ) . to . be . true ;
@@ -232,5 +244,5 @@ describe('proxy chain', function () {
232
244
expect ( mockPushProcessors . checkRepoInAuthorisedList . called ) . to . be . false ;
233
245
expect ( mockPushProcessors . parsePush . called ) . to . be . false ;
234
246
expect ( result ) . to . deep . equal ( action ) ;
235
- } )
247
+ } ) ;
236
248
} ) ;
0 commit comments