summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-request-invalid-method-error.js
AgeCommit message (Collapse)Author
2017-12-08test: replace assert.throws w/ common.expectsErrorMithun Sasidharan
PR-URL: https://github.com/nodejs/node/pull/17497 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-08-14errors: migrate _http_outgoingWeijia Wang
PR-URL: https://github.com/nodejs/node/pull/14735 Refs: https://github.com/nodejs/node/issues/11273 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2017-08-01http_client, errors: migrate to internal/errorsWeijia Wang
PR-URL: https://github.com/nodejs/node/pull/14423 Refs: https://github.com/nodejs/node/issues/11273 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-07-21lib,src: fix consistent spacing inside bracesSebastiaan Deckers
PR-URL: https://github.com/nodejs/node/pull/14162 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-02-27test: change common.expectsError() signatureRich Trott
One downside to `common.expectsError()` is that it increases the abstractions people have to learn about in order to work with even simple tests. Whereas before, all they had to know about is `assert.throws()`, now they have to *also* know about `common.expectsError()`. This is very different (IMO) from `common.mustCall()` in that the latter has an intuitively understandable name, accepts arguments as one would expect, and (in most cases) doesn't actually require reading documentation or code to figure out what it's doing. With `common.expectsError()`, there's a fair bit of magic. Like, it's not obvious what the first argument would be. Or the second. Or the third. You just have to know. This PR changes the arguments accepted by `common.expectsError()` to a single settings object. Someone coming across this has a hope of understanding what's going on without reading source or docs: ```js const validatorFunction = common.expectsError({code: 'ELOOP', type: Error, message: 'foo'}); ``` This, by comparison, is harder to grok: ```js const validatorFunction = common.expectsError('ELOOP', Error, 'foo'); ``` And this is especially wat-inducing: ```js common.expectsError(undefined, undefined, 'looped doodad found'); ``` It's likely that only people who work with tests frequently can be expected to remember the three arguments and their order. By comparison, remembering that the error code is `code` and the message is `message` might be manageable. PR-URL: https://github.com/nodejs/node/pull/11512 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-02-17test: use common.expectsError()Rich Trott
Use common.expectsError() instead of rolling own validation function in test-http-request-invalid-method-error.js. common.expectsError() didn't exist when the test was written, but now it does. PR-URL: https://github.com/nodejs/node/pull/11408 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-12-03test: test for http.request() invalid method errorAshton Kinslow
Adds a test for when an invalid http method is passed into http.request() to verify an error is thrown, that the error is the correct type, and the error message is correct. PR-URL: https://github.com/nodejs/node/pull/10080 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>