@middy/do-not-wait-for-empty-event-loop
Advanced tools
Comparing version 1.0.0-alpha.38 to 1.0.0-alpha.39
@@ -102,2 +102,21 @@ const middy = require('../../core') | ||
test(`thrown error should be propagated when it occurs & runOnError is true`, (done) => { | ||
const handler = middy((event, context, cb) => { | ||
context.callbackWaitsForEmptyEventLoop = true | ||
cb(new Error('!')) | ||
}) | ||
handler.use(doNotWaitForEmptyEventLoop({ | ||
runOnAfter: true, | ||
runOnError: true | ||
})) | ||
const event = {} | ||
const context = {} | ||
handler(event, context, (error) => { | ||
expect(error.message).toEqual('!') | ||
done() | ||
}) | ||
}) | ||
test(`callbackWaitsForEmptyEventLoop should be false in handler but true after if set by options`, () => { | ||
@@ -104,0 +123,0 @@ expect.assertions(2) |
@@ -12,3 +12,3 @@ module.exports = (opts) => { | ||
handler.context.callbackWaitsForEmptyEventLoop = false | ||
next() | ||
next(handler.error) | ||
} | ||
@@ -15,0 +15,0 @@ |
{ | ||
"name": "@middy/do-not-wait-for-empty-event-loop", | ||
"version": "1.0.0-alpha.38", | ||
"version": "1.0.0-alpha.39", | ||
"description": "Middleware for the middy framework that allows to easily disable the wait for empty event loop in a Lambda function", | ||
@@ -43,3 +43,3 @@ "engines": { | ||
}, | ||
"gitHead": "4cb5f38791a20ed053edff9c1b8e9347fe13f650" | ||
"gitHead": "361b7a5486dba2682e92e767ae8bc0e984951a04" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10961
154