@@ -5,7 +5,7 @@ import nock from 'nock';
55
66import workFlowJobEvent from '../../test/resources/github_workflowjob_event.json' ;
77
8- import { checkBodySize , handle , publishOnEventBridge } from '.' ;
8+ import { checkBodySize , publishForRunners , publishOnEventBridge } from '.' ;
99import { dispatch } from '../runners/dispatch' ;
1010import { IncomingHttpHeaders } from 'http' ;
1111import { ConfigWebhook , ConfigWebhookEventBridge } from '../ConfigLoader' ;
@@ -43,7 +43,7 @@ describe('handle GitHub webhook events', () => {
4343 } ) ;
4444
4545 it ( 'should return 500 if no signature available' , async ( ) => {
46- await expect ( handle ( { } , '' , config ) ) . rejects . toMatchObject ( {
46+ await expect ( publishForRunners ( { } , '' , config ) ) . rejects . toMatchObject ( {
4747 statusCode : 500 ,
4848 } ) ;
4949 } ) ;
@@ -57,7 +57,7 @@ describe('handle GitHub webhook events', () => {
5757 const event = JSON . stringify ( workFlowJobEvent ) ;
5858
5959 // act and assert
60- const result = handle (
60+ const result = publishForRunners (
6161 {
6262 'X-Hub-Signature-256' : await webhooks . sign ( event ) ,
6363 'X-GitHub-Event' : 'workflow_job' ,
@@ -76,7 +76,7 @@ describe('handle GitHub webhook events', () => {
7676 const other = JSON . stringify ( { ...workFlowJobEvent , action : 'mutated' } ) ;
7777
7878 await expect (
79- handle ( { 'X-Hub-Signature-256' : await webhooks . sign ( other ) , 'X-GitHub-Event' : 'workflow_job' } , event , config ) ,
79+ publishForRunners ( { 'X-Hub-Signature-256' : await webhooks . sign ( other ) , 'X-GitHub-Event' : 'workflow_job' } , event , config ) ,
8080 ) . rejects . toMatchObject ( {
8181 statusCode : 401 ,
8282 } ) ;
@@ -86,7 +86,7 @@ describe('handle GitHub webhook events', () => {
8686 const event = JSON . stringify ( workFlowJobEvent ) ;
8787
8888 await expect (
89- handle ( { 'X-Hub-Signature-256' : await webhooks . sign ( event ) , 'X-GitHub-Event' : 'invalid' } , event , config ) ,
89+ publishForRunners ( { 'X-Hub-Signature-256' : await webhooks . sign ( event ) , 'X-GitHub-Event' : 'invalid' } , event , config ) ,
9090 ) . rejects . toMatchObject ( {
9191 statusCode : 202 ,
9292 } ) ;
@@ -100,7 +100,7 @@ describe('handle GitHub webhook events', () => {
100100 } ) ;
101101
102102 await expect (
103- handle ( { 'X-Hub-Signature-256' : await webhooks . sign ( event ) , 'X-GitHub-Event' : 'workflow_job' } , event , config ) ,
103+ publishForRunners ( { 'X-Hub-Signature-256' : await webhooks . sign ( event ) , 'X-GitHub-Event' : 'workflow_job' } , event , config ) ,
104104 ) . resolves . toMatchObject ( {
105105 statusCode : 201 ,
106106 } ) ;
0 commit comments