Permalink
Browse files

test: cover all HTTP methods that parser supports

Cover all request methods that Node's HTTP parser supports in
parallel/test-http-methods.

PR-URL: #14773
Refs: #14544
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
okyantoro authored and MylesBorins committed Aug 11, 2017
1 parent d20b7bf commit 1aac05b087400f707ab6799d6d53fb373b1ede70
Showing with 40 additions and 7 deletions.
  1. +40 −7 test/parallel/test-http-methods.js
@@ -2,11 +2,44 @@
require('../common');
const assert = require('assert');
const http = require('http');
const util = require('util');
assert(Array.isArray(http.METHODS));
assert(http.METHODS.length > 0);
assert(http.METHODS.includes('GET'));
assert(http.METHODS.includes('HEAD'));
assert(http.METHODS.includes('POST'));
assert.deepStrictEqual(util._extend([], http.METHODS), http.METHODS.sort());
// This test ensures all http methods from HTTP parser are exposed
// to http library
const methods = [
'DELETE',
'GET',
'HEAD',
'POST',
'PUT',
'CONNECT',
'OPTIONS',
'TRACE',
'COPY',
'LOCK',
'MKCOL',
'MOVE',
'PROPFIND',
'PROPPATCH',
'SEARCH',
'UNLOCK',
'BIND',
'REBIND',
'UNBIND',
'ACL',
'REPORT',
'MKACTIVITY',
'CHECKOUT',
'MERGE',
'M-SEARCH',
'NOTIFY',
'SUBSCRIBE',
'UNSUBSCRIBE',
'PATCH',
'PURGE',
'MKCALENDAR',
'LINK',
'UNLINK'
];
assert.deepStrictEqual(http.METHODS, methods.sort());

0 comments on commit 1aac05b

Please sign in to comment.