@@ -5,7 +5,7 @@ import nock from 'nock';
5
5
6
6
import workFlowJobEvent from '../../test/resources/github_workflowjob_event.json' ;
7
7
8
- import { checkBodySize , handle , publishOnEventBridge } from '.' ;
8
+ import { checkBodySize , publishForRunners , publishOnEventBridge } from '.' ;
9
9
import { dispatch } from '../runners/dispatch' ;
10
10
import { IncomingHttpHeaders } from 'http' ;
11
11
import { ConfigWebhook , ConfigWebhookEventBridge } from '../ConfigLoader' ;
@@ -43,7 +43,7 @@ describe('handle GitHub webhook events', () => {
43
43
} ) ;
44
44
45
45
it ( 'should return 500 if no signature available' , async ( ) => {
46
- await expect ( handle ( { } , '' , config ) ) . rejects . toMatchObject ( {
46
+ await expect ( publishForRunners ( { } , '' , config ) ) . rejects . toMatchObject ( {
47
47
statusCode : 500 ,
48
48
} ) ;
49
49
} ) ;
@@ -57,7 +57,7 @@ describe('handle GitHub webhook events', () => {
57
57
const event = JSON . stringify ( workFlowJobEvent ) ;
58
58
59
59
// act and assert
60
- const result = handle (
60
+ const result = publishForRunners (
61
61
{
62
62
'X-Hub-Signature-256' : await webhooks . sign ( event ) ,
63
63
'X-GitHub-Event' : 'workflow_job' ,
@@ -76,7 +76,7 @@ describe('handle GitHub webhook events', () => {
76
76
const other = JSON . stringify ( { ...workFlowJobEvent , action : 'mutated' } ) ;
77
77
78
78
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 ) ,
80
80
) . rejects . toMatchObject ( {
81
81
statusCode : 401 ,
82
82
} ) ;
@@ -86,7 +86,7 @@ describe('handle GitHub webhook events', () => {
86
86
const event = JSON . stringify ( workFlowJobEvent ) ;
87
87
88
88
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 ) ,
90
90
) . rejects . toMatchObject ( {
91
91
statusCode : 202 ,
92
92
} ) ;
@@ -100,7 +100,7 @@ describe('handle GitHub webhook events', () => {
100
100
} ) ;
101
101
102
102
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 ) ,
104
104
) . resolves . toMatchObject ( {
105
105
statusCode : 201 ,
106
106
} ) ;
0 commit comments