Socket
Socket
Sign inDemoInstall

avvio

Package Overview
Dependencies
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avvio - npm Package Compare versions

Comparing version 7.0.0-alpha.2 to 7.0.0-alpha.3

11

boot.js

@@ -151,4 +151,9 @@ 'use strict'

debug('root plugin ready')
this.emit('preReady')
this._root = null
try {
this.emit('preReady')
this._root = null
} catch (prereadyError) {
err = err || this._error || prereadyError
}
if (err) {

@@ -161,4 +166,4 @@ this._error = err

this.booted = true
this._readyQ.resume()
}
this._readyQ.resume()
})

@@ -165,0 +170,0 @@ }

{
"name": "avvio",
"version": "7.0.0-alpha.2",
"version": "7.0.0-alpha.3",
"description": "Asynchronous bootstrapping of Node applications",

@@ -46,5 +46,5 @@ "main": "boot.js",

"debug": "^4.0.0",
"fastq": "^1.6.0",
"fastq": "^1.6.1",
"queue-microtask": "^1.1.2"
}
}

@@ -321,1 +321,40 @@ 'use strict'

})
test('preReady errors must be managed', (t) => {
t.plan(2)
const app = boot()
app.use((f, opts, cb) => {
cb()
})
app.on('preReady', () => {
throw new Error('boom')
})
app.ready(err => {
t.pass('ready function is called')
t.equal(err.message, 'boom')
})
})
test('preReady errors do not override plugin\'s errors', (t) => {
t.plan(3)
const app = boot()
app.use((f, opts, cb) => {
cb(new Error('baam'))
})
app.on('preReady', () => {
t.pass('preReady is executed')
throw new Error('boom')
})
app.ready(err => {
t.pass('ready function is called')
t.equal(err.message, 'baam')
})
})
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