Socket
Socket
Sign inDemoInstall

@middy/do-not-wait-for-empty-event-loop

Package Overview
Dependencies
Maintainers
10
Versions
220
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/do-not-wait-for-empty-event-loop - npm Package Compare versions

Comparing version 1.0.0-alpha.38 to 1.0.0-alpha.39

19

__tests__/index.js

@@ -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)

2

index.js

@@ -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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc