strong-tie/inbound-calls
0
1'use strict'2 3/* eslint no-prototype-builtins: off */4 5const { test } = require('tap')6const boot = require('../boot')7 8test('onReadyTimeout', async (t) => {9 const app = boot({}, {10 timeout: 10, // 10 ms11 autostart: false12 })13 14 app.use(function one (innerApp, opts, next) {15 t.pass('loaded')16 innerApp.ready(function readyNoResolve (err, done) {17 t.notOk(err)18 t.pass('first ready called')19 // Do not call done() to timeout20 })21 next()22 })23 24 await app.start()25 26 try {27 await app.ready()28 t.fail('should throw')29 } catch (err) {30 t.equal(err.message, 'Plugin did not start in time: \'readyNoResolve\'. You may have forgotten to call \'done\' function or to resolve a Promise')31 // And not Plugin did not start in time: 'bound _encapsulateThreeParam'. You may have forgotten to call 'done' function or to resolve a Promise32 }33})34 