RocksonZeta / koa-validate

validate koa request params and format request params
https://github.com/RocksonZeta/koa-validate
MIT License
284 stars 32 forks source link

how are you guys unit testing this? #28

Open mikiebrenbren opened 7 years ago

mikiebrenbren commented 7 years ago

I know this question may not belong here but I will ask anyway.

In order to test this I have had to use supertest, which is more of an integration test. The problem I am having is trying to figure out how to emulate the 'koa context' in order to test it because the validator is attached to the context in the middleware. I really like this validator and don't want to move to another one, so any suggestions would be great. Thanks!