mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 18:44:40 +00:00

PR-URL: https://github.com/nodejs/node/pull/15766 Ref: https://github.com/nodejs/node/issues/14985 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
23 lines
553 B
JavaScript
23 lines
553 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const http2 = require('http2');
|
|
|
|
const invalidOptions = [() => {}, 1, 'test', null, undefined];
|
|
const invalidArgTypeError = {
|
|
type: TypeError,
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
message: 'The "options" argument must be of type object'
|
|
};
|
|
|
|
// Error if options are not passed to createSecureServer
|
|
invalidOptions.forEach((invalidOption) =>
|
|
common.expectsError(
|
|
() => http2.createSecureServer(invalidOption),
|
|
invalidArgTypeError
|
|
)
|
|
);
|