node-mocks-http
Advanced tools
Changelog
v 1.2.0
.header
and .get
method to the request.Changelog
v 1.1.0
.header
, .set
, and .get
method to the response.Changelog
v 1.0.3
Merged changes by invernizzie: to address #11
Merged changes by ericchaves:
I extended your library a little but so it could also handle some structured responses. By doing so res.send now evaluate the data passed and search for either a statusCode or httpCode to be used, and also for a body to send as _data.
It still working as expected (at least tests passed) for regular HTTP responses.
Although I did it with node-restify in mind, it should work well for all other libs.