Is there convenient way to mock the HTTP Request and Response objects for unit testing middlewares?
question from:https://stackoverflow.com/questions/8021956/node-js-mock-http-request-and-responseIs there convenient way to mock the HTTP Request and Response objects for unit testing middlewares?
question from:https://stackoverflow.com/questions/8021956/node-js-mock-http-request-and-responseIt 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.