mirror of
https://github.com/nodejs/node.git
synced 2025-05-04 15:02:25 +00:00

Make the `http2` module always available. The `--expose-http2` cli flag is made a non-op PR-URL: https://github.com/nodejs/node/pull/15535 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
42 lines
836 B
JavaScript
42 lines
836 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const http2 = require('http2');
|
|
|
|
// Verify that setTimeout callback verifications work correctly
|
|
|
|
{
|
|
const server = http2.createServer();
|
|
common.expectsError(
|
|
() => server.setTimeout(10, 'test'),
|
|
{
|
|
code: 'ERR_INVALID_CALLBACK',
|
|
type: TypeError
|
|
});
|
|
common.expectsError(
|
|
() => server.setTimeout(10, 1),
|
|
{
|
|
code: 'ERR_INVALID_CALLBACK',
|
|
type: TypeError
|
|
});
|
|
}
|
|
|
|
{
|
|
const server = http2.createSecureServer({});
|
|
common.expectsError(
|
|
() => server.setTimeout(10, 'test'),
|
|
{
|
|
code: 'ERR_INVALID_CALLBACK',
|
|
type: TypeError
|
|
});
|
|
common.expectsError(
|
|
() => server.setTimeout(10, 1),
|
|
{
|
|
code: 'ERR_INVALID_CALLBACK',
|
|
type: TypeError
|
|
});
|
|
}
|