From c8153ce41187a7f4774487c4594a2ad3fc4fb0e4 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 8 Jan 2019 07:39:56 +0100 Subject: [PATCH] test: move require('https') to after crypto check Currently, test-https-client-override-global-agent.js fails with the following error when configured --without-ssl: Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support at Object.assertCrypto (internal/util.js:101:11) ... at Object. (/node/test/parallel/test-https-client-override-global-agent.js:5:15) This commit moves the require statement to after the crypto check. PR-URL: https://github.com/nodejs/node/pull/25388 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: James M Snell --- test/parallel/test-https-client-override-global-agent.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-https-client-override-global-agent.js b/test/parallel/test-https-client-override-global-agent.js index 12b5ae596bc837..0aaab0d7b3ef96 100644 --- a/test/parallel/test-https-client-override-global-agent.js +++ b/test/parallel/test-https-client-override-global-agent.js @@ -1,12 +1,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); const fixtures = require('../common/fixtures'); const assert = require('assert'); const https = require('https'); -if (!common.hasCrypto) - common.skip('missing crypto'); - // Disable strict server certificate validation by the client process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';