eugef / node-mocks-http

Mock 'http' objects for testing Express routing functions
Other
753 stars 133 forks source link

Support for range function #175

Closed rhodgkins closed 5 years ago

rhodgkins commented 5 years ago

Added in .range() function to mock request, including tests.

Also tidied up lint warnings and updated version in package-lock.json.

howardabrams commented 5 years ago

Very nice, and thanks for the tests. Would it make sense to add some usage examples for this function?

rhodgkins commented 5 years ago

Yep will do. Shall I also update the change log too, or does that get done when someone releases?

On 5 Oct 2018, at 22:24, Howard Abrams notifications@github.com wrote:

Very nice, and thanks for the tests. Would it make sense to add some usage examples for this function?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

rhodgkins commented 5 years ago

@howardabrams actually thinking about it now, I'm not sure usage examples do make sense? It's just mimicking express's Response.range() function, so in reality you don't really need to call the function in tests, it's more for use in express middleware handlers.

Happy to add a note about support for express methods (is, accepts, params) into the README tho?

howardabrams commented 5 years ago

A note in the README would be nice, and yeah, if you are going to update the version number then updating the history file would be grand. Thanks for the PR.

On Oct 7, 2018, at 2:25 AM, Rich Hodgkins notifications@github.com wrote:

@howardabrams https://github.com/howardabrams actually thinking about it now, I'm not sure usage examples do make sense? It's just mimicking express's Response.range() function http://expressjs.com/en/4x/api.html#req.range, so in reality you don't really need to call the function in tests, it's more for use in express middleware handlers.

Happy to add a note about support for express methods (is, accepts, params) into the README tho?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/howardabrams/node-mocks-http/pull/175#issuecomment-427638594, or mute the thread https://github.com/notifications/unsubscribe-auth/AAejja7szkoTCZyJhw10rl3fgKa04XXJks5uich1gaJpZM4XKaeC.

rhodgkins commented 5 years ago

@howardabrams - done! I've added NEXT RELEASE to change log instead of a version number to show it's not yet released - hope that's OK. I guess whoever does the release can then replace that with the eventual version number :)

eugef commented 5 years ago

LGTM