Skip to content

Commit 34e7abc

Browse files
authored
fix: remove extraneous callbackWaitsForEmptyEventLoop line (#90)
`callbackWaitsForEmptyEventLoop` is only needed for non-async functions (i.e. functions that use callbacks) and therefore can be safely removed from this package. See #78 (comment) for more details
1 parent c8472ff commit 34e7abc

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

lambda-function.js

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ const lowercaseKeys = require("lowercase-keys");
44

55
async function lambdaFunction(probot, event, context) {
66
try {
7-
// Ends function immediately after callback
8-
context.callbackWaitsForEmptyEventLoop = false;
9-
107
// lowercase all headers to respect headers insensitivity (RFC 7230 $3.2 'Header Fields', see issue #62)
118
const headersLowerCase = lowercaseKeys(event.headers);
129

test/index.test.js

-16
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ describe("@probot/adapter-aws-lambda-serverless", () => {
5151

5252
await fn(event, context);
5353

54-
expect(context).toStrictEqual({
55-
callbackWaitsForEmptyEventLoop: false,
56-
});
57-
5854
expect(mock.activeMocks()).toStrictEqual([]);
5955
});
6056

@@ -88,10 +84,6 @@ describe("@probot/adapter-aws-lambda-serverless", () => {
8884

8985
await fn(event, context);
9086

91-
expect(context).toStrictEqual({
92-
callbackWaitsForEmptyEventLoop: false,
93-
});
94-
9587
expect(mock.activeMocks()).toStrictEqual([]);
9688
});
9789

@@ -125,10 +117,6 @@ describe("@probot/adapter-aws-lambda-serverless", () => {
125117

126118
await fn(event, context);
127119

128-
expect(context).toStrictEqual({
129-
callbackWaitsForEmptyEventLoop: false,
130-
});
131-
132120
expect(mock.activeMocks()).toStrictEqual([]);
133121
});
134122

@@ -162,10 +150,6 @@ describe("@probot/adapter-aws-lambda-serverless", () => {
162150

163151
await fn(event, context);
164152

165-
expect(context).toStrictEqual({
166-
callbackWaitsForEmptyEventLoop: false,
167-
});
168-
169153
expect(mock.activeMocks()).toStrictEqual([]);
170154
});
171155
});

0 commit comments

Comments
 (0)