@nthlytics/testable-koa-next

1.0.3 • Public • Published

testable-koa-next

A function that returns another function intended to be passed as next to Koa middleware functions under test conditions. Assertions can then be made about whether the middleware function waited for next to complete before returning.

Usage

const koaNext = createKoaNext();
await koaNext();
console.log(koaNext.didComplete)

const longerKoaNext = createKoaNext(100); 100ms
await longerKoaNext();
console.log(koaNext.didComplete)

Package Sidebar

Install

npm i @nthlytics/testable-koa-next

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

4.2 kB

Total Files

8

Last publish

Collaborators

  • nthlytics