Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roadmap towards 2.0 - Requests for Comments #54

Closed
6 of 16 tasks
estilles opened this issue Mar 30, 2015 · 1 comment
Closed
6 of 16 tasks

Roadmap towards 2.0 - Requests for Comments #54

estilles opened this issue Mar 30, 2015 · 1 comment

Comments

@estilles
Copy link

Roadmap to node-mocks-http v2.0

We want node-mocks-http to provide Express 4.x compatible request and response object mocks. As with 1.x we want 2.x to be as lightweight and dependency free as possible.

The list below is a first draft of our roadmap towards 2.0. It is by no means comprehensive or final. Comments, questions and requests are most definitely welcome.

Proposed Changes

  • add mockStream (with sufficient functionality for mockStreamReadable), which will inherit from EventEmitter used real Stream
  • deprecate mockEventEmitter in favor using a real EventEmitter
  • add mockStreamReadable (with sufficient functionality for mockHttpIncomingMessage), which will inherit from mockStream used real Stream.Readable
  • update mockStreamWritable (with sufficient functionality for mockHttpOutgoingMessage), which will inherit from mockStream used real Stream.Writable
  • add mockHttpIncomingMessage node/_http_incoming.js (to mock http.IncomingMessage), which will inherit from mockStreamReadable
  • add mockHttpOutgoingMessage (to mock http.OutgoingMessage), which will inherit from mockWritableReadable
  • add mockHttpServerResponse (to mock http.ServerResponse)
  • add mockApp, which will serve as a parent to mockRequest and mockResponse, and will perform some initialization task, so as associating mockRequest with mockResponse (and vice versa). It will likewise provide the ability to configure Express-related settings that have an effect on request and response
  • deprecate .createRequest() and .createResponse() methods in favor of a .createApp(), which will return an mockApp instance that includes both a mockRequest and a mockResponse instance.

NOTE: The intent of the above mocks is to support (via inheritance) mockRequest and mockResponse. These will contain only a subset of their "real life" counterparts. They will be used internally by node-mocks-http and will not be exported for consumption.

We will consider expanding them to full-blown mocks that can be made available for public consumption in future versions of node-mocks-http.

  • update mockRequest to inherit from mockHttpIncomingMessage
  • update mockResponse to inherit form mockHttpServerResponse
  • add warning for all deprecated Express functionality (maybe using deprecate depd as Express does)

Pending Issues

The proposed changes for 2.0 will either response or provide a means to resolve all pending issues.

Comments and Contributions

If you're a node-mocks-http user/consumer we would love to hear your thoughts regarding our 2.0 Roadmap. Please leave your comments below.

For those of you who wish to contribute, we will be creating 2.x branch during the first week of April against which you can submit your pull requests. we've merged our progress of 2.x onto master. Submit any pull request for 2.x against master. Please read and follow our contributing guidelines prior to your submission.

@estilles estilles added this to the v2.0 milestone Mar 30, 2015
@estilles estilles self-assigned this Apr 9, 2015
@estilles estilles changed the title 2.0 Roadmap - Requests for Comments Roadmap towards 2.0 - Requests for Comments Apr 11, 2015
@estilles estilles mentioned this issue May 29, 2015
@github-actions
Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant