diff options
author | Oky Antoro <kiantrue@gmail.com> | 2017-08-11 22:30:03 +0700 |
---|---|---|
committer | Alexey Orlenko <eaglexrlnk@gmail.com> | 2017-08-14 09:44:21 +0300 |
commit | 1268737e7198b77817fd0abf18edef5e76b78b33 (patch) | |
tree | 8c59ce6e4bd4d681315c0a26a4aaf6ded80a5782 /test | |
parent | 170ff0e4bbc31acd4dca779082ff517a6374ae49 (diff) | |
download | android-node-v8-1268737e7198b77817fd0abf18edef5e76b78b33.tar.gz android-node-v8-1268737e7198b77817fd0abf18edef5e76b78b33.tar.bz2 android-node-v8-1268737e7198b77817fd0abf18edef5e76b78b33.zip |
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: https://github.com/nodejs/node/pull/14773
Refs: https://github.com/nodejs/node/issues/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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-http-methods.js | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/test/parallel/test-http-methods.js b/test/parallel/test-http-methods.js index 9d00d8598d..f56d1a5fb3 100644 --- a/test/parallel/test-http-methods.js +++ b/test/parallel/test-http-methods.js @@ -23,11 +23,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()); |