node.js: Mock http request and response


Question

Is there convenient way to mock the HTTP Request and Response objects for unit testing middlewares?

1
34
12/4/2014 11:30:27 PM

It looks like both https://github.com/howardabrams/node-mocks-http and https://github.com/vojtajina/node-mocks can be used to create mock http.ServerRequest and http.ServerResponse objects.

25
2/25/2013 1:33:59 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon