Skip to content

Commit 2d97794

Browse files
committed
Cheat differently when testing SlackHookHandler
1 parent ab1aece commit 2d97794

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/SlackHookHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class SlackHookHandler extends BaseSlackHandler {
6767
createServer = (cb) => httpsCreate(tlsOptions, cb);
6868
}
6969
return new Promise<void>((resolve, reject) => {
70-
const srv = createServer(this._onRequest.bind(this));
70+
const srv = createServer(this.onRequest.bind(this));
7171
srv.once("error", reject);
7272
srv.listen(port, () => {
7373
const protocol = tlsConfig ? "https" : "http";
@@ -85,7 +85,7 @@ export class SlackHookHandler extends BaseSlackHandler {
8585
}
8686
}
8787

88-
public _onRequest(req: IncomingMessage, res: ServerResponse) {
88+
private onRequest(req: IncomingMessage, res: ServerResponse) {
8989
const HTTP_SERVER_ERROR = 500;
9090
const {method, url } = req;
9191
if (!method || !url) {

tests/integration/WebhookTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe("WebhookTest", () => {
7373
});
7474
});
7575

76-
harness.hooks._onRequest(req, res);
76+
harness.hooks['onRequest'](req, res);
7777

7878
req.emit('end');
7979

0 commit comments

Comments
 (0)