11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ci// This test verifies that `tls.connect()` honors the `timeout` option when the 61cb0ef41Sopenharmony_ci// socket is internally created. 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ciif (!common.hasCrypto) 91cb0ef41Sopenharmony_ci common.skip('missing crypto'); 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ciconst assert = require('assert'); 121cb0ef41Sopenharmony_ciconst tls = require('tls'); 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ciconst socket = tls.connect({ 151cb0ef41Sopenharmony_ci port: 42, 161cb0ef41Sopenharmony_ci lookup: () => {}, 171cb0ef41Sopenharmony_ci timeout: 1000 181cb0ef41Sopenharmony_ci}); 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ciassert.strictEqual(socket.timeout, 1000); 21