First commit
This commit is contained in:
31
node_modules/avvio/test/await-self.test.js
generated
vendored
Normal file
31
node_modules/avvio/test/await-self.test.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict'
|
||||
|
||||
const { test } = require('tap')
|
||||
const boot = require('..')
|
||||
|
||||
test('await self', async (t) => {
|
||||
const app = {}
|
||||
boot(app)
|
||||
|
||||
t.equal(await app, app)
|
||||
})
|
||||
|
||||
test('await self three times', async (t) => {
|
||||
const app = {}
|
||||
boot(app)
|
||||
|
||||
t.equal(await app, app)
|
||||
t.equal(await app, app)
|
||||
t.equal(await app, app)
|
||||
})
|
||||
|
||||
test('await self within plugin', async (t) => {
|
||||
const app = {}
|
||||
boot(app)
|
||||
|
||||
app.use(async (f) => {
|
||||
t.equal(await f, f)
|
||||
})
|
||||
|
||||
t.equal(await app, app)
|
||||
})
|
||||
Reference in New Issue
Block a user