matteofigus / api-benchmark

A node.js tool to benchmark APIs
MIT License
311 stars 35 forks source link

Expected response body handler callback #27

Closed dmyers closed 8 years ago

dmyers commented 9 years ago

@matteofigus In order to find API routes that have errors, in addition to status code checking, I was thinking it could be useful to be able to pass a callback handler which is passed the response object and can determine if the response body is what is expected and would return a boolean.

matteofigus commented 9 years ago

We could emit an event for each request with the response body, problem is that parsing would block the single-threaded event-loop and affect results. We should split this in order to use a separate thread so it is actually a little bit complicated.

dmyers commented 9 years ago

Ah good call. Might be best to keep it out then I hadn't thought of that.