diff options
author | James M Snell <jasnell@gmail.com> | 2017-09-05 15:02:48 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-09-13 09:47:09 -0700 |
commit | ad3d899ae0d29c219e9c246414d70ddfd4a7ec3b (patch) | |
tree | a9a54c8cbe35d060a6a53bde8c8172e719d6722b /test/parallel/test-http2-createsecureserver-nooptions.js | |
parent | dcc41fd6623a638dd34fa58ce33e73811c9f7acb (diff) | |
download | node-new-ad3d899ae0d29c219e9c246414d70ddfd4a7ec3b.tar.gz |
http2: improve http2 coverage
Improve http2 coverage through refactoring and tests
PR-URL: https://github.com/nodejs/node/pull/15210
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-createsecureserver-nooptions.js')
-rw-r--r-- | test/parallel/test-http2-createsecureserver-nooptions.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/parallel/test-http2-createsecureserver-nooptions.js b/test/parallel/test-http2-createsecureserver-nooptions.js new file mode 100644 index 0000000000..5a9849f9e1 --- /dev/null +++ b/test/parallel/test-http2-createsecureserver-nooptions.js @@ -0,0 +1,45 @@ +// Flags: --expose-http2 +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +const http2 = require('http2'); + +// Error if options are not passed to createSecureServer + +common.expectsError( + () => http2.createSecureServer(), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + }); + +common.expectsError( + () => http2.createSecureServer(() => {}), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + }); + +common.expectsError( + () => http2.createSecureServer(1), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + }); + +common.expectsError( + () => http2.createSecureServer('test'), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + }); + +common.expectsError( + () => http2.createSecureServer(null), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError + }); |