From bc99efc9739d252d5307c78fd40fc80307cd6d98 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Sat, 1 Jul 2017 02:29:09 +0300 Subject: [PATCH] test: simplify test skipping * Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann --- test/abort/test-abort-backtrace.js | 8 +++----- test/addons/load-long-path/test.js | 8 +++----- test/addons/openssl-binding/test.js | 5 ++--- .../test-stringbytes-external-at-max.js | 15 +++++---------- ...ingbytes-external-exceed-max-by-1-ascii.js | 15 +++++---------- ...ngbytes-external-exceed-max-by-1-base64.js | 15 +++++---------- ...ngbytes-external-exceed-max-by-1-binary.js | 15 +++++---------- ...tringbytes-external-exceed-max-by-1-hex.js | 15 +++++---------- ...ringbytes-external-exceed-max-by-1-utf8.js | 15 +++++---------- ...st-stringbytes-external-exceed-max-by-2.js | 15 +++++---------- .../test-stringbytes-external-exceed-max.js | 15 +++++---------- test/addons/symlinked-module/test.js | 1 - test/async-hooks/test-connection.ssl.js | 10 ++++------ test/async-hooks/test-crypto-pbkdf2.js | 5 ++--- test/async-hooks/test-crypto-randomBytes.js | 5 ++--- test/async-hooks/test-graph.connection.js | 10 ++++------ test/async-hooks/test-graph.shutdown.js | 9 +++------ test/async-hooks/test-graph.tcp.js | 9 +++------ test/async-hooks/test-graph.tls-write.js | 16 ++++++---------- test/async-hooks/test-tcpwrap.js | 9 +++------ test/async-hooks/test-tlswrap.js | 10 ++++------ test/async-hooks/test-ttywrap.writestream.js | 10 ++++++---- test/async-hooks/test-writewrap.js | 10 ++++------ test/common/README.md | 7 ++++++- test/common/index.js | 8 ++++++-- test/doctool/test-doctool-html.js | 9 ++++----- test/doctool/test-doctool-json.js | 9 ++++----- test/fixtures/tls-connect.js | 9 ++++----- test/inspector/test-inspector-ip-detection.js | 6 ++---- .../test-dgram-broadcast-multi-process.js | 8 +++----- .../test-dgram-multicast-multi-process.js | 10 ++++------ test/internet/test-dns-ipv6.js | 8 +++----- .../internet/test-http-https-default-ports.js | 5 ++--- test/internet/test-tls-add-ca-cert.js | 4 +--- .../internet/test-tls-connnect-melissadata.js | 4 +--- .../test-tls-reuse-host-from-socket.js | 5 ++--- test/known_issues/test-cwd-enoent-file.js | 1 - test/parallel/test-async-wrap-GH13045.js | 4 +--- .../test-async-wrap-uncaughtexception.js | 5 ++--- test/parallel/test-benchmark-crypto.js | 8 ++------ test/parallel/test-buffer-alloc.js | 2 +- .../parallel/test-child-process-fork-dgram.js | 8 +++----- test/parallel/test-cli-node-options.js | 2 +- .../test-cluster-bind-privileged-port.js | 16 ++++++---------- test/parallel/test-cluster-dgram-1.js | 9 +++------ test/parallel/test-cluster-dgram-2.js | 9 +++------ test/parallel/test-cluster-dgram-reuse.js | 8 +++----- test/parallel/test-cluster-disconnect-race.js | 8 +++----- .../test-cluster-disconnect-unshared-udp.js | 4 +--- test/parallel/test-cluster-http-pipe.js | 9 ++++----- ...ster-shared-handle-bind-privileged-port.js | 16 ++++++---------- test/parallel/test-crypto-authenticated.js | 12 +++++------- test/parallel/test-crypto-binary-default.js | 4 +--- test/parallel/test-crypto-certificate.js | 8 +++----- test/parallel/test-crypto-cipher-decipher.js | 10 ++++------ .../test-crypto-cipheriv-decipheriv.js | 8 +++----- test/parallel/test-crypto-deprecated.js | 8 +++----- test/parallel/test-crypto-dh-odd-key.js | 8 +++----- test/parallel/test-crypto-dh.js | 9 ++++----- test/parallel/test-crypto-domain.js | 8 +++----- test/parallel/test-crypto-domains.js | 11 +++++------ test/parallel/test-crypto-ecb.js | 13 +++++-------- test/parallel/test-crypto-engine.js | 4 +--- test/parallel/test-crypto-fips.js | 8 +++----- test/parallel/test-crypto-from-binary.js | 8 +++----- test/parallel/test-crypto-hash-stream-pipe.js | 4 +--- test/parallel/test-crypto-hash.js | 8 +++----- test/parallel/test-crypto-hmac.js | 8 +++----- .../test-crypto-lazy-transform-writable.js | 5 ++--- test/parallel/test-crypto-padding-aes256.js | 8 +++----- test/parallel/test-crypto-padding.js | 8 +++----- test/parallel/test-crypto-pbkdf2.js | 5 +---- test/parallel/test-crypto-random.js | 5 ++--- test/parallel/test-crypto-rsa-dsa.js | 10 ++++------ test/parallel/test-crypto-sign-verify.js | 12 ++++-------- test/parallel/test-crypto-stream.js | 8 +++----- test/parallel/test-crypto-verify-failure.js | 5 ++--- test/parallel/test-crypto.js | 4 +--- test/parallel/test-cwd-enoent-preload.js | 10 ++++------ test/parallel/test-cwd-enoent-repl.js | 10 ++++------ test/parallel/test-cwd-enoent.js | 10 ++++------ test/parallel/test-debug-usage.js | 8 +++----- .../test-dgram-bind-default-address.js | 12 +++++------- .../test-dgram-cluster-close-during-bind.js | 8 +++----- test/parallel/test-dgram-send-empty-array.js | 4 +--- test/parallel/test-dgram-send-empty-buffer.js | 7 ++----- test/parallel/test-dgram-send-empty-packet.js | 7 ++----- .../test-dgram-udp6-send-default-host.js | 8 +++----- test/parallel/test-dh-padding.js | 4 +--- test/parallel/test-domain-crypto.js | 4 +--- test/parallel/test-dsa-fips-invalid-key.js | 7 ++----- test/parallel/test-fs-long-path.js | 8 +++----- .../test-fs-read-file-sync-hostname.js | 8 +++----- test/parallel/test-fs-readdir-ucs2.js | 8 +++----- test/parallel/test-fs-readfile-error.js | 12 +++++------- test/parallel/test-fs-readfile-pipe-large.js | 8 +++----- test/parallel/test-fs-readfile-pipe.js | 6 ++---- .../test-fs-readfilesync-pipe-large.js | 8 +++----- .../test-fs-realpath-on-substed-drive.js | 11 ++++------- test/parallel/test-fs-realpath-pipe.js | 4 +--- test/parallel/test-fs-realpath.js | 16 ++++++++-------- test/parallel/test-fs-symlink.js | 8 +++----- test/parallel/test-fs-watch-encoding.js | 9 ++++----- test/parallel/test-fs-watch-recursive.js | 4 +--- test/parallel/test-http-chunk-problem.js | 7 +++---- test/parallel/test-http-default-port.js | 4 +--- test/parallel/test-http-dns-error.js | 6 ++---- test/parallel/test-http-full-response.js | 2 +- test/parallel/test-http-invalid-urls.js | 4 +--- test/parallel/test-http-localaddress.js | 8 +++----- .../test-http-url.parse-https.request.js | 9 +++------ test/parallel/test-https-agent-constructor.js | 5 ++--- .../test-https-agent-create-connection.js | 4 +--- .../test-https-agent-disable-session-reuse.js | 12 ++++-------- test/parallel/test-https-agent-getname.js | 4 +--- .../test-https-agent-secure-protocol.js | 7 ++----- test/parallel/test-https-agent-servername.js | 4 +--- .../test-https-agent-session-eviction.js | 4 +--- .../test-https-agent-session-reuse.js | 4 +--- test/parallel/test-https-agent-sni.js | 9 +++------ .../parallel/test-https-agent-sockets-leak.js | 4 +--- test/parallel/test-https-agent.js | 9 +++------ .../test-https-argument-of-creating.js | 4 +--- test/parallel/test-https-byteswritten.js | 8 +++----- .../test-https-client-checkServerIdentity.js | 9 +++------ test/parallel/test-https-client-get-url.js | 10 ++++------ test/parallel/test-https-client-reject.js | 9 +++------ test/parallel/test-https-client-resume.js | 9 +++------ test/parallel/test-https-close.js | 8 +++----- .../test-https-connect-address-family.js | 13 ++++--------- .../parallel/test-https-connecting-to-http.js | 9 +++------ test/parallel/test-https-drain.js | 9 +++------ test/parallel/test-https-eof-for-eom.js | 9 +++------ test/parallel/test-https-foafssl.js | 12 +++--------- test/parallel/test-https-host-headers.js | 10 ++++------ .../test-https-localaddress-bind-error.js | 8 +++----- test/parallel/test-https-localaddress.js | 16 ++++++---------- test/parallel/test-https-pfx.js | 8 +++----- test/parallel/test-https-req-split.js | 7 +++---- .../parallel/test-https-resume-after-renew.js | 4 +--- .../test-https-server-keep-alive-timeout.js | 5 ++--- test/parallel/test-https-simple.js | 4 +--- test/parallel/test-https-socket-options.js | 7 ++----- test/parallel/test-https-strict.js | 9 +++------ test/parallel/test-https-timeout-server-2.js | 9 +++------ test/parallel/test-https-timeout-server.js | 5 ++--- test/parallel/test-https-timeout.js | 5 ++--- test/parallel/test-https-truncate.js | 4 +--- .../test-https-unix-socket-self-signed.js | 4 +--- test/parallel/test-icu-data-dir.js | 5 ++--- test/parallel/test-icu-punycode.js | 4 +--- test/parallel/test-icu-stringwidth.js | 4 +--- test/parallel/test-icu-transcode.js | 4 +--- test/parallel/test-inspector-open.js | 3 +-- test/parallel/test-intl-v8BreakIterator.js | 5 ++--- test/parallel/test-intl.js | 3 +-- test/parallel/test-listen-fd-cluster.js | 8 +++----- .../test-listen-fd-detached-inherit.js | 8 +++----- test/parallel/test-listen-fd-detached.js | 8 +++----- test/parallel/test-listen-fd-server.js | 8 +++----- .../parallel/test-module-circular-symlinks.js | 1 - .../test-module-symlinked-peer-modules.js | 1 - test/parallel/test-net-access-byteswritten.js | 5 ++--- test/parallel/test-net-connect-options-fd.js | 8 +++----- .../parallel/test-net-connect-options-ipv6.js | 10 ++++------ .../parallel/test-net-socket-local-address.js | 10 ++++------ test/parallel/test-npm-install.js | 4 +--- test/parallel/test-openssl-ca-options.js | 5 ++--- test/parallel/test-pipe-writev.js | 8 +++----- test/parallel/test-preload.js | 10 ++++------ test/parallel/test-process-execpath.js | 8 +++----- test/parallel/test-process-getgroups.js | 5 ++--- ...est-process-remove-all-signal-listeners.js | 9 +++------ test/parallel/test-regress-GH-1531.js | 5 ++--- test/parallel/test-regress-GH-3542.js | 10 ++++------ test/parallel/test-regress-GH-9819.js | 8 +++----- test/parallel/test-repl-history-perm.js | 1 - test/parallel/test-repl-sigint-nested-eval.js | 8 +++----- test/parallel/test-repl-sigint.js | 8 +++----- test/parallel/test-require-long-path.js | 8 +++----- test/parallel/test-require-symlink.js | 4 +--- test/parallel/test-setproctitle.js | 10 ++++------ test/parallel/test-signal-handler.js | 4 +--- test/parallel/test-spawn-cmd-named-pipe.js | 8 +++----- test/parallel/test-tls-0-dns-altname.js | 9 +++------ test/parallel/test-tls-alert-handling.js | 12 ++++-------- test/parallel/test-tls-alert.js | 11 +++-------- test/parallel/test-tls-alpn-server-client.js | 5 +---- .../test-tls-async-cb-after-socket-end.js | 4 +--- test/parallel/test-tls-basic-validations.js | 4 +--- test/parallel/test-tls-cert-regression.js | 5 ++--- .../test-tls-check-server-identity.js | 4 +--- test/parallel/test-tls-cipher-list.js | 4 +--- test/parallel/test-tls-client-abort.js | 9 +++------ test/parallel/test-tls-client-abort2.js | 8 +++----- .../test-tls-client-default-ciphers.js | 8 +++----- test/parallel/test-tls-client-destroy-soon.js | 9 +++------ .../test-tls-client-getephemeralkeyinfo.js | 10 ++++------ test/parallel/test-tls-client-mindhsize.js | 10 ++++------ test/parallel/test-tls-client-reject.js | 9 +++------ test/parallel/test-tls-client-resume.js | 9 +++------ test/parallel/test-tls-client-verify.js | 5 +---- test/parallel/test-tls-close-error.js | 9 +++------ test/parallel/test-tls-close-notify.js | 6 ++---- test/parallel/test-tls-cnnic-whitelist.js | 4 +--- .../test-tls-connect-address-family.js | 13 ++++--------- .../parallel/test-tls-connect-given-socket.js | 10 ++++------ test/parallel/test-tls-connect-no-host.js | 5 ++--- test/parallel/test-tls-connect-pipe.js | 5 ++--- test/parallel/test-tls-connect-simple.js | 5 ++--- .../test-tls-connect-stream-writes.js | 4 +--- test/parallel/test-tls-connect.js | 6 ++---- .../parallel/test-tls-delayed-attach-error.js | 5 ++--- test/parallel/test-tls-delayed-attach.js | 9 +++------ .../parallel/test-tls-destroy-whilst-write.js | 5 ++--- test/parallel/test-tls-dhe.js | 13 ++++--------- test/parallel/test-tls-ecdh-disable.js | 12 +++--------- test/parallel/test-tls-ecdh.js | 8 ++------ test/parallel/test-tls-econnreset.js | 8 +++----- test/parallel/test-tls-empty-sni-context.js | 11 +++-------- test/parallel/test-tls-env-bad-extra-ca.js | 4 +--- test/parallel/test-tls-env-extra-ca.js | 4 +--- test/parallel/test-tls-external-accessor.js | 10 ++++------ test/parallel/test-tls-fast-writing.js | 9 +++------ .../test-tls-friendly-error-message.js | 9 +++------ test/parallel/test-tls-getcipher.js | 5 ++--- test/parallel/test-tls-getprotocol.js | 7 ++----- test/parallel/test-tls-handshake-error.js | 9 +++------ test/parallel/test-tls-handshake-nohang.js | 5 ++--- .../parallel/test-tls-hello-parser-failure.js | 4 +--- test/parallel/test-tls-honorcipherorder.js | 10 ++++------ test/parallel/test-tls-inception.js | 4 +--- test/parallel/test-tls-interleave.js | 5 ++--- test/parallel/test-tls-invoke-queued.js | 4 +--- test/parallel/test-tls-js-stream.js | 9 +++------ test/parallel/test-tls-junk-closes-server.js | 4 +--- test/parallel/test-tls-junk-server.js | 4 +--- test/parallel/test-tls-key-mismatch.js | 5 ++--- test/parallel/test-tls-legacy-deprecated.js | 5 ++--- test/parallel/test-tls-legacy-onselect.js | 5 ++--- test/parallel/test-tls-lookup.js | 5 ++--- test/parallel/test-tls-max-send-fragment.js | 9 +++------ test/parallel/test-tls-multi-key.js | 8 +++----- test/parallel/test-tls-no-cert-required.js | 8 +++----- test/parallel/test-tls-no-rsa-key.js | 9 +++------ test/parallel/test-tls-no-sslv23.js | 8 +++----- test/parallel/test-tls-no-sslv3.js | 19 +++++++------------ test/parallel/test-tls-npn-server-client.js | 12 ++++-------- test/parallel/test-tls-ocsp-callback.js | 14 +++++--------- test/parallel/test-tls-on-empty-socket.js | 5 ++--- test/parallel/test-tls-over-http-tunnel.js | 9 +++------ test/parallel/test-tls-parse-cert-string.js | 4 +--- test/parallel/test-tls-passphrase.js | 9 +++------ test/parallel/test-tls-pause.js | 9 +++------ .../test-tls-peer-certificate-encoding.js | 9 +++------ .../test-tls-peer-certificate-multi-keys.js | 9 +++------ test/parallel/test-tls-pfx-gh-5100-regr.js | 4 +--- test/parallel/test-tls-regr-gh-5108.js | 4 +--- test/parallel/test-tls-request-timeout.js | 9 +++------ .../test-tls-retain-handle-no-abort.js | 8 +++----- test/parallel/test-tls-securepair-fiftharg.js | 4 +--- test/parallel/test-tls-securepair-leak.js | 7 ++----- test/parallel/test-tls-securepair-server.js | 12 +++--------- .../test-tls-server-connection-server.js | 4 +--- ...rver-failed-handshake-emits-clienterror.js | 5 ++--- test/parallel/test-tls-server-verify.js | 12 ++++-------- test/parallel/test-tls-session-cache.js | 8 ++------ test/parallel/test-tls-set-ciphers.js | 8 ++------ test/parallel/test-tls-set-encoding.js | 10 +++------- test/parallel/test-tls-sni-option.js | 12 ++++-------- test/parallel/test-tls-sni-server-client.js | 12 ++++-------- test/parallel/test-tls-socket-close.js | 6 ++---- test/parallel/test-tls-socket-destroy.js | 4 +--- ...tls-socket-failed-handshake-emits-error.js | 5 ++--- .../test-tls-startcom-wosign-whitelist.js | 5 +---- test/parallel/test-tls-starttls-server.js | 4 +--- test/parallel/test-tls-ticket-cluster.js | 9 +++------ test/parallel/test-tls-ticket.js | 9 +++------ test/parallel/test-tls-timeout-server-2.js | 9 +++------ test/parallel/test-tls-timeout-server.js | 6 ++---- test/parallel/test-tls-two-cas-one-string.js | 4 +--- .../test-tls-wrap-econnreset-localaddress.js | 5 ++--- .../parallel/test-tls-wrap-econnreset-pipe.js | 5 ++--- .../test-tls-wrap-econnreset-socket.js | 5 ++--- test/parallel/test-tls-wrap-econnreset.js | 5 ++--- test/parallel/test-tls-wrap-event-emmiter.js | 5 ++--- test/parallel/test-tls-wrap-no-abort.js | 4 +--- test/parallel/test-tls-wrap-timeout.js | 5 ++--- test/parallel/test-tls-writewrap-leak.js | 4 +--- test/parallel/test-tls-zero-clear-in.js | 5 ++--- .../parallel/test-url-domain-ascii-unicode.js | 5 ++--- test/parallel/test-url-format-whatwg.js | 5 ++--- test/parallel/test-util-sigint-watchdog.js | 7 +++---- .../test-vm-sigint-existing-handler.js | 12 +++++------- test/parallel/test-vm-sigint.js | 11 ++++------- test/parallel/test-warn-sigprof.js | 4 +--- test/parallel/test-whatwg-url-constructor.js | 11 +++++------ test/parallel/test-whatwg-url-domainto.js | 4 +--- test/parallel/test-whatwg-url-historical.js | 7 +++---- test/parallel/test-whatwg-url-inspect.js | 9 ++++----- test/parallel/test-whatwg-url-origin.js | 9 ++++----- test/parallel/test-whatwg-url-parsing.js | 9 ++++----- test/parallel/test-whatwg-url-setters.js | 11 +++++------ test/parallel/test-whatwg-url-toascii.js | 9 ++++----- test/parallel/test-windows-abort-exitcode.js | 9 ++++----- test/parallel/test-zlib-random-byte-pipes.js | 11 ++++------- test/pummel/test-abort-fatal-error.js | 7 ++----- test/pummel/test-crypto-dh.js | 8 +++----- ...est-crypto-timing-safe-equal-benchmarks.js | 11 +++-------- test/pummel/test-dh-regr.js | 8 +++----- test/pummel/test-dtrace-jsstack.js | 8 +++----- test/pummel/test-https-ci-reneg-attack.js | 17 ++++++----------- test/pummel/test-https-large-response.js | 9 +++------ test/pummel/test-https-no-reader.js | 9 +++------ test/pummel/test-keep-alive.js | 8 +++----- test/pummel/test-regress-GH-892.js | 9 +++------ test/pummel/test-tls-ci-reneg-attack.js | 17 ++++++----------- test/pummel/test-tls-connect-memleak.js | 9 +++------ test/pummel/test-tls-securepair-client.js | 9 ++------- test/pummel/test-tls-server-large-request.js | 9 +++------ test/pummel/test-tls-session-timeout.js | 8 ++------ test/pummel/test-tls-throttle.js | 8 +++----- test/sequential/test-benchmark-http.js | 4 +--- .../test-buffer-creation-regression.js | 3 ++- test/sequential/test-child-process-emfile.js | 8 +++----- test/sequential/test-child-process-pass-fd.js | 10 ++++------ .../test-crypto-timing-safe-equal.js | 7 ++----- .../test-fs-readfile-tostring-fail.js | 7 ++----- .../test-https-set-timeout-server.js | 4 +--- test/sequential/test-net-server-address.js | 2 +- .../test-tick-processor-builtin.js | 12 ++++-------- .../test-tick-processor-cpp-core.js | 12 ++++-------- .../test-tick-processor-unknown.js | 8 ++------ 333 files changed, 896 insertions(+), 1633 deletions(-) diff --git a/test/abort/test-abort-backtrace.js b/test/abort/test-abort-backtrace.js index 7f72ee8e71c6a5..dd108171684018 100644 --- a/test/abort/test-abort-backtrace.js +++ b/test/abort/test-abort-backtrace.js @@ -1,13 +1,11 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('Backtraces unimplemented on Windows.'); + const assert = require('assert'); const cp = require('child_process'); -if (common.isWindows) { - common.skip('Backtraces unimplemented on Windows.'); - return; -} - if (process.argv[2] === 'child') { process.abort(); } else { diff --git a/test/addons/load-long-path/test.js b/test/addons/load-long-path/test.js index 73d85a75a097a2..accb90d2638274 100644 --- a/test/addons/load-long-path/test.js +++ b/test/addons/load-long-path/test.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../../common'); +if (common.isWOW64) + common.skip('doesn\'t work on WOW64'); + const fs = require('fs'); const path = require('path'); const assert = require('assert'); -if (common.isWOW64) { - common.skip('doesn\'t work on WOW64'); - return; -} - common.refreshTmpDir(); // make a path that is more than 260 chars long. diff --git a/test/addons/openssl-binding/test.js b/test/addons/openssl-binding/test.js index 452f59f752f5e5..1e6c57ffd1e081 100644 --- a/test/addons/openssl-binding/test.js +++ b/test/addons/openssl-binding/test.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - process.exit(0); -} + const assert = require('assert'); const binding = require(`./build/${common.buildType}/binding`); const bytes = new Uint8Array(1024); diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js index 5dd727f8ffddd3..4c074773a21fc2 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js @@ -1,6 +1,10 @@ 'use strict'; const common = require('../../common'); +const skipMessage = 'intensive toString tests due to memory confinements'; +if (!common.enoughTestMem) + common.skip(skipMessage); + const binding = require(`./build/${common.buildType}/binding`); const assert = require('assert'); @@ -8,12 +12,6 @@ const assert = require('assert'); // v8::String::kMaxLength defined in v8.h const kStringMaxLength = process.binding('buffer').kStringMaxLength; -const skipMessage = 'intensive toString tests due to memory confinements'; -if (!common.enoughTestMem) { - common.skip(skipMessage); - return; -} - let buf; try { buf = Buffer.allocUnsafe(kStringMaxLength); @@ -21,14 +19,11 @@ try { // If the exception is not due to memory confinement then rethrow it. if (e.message !== 'Array buffer allocation failed') throw (e); common.skip(skipMessage); - return; } // Ensure we have enough memory available for future allocations to succeed. -if (!binding.ensureAllocation(2 * kStringMaxLength)) { +if (!binding.ensureAllocation(2 * kStringMaxLength)) common.skip(skipMessage); - return; -} const maxString = buf.toString('latin1'); assert.strictEqual(maxString.length, kStringMaxLength); diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js index 2466c8ec42ed57..43b8c63f1e466e 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../../common'); -const binding = require(`./build/${common.buildType}/binding`); -const assert = require('assert'); - const skipMessage = 'intensive toString tests due to memory confinements'; -if (!common.enoughTestMem) { +if (!common.enoughTestMem) common.skip(skipMessage); - return; -} + +const binding = require(`./build/${common.buildType}/binding`); +const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h @@ -21,14 +19,11 @@ try { // If the exception is not due to memory confinement then rethrow it. if (e.message !== 'Array buffer allocation failed') throw (e); common.skip(skipMessage); - return; } // Ensure we have enough memory available for future allocations to succeed. -if (!binding.ensureAllocation(2 * kStringMaxLength)) { +if (!binding.ensureAllocation(2 * kStringMaxLength)) common.skip(skipMessage); - return; -} assert.throws(function() { buf.toString('ascii'); diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js index 16f0f5392e5206..a94a57e18037fd 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../../common'); -const binding = require(`./build/${common.buildType}/binding`); -const assert = require('assert'); - const skipMessage = 'intensive toString tests due to memory confinements'; -if (!common.enoughTestMem) { +if (!common.enoughTestMem) common.skip(skipMessage); - return; -} + +const binding = require(`./build/${common.buildType}/binding`); +const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h @@ -21,14 +19,11 @@ try { // If the exception is not due to memory confinement then rethrow it. if (e.message !== 'Array buffer allocation failed') throw (e); common.skip(skipMessage); - return; } // Ensure we have enough memory available for future allocations to succeed. -if (!binding.ensureAllocation(2 * kStringMaxLength)) { +if (!binding.ensureAllocation(2 * kStringMaxLength)) common.skip(skipMessage); - return; -} assert.throws(function() { buf.toString('base64'); diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js index 1028706b1d1aa9..996c01752da7c6 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../../common'); -const binding = require(`./build/${common.buildType}/binding`); -const assert = require('assert'); - const skipMessage = 'intensive toString tests due to memory confinements'; -if (!common.enoughTestMem) { +if (!common.enoughTestMem) common.skip(skipMessage); - return; -} + +const binding = require(`./build/${common.buildType}/binding`); +const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h @@ -21,14 +19,11 @@ try { // If the exception is not due to memory confinement then rethrow it. if (e.message !== 'Array buffer allocation failed') throw (e); common.skip(skipMessage); - return; } // Ensure we have enough memory available for future allocations to succeed. -if (!binding.ensureAllocation(2 * kStringMaxLength)) { +if (!binding.ensureAllocation(2 * kStringMaxLength)) common.skip(skipMessage); - return; -} assert.throws(function() { buf.toString('latin1'); diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js index caf6112011e2a8..17d9ae5d68f033 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../../common'); -const binding = require(`./build/${common.buildType}/binding`); -const assert = require('assert'); - const skipMessage = 'intensive toString tests due to memory confinements'; -if (!common.enoughTestMem) { +if (!common.enoughTestMem) common.skip(skipMessage); - return; -} + +const binding = require(`./build/${common.buildType}/binding`); +const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h @@ -21,14 +19,11 @@ try { // If the exception is not due to memory confinement then rethrow it. if (e.message !== 'Array buffer allocation failed') throw (e); common.skip(skipMessage); - return; } // Ensure we have enough memory available for future allocations to succeed. -if (!binding.ensureAllocation(2 * kStringMaxLength)) { +if (!binding.ensureAllocation(2 * kStringMaxLength)) common.skip(skipMessage); - return; -} assert.throws(function() { buf.toString('hex'); diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js index 4d3199a033e6d5..d3368ca7b2ea6b 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../../common'); -const binding = require(`./build/${common.buildType}/binding`); -const assert = require('assert'); - const skipMessage = 'intensive toString tests due to memory confinements'; -if (!common.enoughTestMem) { +if (!common.enoughTestMem) common.skip(skipMessage); - return; -} + +const binding = require(`./build/${common.buildType}/binding`); +const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h @@ -21,14 +19,11 @@ try { // If the exception is not due to memory confinement then rethrow it. if (e.message !== 'Array buffer allocation failed') throw (e); common.skip(skipMessage); - return; } // Ensure we have enough memory available for future allocations to succeed. -if (!binding.ensureAllocation(2 * kStringMaxLength)) { +if (!binding.ensureAllocation(2 * kStringMaxLength)) common.skip(skipMessage); - return; -} assert.throws(function() { buf.toString(); diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js index 786d0b679895e1..db007a53a44f3b 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../../common'); -const binding = require(`./build/${common.buildType}/binding`); -const assert = require('assert'); - const skipMessage = 'intensive toString tests due to memory confinements'; -if (!common.enoughTestMem) { +if (!common.enoughTestMem) common.skip(skipMessage); - return; -} + +const binding = require(`./build/${common.buildType}/binding`); +const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h @@ -21,14 +19,11 @@ try { // If the exception is not due to memory confinement then rethrow it. if (e.message !== 'Array buffer allocation failed') throw (e); common.skip(skipMessage); - return; } // Ensure we have enough memory available for future allocations to succeed. -if (!binding.ensureAllocation(2 * kStringMaxLength)) { +if (!binding.ensureAllocation(2 * kStringMaxLength)) common.skip(skipMessage); - return; -} const maxString = buf.toString('utf16le'); assert.strictEqual(maxString.length, (kStringMaxLength + 2) / 2); diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js index 36b0d4174a030b..319a8a93558c45 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../../common'); -const binding = require(`./build/${common.buildType}/binding`); -const assert = require('assert'); - const skipMessage = 'intensive toString tests due to memory confinements'; -if (!common.enoughTestMem) { +if (!common.enoughTestMem) common.skip(skipMessage); - return; -} + +const binding = require(`./build/${common.buildType}/binding`); +const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h @@ -21,14 +19,11 @@ try { // If the exception is not due to memory confinement then rethrow it. if (e.message !== 'Array buffer allocation failed') throw (e); common.skip(skipMessage); - return; } // Ensure we have enough memory available for future allocations to succeed. -if (!binding.ensureAllocation(2 * kStringMaxLength)) { +if (!binding.ensureAllocation(2 * kStringMaxLength)) common.skip(skipMessage); - return; -} assert.throws(function() { buf.toString('utf16le'); diff --git a/test/addons/symlinked-module/test.js b/test/addons/symlinked-module/test.js index d2025c54e4360b..d9455c027bd36b 100644 --- a/test/addons/symlinked-module/test.js +++ b/test/addons/symlinked-module/test.js @@ -22,7 +22,6 @@ try { } catch (err) { if (err.code !== 'EPERM') throw err; common.skip('module identity test (no privs for symlinks)'); - return; } const sub = require('./submodule'); diff --git a/test/async-hooks/test-connection.ssl.js b/test/async-hooks/test-connection.ssl.js index ac3e069fb8a21d..faee0fdf080e42 100644 --- a/test/async-hooks/test-connection.ssl.js +++ b/test/async-hooks/test-connection.ssl.js @@ -1,16 +1,14 @@ 'use strict'; +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const initHooks = require('./init-hooks'); const tick = require('./tick'); -const common = require('../common'); const assert = require('assert'); const { checkInvocations } = require('./hook-checks'); -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} - const tls = require('tls'); const Connection = process.binding('crypto').Connection; const hooks = initHooks(); diff --git a/test/async-hooks/test-crypto-pbkdf2.js b/test/async-hooks/test-crypto-pbkdf2.js index 3023101f0b6640..2a0b44db8ce7a8 100644 --- a/test/async-hooks/test-crypto-pbkdf2.js +++ b/test/async-hooks/test-crypto-pbkdf2.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const tick = require('./tick'); const initHooks = require('./init-hooks'); diff --git a/test/async-hooks/test-crypto-randomBytes.js b/test/async-hooks/test-crypto-randomBytes.js index 49ffc6fdb612ea..76f8f7759503c4 100644 --- a/test/async-hooks/test-crypto-randomBytes.js +++ b/test/async-hooks/test-crypto-randomBytes.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const tick = require('./tick'); const initHooks = require('./init-hooks'); diff --git a/test/async-hooks/test-graph.connection.js b/test/async-hooks/test-graph.connection.js index 37ecc79bb06956..fcc764b5ccf218 100644 --- a/test/async-hooks/test-graph.connection.js +++ b/test/async-hooks/test-graph.connection.js @@ -1,13 +1,11 @@ 'use strict'; -const initHooks = require('./init-hooks'); const common = require('../common'); -const verifyGraph = require('./verify-graph'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const initHooks = require('./init-hooks'); +const verifyGraph = require('./verify-graph'); const tls = require('tls'); const Connection = process.binding('crypto').Connection; diff --git a/test/async-hooks/test-graph.shutdown.js b/test/async-hooks/test-graph.shutdown.js index 029a9c86b66763..136f01821217c1 100644 --- a/test/async-hooks/test-graph.shutdown.js +++ b/test/async-hooks/test-graph.shutdown.js @@ -1,14 +1,11 @@ 'use strict'; const common = require('../common'); -const initHooks = require('./init-hooks'); -const verifyGraph = require('./verify-graph'); - -if (!common.hasIPv6) { +if (!common.hasIPv6) common.skip('IPv6 support required'); - return; -} +const initHooks = require('./init-hooks'); +const verifyGraph = require('./verify-graph'); const net = require('net'); const hooks = initHooks(); diff --git a/test/async-hooks/test-graph.tcp.js b/test/async-hooks/test-graph.tcp.js index f9703769b831b9..872615990733cc 100644 --- a/test/async-hooks/test-graph.tcp.js +++ b/test/async-hooks/test-graph.tcp.js @@ -1,14 +1,11 @@ 'use strict'; const common = require('../common'); -const initHooks = require('./init-hooks'); -const verifyGraph = require('./verify-graph'); - -if (!common.hasIPv6) { +if (!common.hasIPv6) common.skip('IPv6 support required'); - return; -} +const initHooks = require('./init-hooks'); +const verifyGraph = require('./verify-graph'); const net = require('net'); const hooks = initHooks(); diff --git a/test/async-hooks/test-graph.tls-write.js b/test/async-hooks/test-graph.tls-write.js index 77a97bedbc5438..338a714c322314 100644 --- a/test/async-hooks/test-graph.tls-write.js +++ b/test/async-hooks/test-graph.tls-write.js @@ -1,21 +1,17 @@ 'use strict'; const common = require('../common'); -const initHooks = require('./init-hooks'); -const verifyGraph = require('./verify-graph'); -const fs = require('fs'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (!common.hasIPv6) { +if (!common.hasIPv6) common.skip('IPv6 support required'); - return; -} +const initHooks = require('./init-hooks'); +const verifyGraph = require('./verify-graph'); +const fs = require('fs'); const tls = require('tls'); + const hooks = initHooks(); hooks.enable(); diff --git a/test/async-hooks/test-tcpwrap.js b/test/async-hooks/test-tcpwrap.js index 0dce8c7d9f0bde..b4021753a072ed 100644 --- a/test/async-hooks/test-tcpwrap.js +++ b/test/async-hooks/test-tcpwrap.js @@ -2,16 +2,13 @@ 'use strict'; const common = require('../common'); +if (!common.hasIPv6) + common.skip('IPv6 support required'); + const assert = require('assert'); const tick = require('./tick'); const initHooks = require('./init-hooks'); const { checkInvocations } = require('./hook-checks'); - -if (!common.hasIPv6) { - common.skip('IPv6 support required'); - return; -} - const net = require('net'); let tcp1, tcp2, tcp3; diff --git a/test/async-hooks/test-tlswrap.js b/test/async-hooks/test-tlswrap.js index 47cca62c182af9..878afac06311a9 100644 --- a/test/async-hooks/test-tlswrap.js +++ b/test/async-hooks/test-tlswrap.js @@ -1,18 +1,16 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const tick = require('./tick'); const initHooks = require('./init-hooks'); const fs = require('fs'); const { checkInvocations } = require('./hook-checks'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} - const tls = require('tls'); + const hooks = initHooks(); hooks.enable(); diff --git a/test/async-hooks/test-ttywrap.writestream.js b/test/async-hooks/test-ttywrap.writestream.js index b1cc768877d925..990460b53760fe 100644 --- a/test/async-hooks/test-ttywrap.writestream.js +++ b/test/async-hooks/test-ttywrap.writestream.js @@ -1,14 +1,16 @@ 'use strict'; const common = require('../common'); + +const tty_fd = common.getTTYfd(); +if (tty_fd < 0) + common.skip('no valid TTY fd available'); + const assert = require('assert'); const tick = require('./tick'); const initHooks = require('./init-hooks'); const { checkInvocations } = require('./hook-checks'); -const tty_fd = common.getTTYfd(); -if (tty_fd < 0) - return common.skip('no valid TTY fd available'); const ttyStream = (() => { try { return new (require('tty').WriteStream)(tty_fd); @@ -17,7 +19,7 @@ const ttyStream = (() => { } })(); if (ttyStream === null) - return common.skip('no valid TTY fd available'); + common.skip('no valid TTY fd available'); const hooks = initHooks(); hooks.enable(); diff --git a/test/async-hooks/test-writewrap.js b/test/async-hooks/test-writewrap.js index 6253b09d4adccc..eca0d08f10f402 100644 --- a/test/async-hooks/test-writewrap.js +++ b/test/async-hooks/test-writewrap.js @@ -1,17 +1,15 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const initHooks = require('./init-hooks'); const fs = require('fs'); const { checkInvocations } = require('./hook-checks'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} - const tls = require('tls'); + const hooks = initHooks(); hooks.enable(); diff --git a/test/common/README.md b/test/common/README.md index f418115ce31805..78145b412fd6be 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -277,6 +277,11 @@ Path to the test sock. Port tests are running on. +### printSkipMessage(msg) +* `msg` [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) + +Logs '1..0 # Skipped: ' + `msg` + ### refreshTmpDir * return [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) @@ -298,7 +303,7 @@ Path to the 'root' directory. either `/` or `c:\\` (windows) ### skip(msg) * `msg` [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) -Logs '1..0 # Skipped: ' + `msg` +Logs '1..0 # Skipped: ' + `msg` and exits with exit code `0`. ### spawnPwd(options) * `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) diff --git a/test/common/index.js b/test/common/index.js index 5c820211d72033..f92b535efc524f 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -571,10 +571,15 @@ exports.mustNotCall = function(msg) { }; }; -exports.skip = function(msg) { +exports.printSkipMessage = function(msg) { console.log(`1..0 # Skipped: ${msg}`); }; +exports.skip = function(msg) { + exports.printSkipMessage(msg); + process.exit(0); +}; + // A stream to push an array into a REPL function ArrayStream() { this.run = function(data) { @@ -718,7 +723,6 @@ exports.expectsError = function expectsError({code, type, message}) { exports.skipIfInspectorDisabled = function skipIfInspectorDisabled() { if (process.config.variables.v8_enable_inspector === 0) { exports.skip('V8 inspector is disabled'); - process.exit(0); } }; diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js index 3af5a5409db103..64f1d7f8b142f5 100644 --- a/test/doctool/test-doctool-html.js +++ b/test/doctool/test-doctool-html.js @@ -1,17 +1,16 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const fs = require('fs'); -const path = require('path'); - // The doctool currently uses js-yaml from the tool/eslint/ tree. try { require('../../tools/eslint/node_modules/js-yaml'); } catch (e) { - return common.skip('missing js-yaml (eslint not present)'); + common.skip('missing js-yaml (eslint not present)'); } +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); const processIncludes = require('../../tools/doc/preprocess.js'); const html = require('../../tools/doc/html.js'); diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js index 346a7f331e9d7f..4a4d3a895c3f20 100644 --- a/test/doctool/test-doctool-json.js +++ b/test/doctool/test-doctool-json.js @@ -1,17 +1,16 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const fs = require('fs'); -const path = require('path'); - // The doctool currently uses js-yaml from the tool/eslint/ tree. try { require('../../tools/eslint/node_modules/js-yaml'); } catch (e) { - return common.skip('missing js-yaml (eslint not present)'); + common.skip('missing js-yaml (eslint not present)'); } +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); const json = require('../../tools/doc/json.js'); // Outputs valid json with the expected fields when given simple markdown diff --git a/test/fixtures/tls-connect.js b/test/fixtures/tls-connect.js index a434a0316d6fb5..2ce75a53767724 100644 --- a/test/fixtures/tls-connect.js +++ b/test/fixtures/tls-connect.js @@ -4,14 +4,13 @@ 'use strict'; const common = require('../common'); -const fs = require('fs'); -const join = require('path').join; // Check if Node was compiled --without-ssl and if so exit early // as the require of tls will otherwise throw an Error. -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - process.exit(0); -} + +const fs = require('fs'); +const join = require('path').join; const tls = require('tls'); const util = require('util'); diff --git a/test/inspector/test-inspector-ip-detection.js b/test/inspector/test-inspector-ip-detection.js index ad51c631645e4a..be5e34a977eb84 100644 --- a/test/inspector/test-inspector-ip-detection.js +++ b/test/inspector/test-inspector-ip-detection.js @@ -9,10 +9,8 @@ const os = require('os'); const ip = pickIPv4Address(); -if (!ip) { +if (!ip) common.skip('No IP address found'); - return; -} function checkListResponse(instance, err, response) { assert.ifError(err); @@ -29,7 +27,7 @@ function checkListResponse(instance, err, response) { function checkError(instance, error) { // Some OSes will not allow us to connect if (error.code === 'EHOSTUNREACH') { - common.skip('Unable to connect to self'); + common.printSkipMessage('Unable to connect to self'); } else { throw error; } diff --git a/test/internet/test-dgram-broadcast-multi-process.js b/test/internet/test-dgram-broadcast-multi-process.js index 79e139248454d5..0ec4bbd9ce5aa7 100644 --- a/test/internet/test-dgram-broadcast-multi-process.js +++ b/test/internet/test-dgram-broadcast-multi-process.js @@ -21,6 +21,9 @@ 'use strict'; const common = require('../common'); +if (common.inFreeBSDJail) + common.skip('in a FreeBSD jail'); + const assert = require('assert'); const dgram = require('dgram'); const util = require('util'); @@ -35,11 +38,6 @@ const messages = [ Buffer.from('Fourth message to send') ]; -if (common.inFreeBSDJail) { - common.skip('in a FreeBSD jail'); - return; -} - let bindAddress = null; // Take the first non-internal interface as the address for binding. diff --git a/test/internet/test-dgram-multicast-multi-process.js b/test/internet/test-dgram-multicast-multi-process.js index dac8abd6a7a436..a7854652eab49f 100644 --- a/test/internet/test-dgram-multicast-multi-process.js +++ b/test/internet/test-dgram-multicast-multi-process.js @@ -21,6 +21,10 @@ 'use strict'; const common = require('../common'); +// Skip test in FreeBSD jails. +if (common.inFreeBSDJail) + common.skip('In a FreeBSD jail'); + const assert = require('assert'); const dgram = require('dgram'); const fork = require('child_process').fork; @@ -37,12 +41,6 @@ const listeners = 3; let listening, sendSocket, done, timer, dead; -// Skip test in FreeBSD jails. -if (common.inFreeBSDJail) { - common.skip('In a FreeBSD jail'); - return; -} - function launchChildProcess() { const worker = fork(__filename, ['child']); workers[worker.pid] = worker; diff --git a/test/internet/test-dns-ipv6.js b/test/internet/test-dns-ipv6.js index 31f9df5eab8a51..9b9360c2a1628c 100644 --- a/test/internet/test-dns-ipv6.js +++ b/test/internet/test-dns-ipv6.js @@ -1,5 +1,8 @@ 'use strict'; const common = require('../common'); +if (!common.hasIPv6) + common.skip('this test, no IPv6 support'); + const assert = require('assert'); const dns = require('dns'); const net = require('net'); @@ -8,11 +11,6 @@ const isIPv6 = net.isIPv6; let running = false; const queue = []; -if (!common.hasIPv6) { - common.skip('this test, no IPv6 support'); - return; -} - function TEST(f) { function next() { const f = queue.shift(); diff --git a/test/internet/test-http-https-default-ports.js b/test/internet/test-http-https-default-ports.js index b0eb682519bae6..567b045dc6eacf 100644 --- a/test/internet/test-http-https-default-ports.js +++ b/test/internet/test-http-https-default-ports.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const https = require('https'); const http = require('http'); diff --git a/test/internet/test-tls-add-ca-cert.js b/test/internet/test-tls-add-ca-cert.js index 1283230e911b4d..299e01405d7dbd 100644 --- a/test/internet/test-tls-add-ca-cert.js +++ b/test/internet/test-tls-add-ca-cert.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} // Test interaction of compiled-in CAs with user-provided CAs. diff --git a/test/internet/test-tls-connnect-melissadata.js b/test/internet/test-tls-connnect-melissadata.js index f57b897099fc2d..ab5aa3950938b3 100644 --- a/test/internet/test-tls-connnect-melissadata.js +++ b/test/internet/test-tls-connnect-melissadata.js @@ -3,10 +3,8 @@ // certification between Starfield Class 2 and ValiCert Class 2 const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const tls = require('tls'); const socket = tls.connect(443, 'address.melissadata.net', function() { diff --git a/test/internet/test-tls-reuse-host-from-socket.js b/test/internet/test-tls-reuse-host-from-socket.js index fda9712156cb11..73ee91d3b2ea0d 100644 --- a/test/internet/test-tls-reuse-host-from-socket.js +++ b/test/internet/test-tls-reuse-host-from-socket.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const net = require('net'); diff --git a/test/known_issues/test-cwd-enoent-file.js b/test/known_issues/test-cwd-enoent-file.js index 9431919804af4e..b2f59cbca7d48a 100644 --- a/test/known_issues/test-cwd-enoent-file.js +++ b/test/known_issues/test-cwd-enoent-file.js @@ -9,7 +9,6 @@ if (common.isSunOS || common.isWindows || common.isAix) { // The current working directory cannot be removed on these platforms. // Change this to common.skip() when this is no longer a known issue test. assert.fail('cannot rmdir current working directory'); - return; } const cp = require('child_process'); diff --git a/test/parallel/test-async-wrap-GH13045.js b/test/parallel/test-async-wrap-GH13045.js index 41c6f0cd19eb35..1382de8060813a 100644 --- a/test/parallel/test-async-wrap-GH13045.js +++ b/test/parallel/test-async-wrap-GH13045.js @@ -1,9 +1,7 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} // Refs: https://github.com/nodejs/node/issues/13045 // An HTTP Agent reuses a TLSSocket, and makes a failed call to `asyncReset`. diff --git a/test/parallel/test-async-wrap-uncaughtexception.js b/test/parallel/test-async-wrap-uncaughtexception.js index f5f81f10052966..9427e2fb787a9b 100644 --- a/test/parallel/test-async-wrap-uncaughtexception.js +++ b/test/parallel/test-async-wrap-uncaughtexception.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const async_hooks = require('async_hooks'); const call_log = [0, 0, 0, 0]; // [before, callback, exception, after]; diff --git a/test/parallel/test-benchmark-crypto.js b/test/parallel/test-benchmark-crypto.js index 55ab98ee2199df..e7f99ad29c0586 100644 --- a/test/parallel/test-benchmark-crypto.js +++ b/test/parallel/test-benchmark-crypto.js @@ -2,15 +2,11 @@ const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (common.hasFipsCrypto) { +if (common.hasFipsCrypto) common.skip('some benchmarks are FIPS-incompatible'); - return; -} // Minimal test for crypto benchmarks. This makes sure the benchmarks aren't // horribly broken but nothing more than that. diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index b5318110fa7182..8bc4ebc9f534ff 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -917,7 +917,7 @@ if (common.hasCrypto) { crypto.createHash('sha1').update(b2).digest('hex') ); } else { - common.skip('missing crypto'); + common.printSkipMessage('missing crypto'); } const ps = Buffer.poolSize; diff --git a/test/parallel/test-child-process-fork-dgram.js b/test/parallel/test-child-process-fork-dgram.js index be351cced04f0c..4aa36261dbb24b 100644 --- a/test/parallel/test-child-process-fork-dgram.js +++ b/test/parallel/test-child-process-fork-dgram.js @@ -28,15 +28,13 @@ */ const common = require('../common'); +if (common.isWindows) + common.skip('Sending dgram sockets to child processes is not supported'); + const dgram = require('dgram'); const fork = require('child_process').fork; const assert = require('assert'); -if (common.isWindows) { - common.skip('Sending dgram sockets to child processes is not supported'); - return; -} - if (process.argv[2] === 'child') { let childServer; diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 0c39813cf62ccd..8622dafbe10af3 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common'); if (process.config.variables.node_without_node_options) - return common.skip('missing NODE_OPTIONS support'); + common.skip('missing NODE_OPTIONS support'); // Test options specified by env variable. diff --git a/test/parallel/test-cluster-bind-privileged-port.js b/test/parallel/test-cluster-bind-privileged-port.js index e726618ffbd31c..99f7a20c4946be 100644 --- a/test/parallel/test-cluster-bind-privileged-port.js +++ b/test/parallel/test-cluster-bind-privileged-port.js @@ -21,19 +21,15 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const cluster = require('cluster'); -const net = require('net'); - -if (common.isWindows) { +if (common.isWindows) common.skip('not reliable on Windows.'); - return; -} -if (process.getuid() === 0) { +if (process.getuid() === 0) common.skip('Test is not supposed to be run as root.'); - return; -} + +const assert = require('assert'); +const cluster = require('cluster'); +const net = require('net'); if (cluster.isMaster) { cluster.fork().on('exit', common.mustCall((exitCode) => { diff --git a/test/parallel/test-cluster-dgram-1.js b/test/parallel/test-cluster-dgram-1.js index 9e0ed3dfb9c7b8..3688c67f6c68c8 100644 --- a/test/parallel/test-cluster-dgram-1.js +++ b/test/parallel/test-cluster-dgram-1.js @@ -21,6 +21,9 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('dgram clustering is currently not supported on Windows.'); + const NUM_WORKERS = 4; const PACKETS_PER_WORKER = 10; @@ -28,12 +31,6 @@ const assert = require('assert'); const cluster = require('cluster'); const dgram = require('dgram'); - -if (common.isWindows) { - common.skip('dgram clustering is currently not supported on Windows.'); - return; -} - if (cluster.isMaster) master(); else diff --git a/test/parallel/test-cluster-dgram-2.js b/test/parallel/test-cluster-dgram-2.js index 9ae903b6eaf22b..7c1dae65600fc0 100644 --- a/test/parallel/test-cluster-dgram-2.js +++ b/test/parallel/test-cluster-dgram-2.js @@ -21,6 +21,9 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('dgram clustering is currently not supported on Windows.'); + const NUM_WORKERS = 4; const PACKETS_PER_WORKER = 10; @@ -28,12 +31,6 @@ const cluster = require('cluster'); const dgram = require('dgram'); const assert = require('assert'); - -if (common.isWindows) { - common.skip('dgram clustering is currently not supported on Windows.'); - return; -} - if (cluster.isMaster) master(); else diff --git a/test/parallel/test-cluster-dgram-reuse.js b/test/parallel/test-cluster-dgram-reuse.js index 1472dcc5238a63..51a4944e554856 100644 --- a/test/parallel/test-cluster-dgram-reuse.js +++ b/test/parallel/test-cluster-dgram-reuse.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('dgram clustering is currently not supported on windows.'); + const assert = require('assert'); const cluster = require('cluster'); const dgram = require('dgram'); -if (common.isWindows) { - common.skip('dgram clustering is currently not supported on windows.'); - return; -} - if (cluster.isMaster) { cluster.fork().on('exit', common.mustCall((code) => { assert.strictEqual(code, 0); diff --git a/test/parallel/test-cluster-disconnect-race.js b/test/parallel/test-cluster-disconnect-race.js index 7bb66ced3663ef..60d8697b671b84 100644 --- a/test/parallel/test-cluster-disconnect-race.js +++ b/test/parallel/test-cluster-disconnect-race.js @@ -4,15 +4,13 @@ // Ref: https://github.com/nodejs/node/issues/4205 const common = require('../common'); +if (common.isWindows) + common.skip('This test does not apply to Windows.'); + const assert = require('assert'); const net = require('net'); const cluster = require('cluster'); -if (common.isWindows) { - common.skip('This test does not apply to Windows.'); - return; -} - cluster.schedulingPolicy = cluster.SCHED_NONE; if (cluster.isMaster) { diff --git a/test/parallel/test-cluster-disconnect-unshared-udp.js b/test/parallel/test-cluster-disconnect-unshared-udp.js index 653ab6cc9c3be8..d34ce11b0285ab 100644 --- a/test/parallel/test-cluster-disconnect-unshared-udp.js +++ b/test/parallel/test-cluster-disconnect-unshared-udp.js @@ -23,10 +23,8 @@ const common = require('../common'); -if (common.isWindows) { +if (common.isWindows) common.skip('on windows, because clustered dgram is ENOTSUP'); - return; -} const cluster = require('cluster'); const dgram = require('dgram'); diff --git a/test/parallel/test-cluster-http-pipe.js b/test/parallel/test-cluster-http-pipe.js index 93b457fd808013..96f741e80443b7 100644 --- a/test/parallel/test-cluster-http-pipe.js +++ b/test/parallel/test-cluster-http-pipe.js @@ -22,16 +22,15 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const cluster = require('cluster'); -const http = require('http'); - if (common.isWindows) { common.skip( 'It is not possible to send pipe handles over the IPC pipe on Windows'); - return; } +const assert = require('assert'); +const cluster = require('cluster'); +const http = require('http'); + if (cluster.isMaster) { common.refreshTmpDir(); const worker = cluster.fork(); diff --git a/test/parallel/test-cluster-shared-handle-bind-privileged-port.js b/test/parallel/test-cluster-shared-handle-bind-privileged-port.js index 419307d52ccf8a..8f05b28fed3308 100644 --- a/test/parallel/test-cluster-shared-handle-bind-privileged-port.js +++ b/test/parallel/test-cluster-shared-handle-bind-privileged-port.js @@ -21,19 +21,15 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const cluster = require('cluster'); -const net = require('net'); - -if (common.isWindows) { +if (common.isWindows) common.skip('not reliable on Windows'); - return; -} -if (process.getuid() === 0) { +if (process.getuid() === 0) common.skip('as this test should not be run as `root`'); - return; -} + +const assert = require('assert'); +const cluster = require('cluster'); +const net = require('net'); if (cluster.isMaster) { // Master opens and binds the socket and shares it with the worker. diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js index 2d5370ba3eac2b..c03aa0efce54e0 100644 --- a/test/parallel/test-crypto-authenticated.js +++ b/test/parallel/test-crypto-authenticated.js @@ -21,12 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); crypto.DEFAULT_ENCODING = 'buffer'; @@ -341,12 +339,12 @@ for (const i in TEST_CASES) { const test = TEST_CASES[i]; if (!ciphers.includes(test.algo)) { - common.skip(`unsupported ${test.algo} test`); + common.printSkipMessage(`unsupported ${test.algo} test`); continue; } if (common.hasFipsCrypto && test.iv.length < 24) { - common.skip('IV len < 12 bytes unsupported in FIPS mode'); + common.printSkipMessage('IV len < 12 bytes unsupported in FIPS mode'); continue; } diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index e92f70035bde78..5bb254057b5a7a 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -26,10 +26,8 @@ const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const crypto = require('crypto'); diff --git a/test/parallel/test-crypto-certificate.js b/test/parallel/test-crypto-certificate.js index 831fed0f14e921..61d8ea8193d5bc 100644 --- a/test/parallel/test-crypto-certificate.js +++ b/test/parallel/test-crypto-certificate.js @@ -21,12 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); crypto.DEFAULT_ENCODING = 'buffer'; diff --git a/test/parallel/test-crypto-cipher-decipher.js b/test/parallel/test-crypto-cipher-decipher.js index dfb68a7f920844..0104341653f7f5 100644 --- a/test/parallel/test-crypto-cipher-decipher.js +++ b/test/parallel/test-crypto-cipher-decipher.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (common.hasFipsCrypto) { + +if (common.hasFipsCrypto) common.skip('not supported in FIPS mode'); - return; -} + const crypto = require('crypto'); const assert = require('assert'); diff --git a/test/parallel/test-crypto-cipheriv-decipheriv.js b/test/parallel/test-crypto-cipheriv-decipheriv.js index 31a79d8bf175b8..96ca44fec82856 100644 --- a/test/parallel/test-crypto-cipheriv-decipheriv.js +++ b/test/parallel/test-crypto-cipheriv-decipheriv.js @@ -1,11 +1,9 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); function testCipher1(key, iv) { diff --git a/test/parallel/test-crypto-deprecated.js b/test/parallel/test-crypto-deprecated.js index 903862d6c8ed27..84f25316d49b61 100644 --- a/test/parallel/test-crypto-deprecated.js +++ b/test/parallel/test-crypto-deprecated.js @@ -1,11 +1,9 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); const tls = require('tls'); diff --git a/test/parallel/test-crypto-dh-odd-key.js b/test/parallel/test-crypto-dh-odd-key.js index 94f3d382655ae6..449c482d351c56 100644 --- a/test/parallel/test-crypto-dh-odd-key.js +++ b/test/parallel/test-crypto-dh-odd-key.js @@ -21,12 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); function test() { diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js index 91a066d1bd22b1..3b51dc559063d6 100644 --- a/test/parallel/test-crypto-dh.js +++ b/test/parallel/test-crypto-dh.js @@ -1,12 +1,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); + const DH_NOT_SUITABLE_GENERATOR = crypto.constants.DH_NOT_SUITABLE_GENERATOR; // Test Diffie-Hellman with two parties sharing a secret, diff --git a/test/parallel/test-crypto-domain.js b/test/parallel/test-crypto-domain.js index b41b57e3a258b5..d579331287c485 100644 --- a/test/parallel/test-crypto-domain.js +++ b/test/parallel/test-crypto-domain.js @@ -21,13 +21,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const domain = require('domain'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const crypto = require('crypto'); function test(fn) { diff --git a/test/parallel/test-crypto-domains.js b/test/parallel/test-crypto-domains.js index 23ca991500d799..be87cad6ff6ff7 100644 --- a/test/parallel/test-crypto-domains.js +++ b/test/parallel/test-crypto-domains.js @@ -21,17 +21,16 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const domain = require('domain'); const assert = require('assert'); +const crypto = require('crypto'); + const d = domain.create(); const expect = ['pbkdf2', 'randomBytes', 'pseudoRandomBytes']; -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} -const crypto = require('crypto'); - d.on('error', common.mustCall(function(e) { assert.strictEqual(e.message, expect.shift()); }, 3)); diff --git a/test/parallel/test-crypto-ecb.js b/test/parallel/test-crypto-ecb.js index d69cb9ea0d2754..4faf4af2c576fd 100644 --- a/test/parallel/test-crypto-ecb.js +++ b/test/parallel/test-crypto-ecb.js @@ -21,16 +21,13 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (common.hasFipsCrypto) { + +if (common.hasFipsCrypto) common.skip('BF-ECB is not FIPS 140-2 compatible'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); crypto.DEFAULT_ENCODING = 'buffer'; diff --git a/test/parallel/test-crypto-engine.js b/test/parallel/test-crypto-engine.js index 8452087cc50c93..b2fe154d3c228f 100644 --- a/test/parallel/test-crypto-engine.js +++ b/test/parallel/test-crypto-engine.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const crypto = require('crypto'); diff --git a/test/parallel/test-crypto-fips.js b/test/parallel/test-crypto-fips.js index a83170c49ae4b1..f1d81f078bd51f 100644 --- a/test/parallel/test-crypto-fips.js +++ b/test/parallel/test-crypto-fips.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const spawnSync = require('child_process').spawnSync; const path = require('path'); -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} - const FIPS_ENABLED = 1; const FIPS_DISABLED = 0; const FIPS_ERROR_STRING = 'Error: Cannot set FIPS mode'; diff --git a/test/parallel/test-crypto-from-binary.js b/test/parallel/test-crypto-from-binary.js index 785fff4388b43b..ed1be9b3157229 100644 --- a/test/parallel/test-crypto-from-binary.js +++ b/test/parallel/test-crypto-from-binary.js @@ -25,12 +25,10 @@ const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); const EXTERN_APEX = 0xFBEE9; diff --git a/test/parallel/test-crypto-hash-stream-pipe.js b/test/parallel/test-crypto-hash-stream-pipe.js index ee152dc028e2a4..0a240a2abbc7ef 100644 --- a/test/parallel/test-crypto-hash-stream-pipe.js +++ b/test/parallel/test-crypto-hash-stream-pipe.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const crypto = require('crypto'); diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js index 28f0f2f30349ba..f76e4f98c851bb 100644 --- a/test/parallel/test-crypto-hash.js +++ b/test/parallel/test-crypto-hash.js @@ -1,13 +1,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const fs = require('fs'); const path = require('path'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const crypto = require('crypto'); // Test hashing diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js index 94c5cefa058d02..a10e8a731be023 100644 --- a/test/parallel/test-crypto-hmac.js +++ b/test/parallel/test-crypto-hmac.js @@ -1,11 +1,9 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); // Test for binding layer robustness diff --git a/test/parallel/test-crypto-lazy-transform-writable.js b/test/parallel/test-crypto-lazy-transform-writable.js index 9008ebc5f910a6..f12243b9f4d17c 100644 --- a/test/parallel/test-crypto-lazy-transform-writable.js +++ b/test/parallel/test-crypto-lazy-transform-writable.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const crypto = require('crypto'); const Stream = require('stream'); diff --git a/test/parallel/test-crypto-padding-aes256.js b/test/parallel/test-crypto-padding-aes256.js index 3e17a3fc3e5fc5..9fb80f3eed7856 100644 --- a/test/parallel/test-crypto-padding-aes256.js +++ b/test/parallel/test-crypto-padding-aes256.js @@ -21,12 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); crypto.DEFAULT_ENCODING = 'buffer'; diff --git a/test/parallel/test-crypto-padding.js b/test/parallel/test-crypto-padding.js index 095f1ba407caff..6ad504d12c2ced 100644 --- a/test/parallel/test-crypto-padding.js +++ b/test/parallel/test-crypto-padding.js @@ -21,12 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); crypto.DEFAULT_ENCODING = 'buffer'; diff --git a/test/parallel/test-crypto-pbkdf2.js b/test/parallel/test-crypto-pbkdf2.js index 9ed719c1f68358..f8f428652506fe 100644 --- a/test/parallel/test-crypto-pbkdf2.js +++ b/test/parallel/test-crypto-pbkdf2.js @@ -1,10 +1,7 @@ 'use strict'; const common = require('../common'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const crypto = require('crypto'); diff --git a/test/parallel/test-crypto-random.js b/test/parallel/test-crypto-random.js index c60e3b2681e118..eec6f00b5426e0 100644 --- a/test/parallel/test-crypto-random.js +++ b/test/parallel/test-crypto-random.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + 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 daa818705b8488..813df587325ba5 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const fs = require('fs'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} -const constants = require('crypto').constants; const crypto = require('crypto'); +const constants = crypto.constants; const fixtDir = common.fixturesDir; // Test certificates diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js index 2a64b6d072485b..5d19917c488f80 100644 --- a/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const fs = require('fs'); const path = require('path'); const exec = require('child_process').exec; - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const crypto = require('crypto'); // Test certificates @@ -245,10 +243,8 @@ const modSize = 1024; // RSA-PSS Sign test by verifying with 'openssl dgst -verify' { - if (!common.opensslCli) { + if (!common.opensslCli) common.skip('node compiled without OpenSSL CLI.'); - return; - } const pubfile = path.join(common.fixturesDir, 'keys/rsa_public_2048.pem'); const privfile = path.join(common.fixturesDir, 'keys/rsa_private_2048.pem'); diff --git a/test/parallel/test-crypto-stream.js b/test/parallel/test-crypto-stream.js index e40b36847b5602..1c3b8bbcbb1c41 100644 --- a/test/parallel/test-crypto-stream.js +++ b/test/parallel/test-crypto-stream.js @@ -21,14 +21,12 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const stream = require('stream'); const util = require('util'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const crypto = require('crypto'); // Small stream to buffer converter diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js index 1b3622fe01eea8..4bd70f388d878f 100644 --- a/test/parallel/test-crypto-verify-failure.js +++ b/test/parallel/test-crypto-verify-failure.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const crypto = require('crypto'); const tls = require('tls'); diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js index a7638d3cd899a1..d45de9979b96ec 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const crypto = require('crypto'); diff --git a/test/parallel/test-cwd-enoent-preload.js b/test/parallel/test-cwd-enoent-preload.js index 5d44814d2fe430..8979547c0dea94 100644 --- a/test/parallel/test-cwd-enoent-preload.js +++ b/test/parallel/test-cwd-enoent-preload.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); +// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX. +if (common.isSunOS || common.isWindows || common.isAix) + common.skip('cannot rmdir current working directory'); + const assert = require('assert'); const fs = require('fs'); const spawn = require('child_process').spawn; -// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX. -if (common.isSunOS || common.isWindows || common.isAix) { - common.skip('cannot rmdir current working directory'); - return; -} - const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`; const abspathFile = require('path').join(common.fixturesDir, 'a.js'); common.refreshTmpDir(); diff --git a/test/parallel/test-cwd-enoent-repl.js b/test/parallel/test-cwd-enoent-repl.js index c82083668aab43..bb41b1fccd8bf6 100644 --- a/test/parallel/test-cwd-enoent-repl.js +++ b/test/parallel/test-cwd-enoent-repl.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); +// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX. +if (common.isSunOS || common.isWindows || common.isAix) + common.skip('cannot rmdir current working directory'); + const assert = require('assert'); const fs = require('fs'); const spawn = require('child_process').spawn; -// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX. -if (common.isSunOS || common.isWindows || common.isAix) { - common.skip('cannot rmdir current working directory'); - return; -} - const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`; common.refreshTmpDir(); fs.mkdirSync(dirname); diff --git a/test/parallel/test-cwd-enoent.js b/test/parallel/test-cwd-enoent.js index dac23e4084aaf5..27df46acf89ea4 100644 --- a/test/parallel/test-cwd-enoent.js +++ b/test/parallel/test-cwd-enoent.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); +// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX. +if (common.isSunOS || common.isWindows || common.isAix) + common.skip('cannot rmdir current working directory'); + const assert = require('assert'); const fs = require('fs'); const spawn = require('child_process').spawn; -// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX. -if (common.isSunOS || common.isWindows || common.isAix) { - common.skip('cannot rmdir current working directory'); - return; -} - const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`; common.refreshTmpDir(); fs.mkdirSync(dirname); diff --git a/test/parallel/test-debug-usage.js b/test/parallel/test-debug-usage.js index e01ac8e15b8993..a264029f434a5a 100644 --- a/test/parallel/test-debug-usage.js +++ b/test/parallel/test-debug-usage.js @@ -1,13 +1,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const spawn = require('child_process').spawn; -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} - const child = spawn(process.execPath, ['debug']); child.stderr.setEncoding('utf8'); diff --git a/test/parallel/test-dgram-bind-default-address.js b/test/parallel/test-dgram-bind-default-address.js index d0b5b6023445ca..762ead7c869e8d 100755 --- a/test/parallel/test-dgram-bind-default-address.js +++ b/test/parallel/test-dgram-bind-default-address.js @@ -21,14 +21,12 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const dgram = require('dgram'); - // skip test in FreeBSD jails since 0.0.0.0 will resolve to default interface -if (common.inFreeBSDJail) { +if (common.inFreeBSDJail) common.skip('In a FreeBSD jail'); - return; -} + +const assert = require('assert'); +const dgram = require('dgram'); dgram.createSocket('udp4').bind(0, common.mustCall(function() { assert.strictEqual(typeof this.address().port, 'number'); @@ -39,7 +37,7 @@ dgram.createSocket('udp4').bind(0, common.mustCall(function() { })); if (!common.hasIPv6) { - common.skip('udp6 part of test, because no IPv6 support'); + common.printSkipMessage('udp6 part of test, because no IPv6 support'); return; } diff --git a/test/parallel/test-dgram-cluster-close-during-bind.js b/test/parallel/test-dgram-cluster-close-during-bind.js index ec62693abfb645..4e8cdbf9d35cbb 100644 --- a/test/parallel/test-dgram-cluster-close-during-bind.js +++ b/test/parallel/test-dgram-cluster-close-during-bind.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('dgram clustering is currently not supported on windows.'); + const assert = require('assert'); const cluster = require('cluster'); const dgram = require('dgram'); -if (common.isWindows) { - common.skip('dgram clustering is currently not supported on windows.'); - return; -} - if (cluster.isMaster) { cluster.fork(); } else { diff --git a/test/parallel/test-dgram-send-empty-array.js b/test/parallel/test-dgram-send-empty-array.js index 1bfcacd9a40497..e6a391de945d07 100644 --- a/test/parallel/test-dgram-send-empty-array.js +++ b/test/parallel/test-dgram-send-empty-array.js @@ -2,10 +2,8 @@ const common = require('../common'); -if (common.isOSX) { +if (common.isOSX) common.skip('because of 17894467 Apple bug'); - return; -} const assert = require('assert'); const dgram = require('dgram'); diff --git a/test/parallel/test-dgram-send-empty-buffer.js b/test/parallel/test-dgram-send-empty-buffer.js index 16c14909f62dff..554a3c9185c852 100644 --- a/test/parallel/test-dgram-send-empty-buffer.js +++ b/test/parallel/test-dgram-send-empty-buffer.js @@ -21,13 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (common.isOSX) { +if (common.isOSX) common.skip('because of 17894467 Apple bug'); - return; -} +const assert = require('assert'); const dgram = require('dgram'); const client = dgram.createSocket('udp4'); diff --git a/test/parallel/test-dgram-send-empty-packet.js b/test/parallel/test-dgram-send-empty-packet.js index 131e808aec0b72..b425e9eb1582cb 100644 --- a/test/parallel/test-dgram-send-empty-packet.js +++ b/test/parallel/test-dgram-send-empty-packet.js @@ -1,12 +1,9 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (common.isOSX) { +if (common.isOSX) common.skip('because of 17894467 Apple bug'); - return; -} +const assert = require('assert'); const dgram = require('dgram'); const client = dgram.createSocket('udp4'); diff --git a/test/parallel/test-dgram-udp6-send-default-host.js b/test/parallel/test-dgram-udp6-send-default-host.js index e893f248ecd87b..d801ca7e8dcd08 100644 --- a/test/parallel/test-dgram-udp6-send-default-host.js +++ b/test/parallel/test-dgram-udp6-send-default-host.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); +if (!common.hasIPv6) + common.skip('no IPv6 support'); + const assert = require('assert'); const dgram = require('dgram'); -if (!common.hasIPv6) { - common.skip('no IPv6 support'); - return; -} - const client = dgram.createSocket('udp6'); const toSend = [Buffer.alloc(256, 'x'), diff --git a/test/parallel/test-dh-padding.js b/test/parallel/test-dh-padding.js index 6853533ee4e4a3..311b9d156ff174 100644 --- a/test/parallel/test-dh-padding.js +++ b/test/parallel/test-dh-padding.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('node compiled without OpenSSL.'); - return; -} const assert = require('assert'); const crypto = require('crypto'); diff --git a/test/parallel/test-domain-crypto.js b/test/parallel/test-domain-crypto.js index d0bdbf4720b913..3890a7b4641ade 100644 --- a/test/parallel/test-domain-crypto.js +++ b/test/parallel/test-domain-crypto.js @@ -23,10 +23,8 @@ const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('node compiled without OpenSSL.'); - return; -} const crypto = require('crypto'); diff --git a/test/parallel/test-dsa-fips-invalid-key.js b/test/parallel/test-dsa-fips-invalid-key.js index b22be9d077922b..b88c05a87cbf85 100644 --- a/test/parallel/test-dsa-fips-invalid-key.js +++ b/test/parallel/test-dsa-fips-invalid-key.js @@ -1,12 +1,9 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasFipsCrypto) { +if (!common.hasFipsCrypto) common.skip('node compiled without FIPS OpenSSL.'); - return; -} +const assert = require('assert'); const crypto = require('crypto'); const fs = require('fs'); diff --git a/test/parallel/test-fs-long-path.js b/test/parallel/test-fs-long-path.js index b8aa6a2ac871a1..ae60b16f1a3f97 100644 --- a/test/parallel/test-fs-long-path.js +++ b/test/parallel/test-fs-long-path.js @@ -21,15 +21,13 @@ 'use strict'; const common = require('../common'); +if (!common.isWindows) + common.skip('this test is Windows-specific.'); + const fs = require('fs'); const path = require('path'); const assert = require('assert'); -if (!common.isWindows) { - common.skip('this test is Windows-specific.'); - return; -} - // make a path that will be at least 260 chars long. const fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1); const fileName = path.join(common.tmpDir, 'x'.repeat(fileNameLen)); diff --git a/test/parallel/test-fs-read-file-sync-hostname.js b/test/parallel/test-fs-read-file-sync-hostname.js index f7a03e552478a4..599f48b6ccfcfe 100644 --- a/test/parallel/test-fs-read-file-sync-hostname.js +++ b/test/parallel/test-fs-read-file-sync-hostname.js @@ -21,14 +21,12 @@ 'use strict'; const common = require('../common'); +if (!common.isLinux) + common.skip('Test is linux specific.'); + const assert = require('assert'); const fs = require('fs'); -if (!common.isLinux) { - common.skip('Test is linux specific.'); - return; -} - // Test to make sure reading a file under the /proc directory works. See: // https://groups.google.com/forum/#!topic/nodejs-dev/rxZ_RoH1Gn0 const hostname = fs.readFileSync('/proc/sys/kernel/hostname'); diff --git a/test/parallel/test-fs-readdir-ucs2.js b/test/parallel/test-fs-readdir-ucs2.js index 4d5f53abd8ead9..e8e69d6ee2fcc7 100644 --- a/test/parallel/test-fs-readdir-ucs2.js +++ b/test/parallel/test-fs-readdir-ucs2.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); +if (!common.isLinux) + common.skip('Test is linux specific.'); + const path = require('path'); const fs = require('fs'); const assert = require('assert'); -if (!common.isLinux) { - common.skip('Test is linux specific.'); - return; -} - common.refreshTmpDir(); const filename = '\uD83D\uDC04'; const root = Buffer.from(`${common.tmpDir}${path.sep}`); diff --git a/test/parallel/test-fs-readfile-error.js b/test/parallel/test-fs-readfile-error.js index 208b478c12abee..d9ad834afcdc29 100644 --- a/test/parallel/test-fs-readfile-error.js +++ b/test/parallel/test-fs-readfile-error.js @@ -21,16 +21,14 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const exec = require('child_process').exec; -const path = require('path'); - // `fs.readFile('/')` does not fail on FreeBSD, because you can open and read // the directory there. -if (common.isFreeBSD) { +if (common.isFreeBSD) common.skip('platform not supported.'); - return; -} + +const assert = require('assert'); +const exec = require('child_process').exec; +const path = require('path'); function test(env, cb) { const filename = path.join(common.fixturesDir, 'test-fs-readfile-error.js'); diff --git a/test/parallel/test-fs-readfile-pipe-large.js b/test/parallel/test-fs-readfile-pipe-large.js index f0d1dd9c408610..46603b14fa0a56 100644 --- a/test/parallel/test-fs-readfile-pipe-large.js +++ b/test/parallel/test-fs-readfile-pipe-large.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const path = require('path'); // simulate `cat readfile.js | node readfile.js` -if (common.isWindows || common.isAix) { +if (common.isWindows || common.isAix) common.skip(`No /dev/stdin on ${process.platform}.`); - return; -} +const assert = require('assert'); +const path = require('path'); const fs = require('fs'); if (process.argv[2] === 'child') { diff --git a/test/parallel/test-fs-readfile-pipe.js b/test/parallel/test-fs-readfile-pipe.js index 10fc6a925af47a..e15c2c10476c66 100644 --- a/test/parallel/test-fs-readfile-pipe.js +++ b/test/parallel/test-fs-readfile-pipe.js @@ -21,15 +21,13 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); // simulate `cat readfile.js | node readfile.js` -if (common.isWindows || common.isAix) { +if (common.isWindows || common.isAix) common.skip(`No /dev/stdin on ${process.platform}.`); - return; -} +const assert = require('assert'); const fs = require('fs'); const dataExpected = fs.readFileSync(__filename, 'utf8'); diff --git a/test/parallel/test-fs-readfilesync-pipe-large.js b/test/parallel/test-fs-readfilesync-pipe-large.js index 01e41047774c9b..daa53bf3de0cc3 100644 --- a/test/parallel/test-fs-readfilesync-pipe-large.js +++ b/test/parallel/test-fs-readfilesync-pipe-large.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const path = require('path'); // simulate `cat readfile.js | node readfile.js` -if (common.isWindows || common.isAix) { +if (common.isWindows || common.isAix) common.skip(`No /dev/stdin on ${process.platform}.`); - return; -} +const assert = require('assert'); +const path = require('path'); const fs = require('fs'); if (process.argv[2] === 'child') { diff --git a/test/parallel/test-fs-realpath-on-substed-drive.js b/test/parallel/test-fs-realpath-on-substed-drive.js index f8d9e86de5e618..a3d38d9f279707 100644 --- a/test/parallel/test-fs-realpath-on-substed-drive.js +++ b/test/parallel/test-fs-realpath-on-substed-drive.js @@ -1,14 +1,13 @@ 'use strict'; const common = require('../common'); +if (!common.isWindows) + common.skip('Test for Windows only'); + const assert = require('assert'); const fs = require('fs'); const spawnSync = require('child_process').spawnSync; -if (!common.isWindows) { - common.skip('Test for Windows only'); - return; -} let result; // create a subst drive @@ -21,10 +20,8 @@ for (i = 0; i < driveLetters.length; ++i) { if (result.status === 0) break; } -if (i === driveLetters.length) { +if (i === driveLetters.length) common.skip('Cannot create subst drive'); - return; -} // schedule cleanup (and check if all callbacks where called) process.on('exit', function() { diff --git a/test/parallel/test-fs-realpath-pipe.js b/test/parallel/test-fs-realpath-pipe.js index 89bdc08229a9c3..0f30b07f0a9bf1 100644 --- a/test/parallel/test-fs-realpath-pipe.js +++ b/test/parallel/test-fs-realpath-pipe.js @@ -2,10 +2,8 @@ const common = require('../common'); -if (common.isWindows || common.isAix) { +if (common.isWindows || common.isAix) common.skip(`No /dev/stdin on ${process.platform}.`); - return; -} const assert = require('assert'); diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js index 1c9f7a7d90e2c0..a9ec65168d0cce 100644 --- a/test/parallel/test-fs-realpath.js +++ b/test/parallel/test-fs-realpath.js @@ -103,7 +103,7 @@ function test_simple_error_callback(cb) { function test_simple_relative_symlink(callback) { console.log('test_simple_relative_symlink'); if (skipSymlinks) { - common.skip('symlink test (no privs)'); + common.printSkipMessage('symlink test (no privs)'); return runNextTest(); } const entry = `${tmpDir}/symlink`; @@ -152,7 +152,7 @@ function test_simple_absolute_symlink(callback) { function test_deep_relative_file_symlink(callback) { console.log('test_deep_relative_file_symlink'); if (skipSymlinks) { - common.skip('symlink test (no privs)'); + common.printSkipMessage('symlink test (no privs)'); return runNextTest(); } @@ -182,7 +182,7 @@ function test_deep_relative_file_symlink(callback) { function test_deep_relative_dir_symlink(callback) { console.log('test_deep_relative_dir_symlink'); if (skipSymlinks) { - common.skip('symlink test (no privs)'); + common.printSkipMessage('symlink test (no privs)'); return runNextTest(); } const expected = path.join(common.fixturesDir, 'cycles', 'folder'); @@ -210,7 +210,7 @@ function test_deep_relative_dir_symlink(callback) { function test_cyclic_link_protection(callback) { console.log('test_cyclic_link_protection'); if (skipSymlinks) { - common.skip('symlink test (no privs)'); + common.printSkipMessage('symlink test (no privs)'); return runNextTest(); } const entry = path.join(tmpDir, '/cycles/realpath-3a'); @@ -237,7 +237,7 @@ function test_cyclic_link_protection(callback) { function test_cyclic_link_overprotection(callback) { console.log('test_cyclic_link_overprotection'); if (skipSymlinks) { - common.skip('symlink test (no privs)'); + common.printSkipMessage('symlink test (no privs)'); return runNextTest(); } const cycles = `${tmpDir}/cycles`; @@ -258,7 +258,7 @@ function test_cyclic_link_overprotection(callback) { function test_relative_input_cwd(callback) { console.log('test_relative_input_cwd'); if (skipSymlinks) { - common.skip('symlink test (no privs)'); + common.printSkipMessage('symlink test (no privs)'); return runNextTest(); } @@ -297,7 +297,7 @@ function test_deep_symlink_mix(callback) { if (common.isWindows) { // This one is a mix of files and directories, and it's quite tricky // to get the file/dir links sorted out correctly. - common.skip('symlink test (no privs)'); + common.printSkipMessage('symlink test (no privs)'); return runNextTest(); } @@ -384,7 +384,7 @@ assertEqualPath( function test_up_multiple(cb) { console.error('test_up_multiple'); if (skipSymlinks) { - common.skip('symlink test (no privs)'); + common.printSkipMessage('symlink test (no privs)'); return runNextTest(); } function cleanup() { diff --git a/test/parallel/test-fs-symlink.js b/test/parallel/test-fs-symlink.js index 2ceb4d10936a3f..9e19958b628749 100644 --- a/test/parallel/test-fs-symlink.js +++ b/test/parallel/test-fs-symlink.js @@ -21,6 +21,9 @@ 'use strict'; const common = require('../common'); +if (!common.canCreateSymLink()) + common.skip('insufficient privileges'); + const assert = require('assert'); const path = require('path'); const fs = require('fs'); @@ -28,11 +31,6 @@ const fs = require('fs'); let linkTime; let fileTime; -if (!common.canCreateSymLink()) { - common.skip('insufficient privileges'); - return; -} - common.refreshTmpDir(); // test creating and reading symbolic link diff --git a/test/parallel/test-fs-watch-encoding.js b/test/parallel/test-fs-watch-encoding.js index 04f5ffaad97a97..b9488f7a7f8421 100644 --- a/test/parallel/test-fs-watch-encoding.js +++ b/test/parallel/test-fs-watch-encoding.js @@ -11,17 +11,16 @@ // On SmartOS, the watch events fire but the filename is null. const common = require('../common'); -const fs = require('fs'); -const path = require('path'); // fs-watch on folders have limited capability in AIX. // The testcase makes use of folder watching, and causes // hang. This behavior is documented. Skip this for AIX. -if (common.isAix) { +if (common.isAix) common.skip('folder watch capability is limited in AIX.'); - return; -} + +const fs = require('fs'); +const path = require('path'); common.refreshTmpDir(); diff --git a/test/parallel/test-fs-watch-recursive.js b/test/parallel/test-fs-watch-recursive.js index 5fb13623dff543..8e27abb2517692 100644 --- a/test/parallel/test-fs-watch-recursive.js +++ b/test/parallel/test-fs-watch-recursive.js @@ -2,10 +2,8 @@ const common = require('../common'); -if (!(common.isOSX || common.isWindows)) { +if (!(common.isOSX || common.isWindows)) common.skip('recursive option is darwin/windows specific'); - return; -} const assert = require('assert'); const path = require('path'); diff --git a/test/parallel/test-http-chunk-problem.js b/test/parallel/test-http-chunk-problem.js index 822aab804f036d..46a7406e74595a 100644 --- a/test/parallel/test-http-chunk-problem.js +++ b/test/parallel/test-http-chunk-problem.js @@ -1,11 +1,10 @@ 'use strict'; // http://groups.google.com/group/nodejs/browse_thread/thread/f66cd3c960406919 const common = require('../common'); -const assert = require('assert'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); if (process.argv[2] === 'request') { const http = require('http'); diff --git a/test/parallel/test-http-default-port.js b/test/parallel/test-http-default-port.js index d53c69c1b0d607..beae62d3998e50 100644 --- a/test/parallel/test-http-default-port.js +++ b/test/parallel/test-http-default-port.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const http = require('http'); const https = require('https'); diff --git a/test/parallel/test-http-dns-error.js b/test/parallel/test-http-dns-error.js index 4a724b0b41a056..76634c5a830a72 100644 --- a/test/parallel/test-http-dns-error.js +++ b/test/parallel/test-http-dns-error.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const http = require('http'); @@ -57,7 +55,7 @@ function test(mod) { if (common.hasCrypto) { test(https); } else { - common.skip('missing crypto'); + common.printSkipMessage('missing crypto'); } test(http); diff --git a/test/parallel/test-http-full-response.js b/test/parallel/test-http-full-response.js index dc52a5bc2f1b6d..42213432090355 100644 --- a/test/parallel/test-http-full-response.js +++ b/test/parallel/test-http-full-response.js @@ -43,7 +43,7 @@ function runAb(opts, callback) { exec(command, function(err, stdout, stderr) { if (err) { if (/ab|apr/i.test(stderr)) { - common.skip(`problem spawning \`ab\`.\n${stderr}`); + common.printSkipMessage(`problem spawning \`ab\`.\n${stderr}`); process.reallyExit(0); } process.exit(); diff --git a/test/parallel/test-http-invalid-urls.js b/test/parallel/test-http-invalid-urls.js index 65cca822f9b2a5..039270fe430108 100644 --- a/test/parallel/test-http-invalid-urls.js +++ b/test/parallel/test-http-invalid-urls.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const http = require('http'); diff --git a/test/parallel/test-http-localaddress.js b/test/parallel/test-http-localaddress.js index 35f2c15f8d9138..0ed048688eefae 100644 --- a/test/parallel/test-http-localaddress.js +++ b/test/parallel/test-http-localaddress.js @@ -21,14 +21,12 @@ 'use strict'; const common = require('../common'); +if (!common.hasMultiLocalhost()) + common.skip('platform-specific test.'); + const http = require('http'); const assert = require('assert'); -if (!common.hasMultiLocalhost()) { - common.skip('platform-specific test.'); - return; -} - const server = http.createServer(function(req, res) { console.log(`Connect from: ${req.connection.remoteAddress}`); assert.strictEqual('127.0.0.2', req.connection.remoteAddress); diff --git a/test/parallel/test-http-url.parse-https.request.js b/test/parallel/test-http-url.parse-https.request.js index 5c625cf4475fe0..b644e7530ff828 100644 --- a/test/parallel/test-http-url.parse-https.request.js +++ b/test/parallel/test-http-url.parse-https.request.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const url = require('url'); const fs = require('fs'); diff --git a/test/parallel/test-https-agent-constructor.js b/test/parallel/test-https-agent-constructor.js index fe77381c858c8e..29bb9eaa98067d 100644 --- a/test/parallel/test-https-agent-constructor.js +++ b/test/parallel/test-https-agent-constructor.js @@ -1,9 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-https-agent-create-connection.js b/test/parallel/test-https-agent-create-connection.js index a1f0c4ace4cab6..267030232dcf9b 100644 --- a/test/parallel/test-https-agent-create-connection.js +++ b/test/parallel/test-https-agent-create-connection.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-https-agent-disable-session-reuse.js b/test/parallel/test-https-agent-disable-session-reuse.js index 0331cd4e283c17..4f92547e999ac2 100644 --- a/test/parallel/test-https-agent-disable-session-reuse.js +++ b/test/parallel/test-https-agent-disable-session-reuse.js @@ -1,18 +1,14 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} - -const TOTAL_REQS = 2; +const assert = require('assert'); const https = require('https'); - const fs = require('fs'); +const TOTAL_REQS = 2; + const options = { key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) diff --git a/test/parallel/test-https-agent-getname.js b/test/parallel/test-https-agent-getname.js index 9b4f29602b79c6..0986f8472de871 100644 --- a/test/parallel/test-https-agent-getname.js +++ b/test/parallel/test-https-agent-getname.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-https-agent-secure-protocol.js b/test/parallel/test-https-agent-secure-protocol.js index c11d9f8ca870e7..4839dd7c460d6a 100644 --- a/test/parallel/test-https-agent-secure-protocol.js +++ b/test/parallel/test-https-agent-secure-protocol.js @@ -1,12 +1,9 @@ 'use strict'; -const assert = require('assert'); const common = require('../common'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} +const assert = require('assert'); const https = require('https'); const fs = require('fs'); diff --git a/test/parallel/test-https-agent-servername.js b/test/parallel/test-https-agent-servername.js index 8562d021c997ad..625fa45c7c1d67 100644 --- a/test/parallel/test-https-agent-servername.js +++ b/test/parallel/test-https-agent-servername.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const https = require('https'); const fs = require('fs'); diff --git a/test/parallel/test-https-agent-session-eviction.js b/test/parallel/test-https-agent-session-eviction.js index acead806ed066e..567ed809e646c3 100644 --- a/test/parallel/test-https-agent-session-eviction.js +++ b/test/parallel/test-https-agent-session-eviction.js @@ -2,10 +2,8 @@ const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-https-agent-session-reuse.js b/test/parallel/test-https-agent-session-reuse.js index a9977d8ce9a915..f850144eaab169 100644 --- a/test/parallel/test-https-agent-session-reuse.js +++ b/test/parallel/test-https-agent-session-reuse.js @@ -2,10 +2,8 @@ const common = require('../common'); const assert = require('assert'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const https = require('https'); const crypto = require('crypto'); diff --git a/test/parallel/test-https-agent-sni.js b/test/parallel/test-https-agent-sni.js index fb7bee16ec004a..a06ce439fa43d9 100644 --- a/test/parallel/test-https-agent-sni.js +++ b/test/parallel/test-https-agent-sni.js @@ -1,13 +1,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const fs = require('fs'); const options = { diff --git a/test/parallel/test-https-agent-sockets-leak.js b/test/parallel/test-https-agent-sockets-leak.js index bc86b9c24128b3..2fc477c0b33c7b 100644 --- a/test/parallel/test-https-agent-sockets-leak.js +++ b/test/parallel/test-https-agent-sockets-leak.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const fs = require('fs'); const https = require('https'); diff --git a/test/parallel/test-https-agent.js b/test/parallel/test-https-agent.js index add9913358fe43..e2e71cd31a769c 100644 --- a/test/parallel/test-https-agent.js +++ b/test/parallel/test-https-agent.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const fs = require('fs'); const options = { diff --git a/test/parallel/test-https-argument-of-creating.js b/test/parallel/test-https-argument-of-creating.js index 87d934316f887c..5a4150eb1cca6d 100644 --- a/test/parallel/test-https-argument-of-creating.js +++ b/test/parallel/test-https-argument-of-creating.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-https-byteswritten.js b/test/parallel/test-https-byteswritten.js index cad824c5fed5f7..8f4d761c02b7d4 100644 --- a/test/parallel/test-https-byteswritten.js +++ b/test/parallel/test-https-byteswritten.js @@ -21,13 +21,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const fs = require('fs'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const https = require('https'); const options = { diff --git a/test/parallel/test-https-client-checkServerIdentity.js b/test/parallel/test-https-client-checkServerIdentity.js index a70af2c42946b6..9842fc1f357eb0 100644 --- a/test/parallel/test-https-client-checkServerIdentity.js +++ b/test/parallel/test-https-client-checkServerIdentity.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const fs = require('fs'); const path = require('path'); diff --git a/test/parallel/test-https-client-get-url.js b/test/parallel/test-https-client-get-url.js index 05a3824637a3e1..f0e919ca648b05 100644 --- a/test/parallel/test-https-client-get-url.js +++ b/test/parallel/test-https-client-get-url.js @@ -21,19 +21,17 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + // disable strict server certificate validation by the client process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; const assert = require('assert'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const https = require('https'); - const fs = require('fs'); const url = require('url'); + const URL = url.URL; const options = { diff --git a/test/parallel/test-https-client-reject.js b/test/parallel/test-https-client-reject.js index 95c3ca1a3b8ac6..82a7851e4e11a6 100644 --- a/test/parallel/test-https-client-reject.js +++ b/test/parallel/test-https-client-reject.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const fs = require('fs'); const path = require('path'); diff --git a/test/parallel/test-https-client-resume.js b/test/parallel/test-https-client-resume.js index 95e1da56d0c46a..d61d91964b0eec 100644 --- a/test/parallel/test-https-client-resume.js +++ b/test/parallel/test-https-client-resume.js @@ -24,14 +24,11 @@ // Cache session and close connection. Use session on second connection. // ASSERT resumption. const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const tls = require('tls'); const fs = require('fs'); diff --git a/test/parallel/test-https-close.js b/test/parallel/test-https-close.js index e32e25314746cb..6b22192e99a5b7 100644 --- a/test/parallel/test-https-close.js +++ b/test/parallel/test-https-close.js @@ -1,11 +1,9 @@ 'use strict'; const common = require('../common'); -const fs = require('fs'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const fs = require('fs'); const https = require('https'); const options = { diff --git a/test/parallel/test-https-connect-address-family.js b/test/parallel/test-https-connect-address-family.js index e7f41ce861cb27..76a12ef5d5dc0e 100644 --- a/test/parallel/test-https-connect-address-family.js +++ b/test/parallel/test-https-connect-address-family.js @@ -1,14 +1,10 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (!common.hasIPv6) { +if (!common.hasIPv6) common.skip('no IPv6 support'); - return; -} const assert = require('assert'); const https = require('https'); @@ -37,10 +33,9 @@ function runTest() { dns.lookup('localhost', {family: 6, all: true}, (err, addresses) => { if (err) { - if (err.code === 'ENOTFOUND') { + if (err.code === 'ENOTFOUND') common.skip('localhost does not resolve to ::1'); - return; - } + throw err; } diff --git a/test/parallel/test-https-connecting-to-http.js b/test/parallel/test-https-connecting-to-http.js index 168be7c2d984e8..195ad38ed44a31 100644 --- a/test/parallel/test-https-connecting-to-http.js +++ b/test/parallel/test-https-connecting-to-http.js @@ -23,14 +23,11 @@ // This tests the situation where you try to connect a https client // to an http server. You should get an error and exit. const common = require('../common'); -const http = require('http'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const http = require('http'); +const https = require('https'); const server = http.createServer(common.mustNotCall()); server.listen(0, common.mustCall(function() { diff --git a/test/parallel/test-https-drain.js b/test/parallel/test-https-drain.js index ed0a11ae832a43..f9316a261b9877 100644 --- a/test/parallel/test-https-drain.js +++ b/test/parallel/test-https-drain.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const fs = require('fs'); const path = require('path'); diff --git a/test/parallel/test-https-eof-for-eom.js b/test/parallel/test-https-eof-for-eom.js index 3300dabb54aa7b..3c724fe6342dfc 100644 --- a/test/parallel/test-https-eof-for-eom.js +++ b/test/parallel/test-https-eof-for-eom.js @@ -29,15 +29,12 @@ // correctly. const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const https = require('https'); const tls = require('tls'); - const fs = require('fs'); const options = { diff --git a/test/parallel/test-https-foafssl.js b/test/parallel/test-https-foafssl.js index 9900cf7a643c10..d8beefc22b252f 100644 --- a/test/parallel/test-https-foafssl.js +++ b/test/parallel/test-https-foafssl.js @@ -21,22 +21,16 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); -if (!common.opensslCli) { +if (!common.opensslCli) common.skip('node compiled without OpenSSL CLI.'); - return; -} const assert = require('assert'); const join = require('path').join; - const fs = require('fs'); const spawn = require('child_process').spawn; - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const https = require('https'); const options = { diff --git a/test/parallel/test-https-host-headers.js b/test/parallel/test-https-host-headers.js index adb8952871ca54..1181d300bf29b8 100644 --- a/test/parallel/test-https-host-headers.js +++ b/test/parallel/test-https-host-headers.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const fs = require('fs'); + const options = { key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), cert: fs.readFileSync(`${common.fixturesDir}/keys/agent1-cert.pem`) diff --git a/test/parallel/test-https-localaddress-bind-error.js b/test/parallel/test-https-localaddress-bind-error.js index 0b046cfa85c52b..a22db1e9e61594 100644 --- a/test/parallel/test-https-localaddress-bind-error.js +++ b/test/parallel/test-https-localaddress-bind-error.js @@ -21,13 +21,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const fs = require('fs'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const https = require('https'); const options = { diff --git a/test/parallel/test-https-localaddress.js b/test/parallel/test-https-localaddress.js index bcd1d6fdbd71e6..1c5669be30c1fa 100644 --- a/test/parallel/test-https-localaddress.js +++ b/test/parallel/test-https-localaddress.js @@ -21,19 +21,15 @@ 'use strict'; const common = require('../common'); -const fs = require('fs'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); -if (!common.hasMultiLocalhost()) { +if (!common.hasMultiLocalhost()) common.skip('platform-specific test.'); - return; -} + +const fs = require('fs'); +const assert = require('assert'); +const https = require('https'); const options = { key: fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`), diff --git a/test/parallel/test-https-pfx.js b/test/parallel/test-https-pfx.js index 9d7a1d888cef10..d7561f74246286 100644 --- a/test/parallel/test-https-pfx.js +++ b/test/parallel/test-https-pfx.js @@ -21,13 +21,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const fs = require('fs'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const https = require('https'); const pfx = fs.readFileSync(`${common.fixturesDir}/test_cert.pfx`); diff --git a/test/parallel/test-https-req-split.js b/test/parallel/test-https-req-split.js index 0abd74be61720e..d0306cb714fb71 100644 --- a/test/parallel/test-https-req-split.js +++ b/test/parallel/test-https-req-split.js @@ -21,13 +21,12 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + // disable strict server certificate validation by the client process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const https = require('https'); const tls = require('tls'); diff --git a/test/parallel/test-https-resume-after-renew.js b/test/parallel/test-https-resume-after-renew.js index c9e208ab97141f..eb319230371342 100644 --- a/test/parallel/test-https-resume-after-renew.js +++ b/test/parallel/test-https-resume-after-renew.js @@ -1,9 +1,7 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const fs = require('fs'); const https = require('https'); diff --git a/test/parallel/test-https-server-keep-alive-timeout.js b/test/parallel/test-https-server-keep-alive-timeout.js index d1e9ed67889ac6..01d0fa6078b021 100644 --- a/test/parallel/test-https-server-keep-alive-timeout.js +++ b/test/parallel/test-https-server-keep-alive-timeout.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const https = require('https'); const tls = require('tls'); diff --git a/test/parallel/test-https-simple.js b/test/parallel/test-https-simple.js index 3ad2806f6afa59..b79d1b943f355b 100644 --- a/test/parallel/test-https-simple.js +++ b/test/parallel/test-https-simple.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-https-socket-options.js b/test/parallel/test-https-socket-options.js index 3718d3809cc9b9..75c5f51bb0c80a 100644 --- a/test/parallel/test-https-socket-options.js +++ b/test/parallel/test-https-socket-options.js @@ -22,14 +22,11 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const https = require('https'); const fs = require('fs'); - const http = require('http'); const options = { diff --git a/test/parallel/test-https-strict.js b/test/parallel/test-https-strict.js index f28164a322a88a..060151332d2768 100644 --- a/test/parallel/test-https-strict.js +++ b/test/parallel/test-https-strict.js @@ -21,17 +21,14 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + // disable strict server certificate validation by the client process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; const assert = require('assert'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const https = require('https'); - const fs = require('fs'); const path = require('path'); diff --git a/test/parallel/test-https-timeout-server-2.js b/test/parallel/test-https-timeout-server-2.js index 08144f108b2a99..269c06569f6ba7 100644 --- a/test/parallel/test-https-timeout-server-2.js +++ b/test/parallel/test-https-timeout-server-2.js @@ -22,14 +22,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const tls = require('tls'); const fs = require('fs'); diff --git a/test/parallel/test-https-timeout-server.js b/test/parallel/test-https-timeout-server.js index 7d33e552115c2a..17218ba8055f99 100644 --- a/test/parallel/test-https-timeout-server.js +++ b/test/parallel/test-https-timeout-server.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-https-timeout.js b/test/parallel/test-https-timeout.js index e75a8566e429df..ad1fcb3ed232e4 100644 --- a/test/parallel/test-https-timeout.js +++ b/test/parallel/test-https-timeout.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const https = require('https'); const fs = require('fs'); diff --git a/test/parallel/test-https-truncate.js b/test/parallel/test-https-truncate.js index d15efc9abce3a3..dcefcca104ef36 100644 --- a/test/parallel/test-https-truncate.js +++ b/test/parallel/test-https-truncate.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-https-unix-socket-self-signed.js b/test/parallel/test-https-unix-socket-self-signed.js index f503b84591cad7..df6773f8390675 100644 --- a/test/parallel/test-https-unix-socket-self-signed.js +++ b/test/parallel/test-https-unix-socket-self-signed.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} common.refreshTmpDir(); diff --git a/test/parallel/test-icu-data-dir.js b/test/parallel/test-icu-data-dir.js index 5619d934020ace..eb9b07e3a49275 100644 --- a/test/parallel/test-icu-data-dir.js +++ b/test/parallel/test-icu-data-dir.js @@ -1,9 +1,8 @@ 'use strict'; const common = require('../common'); -if (!(common.hasIntl && common.hasSmallICU)) { +if (!(common.hasIntl && common.hasSmallICU)) common.skip('missing Intl'); - return; -} + const assert = require('assert'); const { spawnSync } = require('child_process'); diff --git a/test/parallel/test-icu-punycode.js b/test/parallel/test-icu-punycode.js index 9488568267a140..7abcae461774c0 100644 --- a/test/parallel/test-icu-punycode.js +++ b/test/parallel/test-icu-punycode.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasIntl) { +if (!common.hasIntl) common.skip('missing Intl'); - return; -} const icu = process.binding('icu'); const assert = require('assert'); diff --git a/test/parallel/test-icu-stringwidth.js b/test/parallel/test-icu-stringwidth.js index 7c8c2e948e0eba..3c8021049c3413 100644 --- a/test/parallel/test-icu-stringwidth.js +++ b/test/parallel/test-icu-stringwidth.js @@ -2,10 +2,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasIntl) { +if (!common.hasIntl) common.skip('missing Intl'); - return; -} const assert = require('assert'); const readline = require('internal/readline'); diff --git a/test/parallel/test-icu-transcode.js b/test/parallel/test-icu-transcode.js index 1c77427b1545bc..d7794c30b7ac25 100644 --- a/test/parallel/test-icu-transcode.js +++ b/test/parallel/test-icu-transcode.js @@ -2,10 +2,8 @@ const common = require('../common'); -if (!common.hasIntl) { +if (!common.hasIntl) common.skip('missing Intl'); - return; -} const buffer = require('buffer'); const assert = require('assert'); diff --git a/test/parallel/test-inspector-open.js b/test/parallel/test-inspector-open.js index bc7d15a554aa06..346393d6fac646 100644 --- a/test/parallel/test-inspector-open.js +++ b/test/parallel/test-inspector-open.js @@ -1,5 +1,6 @@ 'use strict'; const common = require('../common'); +common.skipIfInspectorDisabled(); // Test inspector open()/close()/url() API. It uses ephemeral ports so can be // run safely in parallel. @@ -9,8 +10,6 @@ const fork = require('child_process').fork; const net = require('net'); const url = require('url'); -common.skipIfInspectorDisabled(); - if (process.env.BE_CHILD) return beChild(); diff --git a/test/parallel/test-intl-v8BreakIterator.js b/test/parallel/test-intl-v8BreakIterator.js index 70f0f782bbc7e7..6e9c9dbe3a1bcb 100644 --- a/test/parallel/test-intl-v8BreakIterator.js +++ b/test/parallel/test-intl-v8BreakIterator.js @@ -1,9 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasIntl || Intl.v8BreakIterator === undefined) { - return common.skip('missing Intl'); -} +if (!common.hasIntl || Intl.v8BreakIterator === undefined) + common.skip('missing Intl'); const assert = require('assert'); const warning = 'Intl.v8BreakIterator is deprecated and will be removed soon.'; diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index 1e061d8f51dea5..ff9569774d0db4 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -52,7 +52,6 @@ if (!common.hasIntl) { `"Intl" object is NOT present but v8_enable_i18n_support is ${enablei18n}`; assert.strictEqual(enablei18n, 0, erMsg); common.skip('Intl tests because Intl object not present.'); - } else { const erMsg = `"Intl" object is present but v8_enable_i18n_support is ${ @@ -72,7 +71,7 @@ if (!common.hasIntl) { // If list is specified and doesn't contain 'en' then return. if (process.config.variables.icu_locales && !haveLocale('en')) { - common.skip( + common.printSkipMessage( 'detailed Intl tests because English is not listed as supported.'); // Smoke test. Does it format anything, or fail? console.log(`Date(0) formatted to: ${dtf.format(date0)}`); diff --git a/test/parallel/test-listen-fd-cluster.js b/test/parallel/test-listen-fd-cluster.js index 688083f2a893cc..4f74a5b22d6eb8 100644 --- a/test/parallel/test-listen-fd-cluster.js +++ b/test/parallel/test-listen-fd-cluster.js @@ -21,6 +21,9 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('This test is disabled on windows.'); + const assert = require('assert'); const http = require('http'); const net = require('net'); @@ -28,11 +31,6 @@ const cluster = require('cluster'); console.error('Cluster listen fd test', process.argv[2] || 'runner'); -if (common.isWindows) { - common.skip('This test is disabled on windows.'); - return; -} - // Process relationship is: // // parent: the test main script diff --git a/test/parallel/test-listen-fd-detached-inherit.js b/test/parallel/test-listen-fd-detached-inherit.js index f3f33055ac7d7a..aad8d663c915c8 100644 --- a/test/parallel/test-listen-fd-detached-inherit.js +++ b/test/parallel/test-listen-fd-detached-inherit.js @@ -21,16 +21,14 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('This test is disabled on windows.'); + const assert = require('assert'); const http = require('http'); const net = require('net'); const spawn = require('child_process').spawn; -if (common.isWindows) { - common.skip('This test is disabled on windows.'); - return; -} - switch (process.argv[2]) { case 'child': return child(); case 'parent': return parent(); diff --git a/test/parallel/test-listen-fd-detached.js b/test/parallel/test-listen-fd-detached.js index 8a40cce56bced8..cc9cb6471e408b 100644 --- a/test/parallel/test-listen-fd-detached.js +++ b/test/parallel/test-listen-fd-detached.js @@ -21,16 +21,14 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('This test is disabled on windows.'); + const assert = require('assert'); const http = require('http'); const net = require('net'); const spawn = require('child_process').spawn; -if (common.isWindows) { - common.skip('This test is disabled on windows.'); - return; -} - switch (process.argv[2]) { case 'child': return child(); case 'parent': return parent(); diff --git a/test/parallel/test-listen-fd-server.js b/test/parallel/test-listen-fd-server.js index 3d238a8019a0d9..b21b5ee55d2e31 100644 --- a/test/parallel/test-listen-fd-server.js +++ b/test/parallel/test-listen-fd-server.js @@ -21,15 +21,13 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('This test is disabled on windows.'); + const assert = require('assert'); const http = require('http'); const net = require('net'); -if (common.isWindows) { - common.skip('This test is disabled on windows.'); - return; -} - switch (process.argv[2]) { case 'child': return child(); } diff --git a/test/parallel/test-module-circular-symlinks.js b/test/parallel/test-module-circular-symlinks.js index a04022c6564bbd..b5e04a9c622da8 100644 --- a/test/parallel/test-module-circular-symlinks.js +++ b/test/parallel/test-module-circular-symlinks.js @@ -50,7 +50,6 @@ try { } catch (err) { if (err.code !== 'EPERM') throw err; common.skip('insufficient privileges for symlinks'); - return; } fs.writeFileSync(path.join(tmpDir, 'index.js'), diff --git a/test/parallel/test-module-symlinked-peer-modules.js b/test/parallel/test-module-symlinked-peer-modules.js index 83aca75ed197a8..5fe3169ee87382 100644 --- a/test/parallel/test-module-symlinked-peer-modules.js +++ b/test/parallel/test-module-symlinked-peer-modules.js @@ -46,7 +46,6 @@ try { } catch (err) { if (err.code !== 'EPERM') throw err; common.skip('insufficient privileges for symlinks'); - return; } fs.writeFileSync(path.join(moduleA, 'package.json'), diff --git a/test/parallel/test-net-access-byteswritten.js b/test/parallel/test-net-access-byteswritten.js index 5b734e7c6dc853..c928ab27c6d146 100644 --- a/test/parallel/test-net-access-byteswritten.js +++ b/test/parallel/test-net-access-byteswritten.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +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-net-connect-options-fd.js b/test/parallel/test-net-connect-options-fd.js index 9e3859f84314b8..68e63f0ba4cbc9 100644 --- a/test/parallel/test-net-connect-options-fd.js +++ b/test/parallel/test-net-connect-options-fd.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('Does not support wrapping sockets with fd on Windows'); + const assert = require('assert'); const net = require('net'); const path = require('path'); const Pipe = process.binding('pipe_wrap').Pipe; -if (common.isWindows) { - common.skip('Does not support wrapping sockets with fd on Windows'); - return; -} - common.refreshTmpDir(); function testClients(getSocketOpt, getConnectOpt, getConnectCb) { diff --git a/test/parallel/test-net-connect-options-ipv6.js b/test/parallel/test-net-connect-options-ipv6.js index 6ac6c29e10fd08..29b07645c452d3 100644 --- a/test/parallel/test-net-connect-options-ipv6.js +++ b/test/parallel/test-net-connect-options-ipv6.js @@ -21,14 +21,12 @@ 'use strict'; const common = require('../common'); +if (!common.hasIPv6) + common.skip('no IPv6 support'); + const assert = require('assert'); const net = require('net'); -if (!common.hasIPv6) { - common.skip('no IPv6 support'); - return; -} - const hosts = common.localIPv6Hosts; let hostIdx = 0; let host = hosts[hostIdx]; @@ -81,8 +79,8 @@ function tryConnect() { if (host) tryConnect(); else { - common.skip('no IPv6 localhost support'); server.close(); + common.skip('no IPv6 localhost support'); } return; } diff --git a/test/parallel/test-net-socket-local-address.js b/test/parallel/test-net-socket-local-address.js index 19749bde9552b6..c4f11db76bc4f2 100644 --- a/test/parallel/test-net-socket-local-address.js +++ b/test/parallel/test-net-socket-local-address.js @@ -1,13 +1,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const net = require('net'); - // skip test in FreeBSD jails -if (common.inFreeBSDJail) { +if (common.inFreeBSDJail) common.skip('In a FreeBSD jail'); - return; -} + +const assert = require('assert'); +const net = require('net'); let conns = 0; const clientLocalPorts = []; diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js index 75e2c92d5a7937..1faa698b15fc22 100644 --- a/test/parallel/test-npm-install.js +++ b/test/parallel/test-npm-install.js @@ -1,9 +1,7 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const path = require('path'); const spawn = require('child_process').spawn; diff --git a/test/parallel/test-openssl-ca-options.js b/test/parallel/test-openssl-ca-options.js index 144a7dfe3d00e8..f8f777e2682584 100644 --- a/test/parallel/test-openssl-ca-options.js +++ b/test/parallel/test-openssl-ca-options.js @@ -2,10 +2,9 @@ // This test checks the usage of --use-bundled-ca and --use-openssl-ca arguments // to verify that both are not used at the same time. const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const os = require('os'); const childProcess = require('child_process'); diff --git a/test/parallel/test-pipe-writev.js b/test/parallel/test-pipe-writev.js index 6440b5f623761d..db95a4b181849f 100644 --- a/test/parallel/test-pipe-writev.js +++ b/test/parallel/test-pipe-writev.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('Unix-specific test'); + const assert = require('assert'); const net = require('net'); -if (common.isWindows) { - common.skip('Unix-specific test'); - return; -} - common.refreshTmpDir(); const server = net.createServer((connection) => { diff --git a/test/parallel/test-preload.js b/test/parallel/test-preload.js index 9d24fbb3652fa6..a5f8a0c2765046 100644 --- a/test/parallel/test-preload.js +++ b/test/parallel/test-preload.js @@ -1,16 +1,14 @@ 'use strict'; const common = require('../common'); +// Refs: https://github.com/nodejs/node/pull/2253 +if (common.isSunOS) + common.skip('unreliable on SunOS'); + const assert = require('assert'); const path = require('path'); const childProcess = require('child_process'); -// Refs: https://github.com/nodejs/node/pull/2253 -if (common.isSunOS) { - common.skip('unreliable on SunOS'); - return; -} - const nodeBinary = process.argv[0]; const preloadOption = (preloads) => { diff --git a/test/parallel/test-process-execpath.js b/test/parallel/test-process-execpath.js index 5ac8a3f2238a7c..d70d1dfd389875 100644 --- a/test/parallel/test-process-execpath.js +++ b/test/parallel/test-process-execpath.js @@ -1,5 +1,8 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('symlinks are weird on windows'); + const assert = require('assert'); const child_process = require('child_process'); const path = require('path'); @@ -7,11 +10,6 @@ const fs = require('fs'); assert.strictEqual(process.execPath, fs.realpathSync(process.execPath)); -if (common.isWindows) { - common.skip('symlinks are weird on windows'); - return; -} - if (process.argv[2] === 'child') { // The console.log() output is part of the test here. console.log(process.execPath); diff --git a/test/parallel/test-process-getgroups.js b/test/parallel/test-process-getgroups.js index 952e0d95ef9d95..3479cf7028b28b 100644 --- a/test/parallel/test-process-getgroups.js +++ b/test/parallel/test-process-getgroups.js @@ -24,10 +24,9 @@ const common = require('../common'); // Check `id -G` and `process.getgroups()` return same groups. -if (common.isOSX) { +if (common.isOSX) common.skip('Output of `id -G` is unreliable on Darwin.'); - return; -} + const assert = require('assert'); const exec = require('child_process').exec; diff --git a/test/parallel/test-process-remove-all-signal-listeners.js b/test/parallel/test-process-remove-all-signal-listeners.js index 85db45ff88c7c8..759820c2dc56d4 100644 --- a/test/parallel/test-process-remove-all-signal-listeners.js +++ b/test/parallel/test-process-remove-all-signal-listeners.js @@ -1,15 +1,12 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('Win32 does not support signals.'); + const assert = require('assert'); const spawn = require('child_process').spawn; -if (common.isWindows) { - common.skip('Win32 doesn\'t have signals, just a kind of ' + - 'emulation, insufficient for this test to apply.'); - return; -} - if (process.argv[2] !== '--do-test') { // We are the master, fork a child so we can verify it exits with correct // status. diff --git a/test/parallel/test-regress-GH-1531.js b/test/parallel/test-regress-GH-1531.js index 3cf342b869d418..7d1f4a0dbec4c1 100644 --- a/test/parallel/test-regress-GH-1531.js +++ b/test/parallel/test-regress-GH-1531.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const https = require('https'); const fs = require('fs'); diff --git a/test/parallel/test-regress-GH-3542.js b/test/parallel/test-regress-GH-3542.js index cc0285f7475697..b652c95c9ac881 100644 --- a/test/parallel/test-regress-GH-3542.js +++ b/test/parallel/test-regress-GH-3542.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); +// This test is only relevant on Windows. +if (!common.isWindows) + common.skip('Windows specific test.'); + const assert = require('assert'); const fs = require('fs'); const path = require('path'); -// This test is only relevant on Windows. -if (!common.isWindows) { - common.skip('Windows specific test.'); - return; -} - function test(p) { const result = fs.realpathSync(p); assert.strictEqual(result.toLowerCase(), path.resolve(p).toLowerCase()); diff --git a/test/parallel/test-regress-GH-9819.js b/test/parallel/test-regress-GH-9819.js index fb9bb489a081cf..7eed1c512f7942 100644 --- a/test/parallel/test-regress-GH-9819.js +++ b/test/parallel/test-regress-GH-9819.js @@ -1,13 +1,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const execFile = require('child_process').execFile; -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} - const setup = 'const enc = { toString: () => { throw new Error("xyz"); } };'; const scripts = [ diff --git a/test/parallel/test-repl-history-perm.js b/test/parallel/test-repl-history-perm.js index ebca7c9725652f..3b58986dc08efc 100644 --- a/test/parallel/test-repl-history-perm.js +++ b/test/parallel/test-repl-history-perm.js @@ -7,7 +7,6 @@ if (common.isWindows) { common.skip('Win32 uses ACLs for file permissions, ' + 'modes are always 0666 and says nothing about group/other ' + 'read access.'); - return; } const assert = require('assert'); diff --git a/test/parallel/test-repl-sigint-nested-eval.js b/test/parallel/test-repl-sigint-nested-eval.js index 030c86be8e8dd4..7f15b7dfeb8b9d 100644 --- a/test/parallel/test-repl-sigint-nested-eval.js +++ b/test/parallel/test-repl-sigint-nested-eval.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -const spawn = require('child_process').spawn; - if (common.isWindows) { // No way to send CTRL_C_EVENT to processes from JS right now. common.skip('platform not supported'); - return; } +const assert = require('assert'); +const spawn = require('child_process').spawn; + process.env.REPL_TEST_PPID = process.pid; const child = spawn(process.execPath, [ '-i' ], { stdio: [null, null, 2] diff --git a/test/parallel/test-repl-sigint.js b/test/parallel/test-repl-sigint.js index 61bc75cc6ffe67..818111c39bf578 100644 --- a/test/parallel/test-repl-sigint.js +++ b/test/parallel/test-repl-sigint.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -const spawn = require('child_process').spawn; - if (common.isWindows) { // No way to send CTRL_C_EVENT to processes from JS right now. common.skip('platform not supported'); - return; } +const assert = require('assert'); +const spawn = require('child_process').spawn; + process.env.REPL_TEST_PPID = process.pid; const child = spawn(process.execPath, [ '-i' ], { stdio: [null, null, 2] diff --git a/test/parallel/test-require-long-path.js b/test/parallel/test-require-long-path.js index 1a8ce1b7dfd2c3..aaaf07d48ae897 100644 --- a/test/parallel/test-require-long-path.js +++ b/test/parallel/test-require-long-path.js @@ -1,13 +1,11 @@ 'use strict'; const common = require('../common'); +if (!common.isWindows) + common.skip('this test is Windows-specific.'); + const fs = require('fs'); const path = require('path'); -if (!common.isWindows) { - common.skip('this test is Windows-specific.'); - return; -} - // make a path that is more than 260 chars long. const dirNameLen = Math.max(260 - common.tmpDir.length, 1); const dirName = path.join(common.tmpDir, 'x'.repeat(dirNameLen)); diff --git a/test/parallel/test-require-symlink.js b/test/parallel/test-require-symlink.js index 964f856829ac35..d5dc03e49dfc37 100644 --- a/test/parallel/test-require-symlink.js +++ b/test/parallel/test-require-symlink.js @@ -27,10 +27,8 @@ if (common.isWindows) { // On Windows, creating symlinks requires admin privileges. // We'll only try to run symlink test if we have enough privileges. exec('whoami /priv', function(err, o) { - if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) { + if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) common.skip('insufficient privileges'); - return; - } test(); }); diff --git a/test/parallel/test-setproctitle.js b/test/parallel/test-setproctitle.js index 672b6f037d8a61..f4e25a6e8ce71b 100644 --- a/test/parallel/test-setproctitle.js +++ b/test/parallel/test-setproctitle.js @@ -3,9 +3,8 @@ const common = require('../common'); // FIXME add sunos support -if (common.isSunOS) { - return common.skip(`Unsupported platform [${process.platform}]`); -} +if (common.isSunOS) + common.skip(`Unsupported platform [${process.platform}]`); const assert = require('assert'); const exec = require('child_process').exec; @@ -21,9 +20,8 @@ process.title = title; assert.strictEqual(process.title, title); // Test setting the title but do not try to run `ps` on Windows. -if (common.isWindows) { - return common.skip('Windows does not have "ps" utility'); -} +if (common.isWindows) + common.skip('Windows does not have "ps" utility'); // To pass this test on alpine, since Busybox `ps` does not // support `-p` switch, use `ps -o` and `grep` instead. diff --git a/test/parallel/test-signal-handler.js b/test/parallel/test-signal-handler.js index db34a036e45660..a5c900695a54cb 100644 --- a/test/parallel/test-signal-handler.js +++ b/test/parallel/test-signal-handler.js @@ -23,10 +23,8 @@ const common = require('../common'); -if (common.isWindows) { +if (common.isWindows) common.skip('SIGUSR1 and SIGHUP signals are not supported'); - return; -} console.log(`process.pid: ${process.pid}`); diff --git a/test/parallel/test-spawn-cmd-named-pipe.js b/test/parallel/test-spawn-cmd-named-pipe.js index 94a34b640d1e3c..30d0ec2c263fcb 100644 --- a/test/parallel/test-spawn-cmd-named-pipe.js +++ b/test/parallel/test-spawn-cmd-named-pipe.js @@ -1,12 +1,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - // This test is intended for Windows only -if (!common.isWindows) { +if (!common.isWindows) common.skip('this test is Windows-specific.'); - return; -} + +const assert = require('assert'); if (!process.argv[2]) { // parent diff --git a/test/parallel/test-tls-0-dns-altname.js b/test/parallel/test-tls-0-dns-altname.js index 7ac40eeda162b6..0b1c7f6496ce39 100644 --- a/test/parallel/test-tls-0-dns-altname.js +++ b/test/parallel/test-tls-0-dns-altname.js @@ -21,16 +21,13 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); +if (!common.hasCrypto) + common.skip('missing crypto'); // Check getPeerCertificate can properly handle '\0' for fix CVE-2009-2408. -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} +const assert = require('assert'); const tls = require('tls'); - const fs = require('fs'); const server = tls.createServer({ diff --git a/test/parallel/test-tls-alert-handling.js b/test/parallel/test-tls-alert-handling.js index d089ad223b1fd8..0b3447243db7f3 100644 --- a/test/parallel/test-tls-alert-handling.js +++ b/test/parallel/test-tls-alert-handling.js @@ -1,15 +1,11 @@ 'use strict'; const common = require('../common'); -if (!common.opensslCli) { - common.skip('node compiled without OpenSSL CLI.'); - return; -} - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); const fs = require('fs'); const net = require('net'); diff --git a/test/parallel/test-tls-alert.js b/test/parallel/test-tls-alert.js index ef79856108ea3f..8aa56eaf755ab6 100644 --- a/test/parallel/test-tls-alert.js +++ b/test/parallel/test-tls-alert.js @@ -21,16 +21,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); -if (!common.opensslCli) { +if (!common.opensslCli) common.skip('node compiled without OpenSSL CLI.'); - return; -} - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const assert = require('assert'); const { spawn } = require('child_process'); diff --git a/test/parallel/test-tls-alpn-server-client.js b/test/parallel/test-tls-alpn-server-client.js index 3d3453d32fdb82..56f925b8a97945 100644 --- a/test/parallel/test-tls-alpn-server-client.js +++ b/test/parallel/test-tls-alpn-server-client.js @@ -1,15 +1,12 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} if (!process.features.tls_alpn || !process.features.tls_npn) { common.skip( 'Skipping because node compiled without NPN or ALPN feature of OpenSSL.'); - return; } const assert = require('assert'); 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 be499b84503472..6b4d2bd9f58c9c 100644 --- a/test/parallel/test-tls-async-cb-after-socket-end.js +++ b/test/parallel/test-tls-async-cb-after-socket-end.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const path = require('path'); const fs = require('fs'); diff --git a/test/parallel/test-tls-basic-validations.js b/test/parallel/test-tls-basic-validations.js index a6775c06033a2c..1d494b4ed3b76f 100644 --- a/test/parallel/test-tls-basic-validations.js +++ b/test/parallel/test-tls-basic-validations.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-cert-regression.js b/test/parallel/test-tls-cert-regression.js index 0a128275c3874d..ab967bb2c6e11c 100644 --- a/test/parallel/test-tls-cert-regression.js +++ b/test/parallel/test-tls-cert-regression.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); diff --git a/test/parallel/test-tls-check-server-identity.js b/test/parallel/test-tls-check-server-identity.js index e608df5a5a1ae1..1623e70a2af2ec 100644 --- a/test/parallel/test-tls-check-server-identity.js +++ b/test/parallel/test-tls-check-server-identity.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const util = require('util'); diff --git a/test/parallel/test-tls-cipher-list.js b/test/parallel/test-tls-cipher-list.js index 912fb6412859bf..4a39ee9391a7c1 100644 --- a/test/parallel/test-tls-cipher-list.js +++ b/test/parallel/test-tls-cipher-list.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const spawn = require('child_process').spawn; diff --git a/test/parallel/test-tls-client-abort.js b/test/parallel/test-tls-client-abort.js index 15928a04f67876..14f96104e16aef 100644 --- a/test/parallel/test-tls-client-abort.js +++ b/test/parallel/test-tls-client-abort.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const path = require('path'); diff --git a/test/parallel/test-tls-client-abort2.js b/test/parallel/test-tls-client-abort2.js index a652edfa8fe389..59b592d2556699 100644 --- a/test/parallel/test-tls-client-abort2.js +++ b/test/parallel/test-tls-client-abort2.js @@ -21,12 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const tls = require('tls'); const conn = tls.connect(0, common.mustNotCall()); diff --git a/test/parallel/test-tls-client-default-ciphers.js b/test/parallel/test-tls-client-default-ciphers.js index 9eefe21e95732e..0630fe947e7f50 100644 --- a/test/parallel/test-tls-client-default-ciphers.js +++ b/test/parallel/test-tls-client-default-ciphers.js @@ -21,12 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const tls = require('tls'); function Done() {} diff --git a/test/parallel/test-tls-client-destroy-soon.js b/test/parallel/test-tls-client-destroy-soon.js index 8d1f3e90234d43..a94e8fbdb98afd 100644 --- a/test/parallel/test-tls-client-destroy-soon.js +++ b/test/parallel/test-tls-client-destroy-soon.js @@ -25,14 +25,11 @@ // ASSERT resumption. const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const options = { diff --git a/test/parallel/test-tls-client-getephemeralkeyinfo.js b/test/parallel/test-tls-client-getephemeralkeyinfo.js index f3da64ed376607..53e0144ac73d97 100644 --- a/test/parallel/test-tls-client-getephemeralkeyinfo.js +++ b/test/parallel/test-tls-client-getephemeralkeyinfo.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - process.exit(); -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); + const key = fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`); const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`); diff --git a/test/parallel/test-tls-client-mindhsize.js b/test/parallel/test-tls-client-mindhsize.js index 10fe196b539647..230c6e08458cb1 100644 --- a/test/parallel/test-tls-client-mindhsize.js +++ b/test/parallel/test-tls-client-mindhsize.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - process.exit(); -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); + const key = fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`); const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`); diff --git a/test/parallel/test-tls-client-reject.js b/test/parallel/test-tls-client-reject.js index 43cf337e672627..a11e0fe28028ca 100644 --- a/test/parallel/test-tls-client-reject.js +++ b/test/parallel/test-tls-client-reject.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const path = require('path'); diff --git a/test/parallel/test-tls-client-resume.js b/test/parallel/test-tls-client-resume.js index aa23f3331b596c..fccdf6d930c09c 100644 --- a/test/parallel/test-tls-client-resume.js +++ b/test/parallel/test-tls-client-resume.js @@ -25,14 +25,11 @@ // ASSERT resumption. const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const options = { diff --git a/test/parallel/test-tls-client-verify.js b/test/parallel/test-tls-client-verify.js index d713be3b0cf17d..217185166584a4 100644 --- a/test/parallel/test-tls-client-verify.js +++ b/test/parallel/test-tls-client-verify.js @@ -21,11 +21,8 @@ 'use strict'; const common = require('../common'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-close-error.js b/test/parallel/test-tls-close-error.js index 978f7659508999..9973adde122024 100644 --- a/test/parallel/test-tls-close-error.js +++ b/test/parallel/test-tls-close-error.js @@ -1,14 +1,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const server = tls.createServer({ diff --git a/test/parallel/test-tls-close-notify.js b/test/parallel/test-tls-close-notify.js index 625909c9c5edab..500aec26c8d200 100644 --- a/test/parallel/test-tls-close-notify.js +++ b/test/parallel/test-tls-close-notify.js @@ -22,12 +22,10 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const tls = require('tls'); const fs = require('fs'); const server = tls.createServer({ diff --git a/test/parallel/test-tls-cnnic-whitelist.js b/test/parallel/test-tls-cnnic-whitelist.js index 084531748656e2..84b71c7e64b1be 100644 --- a/test/parallel/test-tls-cnnic-whitelist.js +++ b/test/parallel/test-tls-cnnic-whitelist.js @@ -2,10 +2,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-connect-address-family.js b/test/parallel/test-tls-connect-address-family.js index f22831f395a8dd..afacd5a39027a0 100644 --- a/test/parallel/test-tls-connect-address-family.js +++ b/test/parallel/test-tls-connect-address-family.js @@ -1,14 +1,10 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (!common.hasIPv6) { +if (!common.hasIPv6) common.skip('no IPv6 support'); - return; -} const assert = require('assert'); const tls = require('tls'); @@ -36,10 +32,9 @@ function runTest() { dns.lookup('localhost', {family: 6, all: true}, (err, addresses) => { if (err) { - if (err.code === 'ENOTFOUND') { + if (err.code === 'ENOTFOUND') common.skip('localhost does not resolve to ::1'); - return; - } + throw err; } diff --git a/test/parallel/test-tls-connect-given-socket.js b/test/parallel/test-tls-connect-given-socket.js index 08553916194116..d922d7d4d53223 100644 --- a/test/parallel/test-tls-connect-given-socket.js +++ b/test/parallel/test-tls-connect-given-socket.js @@ -21,17 +21,15 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const net = require('net'); const fs = require('fs'); const path = require('path'); + const options = { key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')), cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')) diff --git a/test/parallel/test-tls-connect-no-host.js b/test/parallel/test-tls-connect-no-host.js index 2e4bcfbc6d4787..f63c821a7f6a35 100644 --- a/test/parallel/test-tls-connect-no-host.js +++ b/test/parallel/test-tls-connect-no-host.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const assert = require('assert'); diff --git a/test/parallel/test-tls-connect-pipe.js b/test/parallel/test-tls-connect-pipe.js index 836471a0c50fb4..8a3abe3312ec2d 100644 --- a/test/parallel/test-tls-connect-pipe.js +++ b/test/parallel/test-tls-connect-pipe.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const fs = require('fs'); diff --git a/test/parallel/test-tls-connect-simple.js b/test/parallel/test-tls-connect-simple.js index 7e0d1b462bff7d..d6211d05c8cab1 100644 --- a/test/parallel/test-tls-connect-simple.js +++ b/test/parallel/test-tls-connect-simple.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const fs = require('fs'); diff --git a/test/parallel/test-tls-connect-stream-writes.js b/test/parallel/test-tls-connect-stream-writes.js index 637e54f535dada..4a8b53b4de185b 100644 --- a/test/parallel/test-tls-connect-stream-writes.js +++ b/test/parallel/test-tls-connect-stream-writes.js @@ -1,9 +1,7 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-connect.js b/test/parallel/test-tls-connect.js index 1908dba6574124..5e73196bc1f8a2 100644 --- a/test/parallel/test-tls-connect.js +++ b/test/parallel/test-tls-connect.js @@ -22,12 +22,10 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const tls = require('tls'); const fs = require('fs'); const path = require('path'); diff --git a/test/parallel/test-tls-delayed-attach-error.js b/test/parallel/test-tls-delayed-attach-error.js index 35da6d0e42efed..9d37f15efe4846 100644 --- a/test/parallel/test-tls-delayed-attach-error.js +++ b/test/parallel/test-tls-delayed-attach-error.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const fs = require('fs'); const net = require('net'); diff --git a/test/parallel/test-tls-delayed-attach.js b/test/parallel/test-tls-delayed-attach.js index fa8baa81f85fa0..9ab611566583b4 100644 --- a/test/parallel/test-tls-delayed-attach.js +++ b/test/parallel/test-tls-delayed-attach.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const net = require('net'); diff --git a/test/parallel/test-tls-destroy-whilst-write.js b/test/parallel/test-tls-destroy-whilst-write.js index b4f9766d998630..d157c7bf3f82b5 100644 --- a/test/parallel/test-tls-destroy-whilst-write.js +++ b/test/parallel/test-tls-destroy-whilst-write.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const stream = require('stream'); diff --git a/test/parallel/test-tls-dhe.js b/test/parallel/test-tls-dhe.js index 2f86e82be7fc96..fe17206fdcdc14 100644 --- a/test/parallel/test-tls-dhe.js +++ b/test/parallel/test-tls-dhe.js @@ -22,22 +22,17 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (!common.opensslCli) { +if (!common.opensslCli) common.skip('missing openssl-cli'); - return; -} +const assert = require('assert'); const tls = require('tls'); - const spawn = require('child_process').spawn; const fs = require('fs'); + const key = fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`); const cert = fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`); let nsuccess = 0; diff --git a/test/parallel/test-tls-ecdh-disable.js b/test/parallel/test-tls-ecdh-disable.js index 732ebe4d1bdafc..65ee8fd69198c7 100644 --- a/test/parallel/test-tls-ecdh-disable.js +++ b/test/parallel/test-tls-ecdh-disable.js @@ -21,20 +21,14 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (!common.opensslCli) { +if (!common.opensslCli) common.skip('missing openssl-cli'); - return; -} +const assert = require('assert'); const tls = require('tls'); - const exec = require('child_process').exec; const fs = require('fs'); diff --git a/test/parallel/test-tls-ecdh.js b/test/parallel/test-tls-ecdh.js index 32e77456bdc045..856c1a96fb8048 100644 --- a/test/parallel/test-tls-ecdh.js +++ b/test/parallel/test-tls-ecdh.js @@ -22,15 +22,11 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (!common.opensslCli) { +if (!common.opensslCli) common.skip('missing openssl-cli'); - return; -} const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-econnreset.js b/test/parallel/test-tls-econnreset.js index 798c10ca4c141c..8a6536890e8636 100644 --- a/test/parallel/test-tls-econnreset.js +++ b/test/parallel/test-tls-econnreset.js @@ -21,12 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const tls = require('tls'); const cacert = diff --git a/test/parallel/test-tls-empty-sni-context.js b/test/parallel/test-tls-empty-sni-context.js index 4974e6323e8726..9a8e3449f0cbea 100644 --- a/test/parallel/test-tls-empty-sni-context.js +++ b/test/parallel/test-tls-empty-sni-context.js @@ -1,18 +1,13 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); -if (!process.features.tls_sni) { +if (!process.features.tls_sni) common.skip('node compiled without OpenSSL or with old OpenSSL version.'); - return; -} const assert = require('assert'); - -if (!common.hasCrypto) { - return common.skip('missing crypto'); -} - const tls = require('tls'); const options = { diff --git a/test/parallel/test-tls-env-bad-extra-ca.js b/test/parallel/test-tls-env-bad-extra-ca.js index 57e4c1cfaf3af6..ece93f33539d71 100644 --- a/test/parallel/test-tls-env-bad-extra-ca.js +++ b/test/parallel/test-tls-env-bad-extra-ca.js @@ -3,10 +3,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-env-extra-ca.js b/test/parallel/test-tls-env-extra-ca.js index e2de272184e5f4..be7c826b85cc1f 100644 --- a/test/parallel/test-tls-env-extra-ca.js +++ b/test/parallel/test-tls-env-extra-ca.js @@ -3,10 +3,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-external-accessor.js b/test/parallel/test-tls-external-accessor.js index 08a4ad16e8b4d4..2d7b1f62b98977 100644 --- a/test/parallel/test-tls-external-accessor.js +++ b/test/parallel/test-tls-external-accessor.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -// Ensure accessing ._external doesn't hit an assert in the accessor method. +const assert = require('assert'); const tls = require('tls'); + +// Ensure accessing ._external doesn't hit an assert in the accessor method. { const pctx = tls.createSecureContext().context; const cctx = Object.create(pctx); diff --git a/test/parallel/test-tls-fast-writing.js b/test/parallel/test-tls-fast-writing.js index 05722d895943bb..b846f732d2fb0e 100644 --- a/test/parallel/test-tls-fast-writing.js +++ b/test/parallel/test-tls-fast-writing.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const dir = common.fixturesDir; diff --git a/test/parallel/test-tls-friendly-error-message.js b/test/parallel/test-tls-friendly-error-message.js index c476fb20fe47f0..644b298fb9a40c 100644 --- a/test/parallel/test-tls-friendly-error-message.js +++ b/test/parallel/test-tls-friendly-error-message.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const key = fs.readFileSync(`${common.fixturesDir}/keys/agent1-key.pem`); diff --git a/test/parallel/test-tls-getcipher.js b/test/parallel/test-tls-getcipher.js index d2c5b9eab4d170..acf07ef0a03320 100644 --- a/test/parallel/test-tls-getcipher.js +++ b/test/parallel/test-tls-getcipher.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-getprotocol.js b/test/parallel/test-tls-getprotocol.js index 393b8fb3fe028a..dd96aa6f7494a6 100644 --- a/test/parallel/test-tls-getprotocol.js +++ b/test/parallel/test-tls-getprotocol.js @@ -1,12 +1,9 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} +const assert = require('assert'); const tls = require('tls'); const fs = require('fs'); diff --git a/test/parallel/test-tls-handshake-error.js b/test/parallel/test-tls-handshake-error.js index 3bd74baa9772b9..e4a4addd37be1d 100644 --- a/test/parallel/test-tls-handshake-error.js +++ b/test/parallel/test-tls-handshake-error.js @@ -1,14 +1,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const server = tls.createServer({ diff --git a/test/parallel/test-tls-handshake-nohang.js b/test/parallel/test-tls-handshake-nohang.js index 791ba8df84b3a0..e724fcd3422b00 100644 --- a/test/parallel/test-tls-handshake-nohang.js +++ b/test/parallel/test-tls-handshake-nohang.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); // neither should hang diff --git a/test/parallel/test-tls-hello-parser-failure.js b/test/parallel/test-tls-hello-parser-failure.js index a6e272aa2aab99..ed4c4f7b991f47 100644 --- a/test/parallel/test-tls-hello-parser-failure.js +++ b/test/parallel/test-tls-hello-parser-failure.js @@ -23,10 +23,8 @@ const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-honorcipherorder.js b/test/parallel/test-tls-honorcipherorder.js index a6d51d5dfeea6d..a9d35a01baca51 100644 --- a/test/parallel/test-tls-honorcipherorder.js +++ b/test/parallel/test-tls-honorcipherorder.js @@ -1,14 +1,12 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); + let nconns = 0; // We explicitly set TLS version to 1.2 so as to be safe when the diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js index 38f922107b0b9a..267fa391a73e20 100644 --- a/test/parallel/test-tls-inception.js +++ b/test/parallel/test-tls-inception.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-interleave.js b/test/parallel/test-tls-interleave.js index 131915911fbe9c..d704a35e6881df 100644 --- a/test/parallel/test-tls-interleave.js +++ b/test/parallel/test-tls-interleave.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-invoke-queued.js b/test/parallel/test-tls-invoke-queued.js index 4437507516b921..b1027dd943386c 100644 --- a/test/parallel/test-tls-invoke-queued.js +++ b/test/parallel/test-tls-invoke-queued.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-js-stream.js b/test/parallel/test-tls-js-stream.js index 6553d6862dd4e9..f535a46cce593b 100644 --- a/test/parallel/test-tls-js-stream.js +++ b/test/parallel/test-tls-js-stream.js @@ -1,13 +1,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const stream = require('stream'); const fs = require('fs'); const net = require('net'); diff --git a/test/parallel/test-tls-junk-closes-server.js b/test/parallel/test-tls-junk-closes-server.js index a1ffb32c2408f4..b0e29ec9f8cffc 100644 --- a/test/parallel/test-tls-junk-closes-server.js +++ b/test/parallel/test-tls-junk-closes-server.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const tls = require('tls'); const fs = require('fs'); diff --git a/test/parallel/test-tls-junk-server.js b/test/parallel/test-tls-junk-server.js index 9b5ab6fdcc649d..3270dec745c1ba 100644 --- a/test/parallel/test-tls-junk-server.js +++ b/test/parallel/test-tls-junk-server.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const https = require('https'); diff --git a/test/parallel/test-tls-key-mismatch.js b/test/parallel/test-tls-key-mismatch.js index ac261122ea6bbf..ed5a15c258ae75 100644 --- a/test/parallel/test-tls-key-mismatch.js +++ b/test/parallel/test-tls-key-mismatch.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const tls = require('tls'); const fs = require('fs'); diff --git a/test/parallel/test-tls-legacy-deprecated.js b/test/parallel/test-tls-legacy-deprecated.js index b50c63e7763dfd..4a6120c71b1f77 100644 --- a/test/parallel/test-tls-legacy-deprecated.js +++ b/test/parallel/test-tls-legacy-deprecated.js @@ -1,10 +1,9 @@ // Flags: --no-warnings 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-legacy-onselect.js b/test/parallel/test-tls-legacy-onselect.js index 9af65c43a0661c..efcc5c2c92b889 100644 --- a/test/parallel/test-tls-legacy-onselect.js +++ b/test/parallel/test-tls-legacy-onselect.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const net = require('net'); diff --git a/test/parallel/test-tls-lookup.js b/test/parallel/test-tls-lookup.js index cebb85c4b2a60f..4656d3e5cc6a1e 100644 --- a/test/parallel/test-tls-lookup.js +++ b/test/parallel/test-tls-lookup.js @@ -1,9 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-max-send-fragment.js b/test/parallel/test-tls-max-send-fragment.js index 86ee1a4f14a7ba..1cbcb8e272d6c8 100644 --- a/test/parallel/test-tls-max-send-fragment.js +++ b/test/parallel/test-tls-max-send-fragment.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const buf = Buffer.allocUnsafe(10000); diff --git a/test/parallel/test-tls-multi-key.js b/test/parallel/test-tls-multi-key.js index 6158f7d4057657..6e1a3c8777eeba 100644 --- a/test/parallel/test-tls-multi-key.js +++ b/test/parallel/test-tls-multi-key.js @@ -21,12 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const tls = require('tls'); const fs = require('fs'); diff --git a/test/parallel/test-tls-no-cert-required.js b/test/parallel/test-tls-no-cert-required.js index 06139307c43ce6..11c86efa08e1b4 100644 --- a/test/parallel/test-tls-no-cert-required.js +++ b/test/parallel/test-tls-no-cert-required.js @@ -20,13 +20,11 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -const assert = require('assert'); const common = require('../common'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const tls = require('tls'); // Omitting the cert or pfx option to tls.createServer() should not throw. diff --git a/test/parallel/test-tls-no-rsa-key.js b/test/parallel/test-tls-no-rsa-key.js index 60ac0ab148b1ac..4551928acdcf38 100644 --- a/test/parallel/test-tls-no-rsa-key.js +++ b/test/parallel/test-tls-no-rsa-key.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const options = { diff --git a/test/parallel/test-tls-no-sslv23.js b/test/parallel/test-tls-no-sslv23.js index 564efab26da22c..737f42b530d93a 100644 --- a/test/parallel/test-tls-no-sslv23.js +++ b/test/parallel/test-tls-no-sslv23.js @@ -1,11 +1,9 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const tls = require('tls'); assert.throws(function() { diff --git a/test/parallel/test-tls-no-sslv3.js b/test/parallel/test-tls-no-sslv3.js index 2c2c51eb9be5fd..0a118dbe7e9d49 100644 --- a/test/parallel/test-tls-no-sslv3.js +++ b/test/parallel/test-tls-no-sslv3.js @@ -1,21 +1,16 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +if (common.opensslCli === false) + common.skip('node compiled without OpenSSL CLI.'); + +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const spawn = require('child_process').spawn; -if (common.opensslCli === false) { - common.skip('node compiled without OpenSSL CLI.'); - return; -} - const cert = fs.readFileSync(`${common.fixturesDir}/test_cert.pem`); const key = fs.readFileSync(`${common.fixturesDir}/test_key.pem`); const server = tls.createServer({ cert: cert, key: key }, common.mustNotCall()); @@ -48,7 +43,7 @@ server.on('tlsClientError', (err) => errors.push(err)); process.on('exit', function() { if (/unknown option -ssl3/.test(stderr)) { - common.skip('`openssl s_client -ssl3` not supported.'); + common.printSkipMessage('`openssl s_client -ssl3` not supported.'); } else { assert.strictEqual(errors.length, 1); assert(/:wrong version number/.test(errors[0].message)); diff --git a/test/parallel/test-tls-npn-server-client.js b/test/parallel/test-tls-npn-server-client.js index ffaf61b633bc1d..6a528732a3202a 100644 --- a/test/parallel/test-tls-npn-server-client.js +++ b/test/parallel/test-tls-npn-server-client.js @@ -21,15 +21,11 @@ 'use strict'; const common = require('../common'); -if (!process.features.tls_npn) { - common.skip('Skipping because node compiled without NPN feature of OpenSSL.'); - return; -} - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +if (!process.features.tls_npn) + common.skip('Skipping because node compiled without NPN feature of OpenSSL.'); const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-ocsp-callback.js b/test/parallel/test-tls-ocsp-callback.js index a839384925c0a2..b4437c6a9b35f5 100644 --- a/test/parallel/test-tls-ocsp-callback.js +++ b/test/parallel/test-tls-ocsp-callback.js @@ -22,19 +22,15 @@ 'use strict'; const common = require('../common'); -if (!process.features.tls_ocsp) { +if (!process.features.tls_ocsp) common.skip('node compiled without OpenSSL or with old OpenSSL version.'); - return; -} -if (!common.opensslCli) { + +if (!common.opensslCli) common.skip('node compiled without OpenSSL CLI.'); - return; -} -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const assert = require('assert'); diff --git a/test/parallel/test-tls-on-empty-socket.js b/test/parallel/test-tls-on-empty-socket.js index 38537fd640c71a..5b66edd0c2076a 100644 --- a/test/parallel/test-tls-on-empty-socket.js +++ b/test/parallel/test-tls-on-empty-socket.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-over-http-tunnel.js b/test/parallel/test-tls-over-http-tunnel.js index 638886e92e92c9..5ff05b8504fdf8 100644 --- a/test/parallel/test-tls-over-http-tunnel.js +++ b/test/parallel/test-tls-over-http-tunnel.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const fs = require('fs'); const net = require('net'); const http = require('http'); diff --git a/test/parallel/test-tls-parse-cert-string.js b/test/parallel/test-tls-parse-cert-string.js index c6cdbf2e36e677..2e940805c0b958 100644 --- a/test/parallel/test-tls-parse-cert-string.js +++ b/test/parallel/test-tls-parse-cert-string.js @@ -1,9 +1,7 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-passphrase.js b/test/parallel/test-tls-passphrase.js index 20b5961fb47f66..c8cc06d35e4cd9 100644 --- a/test/parallel/test-tls-passphrase.js +++ b/test/parallel/test-tls-passphrase.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const path = require('path'); diff --git a/test/parallel/test-tls-pause.js b/test/parallel/test-tls-pause.js index a08b435f678508..647b13c62a298c 100644 --- a/test/parallel/test-tls-pause.js +++ b/test/parallel/test-tls-pause.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const path = require('path'); diff --git a/test/parallel/test-tls-peer-certificate-encoding.js b/test/parallel/test-tls-peer-certificate-encoding.js index 95f14c7b8ee12a..76781e0953470e 100644 --- a/test/parallel/test-tls-peer-certificate-encoding.js +++ b/test/parallel/test-tls-peer-certificate-encoding.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const util = require('util'); const join = require('path').join; diff --git a/test/parallel/test-tls-peer-certificate-multi-keys.js b/test/parallel/test-tls-peer-certificate-multi-keys.js index a58c747bd41ea1..226772386253f4 100644 --- a/test/parallel/test-tls-peer-certificate-multi-keys.js +++ b/test/parallel/test-tls-peer-certificate-multi-keys.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const util = require('util'); const join = require('path').join; diff --git a/test/parallel/test-tls-pfx-gh-5100-regr.js b/test/parallel/test-tls-pfx-gh-5100-regr.js index 142a7de10b841a..c47ad5f89d4721 100644 --- a/test/parallel/test-tls-pfx-gh-5100-regr.js +++ b/test/parallel/test-tls-pfx-gh-5100-regr.js @@ -2,10 +2,8 @@ const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('node compiled without crypto.'); - return; -} const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-regr-gh-5108.js b/test/parallel/test-tls-regr-gh-5108.js index 6f4392007bc856..9bb07fe7ca3b3e 100644 --- a/test/parallel/test-tls-regr-gh-5108.js +++ b/test/parallel/test-tls-regr-gh-5108.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-request-timeout.js b/test/parallel/test-tls-request-timeout.js index c529d972d2185e..216b69bb21269c 100644 --- a/test/parallel/test-tls-request-timeout.js +++ b/test/parallel/test-tls-request-timeout.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const options = { diff --git a/test/parallel/test-tls-retain-handle-no-abort.js b/test/parallel/test-tls-retain-handle-no-abort.js index a3a2aebcd6ab2c..4be64c15969f22 100644 --- a/test/parallel/test-tls-retain-handle-no-abort.js +++ b/test/parallel/test-tls-retain-handle-no-abort.js @@ -1,12 +1,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const tls = require('tls'); const fs = require('fs'); const util = require('util'); diff --git a/test/parallel/test-tls-securepair-fiftharg.js b/test/parallel/test-tls-securepair-fiftharg.js index 2b69ce88f4f9aa..236f719157f11e 100644 --- a/test/parallel/test-tls-securepair-fiftharg.js +++ b/test/parallel/test-tls-securepair-fiftharg.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-securepair-leak.js b/test/parallel/test-tls-securepair-leak.js index b513bcd4c7c73a..cbc7c7daddd74b 100644 --- a/test/parallel/test-tls-securepair-leak.js +++ b/test/parallel/test-tls-securepair-leak.js @@ -2,13 +2,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} +const assert = require('assert'); const { createSecureContext } = require('tls'); const { createSecurePair } = require('_tls_legacy'); diff --git a/test/parallel/test-tls-securepair-server.js b/test/parallel/test-tls-securepair-server.js index 00e8cd591ff2c9..6aebc80722120f 100644 --- a/test/parallel/test-tls-securepair-server.js +++ b/test/parallel/test-tls-securepair-server.js @@ -21,20 +21,14 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (!common.opensslCli) { +if (!common.opensslCli) common.skip('missing openssl-cli'); - return; -} +const assert = require('assert'); const tls = require('tls'); - const join = require('path').join; const net = require('net'); const fs = require('fs'); diff --git a/test/parallel/test-tls-server-connection-server.js b/test/parallel/test-tls-server-connection-server.js index 1c54eb635ad449..7eef14d23b5371 100644 --- a/test/parallel/test-tls-server-connection-server.js +++ b/test/parallel/test-tls-server-connection-server.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-server-failed-handshake-emits-clienterror.js b/test/parallel/test-tls-server-failed-handshake-emits-clienterror.js index 0290bcc629a3e3..8efb4ec53866d5 100644 --- a/test/parallel/test-tls-server-failed-handshake-emits-clienterror.js +++ b/test/parallel/test-tls-server-failed-handshake-emits-clienterror.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const net = require('net'); const assert = require('assert'); diff --git a/test/parallel/test-tls-server-verify.js b/test/parallel/test-tls-server-verify.js index 86a735f64c98a4..dcae05eb968565 100644 --- a/test/parallel/test-tls-server-verify.js +++ b/test/parallel/test-tls-server-verify.js @@ -22,15 +22,11 @@ 'use strict'; const common = require('../common'); -if (!common.opensslCli) { - common.skip('node compiled without OpenSSL CLI.'); - return; -} - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); // This is a rather complex test which sets up various TLS servers with node // and connects to them using the 'openssl s_client' command line utility diff --git a/test/parallel/test-tls-session-cache.js b/test/parallel/test-tls-session-cache.js index e87c62d3ed9416..805c21b3ade248 100644 --- a/test/parallel/test-tls-session-cache.js +++ b/test/parallel/test-tls-session-cache.js @@ -22,15 +22,11 @@ 'use strict'; const common = require('../common'); -if (!common.opensslCli) { +if (!common.opensslCli) common.skip('node compiled without OpenSSL CLI.'); - return; -} -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} doTest({ tickets: false }, function() { doTest({ tickets: true }, function() { diff --git a/test/parallel/test-tls-set-ciphers.js b/test/parallel/test-tls-set-ciphers.js index 4b7923891bd5b4..2c7177389b125d 100644 --- a/test/parallel/test-tls-set-ciphers.js +++ b/test/parallel/test-tls-set-ciphers.js @@ -22,15 +22,11 @@ 'use strict'; const common = require('../common'); -if (!common.opensslCli) { +if (!common.opensslCli) common.skip('node compiled without OpenSSL CLI.'); - return; -} -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const exec = require('child_process').exec; diff --git a/test/parallel/test-tls-set-encoding.js b/test/parallel/test-tls-set-encoding.js index 7023132d7373e3..c9ff52b9b2fc05 100644 --- a/test/parallel/test-tls-set-encoding.js +++ b/test/parallel/test-tls-set-encoding.js @@ -21,17 +21,13 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); - const options = { key: fs.readFileSync(`${common.fixturesDir}/keys/agent2-key.pem`), cert: fs.readFileSync(`${common.fixturesDir}/keys/agent2-cert.pem`) diff --git a/test/parallel/test-tls-sni-option.js b/test/parallel/test-tls-sni-option.js index ad7410b1631106..f744b6db54c9ce 100644 --- a/test/parallel/test-tls-sni-option.js +++ b/test/parallel/test-tls-sni-option.js @@ -21,15 +21,11 @@ 'use strict'; const common = require('../common'); -if (!process.features.tls_sni) { - common.skip('node compiled without OpenSSL or with old OpenSSL version.'); - return; -} - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +if (!process.features.tls_sni) + common.skip('node compiled without OpenSSL or with old OpenSSL version.'); 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 300010cfa13cda..83fd50c06603d1 100644 --- a/test/parallel/test-tls-sni-server-client.js +++ b/test/parallel/test-tls-sni-server-client.js @@ -21,15 +21,11 @@ 'use strict'; const common = require('../common'); -if (!process.features.tls_sni) { - common.skip('node compiled without OpenSSL or with old OpenSSL version.'); - return; -} - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +if (!process.features.tls_sni) + common.skip('node compiled without OpenSSL or with old OpenSSL version.'); const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-socket-close.js b/test/parallel/test-tls-socket-close.js index 25282ada9ed31a..f9a77bf4648b46 100644 --- a/test/parallel/test-tls-socket-close.js +++ b/test/parallel/test-tls-socket-close.js @@ -1,11 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const assert = require('assert'); +const assert = require('assert'); const tls = require('tls'); const fs = require('fs'); const net = require('net'); diff --git a/test/parallel/test-tls-socket-destroy.js b/test/parallel/test-tls-socket-destroy.js index 0a72ac6232e865..b101a872c23422 100644 --- a/test/parallel/test-tls-socket-destroy.js +++ b/test/parallel/test-tls-socket-destroy.js @@ -2,10 +2,8 @@ const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const fs = require('fs'); const net = require('net'); diff --git a/test/parallel/test-tls-socket-failed-handshake-emits-error.js b/test/parallel/test-tls-socket-failed-handshake-emits-error.js index 106a14a7df8ec6..16175b8898115e 100644 --- a/test/parallel/test-tls-socket-failed-handshake-emits-error.js +++ b/test/parallel/test-tls-socket-failed-handshake-emits-error.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const net = require('net'); const assert = require('assert'); diff --git a/test/parallel/test-tls-startcom-wosign-whitelist.js b/test/parallel/test-tls-startcom-wosign-whitelist.js index 601c0e4393c2eb..92d595e80cfae6 100644 --- a/test/parallel/test-tls-startcom-wosign-whitelist.js +++ b/test/parallel/test-tls-startcom-wosign-whitelist.js @@ -1,10 +1,7 @@ 'use strict'; const common = require('../common'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-starttls-server.js b/test/parallel/test-tls-starttls-server.js index d588fee34d5feb..28d1db88598cfd 100644 --- a/test/parallel/test-tls-starttls-server.js +++ b/test/parallel/test-tls-starttls-server.js @@ -5,10 +5,8 @@ const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const fs = require('fs'); diff --git a/test/parallel/test-tls-ticket-cluster.js b/test/parallel/test-tls-ticket-cluster.js index 8654dd9ceb32f1..486aef8358715c 100644 --- a/test/parallel/test-tls-ticket-cluster.js +++ b/test/parallel/test-tls-ticket-cluster.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const cluster = require('cluster'); const fs = require('fs'); const join = require('path').join; diff --git a/test/parallel/test-tls-ticket.js b/test/parallel/test-tls-ticket.js index b2541e06ab8872..bf1ce0d5eb421b 100644 --- a/test/parallel/test-tls-ticket.js +++ b/test/parallel/test-tls-ticket.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const net = require('net'); const crypto = require('crypto'); diff --git a/test/parallel/test-tls-timeout-server-2.js b/test/parallel/test-tls-timeout-server-2.js index bf6dcc385bc2b5..8513b29f2e94cd 100644 --- a/test/parallel/test-tls-timeout-server-2.js +++ b/test/parallel/test-tls-timeout-server-2.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const options = { diff --git a/test/parallel/test-tls-timeout-server.js b/test/parallel/test-tls-timeout-server.js index b43bb169f34388..a3d9a8164707aa 100644 --- a/test/parallel/test-tls-timeout-server.js +++ b/test/parallel/test-tls-timeout-server.js @@ -22,12 +22,10 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const tls = require('tls'); const net = require('net'); 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 3f948b86a585e8..897635d7b18c02 100644 --- a/test/parallel/test-tls-two-cas-one-string.js +++ b/test/parallel/test-tls-two-cas-one-string.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const fs = require('fs'); const tls = require('tls'); diff --git a/test/parallel/test-tls-wrap-econnreset-localaddress.js b/test/parallel/test-tls-wrap-econnreset-localaddress.js index 5052d4377a446d..9df145ac374ab7 100644 --- a/test/parallel/test-tls-wrap-econnreset-localaddress.js +++ b/test/parallel/test-tls-wrap-econnreset-localaddress.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +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-tls-wrap-econnreset-pipe.js b/test/parallel/test-tls-wrap-econnreset-pipe.js index f31e058e6aaeed..ef6efaedc34aa7 100644 --- a/test/parallel/test-tls-wrap-econnreset-pipe.js +++ b/test/parallel/test-tls-wrap-econnreset-pipe.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const tls = require('tls'); const net = require('net'); diff --git a/test/parallel/test-tls-wrap-econnreset-socket.js b/test/parallel/test-tls-wrap-econnreset-socket.js index 479d7524aa3611..672da9876fd005 100644 --- a/test/parallel/test-tls-wrap-econnreset-socket.js +++ b/test/parallel/test-tls-wrap-econnreset-socket.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +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-tls-wrap-econnreset.js b/test/parallel/test-tls-wrap-econnreset.js index ed0fe9b1a31b29..5c6db86b75e06a 100644 --- a/test/parallel/test-tls-wrap-econnreset.js +++ b/test/parallel/test-tls-wrap-econnreset.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +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-tls-wrap-event-emmiter.js b/test/parallel/test-tls-wrap-event-emmiter.js index 417b21804a4075..82953f1333e5da 100644 --- a/test/parallel/test-tls-wrap-event-emmiter.js +++ b/test/parallel/test-tls-wrap-event-emmiter.js @@ -6,10 +6,9 @@ */ const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const TlsSocket = require('tls').TLSSocket; diff --git a/test/parallel/test-tls-wrap-no-abort.js b/test/parallel/test-tls-wrap-no-abort.js index c18b17a6406321..21a472ee3bc7a7 100644 --- a/test/parallel/test-tls-wrap-no-abort.js +++ b/test/parallel/test-tls-wrap-no-abort.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const util = require('util'); const TLSWrap = process.binding('tls_wrap').TLSWrap; diff --git a/test/parallel/test-tls-wrap-timeout.js b/test/parallel/test-tls-wrap-timeout.js index 64fbcc7fc7f270..b4cff368182fa3 100644 --- a/test/parallel/test-tls-wrap-timeout.js +++ b/test/parallel/test-tls-wrap-timeout.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const assert = require('assert'); const tls = require('tls'); diff --git a/test/parallel/test-tls-writewrap-leak.js b/test/parallel/test-tls-writewrap-leak.js index 0d61f279312dcf..7035764cba5394 100644 --- a/test/parallel/test-tls-writewrap-leak.js +++ b/test/parallel/test-tls-writewrap-leak.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const net = require('net'); diff --git a/test/parallel/test-tls-zero-clear-in.js b/test/parallel/test-tls-zero-clear-in.js index 10d0efaf0b470b..84c03d292c1dbe 100644 --- a/test/parallel/test-tls-zero-clear-in.js +++ b/test/parallel/test-tls-zero-clear-in.js @@ -22,10 +22,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + const tls = require('tls'); const fs = require('fs'); diff --git a/test/parallel/test-url-domain-ascii-unicode.js b/test/parallel/test-url-domain-ascii-unicode.js index 2be8ac7f5fec8b..49259a7ab0f4c4 100644 --- a/test/parallel/test-url-domain-ascii-unicode.js +++ b/test/parallel/test-url-domain-ascii-unicode.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasIntl) { +if (!common.hasIntl) common.skip('missing Intl'); - return; -} + const strictEqual = require('assert').strictEqual; const url = require('url'); diff --git a/test/parallel/test-url-format-whatwg.js b/test/parallel/test-url-format-whatwg.js index f7363fdbb998b0..d484760c808584 100644 --- a/test/parallel/test-url-format-whatwg.js +++ b/test/parallel/test-url-format-whatwg.js @@ -1,10 +1,9 @@ 'use strict'; const common = require('../common'); -if (!common.hasIntl) { +if (!common.hasIntl) common.skip('missing Intl'); - return; -} + const assert = require('assert'); const url = require('url'); const URL = url.URL; diff --git a/test/parallel/test-util-sigint-watchdog.js b/test/parallel/test-util-sigint-watchdog.js index 207f44b011c3a2..6debd18d0500ff 100644 --- a/test/parallel/test-util-sigint-watchdog.js +++ b/test/parallel/test-util-sigint-watchdog.js @@ -1,14 +1,13 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); -const binding = process.binding('util'); - if (common.isWindows) { // No way to send CTRL_C_EVENT to processes from JS right now. common.skip('platform not supported'); - return; } +const assert = require('assert'); +const binding = process.binding('util'); + [(next) => { // Test with no signal observed. binding.startSigintWatchdog(); diff --git a/test/parallel/test-vm-sigint-existing-handler.js b/test/parallel/test-vm-sigint-existing-handler.js index 9bd5d338797a35..217d56dd972421 100644 --- a/test/parallel/test-vm-sigint-existing-handler.js +++ b/test/parallel/test-vm-sigint-existing-handler.js @@ -1,8 +1,12 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) { + // No way to send CTRL_C_EVENT to processes from JS right now. + common.skip('platform not supported'); +} + const assert = require('assert'); const vm = require('vm'); - const spawn = require('child_process').spawn; const methods = [ @@ -10,12 +14,6 @@ const methods = [ 'runInContext' ]; -if (common.isWindows) { - // No way to send CTRL_C_EVENT to processes from JS right now. - common.skip('platform not supported'); - return; -} - if (process.argv[2] === 'child') { const method = process.argv[3]; assert.ok(method); diff --git a/test/parallel/test-vm-sigint.js b/test/parallel/test-vm-sigint.js index b1ad616405453d..ae205edb3d0abd 100644 --- a/test/parallel/test-vm-sigint.js +++ b/test/parallel/test-vm-sigint.js @@ -1,17 +1,14 @@ 'use strict'; const common = require('../common'); - -const assert = require('assert'); -const vm = require('vm'); - -const spawn = require('child_process').spawn; - if (common.isWindows) { // No way to send CTRL_C_EVENT to processes from JS right now. common.skip('platform not supported'); - return; } +const assert = require('assert'); +const vm = require('vm'); +const spawn = require('child_process').spawn; + if (process.argv[2] === 'child') { const method = process.argv[3]; const listeners = +process.argv[4]; diff --git a/test/parallel/test-warn-sigprof.js b/test/parallel/test-warn-sigprof.js index eedbe33d84ff2a..3404490c2a179d 100644 --- a/test/parallel/test-warn-sigprof.js +++ b/test/parallel/test-warn-sigprof.js @@ -6,10 +6,8 @@ const common = require('../common'); common.skipIfInspectorDisabled(); -if (common.isWindows) { +if (common.isWindows) common.skip('test does not apply to Windows'); - return; -} common.expectWarning('Warning', 'process.on(SIGPROF) is reserved while debugging'); diff --git a/test/parallel/test-whatwg-url-constructor.js b/test/parallel/test-whatwg-url-constructor.js index b67f63baf139b7..290f9266b54f41 100644 --- a/test/parallel/test-whatwg-url-constructor.js +++ b/test/parallel/test-whatwg-url-constructor.js @@ -1,16 +1,15 @@ 'use strict'; const common = require('../common'); -const path = require('path'); -const { URL, URLSearchParams } = require('url'); -const { test, assert_equals, assert_true, assert_throws } = - require('../common/wpt'); - if (!common.hasIntl) { // A handful of the tests fail when ICU is not included. common.skip('missing Intl'); - return; } +const path = require('path'); +const { URL, URLSearchParams } = require('url'); +const { test, assert_equals, assert_true, assert_throws } = + require('../common/wpt'); + const request = { response: require(path.join(common.fixturesDir, 'url-tests')) }; diff --git a/test/parallel/test-whatwg-url-domainto.js b/test/parallel/test-whatwg-url-domainto.js index b399f24136e14b..bfd5e94d2e5dd8 100644 --- a/test/parallel/test-whatwg-url-domainto.js +++ b/test/parallel/test-whatwg-url-domainto.js @@ -1,10 +1,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasIntl) { +if (!common.hasIntl) common.skip('missing Intl'); - return; -} const assert = require('assert'); const { domainToASCII, domainToUnicode } = require('url'); diff --git a/test/parallel/test-whatwg-url-historical.js b/test/parallel/test-whatwg-url-historical.js index 0f7c0e70cd6392..7848b1c1873a70 100644 --- a/test/parallel/test-whatwg-url-historical.js +++ b/test/parallel/test-whatwg-url-historical.js @@ -1,14 +1,13 @@ 'use strict'; const common = require('../common'); -const URL = require('url').URL; -const { test, assert_equals, assert_throws } = require('../common/wpt'); - if (!common.hasIntl) { // A handful of the tests fail when ICU is not included. common.skip('missing Intl'); - return; } +const URL = require('url').URL; +const { test, assert_equals, assert_throws } = require('../common/wpt'); + /* eslint-disable */ /* WPT Refs: https://github.com/w3c/web-platform-tests/blob/8791bed/url/historical.html diff --git a/test/parallel/test-whatwg-url-inspect.js b/test/parallel/test-whatwg-url-inspect.js index 8db1a20e5be152..5758b39b8af83d 100644 --- a/test/parallel/test-whatwg-url-inspect.js +++ b/test/parallel/test-whatwg-url-inspect.js @@ -1,16 +1,15 @@ 'use strict'; const common = require('../common'); -const util = require('util'); -const URL = require('url').URL; -const assert = require('assert'); - if (!common.hasIntl) { // A handful of the tests fail when ICU is not included. common.skip('missing Intl'); - return; } +const util = require('util'); +const URL = require('url').URL; +const assert = require('assert'); + // Tests below are not from WPT. const url = new URL('https://username:password@host.name:8080/path/name/?que=ry#hash'); diff --git a/test/parallel/test-whatwg-url-origin.js b/test/parallel/test-whatwg-url-origin.js index b5b54f887f09eb..732100e142a509 100644 --- a/test/parallel/test-whatwg-url-origin.js +++ b/test/parallel/test-whatwg-url-origin.js @@ -1,15 +1,14 @@ 'use strict'; const common = require('../common'); -const path = require('path'); -const URL = require('url').URL; -const { test, assert_equals } = require('../common/wpt'); - if (!common.hasIntl) { // A handful of the tests fail when ICU is not included. common.skip('missing Intl'); - return; } +const path = require('path'); +const URL = require('url').URL; +const { test, assert_equals } = require('../common/wpt'); + const request = { response: require(path.join(common.fixturesDir, 'url-tests')) }; diff --git a/test/parallel/test-whatwg-url-parsing.js b/test/parallel/test-whatwg-url-parsing.js index 0e8f3b6d77cb56..35658d94a912bc 100644 --- a/test/parallel/test-whatwg-url-parsing.js +++ b/test/parallel/test-whatwg-url-parsing.js @@ -1,16 +1,15 @@ 'use strict'; const common = require('../common'); -const URL = require('url').URL; -const path = require('path'); -const assert = require('assert'); - if (!common.hasIntl) { // A handful of the tests fail when ICU is not included. common.skip('missing Intl'); - return; } +const URL = require('url').URL; +const path = require('path'); +const assert = require('assert'); + // Tests below are not from WPT. const tests = require(path.join(common.fixturesDir, 'url-tests')); const failureTests = tests.filter((test) => test.failure).concat([ diff --git a/test/parallel/test-whatwg-url-setters.js b/test/parallel/test-whatwg-url-setters.js index 60a482decc32f3..938c2aa2538765 100644 --- a/test/parallel/test-whatwg-url-setters.js +++ b/test/parallel/test-whatwg-url-setters.js @@ -1,6 +1,11 @@ 'use strict'; const common = require('../common'); +if (!common.hasIntl) { + // A handful of the tests fail when ICU is not included. + common.skip('missing Intl'); +} + const assert = require('assert'); const path = require('path'); const URL = require('url').URL; @@ -8,12 +13,6 @@ const { test, assert_equals } = require('../common/wpt'); const additionalTestCases = require( path.join(common.fixturesDir, 'url-setter-tests-additional.js')); -if (!common.hasIntl) { - // A handful of the tests fail when ICU is not included. - common.skip('missing Intl'); - return; -} - const request = { response: require(path.join(common.fixturesDir, 'url-setter-tests')) }; diff --git a/test/parallel/test-whatwg-url-toascii.js b/test/parallel/test-whatwg-url-toascii.js index bd986c96a47a84..851240ce650a70 100644 --- a/test/parallel/test-whatwg-url-toascii.js +++ b/test/parallel/test-whatwg-url-toascii.js @@ -1,15 +1,14 @@ 'use strict'; const common = require('../common'); -const path = require('path'); -const { URL } = require('url'); -const { test, assert_equals, assert_throws } = require('../common/wpt'); - if (!common.hasIntl) { // A handful of the tests fail when ICU is not included. common.skip('missing Intl'); - return; } +const path = require('path'); +const { URL } = require('url'); +const { test, assert_equals, assert_throws } = require('../common/wpt'); + const request = { response: require(path.join(common.fixturesDir, 'url-toascii')) }; diff --git a/test/parallel/test-windows-abort-exitcode.js b/test/parallel/test-windows-abort-exitcode.js index c5c5fa6f3a5e78..d61a91315bb679 100644 --- a/test/parallel/test-windows-abort-exitcode.js +++ b/test/parallel/test-windows-abort-exitcode.js @@ -1,17 +1,16 @@ 'use strict'; const common = require('../common'); +if (!common.isWindows) + common.skip('test is windows specific'); + const assert = require('assert'); +const spawn = require('child_process').spawn; // This test makes sure that an aborted node process // exits with code 3 on Windows. // Spawn a child, force an abort, and then check the // exit code in the parent. -const spawn = require('child_process').spawn; -if (!common.isWindows) { - common.skip('test is windows specific'); - return; -} if (process.argv[2] === 'child') { process.abort(); } else { diff --git a/test/parallel/test-zlib-random-byte-pipes.js b/test/parallel/test-zlib-random-byte-pipes.js index 4ccfd2dc228255..f15b31c2f42c96 100644 --- a/test/parallel/test-zlib-random-byte-pipes.js +++ b/test/parallel/test-zlib-random-byte-pipes.js @@ -21,19 +21,16 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const crypto = require('crypto'); +const assert = require('assert'); +const crypto = require('crypto'); const stream = require('stream'); -const Stream = stream.Stream; const util = require('util'); const zlib = require('zlib'); +const Stream = stream.Stream; // emit random bytes, and keep a shasum function RandomReadStream(opt) { diff --git a/test/pummel/test-abort-fatal-error.js b/test/pummel/test-abort-fatal-error.js index 6208a13261bdfa..176a16c9eac8de 100644 --- a/test/pummel/test-abort-fatal-error.js +++ b/test/pummel/test-abort-fatal-error.js @@ -21,13 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (common.isWindows) { +if (common.isWindows) common.skip('no RLIMIT_NOFILE on Windows'); - return; -} +const assert = require('assert'); const exec = require('child_process').exec; let cmdline = `ulimit -c 0; ${process.execPath}`; diff --git a/test/pummel/test-crypto-dh.js b/test/pummel/test-crypto-dh.js index 2268994b4d2f16..f64f982c0e1100 100644 --- a/test/pummel/test-crypto-dh.js +++ b/test/pummel/test-crypto-dh.js @@ -21,14 +21,12 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('node compiled without OpenSSL.'); + const assert = require('assert'); const crypto = require('crypto'); -if (!common.hasCrypto) { - common.skip('node compiled without OpenSSL.'); - return; -} - assert.throws( function() { crypto.getDiffieHellman('unknown-group'); diff --git a/test/pummel/test-crypto-timing-safe-equal-benchmarks.js b/test/pummel/test-crypto-timing-safe-equal-benchmarks.js index 5560a4a256b5fe..4aad5ed20cbe39 100644 --- a/test/pummel/test-crypto-timing-safe-equal-benchmarks.js +++ b/test/pummel/test-crypto-timing-safe-equal-benchmarks.js @@ -1,17 +1,12 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -if (!common.enoughTestMem) { +if (!common.enoughTestMem) common.skip('memory-intensive test'); - return; -} +const assert = require('assert'); const crypto = require('crypto'); const BENCHMARK_FUNC_PATH = diff --git a/test/pummel/test-dh-regr.js b/test/pummel/test-dh-regr.js index 092d91428eb4e7..b8e0ca3f1f88cc 100644 --- a/test/pummel/test-dh-regr.js +++ b/test/pummel/test-dh-regr.js @@ -21,12 +21,10 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const crypto = require('crypto'); const p = crypto.createDiffieHellman(1024).getPrime(); diff --git a/test/pummel/test-dtrace-jsstack.js b/test/pummel/test-dtrace-jsstack.js index d69e96b2511711..41d10bf1d84e05 100644 --- a/test/pummel/test-dtrace-jsstack.js +++ b/test/pummel/test-dtrace-jsstack.js @@ -21,14 +21,12 @@ 'use strict'; const common = require('../common'); +if (!common.isSunOS) + common.skip('no DTRACE support'); + const assert = require('assert'); const os = require('os'); -if (!common.isSunOS) { - common.skip('no DTRACE support'); - return; -} - /* * Some functions to create a recognizable stack. */ diff --git a/test/pummel/test-https-ci-reneg-attack.js b/test/pummel/test-https-ci-reneg-attack.js index 6cc8c51fe21114..fbe0e37873c79a 100644 --- a/test/pummel/test-https-ci-reneg-attack.js +++ b/test/pummel/test-https-ci-reneg-attack.js @@ -21,23 +21,18 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + const assert = require('assert'); const spawn = require('child_process').spawn; - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const tls = require('tls'); const https = require('https'); - const fs = require('fs'); -if (!common.opensslCli) { - common.skip('node compiled without OpenSSL CLI.'); - return; -} - // renegotiation limits to test const LIMITS = [0, 1, 2, 3, 5, 10, 16]; diff --git a/test/pummel/test-https-large-response.js b/test/pummel/test-https-large-response.js index 17038bf7bde563..7775ccca63e1c3 100644 --- a/test/pummel/test-https-large-response.js +++ b/test/pummel/test-https-large-response.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); const fs = require('fs'); - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const https = require('https'); const options = { diff --git a/test/pummel/test-https-no-reader.js b/test/pummel/test-https-no-reader.js index cc77993a7312f6..b8071b9ba97819 100644 --- a/test/pummel/test-https-no-reader.js +++ b/test/pummel/test-https-no-reader.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const https = require('https'); +const assert = require('assert'); +const https = require('https'); const fs = require('fs'); const path = require('path'); diff --git a/test/pummel/test-keep-alive.js b/test/pummel/test-keep-alive.js index 26e19786913f22..d2387495c1c288 100644 --- a/test/pummel/test-keep-alive.js +++ b/test/pummel/test-keep-alive.js @@ -23,16 +23,14 @@ // This test requires the program 'wrk' const common = require('../common'); +if (common.isWindows) + common.skip('no `wrk` on windows'); + const assert = require('assert'); const spawn = require('child_process').spawn; const http = require('http'); const url = require('url'); -if (common.isWindows) { - common.skip('no `wrk` on windows'); - return; -} - const body = 'hello world\n'; const server = http.createServer(function(req, res) { res.writeHead(200, { diff --git a/test/pummel/test-regress-GH-892.js b/test/pummel/test-regress-GH-892.js index 1a7e3ad1cb0377..b1d46adbabb362 100644 --- a/test/pummel/test-regress-GH-892.js +++ b/test/pummel/test-regress-GH-892.js @@ -27,15 +27,12 @@ // TLS server causes the child process to exit cleanly before having sent // the entire buffer. const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + const assert = require('assert'); const spawn = require('child_process').spawn; - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const https = require('https'); - const fs = require('fs'); const bytesExpected = 1024 * 1024 * 32; diff --git a/test/pummel/test-tls-ci-reneg-attack.js b/test/pummel/test-tls-ci-reneg-attack.js index 4bbaacebf4b6e8..905d922db3a7b5 100644 --- a/test/pummel/test-tls-ci-reneg-attack.js +++ b/test/pummel/test-tls-ci-reneg-attack.js @@ -21,22 +21,17 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); + +if (!common.opensslCli) + common.skip('node compiled without OpenSSL CLI.'); + const assert = require('assert'); const spawn = require('child_process').spawn; - -if (!common.hasCrypto) { - common.skip('missing crypto'); - return; -} const tls = require('tls'); - const fs = require('fs'); -if (!common.opensslCli) { - common.skip('node compiled without OpenSSL CLI.'); - return; -} - // renegotiation limits to test const LIMITS = [0, 1, 2, 3, 5, 10, 16]; diff --git a/test/pummel/test-tls-connect-memleak.js b/test/pummel/test-tls-connect-memleak.js index d4797e194026f9..c086933a3e0474 100644 --- a/test/pummel/test-tls-connect-memleak.js +++ b/test/pummel/test-tls-connect-memleak.js @@ -23,14 +23,11 @@ // Flags: --expose-gc const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); assert.strictEqual( diff --git a/test/pummel/test-tls-securepair-client.js b/test/pummel/test-tls-securepair-client.js index f147d019c9388f..e9bae682d7290a 100644 --- a/test/pummel/test-tls-securepair-client.js +++ b/test/pummel/test-tls-securepair-client.js @@ -20,19 +20,14 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -// const common = require('../common'); -if (!common.opensslCli) { +if (!common.opensslCli) common.skip('node compiled without OpenSSL CLI.'); - return; -} -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const join = require('path').join; const net = require('net'); diff --git a/test/pummel/test-tls-server-large-request.js b/test/pummel/test-tls-server-large-request.js index 021fb7913b586b..3255633ec7c41f 100644 --- a/test/pummel/test-tls-server-large-request.js +++ b/test/pummel/test-tls-server-large-request.js @@ -21,14 +21,11 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} -const tls = require('tls'); +const assert = require('assert'); +const tls = require('tls'); const fs = require('fs'); const stream = require('stream'); const util = require('util'); diff --git a/test/pummel/test-tls-session-timeout.js b/test/pummel/test-tls-session-timeout.js index 1bb3592042275f..9b175da77e62a7 100644 --- a/test/pummel/test-tls-session-timeout.js +++ b/test/pummel/test-tls-session-timeout.js @@ -22,15 +22,11 @@ 'use strict'; const common = require('../common'); -if (!common.opensslCli) { +if (!common.opensslCli) common.skip('node compiled without OpenSSL CLI.'); - return; -} -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} doTest(); diff --git a/test/pummel/test-tls-throttle.js b/test/pummel/test-tls-throttle.js index a9e2442ef2bcfa..2d0ea1c673a70c 100644 --- a/test/pummel/test-tls-throttle.js +++ b/test/pummel/test-tls-throttle.js @@ -24,12 +24,10 @@ // seconds. Makes sure that pause and resume work properly. const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} + +const assert = require('assert'); const tls = require('tls'); const fs = require('fs'); diff --git a/test/sequential/test-benchmark-http.js b/test/sequential/test-benchmark-http.js index ce3d58e5d8d4b8..34fbc3732b20b9 100644 --- a/test/sequential/test-benchmark-http.js +++ b/test/sequential/test-benchmark-http.js @@ -2,10 +2,8 @@ const common = require('../common'); -if (!common.enoughTestMem) { +if (!common.enoughTestMem) common.skip('Insufficient memory for HTTP benchmark test'); - return; -} // Minimal test for http benchmarks. This makes sure the benchmarks aren't // horribly broken but nothing more than that. diff --git a/test/sequential/test-buffer-creation-regression.js b/test/sequential/test-buffer-creation-regression.js index 8137e4830a9cb0..8c3a09848c9fa9 100644 --- a/test/sequential/test-buffer-creation-regression.js +++ b/test/sequential/test-buffer-creation-regression.js @@ -29,7 +29,8 @@ try { arrayBuffer = new ArrayBuffer(size); } catch (e) { if (e instanceof RangeError && acceptableOOMErrors.includes(e.message)) - return common.skip(`Unable to allocate ${size} bytes for ArrayBuffer`); + common.skip(`Unable to allocate ${size} bytes for ArrayBuffer`); + throw e; } diff --git a/test/sequential/test-child-process-emfile.js b/test/sequential/test-child-process-emfile.js index 59756e4c7b2e7c..e81b3a0ffec9cb 100644 --- a/test/sequential/test-child-process-emfile.js +++ b/test/sequential/test-child-process-emfile.js @@ -21,15 +21,13 @@ 'use strict'; const common = require('../common'); +if (common.isWindows) + common.skip('no RLIMIT_NOFILE on Windows'); + const assert = require('assert'); const child_process = require('child_process'); const fs = require('fs'); -if (common.isWindows) { - common.skip('no RLIMIT_NOFILE on Windows'); - return; -} - const ulimit = Number(child_process.execSync('ulimit -Hn')); if (ulimit > 64 || Number.isNaN(ulimit)) { // Sorry about this nonsense. It can be replaced if diff --git a/test/sequential/test-child-process-pass-fd.js b/test/sequential/test-child-process-pass-fd.js index b2481270faf065..8cc11f6c11f5b4 100644 --- a/test/sequential/test-child-process-pass-fd.js +++ b/test/sequential/test-child-process-pass-fd.js @@ -1,15 +1,13 @@ 'use strict'; const common = require('../common'); +if ((process.config.variables.arm_version === '6') || + (process.config.variables.arm_version === '7')) + common.skip('Too slow for armv6 and armv7 bots'); + const assert = require('assert'); const fork = require('child_process').fork; const net = require('net'); -if ((process.config.variables.arm_version === '6') || - (process.config.variables.arm_version === '7')) { - common.skip('Too slow for armv6 and armv7 bots'); - return; -} - const N = 80; if (process.argv[2] !== 'child') { diff --git a/test/sequential/test-crypto-timing-safe-equal.js b/test/sequential/test-crypto-timing-safe-equal.js index 7a1f8d2993669b..2847af9ef8bdb5 100644 --- a/test/sequential/test-crypto-timing-safe-equal.js +++ b/test/sequential/test-crypto-timing-safe-equal.js @@ -1,12 +1,9 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); - -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} +const assert = require('assert'); const crypto = require('crypto'); assert.strictEqual( diff --git a/test/sequential/test-fs-readfile-tostring-fail.js b/test/sequential/test-fs-readfile-tostring-fail.js index ee962652fc14b5..2eb6ce0732dd70 100644 --- a/test/sequential/test-fs-readfile-tostring-fail.js +++ b/test/sequential/test-fs-readfile-tostring-fail.js @@ -2,11 +2,8 @@ const common = require('../common'); -if (!common.enoughTestMem) { - const skipMessage = 'intensive toString tests due to memory confinements'; - common.skip(skipMessage); - return; -} +if (!common.enoughTestMem) + common.skip('intensive toString tests due to memory confinements'); const assert = require('assert'); const fs = require('fs'); diff --git a/test/sequential/test-https-set-timeout-server.js b/test/sequential/test-https-set-timeout-server.js index aa4eb5714ffa58..e1b9430583ff39 100644 --- a/test/sequential/test-https-set-timeout-server.js +++ b/test/sequential/test-https-set-timeout-server.js @@ -22,10 +22,8 @@ 'use strict'; const common = require('../common'); -if (!common.hasCrypto) { +if (!common.hasCrypto) common.skip('missing crypto'); - return; -} const assert = require('assert'); const fs = require('fs'); diff --git a/test/sequential/test-net-server-address.js b/test/sequential/test-net-server-address.js index a6e09a86532dbc..52a8c1ac820e24 100644 --- a/test/sequential/test-net-server-address.js +++ b/test/sequential/test-net-server-address.js @@ -40,7 +40,7 @@ server_ipv4 })); if (!common.hasIPv6) { - common.skip('ipv6 part of test, no IPv6 support'); + common.printSkipMessage('ipv6 part of test, no IPv6 support'); return; } diff --git a/test/tick-processor/test-tick-processor-builtin.js b/test/tick-processor/test-tick-processor-builtin.js index afe08bdb0b672b..0fb839f8d1321c 100644 --- a/test/tick-processor/test-tick-processor-builtin.js +++ b/test/tick-processor/test-tick-processor-builtin.js @@ -1,19 +1,15 @@ 'use strict'; const common = require('../common'); +if (!common.enoughTestCpu) + common.skip('test is CPU-intensive'); + if (common.isWindows || common.isSunOS || common.isAix || common.isLinuxPPCBE || - common.isFreeBSD) { + common.isFreeBSD) common.skip('C++ symbols are not mapped for this os.'); - return; -} - -if (!common.enoughTestCpu) { - common.skip('test is CPU-intensive'); - return; -} const base = require('./tick-processor-base.js'); diff --git a/test/tick-processor/test-tick-processor-cpp-core.js b/test/tick-processor/test-tick-processor-cpp-core.js index 72eb25e91c394a..dc1aed41a79ea6 100644 --- a/test/tick-processor/test-tick-processor-cpp-core.js +++ b/test/tick-processor/test-tick-processor-cpp-core.js @@ -1,19 +1,15 @@ 'use strict'; const common = require('../common'); +if (!common.enoughTestCpu) + common.skip('test is CPU-intensive'); + if (common.isWindows || common.isSunOS || common.isAix || common.isLinuxPPCBE || - common.isFreeBSD) { + common.isFreeBSD) common.skip('C++ symbols are not mapped for this os.'); - return; -} - -if (!common.enoughTestCpu) { - common.skip('test is CPU-intensive'); - return; -} const base = require('./tick-processor-base.js'); diff --git a/test/tick-processor/test-tick-processor-unknown.js b/test/tick-processor/test-tick-processor-unknown.js index ab3d110ccff012..c0f5f332b260fe 100644 --- a/test/tick-processor/test-tick-processor-unknown.js +++ b/test/tick-processor/test-tick-processor-unknown.js @@ -6,15 +6,11 @@ const common = require('../common'); // the full 64 bits and the result is that it does not process the // addresses correctly and runs out of memory // Disabling until we get a fix upstreamed into V8 -if (common.isAix) { +if (common.isAix) common.skip('AIX address range too big for scripts.'); - return; -} -if (!common.enoughTestCpu) { +if (!common.enoughTestCpu) common.skip('test is CPU-intensive'); - return; -} const base = require('./tick-processor-base.js');