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 5.8.1 to 5.9.0

test/after-pass-through.test.js

22

boot.js

@@ -365,7 +365,23 @@ 'use strict'

function _encapsulateThreeParam (err, cb) {
var res
if (!func) {
process.nextTick(cb)
} else if (func.length === 0 || func.length === 1) {
func(err)
process.nextTick(cb)
} else if (func.length === 0) {
res = func()
if (res && res.then) {
res.then(function () {
process.nextTick(cb, err)
}, cb)
} else {
process.nextTick(cb, err)
}
} else if (func.length === 1) {
res = func(err)
if (res && res.then) {
res.then(function () {
process.nextTick(cb)
}, cb)
} else {
process.nextTick(cb)
}
} else if (func.length === 2) {

@@ -372,0 +388,0 @@ func(err, cb)

2

package.json
{
"name": "avvio",
"version": "5.8.1",
"version": "5.9.0",
"description": "Asynchronous bootstrapping of Node applications",

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

@@ -183,1 +183,47 @@ 'use strict'

})
test('after wrapped', async (t) => {
t.plan(15)
const app = {}
boot(app)
let firstLoaded = false
let secondLoaded = false
let thirdLoaded = false
app.use(first)
async function first (s, opts) {
t.notOk(firstLoaded, 'first is not loaded')
t.notOk(secondLoaded, 'second is not loaded')
t.notOk(thirdLoaded, 'third is not loaded')
firstLoaded = true
s.after(second)
s.after(third)
}
async function second (err) {
t.error(err)
t.ok(firstLoaded, 'first is loaded')
t.notOk(secondLoaded, 'second is not loaded')
t.notOk(thirdLoaded, 'third is not loaded')
await sleep(10)
secondLoaded = true
}
async function third () {
t.ok(firstLoaded, 'first is loaded')
t.ok(secondLoaded, 'second is loaded')
t.notOk(thirdLoaded, 'third is not loaded')
await sleep(10)
thirdLoaded = true
}
const readyContext = await app.ready()
t.equal(app, readyContext)
t.ok(firstLoaded, 'first is loaded')
t.ok(secondLoaded, 'second is loaded')
t.ok(thirdLoaded, 'third is loaded')
t.pass('booted')
})
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