diff --git a/test/parallel/test-async-wrap-check-providers.js b/test/parallel/test-async-wrap-check-providers.js index 4b5447b82c..5125890f99 100644 --- a/test/parallel/test-async-wrap-check-providers.js +++ b/test/parallel/test-async-wrap-check-providers.js @@ -1,6 +1,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const assert = require('assert'); const crypto = require('crypto'); const dgram = require('dgram'); diff --git a/test/parallel/test-async-wrap-post-did-throw.js b/test/parallel/test-async-wrap-post-did-throw.js index 9781983f58..37f18b649d 100644 --- a/test/parallel/test-async-wrap-post-did-throw.js +++ b/test/parallel/test-async-wrap-post-did-throw.js @@ -1,6 +1,11 @@ 'use strict'; -require('../common'); +const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const assert = require('assert'); const async_wrap = process.binding('async_wrap'); var asyncThrows = 0; diff --git a/test/parallel/test-async-wrap-throw-from-callback.js b/test/parallel/test-async-wrap-throw-from-callback.js index bfbe32c38b..8b8316a65f 100644 --- a/test/parallel/test-async-wrap-throw-from-callback.js +++ b/test/parallel/test-async-wrap-throw-from-callback.js @@ -1,6 +1,11 @@ 'use strict'; -require('../common'); +const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const async_wrap = process.binding('async_wrap'); const assert = require('assert'); const crypto = require('crypto'); diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index 2e29cd723d..15b56c642b 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -2,12 +2,12 @@ var common = require('../common'); var assert = require('assert'); var fs = require('fs'); -var constants = require('crypto').constants; if (!common.hasCrypto) { common.skip('missing crypto'); return; } +var constants = require('crypto').constants; var crypto = require('crypto'); // Test certificates diff --git a/test/parallel/test-http-invalid-urls.js b/test/parallel/test-http-invalid-urls.js index 678e8eceeb..65cca822f9 100644 --- a/test/parallel/test-http-invalid-urls.js +++ b/test/parallel/test-http-invalid-urls.js @@ -1,6 +1,11 @@ 'use strict'; -require('../common'); +const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const assert = require('assert'); const http = require('http'); const https = require('https'); diff --git a/test/parallel/test-https-agent-getname.js b/test/parallel/test-https-agent-getname.js index 63473775b0..49c1dcef4f 100644 --- a/test/parallel/test-https-agent-getname.js +++ b/test/parallel/test-https-agent-getname.js @@ -1,6 +1,11 @@ 'use strict'; -require('../common'); +const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-https-connect-address-family.js b/test/parallel/test-https-connect-address-family.js index b2f3c233cf..5bfb7d851c 100644 --- a/test/parallel/test-https-connect-address-family.js +++ b/test/parallel/test-https-connect-address-family.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-https-resume-after-renew.js b/test/parallel/test-https-resume-after-renew.js index 6a1238f6e8..a1fb93194f 100644 --- a/test/parallel/test-https-resume-after-renew.js +++ b/test/parallel/test-https-resume-after-renew.js @@ -1,5 +1,10 @@ 'use strict'; -var common = require('../common'); +const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + var fs = require('fs'); var https = require('https'); var crypto = require('crypto'); diff --git a/test/parallel/test-net-access-byteswritten.js b/test/parallel/test-net-access-byteswritten.js index 362d533bbb..5b734e7c6d 100644 --- a/test/parallel/test-net-access-byteswritten.js +++ b/test/parallel/test-net-access-byteswritten.js @@ -1,6 +1,10 @@ 'use strict'; -require('../common'); +const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} const assert = require('assert'); const net = require('net'); const tls = require('tls'); diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js index c716e48aef..6fc5151d38 100644 --- a/test/parallel/test-npm-install.js +++ b/test/parallel/test-npm-install.js @@ -1,5 +1,9 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} const path = require('path'); const spawn = require('child_process').spawn; diff --git a/test/parallel/test-stream-base-no-abort.js b/test/parallel/test-stream-base-no-abort.js index d2d8702676..fa33bfb019 100644 --- a/test/parallel/test-stream-base-no-abort.js +++ b/test/parallel/test-stream-base-no-abort.js @@ -1,9 +1,14 @@ 'use strict'; +const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const async_wrap = process.binding('async_wrap'); const uv = process.binding('uv'); const assert = require('assert'); -const common = require('../common'); const dgram = require('dgram'); const fs = require('fs'); const net = require('net'); diff --git a/test/parallel/test-tls-async-cb-after-socket-end.js b/test/parallel/test-tls-async-cb-after-socket-end.js index f43f7e9441..34621053e9 100644 --- a/test/parallel/test-tls-async-cb-after-socket-end.js +++ b/test/parallel/test-tls-async-cb-after-socket-end.js @@ -1,16 +1,15 @@ 'use strict'; -var common = require('../common'); - -var path = require('path'); -var fs = require('fs'); -const SSL_OP_NO_TICKET = require('crypto').constants.SSL_OP_NO_TICKET; - +const common = require('../common'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } +const path = require('path'); +const fs = require('fs'); +const SSL_OP_NO_TICKET = require('crypto').constants.SSL_OP_NO_TICKET; + var tls = require('tls'); var options = { diff --git a/test/parallel/test-tls-basic-validations.js b/test/parallel/test-tls-basic-validations.js index a741f3b49c..fa0165b370 100644 --- a/test/parallel/test-tls-basic-validations.js +++ b/test/parallel/test-tls-basic-validations.js @@ -1,6 +1,11 @@ 'use strict'; -require('../common'); +const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-connect-address-family.js b/test/parallel/test-tls-connect-address-family.js index 665a71dfe6..59a5c579ef 100644 --- a/test/parallel/test-tls-connect-address-family.js +++ b/test/parallel/test-tls-connect-address-family.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-connect-stream-writes.js b/test/parallel/test-tls-connect-stream-writes.js index 811967a896..7a7bc7a708 100644 --- a/test/parallel/test-tls-connect-stream-writes.js +++ b/test/parallel/test-tls-connect-stream-writes.js @@ -1,5 +1,10 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const assert = require('assert'); const fs = require('fs'); const tls = require('tls'); diff --git a/test/parallel/test-tls-npn-server-client.js b/test/parallel/test-tls-npn-server-client.js index 446d249c60..d6fcb5956c 100644 --- a/test/parallel/test-tls-npn-server-client.js +++ b/test/parallel/test-tls-npn-server-client.js @@ -1,11 +1,11 @@ 'use strict'; +const common = require('../common'); if (!process.features.tls_npn) { common.skip('node compiled without OpenSSL or ' + 'with old OpenSSL version.'); return; } -const common = require('../common'); const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-parse-cert-string.js b/test/parallel/test-tls-parse-cert-string.js index 2a3c449481..b90fa2b32c 100644 --- a/test/parallel/test-tls-parse-cert-string.js +++ b/test/parallel/test-tls-parse-cert-string.js @@ -1,6 +1,10 @@ 'use strict'; +const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} -require('../common'); const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-securepair-fiftharg.js b/test/parallel/test-tls-securepair-fiftharg.js index b461011788..99564055ef 100644 --- a/test/parallel/test-tls-securepair-fiftharg.js +++ b/test/parallel/test-tls-securepair-fiftharg.js @@ -1,6 +1,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const assert = require('assert'); const fs = require('fs'); const tls = require('tls'); diff --git a/test/parallel/test-tls-sni-option.js b/test/parallel/test-tls-sni-option.js index c548e2f424..f0742d7e1f 100644 --- a/test/parallel/test-tls-sni-option.js +++ b/test/parallel/test-tls-sni-option.js @@ -1,11 +1,11 @@ 'use strict'; +const common = require('../common'); if (!process.features.tls_sni) { common.skip('node compiled without OpenSSL or ' + 'with old OpenSSL version.'); return; } -const common = require('../common'); const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-sni-server-client.js b/test/parallel/test-tls-sni-server-client.js index e228b76bea..422f7e1fb7 100644 --- a/test/parallel/test-tls-sni-server-client.js +++ b/test/parallel/test-tls-sni-server-client.js @@ -1,11 +1,11 @@ 'use strict'; +const common = require('../common'); if (!process.features.tls_sni) { common.skip('node compiled without OpenSSL or ' + 'with old OpenSSL version.'); return; } -const common = require('../common'); const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-two-cas-one-string.js b/test/parallel/test-tls-two-cas-one-string.js index ba9b3609c2..b5fe578017 100644 --- a/test/parallel/test-tls-two-cas-one-string.js +++ b/test/parallel/test-tls-two-cas-one-string.js @@ -1,6 +1,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const tls = require('tls'); const fs = require('fs'); diff --git a/test/parallel/test-tls-wrap-no-abort.js b/test/parallel/test-tls-wrap-no-abort.js index a64aea0b05..c18b17a640 100644 --- a/test/parallel/test-tls-wrap-no-abort.js +++ b/test/parallel/test-tls-wrap-no-abort.js @@ -1,6 +1,11 @@ 'use strict'; -require('../common'); +const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + const util = require('util'); const TLSWrap = process.binding('tls_wrap').TLSWrap;