mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 20:08:02 +00:00

Improve http2 coverage through refactoring and tests PR-URL: https://github.com/nodejs/node/pull/15210 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
43 lines
861 B
JavaScript
43 lines
861 B
JavaScript
// Flags: --expose-http2
|
|
'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
|
|
});
|
|
}
|