@nthlytics/testable-koa-next

A function that returns another function intended to be passed to tests that ensure a piece of Koa middleware waits for next to return.

Stats

StarsIssuesVersionUpdatedCreatedSize
@nthlytics/testable-koa-next
1.0.33 years ago3 years agoMinified + gzip package size for @nthlytics/testable-koa-next in KB

Readme

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)

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.