Skip to content

Commit

Permalink
Cheat differently when testing SlackHookHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
tadzik committed Jun 5, 2024
1 parent ab1aece commit 2d97794
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/SlackHookHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class SlackHookHandler extends BaseSlackHandler {
createServer = (cb) => httpsCreate(tlsOptions, cb);
}
return new Promise<void>((resolve, reject) => {
const srv = createServer(this._onRequest.bind(this));
const srv = createServer(this.onRequest.bind(this));
srv.once("error", reject);
srv.listen(port, () => {
const protocol = tlsConfig ? "https" : "http";
Expand All @@ -85,7 +85,7 @@ export class SlackHookHandler extends BaseSlackHandler {
}
}

public _onRequest(req: IncomingMessage, res: ServerResponse) {
private onRequest(req: IncomingMessage, res: ServerResponse) {
const HTTP_SERVER_ERROR = 500;
const {method, url } = req;
if (!method || !url) {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/WebhookTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe("WebhookTest", () => {
});
});

harness.hooks._onRequest(req, res);
harness.hooks['onRequest'](req, res);

req.emit('end');

Expand Down

0 comments on commit 2d97794

Please sign in to comment.