@@ -49,7 +49,7 @@ test('reject requests other than webhook payloads', async () => {
49
49
body : `Not a valid GitHub webhook: Error: ${ message } ` ,
50
50
status : 403
51
51
} )
52
- expect ( context . done ) . toHaveBeenCalledTimes ( 1 )
52
+ expect ( context . done ) . not . toHaveBeenCalled ( )
53
53
}
54
54
55
55
await expectInvalidWebhook ( 'Unexpected content type: text/plain' )
@@ -142,7 +142,7 @@ const testIssueComment = (comment, repoOwner, fn) => {
142
142
try {
143
143
expect ( await index ( context , context . req ) ) . toBeUndefined ( )
144
144
await fn ( context )
145
- expect ( context . done ) . toHaveBeenCalledTimes ( 1 )
145
+ expect ( context . done ) . not . toHaveBeenCalled ( )
146
146
} catch ( e ) {
147
147
context . log . mock . calls . forEach ( e => console . log ( e [ 0 ] ) )
148
148
throw e ;
@@ -151,7 +151,7 @@ const testIssueComment = (comment, repoOwner, fn) => {
151
151
}
152
152
153
153
testIssueComment ( '/test' , async ( context ) => {
154
- expect ( context . done ) . toHaveBeenCalledTimes ( 1 )
154
+ expect ( context . done ) . not . toHaveBeenCalled ( )
155
155
expect ( context . res ) . toEqual ( {
156
156
body : 'Okay, triggered <the URL to the workflow handle-pr-comment.yml run on main with inputs {"pr-comment-url":"https://github.com/gitgitgadget/git/pull/1886743660"}>!'
157
157
} )
@@ -160,7 +160,7 @@ testIssueComment('/test', async (context) => {
160
160
} )
161
161
162
162
testIssueComment ( '/verify-repository' , 'nope' , ( context ) => {
163
- expect ( context . done ) . toHaveBeenCalledTimes ( 1 )
163
+ expect ( context . done ) . not . toHaveBeenCalled ( )
164
164
expect ( context . res ) . toEqual ( {
165
165
body : 'Refusing to work on a repository other than gitgitgadget/git or git/git' ,
166
166
'status' : 403 ,
@@ -178,7 +178,7 @@ const testWebhookPayload = (testLabel, gitHubEvent, payload, fn) => {
178
178
try {
179
179
expect ( await index ( context , context . req ) ) . toBeUndefined ( )
180
180
await fn ( context )
181
- expect ( context . done ) . toHaveBeenCalledTimes ( 1 )
181
+ expect ( context . done ) . not . toHaveBeenCalled ( )
182
182
} catch ( e ) {
183
183
context . log . mock . calls . forEach ( e => console . log ( e [ 0 ] ) )
184
184
throw e ;
@@ -305,4 +305,4 @@ testWebhookPayload('react to PR push', 'pull_request', {
305
305
'pr-url' : 'https://github.com/gitgitgadget/git/pull/1956' ,
306
306
}
307
307
] )
308
- } )
308
+ } )
0 commit comments