The error is:
node:30504) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'logger' of undefined
at error (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/swatchjs-koa-middleware/dist/lib/response/index.js:57:10)
at setResponse (/Users/furchin/Documents/BFM/swatchjs-koa/lib/response.js:1:28)
at Object._callee$ (/Users/furchin/Documents/BFM/swatchjs-koa/lib/defaults.js:3:55)
at tryCatch (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:65:40)
at Generator.invoke [as _invoke] (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:299:22)
at Generator.prototype.(anonymous function) [as next] (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /Users/furchin/Documents/BFM/swatchjs-koa/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
at new Promise (<anonymous>)
at new F (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/core-js/library/modules/_export.js:35:28)
at Object.<anonymous> (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12)
at Object.authMiddleware [as authAdapter] (/Users/furchin/Documents/BFM/swatchjs-koa/lib/defaults.js:3:340)
at Context.<anonymous> (/Users/furchin/Documents/BFM/swatchjs-koa/test/defaults.test.js:153:25)
at callFn (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/mocha/lib/runnable.js:348:21)
at Test.Runnable.run (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/mocha/lib/runnable.js:340:7)
at Runner.runTest (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/mocha/lib/runner.js:443:10)
at /Users/furchin/Documents/BFM/swatchjs-koa/node_modules/mocha/lib/runner.js:549:12
at next (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/mocha/lib/runner.js:361:14)
at /Users/furchin/Documents/BFM/swatchjs-koa/node_modules/mocha/lib/runner.js:371:7
at next (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/mocha/lib/runner.js:295:14)
at Immediate._onImmediate (/Users/furchin/Documents/BFM/swatchjs-koa/node_modules/mocha/lib/runner.js:339:5)
at runCallback (timers.js:794:20)
at tryOnImmediate (timers.js:752:5)
at processImmediate [as _immediateCallback] (timers.js:729:5)
(node:30504) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
There are two concerns here:
- The error itself should be fixed.
- The tests should fail when an unhandled promise rejection occurs.
In reality we ought to fix the latter issue first, confirm the tests begin failing, then fix the error itself.
The error is:
There are two concerns here:
In reality we ought to fix the latter issue first, confirm the tests begin failing, then fix the error itself.