mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 22:28:51 +02:00

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>
9 lines
258 B
JavaScript
9 lines
258 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const http = require('http');
|
|
|
|
assert.throws(
|
|
() => { http.request({method: '\0'}); },
|
|
common.expectsError(undefined, TypeError, 'Method must be a valid HTTP token')
|
|
);
|