nodejs/test/parallel/test-tls-snicallback-error.js

15 lines
383 B
JavaScript

'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const tls = require('tls');
['fhqwhgads', 42, {}, []].forEach((testValue) => {
assert.throws(
() => { tls.createServer({ SNICallback: testValue }); },
{ code: 'ERR_INVALID_ARG_TYPE', message: /\boptions\.SNICallback\b/ }
);
});