CoolFace
Apppublic

strong-tie/inbound-calls

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
plugin-timeout-await.test.js34 linesDownload Raw Back to test
1'use strict'2 3/* eslint no-prototype-builtins: off */4 5const { test } = require('tap')6const boot = require('..')7 8test('do not load', async (t) => {9  const app = boot({}, { timeout: 10 })10 11  app.use(first)12 13  async function first (s, opts) {14    await s.use(second)15  }16 17  async function second (s, opts) {18    await s.use(third)19  }20 21  function third (s, opts) {22    return new Promise((resolve, reject) => {23      // no resolve24    })25  }26 27  try {28    await app.start()29    t.fail('should throw')30  } catch (err) {31    t.equal(err.message, 'Plugin did not start in time: \'third\'. You may have forgotten to call \'done\' function or to resolve a Promise')32  }33})34