Skip to content

Commit

Permalink
test: rewrite error handling tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 committed Sep 25, 2023
1 parent db28dcc commit 76a384f
Show file tree
Hide file tree
Showing 3 changed files with 283 additions and 35 deletions.
2 changes: 1 addition & 1 deletion packages/bot-framework/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let handler: HandlerFunction;
app.on('issues.opened', context => {});

Check warning on line 21 in packages/bot-framework/src/app.ts

View workflow job for this annotation

GitHub Actions / test (bot-framework)

'context' is defined but never used
};
const webhookHandler = await Bootstrapper.load({});
handler = webhookHandler.gcf(appFn);
handler = webhookHandler.handler(appFn);
})();

export {handler};
6 changes: 3 additions & 3 deletions packages/bot-framework/src/bootstrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ export class Bootstrapper {
}

server(appFn: ApplicationFunction): http.Server {
return getServer(this.gcf(appFn));
return getServer(this.handler(appFn));
}

gcf(appFn: ApplicationFunction): HandlerFunction {
handler(appFn: ApplicationFunction): HandlerFunction {
// load handlers onto webhooks
appFn(this.webhooks);

Expand Down Expand Up @@ -509,7 +509,7 @@ export class Bootstrapper {
}

try {
this.webhooks.receive({
await this.webhooks.receive({
id: botRequest.githubDeliveryId,
name: botRequest.eventName as any,
payload: payload as any,
Expand Down
Loading

0 comments on commit 76a384f

Please sign in to comment.