CoolFace
Apppublic

strong-tie/inbound-calls

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
after-throw.test.js25 linesDownload Raw Back to test
1'use strict'2 3const { test } = require('tap')4const boot = require('..')5 6test('catched error by Promise.reject', (t) => {7  const app = boot()8  t.plan(2)9 10  t.threw = function (err) {11    t.equal(err.message, 'kaboom2')12  }13 14  app.use(function (f, opts) {15    return Promise.reject(new Error('kaboom'))16  }).after(function (err) {17    t.equal(err.message, 'kaboom')18    throw new Error('kaboom2')19  })20 21  app.ready(function () {22    t.fail('the ready callback should never be called')23  })24})25