From 794fae86819d694c998bc76448b26a7e7cd84fe9 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Tue, 18 May 2021 11:41:10 +0800 Subject: [PATCH 1/3] tools: update ESLint config comma-dangle to always-multiline The advantage of doing this is that `eslint --fix` can automatically add trailing commas, which avoids wasting time on manual formatting Refs: https://github.com/nodejs/node/discussions/38701 Refs: https://github.com/nodejs/node/pull/38608#pullrequestreview-655062019 --- .eslintrc.js | 8 +- benchmark/_http-benchmarkers.js | 4 +- .../async_hooks/async-resource-vs-destroy.js | 16 +- benchmark/async_hooks/gc-tracking.js | 4 +- benchmark/async_hooks/http-server.js | 8 +- benchmark/async_hooks/promises.js | 12 +- benchmark/buffers/buffer-base64-decode.js | 2 +- benchmark/buffers/buffer-base64-encode.js | 4 +- benchmark/buffers/buffer-bytelength.js | 2 +- .../buffers/buffer-compare-instance-method.js | 2 +- benchmark/buffers/buffer-compare-offset.js | 2 +- benchmark/buffers/buffer-compare.js | 2 +- benchmark/buffers/buffer-concat-fill.js | 2 +- benchmark/buffers/buffer-concat.js | 2 +- benchmark/buffers/buffer-copy.js | 2 +- benchmark/buffers/buffer-creation.js | 2 +- benchmark/buffers/buffer-equals.js | 2 +- benchmark/buffers/buffer-fill.js | 2 +- benchmark/buffers/buffer-from.js | 2 +- benchmark/buffers/buffer-hex.js | 2 +- benchmark/buffers/buffer-indexof-number.js | 2 +- benchmark/buffers/buffer-indexof.js | 2 +- benchmark/buffers/buffer-iterate.js | 4 +- .../buffers/buffer-normalize-encoding.js | 4 +- benchmark/buffers/buffer-read-float.js | 2 +- .../buffers/buffer-read-with-byteLength.js | 2 +- benchmark/buffers/buffer-read.js | 2 +- benchmark/buffers/buffer-slice.js | 2 +- benchmark/buffers/buffer-swap.js | 4 +- benchmark/buffers/buffer-tojson.js | 2 +- benchmark/buffers/buffer-tostring.js | 2 +- benchmark/buffers/buffer-write-string.js | 2 +- benchmark/buffers/buffer-write.js | 6 +- benchmark/buffers/buffer-zero.js | 2 +- benchmark/buffers/dataview-set.js | 4 +- .../child-process-exec-stdout.js | 2 +- .../child_process/child-process-read-ipc.js | 2 +- benchmark/child_process/child-process-read.js | 2 +- benchmark/child_process/spawn-echo.js | 2 +- benchmark/cluster/echo.js | 4 +- benchmark/compare.js | 2 +- benchmark/crypto/aes-gcm-throughput.js | 2 +- benchmark/crypto/cipher-stream.js | 4 +- benchmark/crypto/get-ciphers.js | 2 +- benchmark/crypto/hash-stream-creation.js | 2 +- benchmark/crypto/hash-stream-throughput.js | 2 +- benchmark/crypto/hkdf.js | 2 +- benchmark/crypto/keygen.js | 6 +- benchmark/crypto/oneshot-sign-verify.js | 10 +- benchmark/crypto/randomInt.js | 2 +- .../crypto/rsa-encrypt-decrypt-throughput.js | 2 +- .../crypto/rsa-sign-verify-throughput.js | 2 +- benchmark/crypto/webcrypto-digest.js | 6 +- benchmark/dgram/array-vs-concat.js | 2 +- benchmark/dgram/multi-buffer.js | 2 +- benchmark/dgram/offset-length.js | 2 +- benchmark/dgram/single-buffer.js | 2 +- benchmark/diagnostics_channel/http.js | 12 +- benchmark/diagnostics_channel/publish.js | 2 +- benchmark/dns/lookup-promises.js | 2 +- benchmark/dns/lookup.js | 2 +- benchmark/domain/domain-fn-args.js | 2 +- benchmark/es/defaultparams-bench.js | 2 +- benchmark/es/destructuring-bench.js | 2 +- benchmark/es/destructuring-object-bench.js | 2 +- benchmark/es/foreach-bench.js | 2 +- benchmark/es/map-bench.js | 4 +- benchmark/es/restparams-bench.js | 2 +- benchmark/es/spread-assign.js | 2 +- benchmark/es/spread-bench.js | 2 +- benchmark/esm/cjs-parse.js | 2 +- benchmark/events/ee-listeners.js | 2 +- benchmark/events/ee-once.js | 2 +- benchmark/events/eventtarget.js | 2 +- benchmark/fixtures/coverage-many-branches.js | 8 +- benchmark/fixtures/require-cachable.js | 2 +- benchmark/fixtures/simple-http-server.js | 6 +- benchmark/fixtures/simple-https-server.js | 6 +- benchmark/fs/bench-opendir.js | 2 +- benchmark/fs/bench-readdir.js | 2 +- benchmark/fs/bench-readdirSync.js | 2 +- benchmark/fs/bench-stat-promise.js | 2 +- benchmark/fs/bench-stat.js | 2 +- benchmark/fs/bench-statSync-failure.js | 2 +- benchmark/fs/bench-statSync.js | 2 +- benchmark/fs/read-stream-throughput.js | 4 +- benchmark/fs/readFileSync.js | 2 +- benchmark/fs/readfile-partitioned.js | 2 +- benchmark/fs/readfile-promises.js | 2 +- benchmark/fs/readfile.js | 2 +- benchmark/fs/write-stream-throughput.js | 2 +- benchmark/fs/writefile-promises.js | 2 +- benchmark/http/bench-parser.js | 4 +- benchmark/http/check_invalid_header_char.js | 2 +- benchmark/http/chunked.js | 4 +- benchmark/http/client-request-body.js | 4 +- benchmark/http/cluster.js | 2 +- benchmark/http/create-clientrequest.js | 4 +- benchmark/http/end-vs-write-end.js | 4 +- benchmark/http/headers.js | 4 +- .../http/http_server_for_chunky_client.js | 2 +- benchmark/http/incoming_headers.js | 6 +- benchmark/http/set-header.js | 4 +- benchmark/http/simple.js | 4 +- benchmark/http/upgrade.js | 2 +- benchmark/http2/compat.js | 4 +- benchmark/http2/headers.js | 8 +- benchmark/http2/respond-with-fd.js | 4 +- benchmark/http2/simple.js | 4 +- benchmark/http2/write.js | 2 +- benchmark/https/simple.js | 4 +- benchmark/misc/arguments.js | 2 +- benchmark/misc/freelist.js | 4 +- benchmark/misc/getstringwidth.js | 6 +- benchmark/misc/hidestackframes.js | 4 +- benchmark/misc/object-property-bench.js | 2 +- benchmark/misc/print.js | 4 +- benchmark/misc/punycode.js | 2 +- benchmark/misc/startup.js | 6 +- benchmark/misc/trace.js | 8 +- .../misc/util-extend-vs-object-assign.js | 2 +- benchmark/module/module-loader-circular.js | 2 +- benchmark/module/module-loader-deep.js | 2 +- benchmark/module/module-loader.js | 2 +- benchmark/napi/function_call/index.js | 2 +- benchmark/net/net-c2s.js | 2 +- benchmark/net/net-pipe.js | 2 +- benchmark/net/net-s2c.js | 8 +- .../net/net-wrap-js-stream-passthrough.js | 2 +- benchmark/net/tcp-raw-c2s.js | 6 +- benchmark/net/tcp-raw-pipe.js | 6 +- benchmark/net/tcp-raw-s2c.js | 6 +- benchmark/os/cpus.js | 2 +- benchmark/os/loadavg.js | 2 +- benchmark/os/networkInterfaces.js | 2 +- benchmark/path/basename-posix.js | 2 +- benchmark/path/basename-win32.js | 2 +- benchmark/path/dirname-posix.js | 2 +- benchmark/path/dirname-win32.js | 2 +- benchmark/path/extname-posix.js | 2 +- benchmark/path/extname-win32.js | 2 +- benchmark/path/format-posix.js | 2 +- benchmark/path/format-win32.js | 2 +- benchmark/path/isAbsolute-posix.js | 2 +- benchmark/path/isAbsolute-win32.js | 2 +- benchmark/path/join-posix.js | 2 +- benchmark/path/join-win32.js | 2 +- benchmark/path/makeLong-win32.js | 2 +- benchmark/path/normalize-posix.js | 2 +- benchmark/path/normalize-win32.js | 2 +- benchmark/path/parse-posix.js | 2 +- benchmark/path/parse-win32.js | 2 +- benchmark/path/relative-posix.js | 2 +- benchmark/path/relative-win32.js | 2 +- benchmark/path/resolve-posix.js | 2 +- benchmark/path/resolve-win32.js | 2 +- benchmark/perf_hooks/usertiming.js | 2 +- benchmark/policy/policy-startup.js | 6 +- benchmark/process/bench-env.js | 2 +- benchmark/process/bench-hrtime.js | 2 +- benchmark/process/coverage.js | 6 +- benchmark/process/memoryUsage.js | 2 +- benchmark/process/next-tick-breadth-args.js | 2 +- benchmark/process/next-tick-breadth.js | 2 +- benchmark/process/next-tick-depth-args.js | 2 +- benchmark/process/next-tick-depth.js | 2 +- benchmark/process/next-tick-exec-args.js | 2 +- benchmark/process/next-tick-exec.js | 2 +- benchmark/process/queue-microtask-breadth.js | 2 +- benchmark/process/queue-microtask-depth.js | 2 +- benchmark/process/resourceUsage.js | 2 +- .../querystring/querystring-stringify.js | 8 +- benchmark/streams/creation.js | 2 +- benchmark/streams/pipe-object-mode.js | 2 +- benchmark/streams/pipe.js | 2 +- benchmark/streams/readable-async-iterator.js | 2 +- benchmark/streams/readable-bigread.js | 2 +- benchmark/streams/readable-bigunevenread.js | 2 +- benchmark/streams/readable-boundaryread.js | 2 +- benchmark/streams/readable-readall.js | 2 +- benchmark/streams/readable-unevenread.js | 2 +- benchmark/streams/writable-manywrites.js | 2 +- .../string_decoder/string-decoder-create.js | 2 +- benchmark/string_decoder/string-decoder.js | 2 +- benchmark/timers/immediate.js | 2 +- .../timers/set-immediate-breadth-args.js | 2 +- benchmark/timers/set-immediate-breadth.js | 2 +- benchmark/timers/set-immediate-depth-args.js | 2 +- benchmark/timers/timers-cancel-unpooled.js | 2 +- benchmark/timers/timers-insert-unpooled.js | 2 +- benchmark/tls/convertprotocols.js | 2 +- benchmark/tls/secure-pair.js | 4 +- benchmark/tls/throughput-c2s.js | 4 +- benchmark/tls/throughput-s2c.js | 8 +- benchmark/tls/tls-connect.js | 6 +- .../url/legacy-vs-whatwg-url-get-prop.js | 6 +- benchmark/url/legacy-vs-whatwg-url-parse.js | 2 +- ...legacy-vs-whatwg-url-searchparams-parse.js | 2 +- ...cy-vs-whatwg-url-searchparams-serialize.js | 2 +- .../url/legacy-vs-whatwg-url-serialize.js | 2 +- benchmark/url/url-format.js | 2 +- benchmark/url/url-parse.js | 4 +- benchmark/url/url-resolve.js | 4 +- benchmark/url/url-searchparams-iteration.js | 2 +- benchmark/url/url-searchparams-read.js | 2 +- benchmark/url/url-searchparams-sort.js | 6 +- benchmark/url/usvstring.js | 6 +- benchmark/url/whatwg-url-idna.js | 14 +- benchmark/url/whatwg-url-properties.js | 2 +- benchmark/util/format.js | 2 +- benchmark/util/inspect-array.js | 2 +- benchmark/util/inspect-proxy.js | 2 +- benchmark/util/inspect.js | 4 +- benchmark/util/normalize-encoding.js | 6 +- benchmark/util/priority-queue.js | 2 +- benchmark/util/type-check.js | 12 +- benchmark/v8/get-stats.js | 2 +- benchmark/vm/create-context.js | 2 +- benchmark/vm/run-in-context.js | 2 +- benchmark/vm/run-in-this-context.js | 2 +- benchmark/worker/atomics-wait.js | 2 +- benchmark/worker/echo.js | 2 +- benchmark/worker/messageport.js | 2 +- benchmark/zlib/createInflate.js | 2 +- benchmark/zlib/creation.js | 2 +- benchmark/zlib/deflate.js | 2 +- benchmark/zlib/inflate.js | 2 +- benchmark/zlib/pipe.js | 6 +- doc/api/assert.md | 76 ++-- doc/api/async_hooks.md | 8 +- doc/api/child_process.md | 14 +- doc/api/cluster.md | 4 +- doc/api/crypto.md | 60 +-- doc/api/dgram.md | 2 +- doc/api/diagnostics_channel.md | 4 +- doc/api/esm.md | 12 +- doc/api/events.md | 6 +- doc/api/fs.md | 2 +- doc/api/http.md | 22 +- doc/api/http2.md | 40 +- doc/api/https.md | 10 +- doc/api/n-api.md | 2 +- doc/api/net.md | 8 +- doc/api/os.md | 16 +- doc/api/packages.md | 2 +- doc/api/path.md | 8 +- doc/api/perf_hooks.md | 18 +- doc/api/process.md | 2 +- doc/api/readline.md | 12 +- doc/api/repl.md | 10 +- doc/api/stream.md | 22 +- doc/api/tls.md | 2 +- doc/api/url.md | 6 +- doc/api/util.md | 8 +- doc/api/v8.md | 2 +- doc/api/vm.md | 8 +- doc/api/wasi.md | 8 +- doc/api/webcrypto.md | 28 +- doc/api/worker_threads.md | 8 +- doc/api/zlib.md | 6 +- doc/changelogs/CHANGELOG_V12.md | 2 +- doc/changelogs/CHANGELOG_V14.md | 2 +- doc/changelogs/CHANGELOG_V15.md | 2 +- doc/guides/using-internal-errors.md | 2 +- doc/guides/writing-and-running-benchmarks.md | 6 +- doc/guides/writing-tests.md | 8 +- lib/_http_agent.js | 4 +- lib/_http_client.js | 8 +- lib/_http_common.js | 2 +- lib/_http_incoming.js | 12 +- lib/_http_outgoing.js | 34 +- lib/_http_server.js | 24 +- lib/_tls_wrap.js | 12 +- lib/assert.js | 38 +- lib/async_hooks.js | 8 +- lib/buffer.js | 58 +-- lib/child_process.js | 20 +- lib/crypto.js | 38 +- lib/dgram.js | 26 +- lib/diagnostics_channel.js | 4 +- lib/dns.js | 8 +- lib/domain.js | 20 +- lib/events.js | 18 +- lib/fs.js | 24 +- lib/http.js | 10 +- lib/http2.js | 4 +- lib/https.js | 8 +- lib/inspector.js | 4 +- lib/internal/abort_controller.js | 16 +- lib/internal/assert/assertion_error.js | 10 +- lib/internal/assert/calltracker.js | 4 +- lib/internal/async_hooks.js | 14 +- lib/internal/blob.js | 8 +- lib/internal/blocklist.js | 6 +- lib/internal/bootstrap/environment.js | 2 +- lib/internal/bootstrap/loaders.js | 6 +- lib/internal/bootstrap/node.js | 40 +- lib/internal/bootstrap/pre_execution.js | 28 +- .../switches/does_not_own_process_state.js | 2 +- .../switches/does_own_process_state.js | 12 +- .../bootstrap/switches/is_main_thread.js | 16 +- .../bootstrap/switches/is_not_main_thread.js | 6 +- lib/internal/buffer.js | 6 +- lib/internal/child_process.js | 42 +-- lib/internal/cluster/child.js | 4 +- lib/internal/cluster/primary.js | 10 +- lib/internal/cluster/utils.js | 2 +- lib/internal/console/constructor.js | 52 +-- lib/internal/console/global.js | 2 +- lib/internal/constants.js | 2 +- lib/internal/crypto/aes.js | 2 +- lib/internal/crypto/cipher.js | 4 +- lib/internal/crypto/diffiehellman.js | 14 +- lib/internal/crypto/dsa.js | 12 +- lib/internal/crypto/ec.js | 8 +- lib/internal/crypto/hash.js | 6 +- lib/internal/crypto/hashnames.js | 2 +- lib/internal/crypto/keygen.js | 10 +- lib/internal/crypto/keys.js | 24 +- lib/internal/crypto/mac.js | 2 +- lib/internal/crypto/random.js | 2 +- lib/internal/crypto/rsa.js | 12 +- lib/internal/crypto/scrypt.js | 2 +- lib/internal/crypto/sig.js | 8 +- lib/internal/crypto/util.js | 8 +- lib/internal/crypto/webcrypto.js | 6 +- lib/internal/crypto/x509.js | 6 +- lib/internal/dgram.js | 2 +- lib/internal/dns/promises.js | 4 +- lib/internal/dtrace.js | 4 +- lib/internal/encoding.js | 18 +- lib/internal/error_serdes.js | 9 +- lib/internal/errors.js | 26 +- lib/internal/event_target.js | 16 +- lib/internal/freeze_intrinsics.js | 8 +- lib/internal/fs/dir.js | 18 +- lib/internal/fs/promises.js | 10 +- lib/internal/fs/read_file_context.js | 2 +- lib/internal/fs/rimraf.js | 2 +- lib/internal/fs/streams.js | 12 +- lib/internal/fs/utils.js | 22 +- lib/internal/fs/watchers.js | 18 +- lib/internal/heap_utils.js | 4 +- lib/internal/histogram.js | 8 +- lib/internal/http2/compat.js | 16 +- lib/internal/http2/core.js | 40 +- lib/internal/http2/util.js | 14 +- lib/internal/inspector/inspect_client.js | 2 +- lib/internal/inspector/inspect_repl.js | 2 +- lib/internal/inspector_async_hook.js | 2 +- lib/internal/legacy/processbinding.js | 2 +- lib/internal/linkedlist.js | 2 +- lib/internal/main/check_syntax.js | 4 +- lib/internal/main/eval_stdin.js | 4 +- lib/internal/main/eval_string.js | 2 +- lib/internal/main/inspect.js | 2 +- lib/internal/main/print_help.js | 10 +- lib/internal/main/prof_process.js | 2 +- lib/internal/main/repl.js | 4 +- lib/internal/main/run_main_module.js | 2 +- lib/internal/main/worker_thread.js | 16 +- lib/internal/modules/cjs/helpers.js | 6 +- lib/internal/modules/cjs/loader.js | 24 +- lib/internal/modules/esm/get_format.js | 6 +- lib/internal/modules/esm/loader.js | 4 +- lib/internal/modules/esm/resolve.js | 8 +- lib/internal/modules/esm/translators.js | 8 +- lib/internal/net.js | 2 +- lib/internal/options.js | 2 +- lib/internal/per_context/domexception.js | 4 +- lib/internal/per_context/primordials.js | 4 +- lib/internal/perf/nodetiming.js | 26 +- lib/internal/perf/observe.js | 4 +- lib/internal/perf/perf.js | 2 +- lib/internal/perf/timerify.js | 12 +- lib/internal/perf/usertiming.js | 2 +- lib/internal/policy/manifest.js | 6 +- lib/internal/policy/sri.js | 4 +- lib/internal/process/execution.js | 8 +- lib/internal/process/per_thread.js | 22 +- lib/internal/process/policy.js | 2 +- lib/internal/process/promises.js | 8 +- lib/internal/process/report.js | 6 +- lib/internal/process/signal.js | 2 +- lib/internal/process/task_queues.js | 12 +- lib/internal/process/worker_thread_only.js | 4 +- lib/internal/querystring.js | 2 +- lib/internal/readline/utils.js | 4 +- lib/internal/repl.js | 4 +- lib/internal/repl/await.js | 6 +- lib/internal/repl/utils.js | 12 +- lib/internal/socket_list.js | 8 +- lib/internal/socketaddress.js | 2 +- .../source_map/prepare_stack_trace.js | 2 +- lib/internal/source_map/source_map.js | 4 +- lib/internal/source_map/source_map_cache.js | 12 +- lib/internal/stream_base_commons.js | 8 +- lib/internal/streams/buffer_list.js | 2 +- lib/internal/streams/destroy.js | 2 +- lib/internal/streams/duplex.js | 4 +- lib/internal/streams/end-of-stream.js | 2 +- lib/internal/streams/from.js | 4 +- lib/internal/streams/lazy_transform.js | 10 +- lib/internal/streams/pipeline.js | 4 +- lib/internal/streams/readable.js | 32 +- lib/internal/streams/state.js | 2 +- lib/internal/streams/transform.js | 4 +- lib/internal/streams/writable.js | 28 +- lib/internal/test/transfer.js | 2 +- lib/internal/timers.js | 14 +- lib/internal/trace_events_async_hooks.js | 6 +- lib/internal/tty.js | 6 +- lib/internal/url.js | 32 +- lib/internal/util.js | 12 +- lib/internal/util/comparisons.js | 8 +- lib/internal/util/debuglog.js | 4 +- lib/internal/util/inspect.js | 30 +- lib/internal/util/inspector.js | 4 +- lib/internal/util/iterable_weak_map.js | 2 +- lib/internal/util/types.js | 8 +- lib/internal/v8_prof_polyfill.js | 6 +- lib/internal/validators.js | 4 +- lib/internal/vm/module.js | 2 +- lib/internal/watchdog.js | 4 +- lib/internal/worker.js | 8 +- lib/internal/worker/io.js | 34 +- lib/internal/worker/js_transferable.js | 4 +- lib/net.js | 42 +-- lib/os.js | 20 +- lib/path.js | 4 +- lib/perf_hooks.js | 10 +- lib/querystring.js | 4 +- lib/readline.js | 8 +- lib/repl.js | 62 +-- lib/stream.js | 6 +- lib/string_decoder.js | 12 +- lib/timers.js | 18 +- lib/timers/promises.js | 4 +- lib/tls.js | 4 +- lib/trace_events.js | 6 +- lib/tty.js | 6 +- lib/util.js | 12 +- lib/v8.js | 12 +- lib/vm.js | 6 +- lib/wasi.js | 2 +- lib/worker_threads.js | 2 +- lib/zlib.js | 30 +- test/addons/async-hooks-promise/test.js | 6 +- test/addons/async-resource/test.js | 4 +- .../addons/callback-scope/test-async-hooks.js | 2 +- .../non-node-context/test-make-buffer.js | 2 +- .../addons/openssl-client-cert-engine/test.js | 4 +- test/addons/openssl-key-engine/test.js | 4 +- test/addons/repl-domain-abort/test.js | 2 +- ...ingbytes-external-exceed-max-by-1-ascii.js | 2 +- ...ngbytes-external-exceed-max-by-1-base64.js | 2 +- ...ngbytes-external-exceed-max-by-1-binary.js | 2 +- ...tringbytes-external-exceed-max-by-1-hex.js | 2 +- ...ringbytes-external-exceed-max-by-1-utf8.js | 4 +- .../test-stringbytes-external-exceed-max.js | 2 +- test/addons/worker-addon/test.js | 6 +- test/async-hooks/init-hooks.js | 10 +- test/async-hooks/test-async-await.js | 2 +- .../test-async-exec-resource-http-32060.js | 2 +- .../test-async-exec-resource-http.js | 2 +- .../test-async-exec-resource-match.js | 4 +- .../test-async-local-storage-http-agent.js | 2 +- .../test-async-local-storage-run-resource.js | 2 +- .../test-async-local-storage-thenable.js | 2 +- test/async-hooks/test-callback-error.js | 6 +- test/async-hooks/test-destroy-not-blocked.js | 2 +- test/async-hooks/test-disable-in-init.js | 4 +- ...est-embedder.api.async-resource-no-type.js | 2 +- .../test-emit-after-on-destroyed.js | 2 +- test/async-hooks/test-emit-before-after.js | 2 +- .../test-emit-before-on-destroyed.js | 2 +- test/async-hooks/test-emit-init.js | 4 +- test/async-hooks/test-enable-in-init.js | 4 +- test/async-hooks/test-filehandle-no-reuse.js | 4 +- test/async-hooks/test-graph.http.js | 2 +- test/async-hooks/test-graph.tls-write.js | 2 +- .../test-http-agent-handle-reuse-parallel.js | 6 +- .../test-http-agent-handle-reuse-serial.js | 8 +- test/async-hooks/test-httpparser-reuse.js | 2 +- test/async-hooks/test-improper-order.js | 2 +- test/async-hooks/test-improper-unwind.js | 2 +- test/async-hooks/test-late-hook-enable.js | 2 +- .../test-nexttick-default-trigger.js | 2 +- test/async-hooks/test-queue-microtask.js | 2 +- test/async-hooks/test-tlswrap.js | 2 +- .../test-unhandled-rejection-context.js | 2 +- .../test-zlib.zlib-binding.deflate.js | 2 +- test/async-hooks/verify-graph.js | 6 +- test/common/README.md | 8 +- test/common/benchmark.js | 2 +- test/common/cpu-prof.js | 4 +- test/common/dns.js | 10 +- test/common/heap.js | 4 +- test/common/hijackstdio.js | 2 +- test/common/http2.js | 2 +- test/common/index.js | 10 +- test/common/index.mjs | 4 +- test/common/inspector-helper.js | 6 +- test/common/internet.js | 4 +- test/common/measure-memory.js | 2 +- test/common/ongc.js | 2 +- test/common/require-as.js | 2 +- test/common/shared-lib-util.js | 2 +- test/common/tls.js | 2 +- test/common/tmpdir.js | 2 +- test/common/udppair.js | 4 +- test/common/wpt.js | 16 +- test/common/wpt/worker.js | 4 +- test/doctool/test-doctool-html.js | 10 +- test/doctool/test-doctool-json.js | 64 ++-- test/es-module/test-esm-cjs-named-error.mjs | 12 +- test/es-module/test-esm-data-urls.js | 2 +- test/es-module/test-esm-dns-promises.mjs | 2 +- test/es-module/test-esm-dynamic-import.js | 2 +- test/es-module/test-esm-import-meta.mjs | 2 +- .../test-esm-loader-invalid-format.mjs | 2 +- .../es-module/test-esm-loader-invalid-url.mjs | 2 +- test/es-module/test-esm-loader-modulemap.js | 8 +- test/es-module/test-esm-loader-search.js | 4 +- test/es-module/test-esm-symlink-type.js | 12 +- .../test-dgram-broadcast-multi-process.js | 4 +- .../test-dgram-multicast-multi-process.js | 2 +- .../test-dgram-multicast-set-interface-lo.js | 6 +- .../test-dgram-multicast-ssm-multi-process.js | 2 +- ...est-dgram-multicast-ssmv6-multi-process.js | 2 +- test/internet/test-dns-any.js | 2 +- test/internet/test-dns-ipv4.js | 8 +- test/internet/test-dns-ipv6.js | 6 +- test/internet/test-dns-lookup.js | 10 +- test/internet/test-dns-promises-resolve.js | 4 +- test/internet/test-dns.js | 14 +- test/internet/test-http-dns-fail.js | 2 +- test/internet/test-tls-add-ca-cert.js | 2 +- test/internet/test-trace-events-dns.js | 2 +- test/js-native-api/test_bigint/test.js | 2 +- test/js-native-api/test_constructor/test.js | 2 +- test/js-native-api/test_conversions/test.js | 22 +- test/js-native-api/test_error/test.js | 6 +- test/js-native-api/test_function/test.js | 2 +- .../test_general/testEnvCleanup.js | 6 +- .../test_general/testInstanceOf.js | 2 +- test/js-native-api/test_object/test.js | 18 +- test/js-native-api/test_object/test_null.js | 4 +- .../test-http-path-contains-unicode.js | 2 +- .../known_issues/test-repl-require-context.js | 2 +- test/known_issues/test-vm-ownkeys.js | 2 +- test/known_issues/test-vm-ownpropertynames.js | 2 +- .../test-vm-ownpropertysymbols.js | 2 +- .../test-vm-timeout-escape-nexttick.js | 4 +- .../test-vm-timeout-escape-queuemicrotask.js | 4 +- test/message/async_error_eval_cjs.js | 2 +- test/message/async_error_eval_esm.js | 2 +- test/message/console_low_stack_space.js | 2 +- .../esm_display_syntax_error_import.mjs | 2 +- .../esm_loader_not_found_cjs_hint_bare.js | 2 +- test/message/vm_dont_display_runtime_error.js | 4 +- test/message/vm_dont_display_syntax_error.js | 4 +- test/node-api/test_async/test-async-hooks.js | 2 +- .../test_callback_scope/test-async-hooks.js | 2 +- test/node-api/test_policy/test_policy.js | 4 +- .../node-api/test_threadsafe_function/test.js | 28 +- test/parallel/test-assert-async.js | 22 +- ...ssert-builtins-not-read-from-filesystem.js | 2 +- test/parallel/test-assert-checktag.js | 4 +- test/parallel/test-assert-deep.js | 82 ++-- test/parallel/test-assert-fail-deprecation.js | 8 +- test/parallel/test-assert-fail.js | 6 +- test/parallel/test-assert-first-line.js | 4 +- test/parallel/test-assert-if-error.js | 8 +- test/parallel/test-assert.js | 153 ++++---- test/parallel/test-async-hooks-async-await.js | 2 +- ...t-async-hooks-asyncresource-constructor.js | 2 +- .../test-async-hooks-close-during-destroy.js | 2 +- .../test-async-hooks-destroy-on-gc.js | 2 +- ...test-async-hooks-disable-during-promise.js | 2 +- .../test-async-hooks-disable-gc-tracking.js | 2 +- ...ync-hooks-enable-before-promise-resolve.js | 2 +- .../test-async-hooks-enable-disable.js | 2 +- .../test-async-hooks-enable-during-promise.js | 2 +- .../test-async-hooks-enable-recursive.js | 4 +- ...nc-hooks-execution-async-resource-await.js | 2 +- ...st-async-hooks-execution-async-resource.js | 2 +- test/parallel/test-async-hooks-fatal-error.js | 2 +- .../test-async-hooks-http-agent-destroy.js | 8 +- test/parallel/test-async-hooks-http-agent.js | 8 +- .../test-async-hooks-http-parser-destroy.js | 4 +- ...test-async-hooks-prevent-double-destroy.js | 2 +- ...test-async-hooks-promise-enable-disable.js | 2 +- .../test-async-hooks-promise-triggerid.js | 2 +- test/parallel/test-async-hooks-promise.js | 2 +- ...st-async-hooks-top-level-clearimmediate.js | 2 +- test/parallel/test-async-wrap-constructor.js | 2 +- .../test-async-wrap-promise-after-enabled.js | 2 +- .../test-async-wrap-tlssocket-asyncreset.js | 6 +- test/parallel/test-asyncresource-bind.js | 2 +- test/parallel/test-blob.js | 8 +- test/parallel/test-blocklist.js | 16 +- test/parallel/test-buffer-alloc.js | 20 +- test/parallel/test-buffer-arraybuffer.js | 14 +- test/parallel/test-buffer-bigint64.js | 2 +- test/parallel/test-buffer-bytelength.js | 2 +- test/parallel/test-buffer-compare-offset.js | 2 +- test/parallel/test-buffer-compare.js | 6 +- test/parallel/test-buffer-concat.js | 6 +- ...buffer-constructor-outside-node-modules.js | 4 +- test/parallel/test-buffer-copy.js | 4 +- test/parallel/test-buffer-equals.js | 2 +- test/parallel/test-buffer-fill.js | 20 +- test/parallel/test-buffer-from.js | 2 +- test/parallel/test-buffer-includes.js | 2 +- test/parallel/test-buffer-indexof.js | 4 +- test/parallel/test-buffer-new.js | 2 +- .../test-buffer-no-negative-allocation.js | 2 +- test/parallel/test-buffer-over-max-length.js | 2 +- test/parallel/test-buffer-read.js | 4 +- test/parallel/test-buffer-readdouble.js | 6 +- test/parallel/test-buffer-readfloat.js | 6 +- test/parallel/test-buffer-readint.js | 16 +- test/parallel/test-buffer-readuint.js | 16 +- test/parallel/test-buffer-slow.js | 2 +- test/parallel/test-buffer-tostring-range.js | 4 +- .../test-buffer-tostring-rangeerror.js | 2 +- test/parallel/test-buffer-tostring.js | 2 +- test/parallel/test-buffer-write.js | 4 +- test/parallel/test-buffer-writedouble.js | 6 +- test/parallel/test-buffer-writefloat.js | 6 +- test/parallel/test-buffer-writeint.js | 14 +- test/parallel/test-buffer-writeuint.js | 14 +- ...st-child-process-advanced-serialization.js | 4 +- .../test-child-process-constructor.js | 10 +- .../parallel/test-child-process-disconnect.js | 2 +- test/parallel/test-child-process-env.js | 2 +- ...rocess-exec-abortcontroller-promisified.js | 2 +- .../test-child-process-exec-timeout.js | 2 +- ...ss-execFile-promisified-abortController.js | 2 +- .../test-child-process-fork-abort-signal.js | 6 +- test/parallel/test-child-process-fork-args.js | 8 +- .../test-child-process-fork-no-shell.js | 2 +- .../parallel/test-child-process-fork-stdio.js | 2 +- test/parallel/test-child-process-fork.js | 6 +- .../test-child-process-recv-handle.js | 2 +- .../test-child-process-send-after-close.js | 2 +- .../test-child-process-server-close.js | 2 +- .../test-child-process-set-blocking.js | 2 +- .../test-child-process-spawn-shell.js | 6 +- .../test-child-process-spawn-typeerror.js | 4 +- .../test-child-process-spawnsync-env.js | 2 +- .../test-child-process-spawnsync-input.js | 10 +- .../test-child-process-spawnsync-shell.js | 2 +- test/parallel/test-child-process-stdin-ipc.js | 2 +- .../test-child-process-stdio-overlapped.js | 2 +- .../parallel/test-child-process-stdout-ipc.js | 2 +- .../test-child-process-validate-stdio.js | 2 +- test/parallel/test-cli-node-options.js | 2 +- test/parallel/test-cli-options-precedence.js | 4 +- test/parallel/test-cluster-basic.js | 16 +- test/parallel/test-cluster-dgram-ipv6only.js | 2 +- test/parallel/test-cluster-fork-env.js | 6 +- test/parallel/test-cluster-fork-stdio.js | 2 +- .../parallel/test-cluster-fork-windowsHide.js | 4 +- test/parallel/test-cluster-invalid-message.js | 2 +- test/parallel/test-cluster-message.js | 10 +- test/parallel/test-cluster-primary-error.js | 2 +- test/parallel/test-cluster-primary-kill.js | 2 +- test/parallel/test-cluster-send-deadlock.js | 4 +- .../test-cluster-send-handle-twice.js | 4 +- test/parallel/test-cluster-setup-primary.js | 4 +- .../test-cluster-worker-constructor.js | 2 +- .../test-cluster-worker-disconnect.js | 6 +- test/parallel/test-cluster-worker-exit.js | 4 +- test/parallel/test-cluster-worker-kill.js | 4 +- test/parallel/test-code-cache.js | 6 +- test/parallel/test-common.js | 4 +- .../test-console-async-write-error.js | 2 +- test/parallel/test-console-group.js | 4 +- test/parallel/test-console-instance.js | 8 +- .../test-console-log-stdio-broken-dest.js | 2 +- .../test-console-log-throw-primitive.js | 2 +- test/parallel/test-console-methods.js | 2 +- .../parallel/test-console-sync-write-error.js | 6 +- test/parallel/test-console-tty-colors.js | 18 +- test/parallel/test-console.js | 2 +- test/parallel/test-crypto-aes-wrap.js | 12 +- .../parallel/test-crypto-async-sign-verify.js | 8 +- test/parallel/test-crypto-authenticated.js | 72 ++-- test/parallel/test-crypto-binary-default.js | 58 +-- test/parallel/test-crypto-certificate.js | 6 +- test/parallel/test-crypto-cipher-decipher.js | 16 +- .../test-crypto-cipheriv-decipheriv.js | 6 +- test/parallel/test-crypto-des3-wrap.js | 2 +- test/parallel/test-crypto-dh-stateless.js | 34 +- test/parallel/test-crypto-dh.js | 16 +- test/parallel/test-crypto-ecdh-convert-key.js | 4 +- test/parallel/test-crypto-engine.js | 8 +- test/parallel/test-crypto-fips.js | 2 +- test/parallel/test-crypto-getcipherinfo.js | 10 +- test/parallel/test-crypto-hash.js | 12 +- test/parallel/test-crypto-hkdf.js | 42 +-- test/parallel/test-crypto-hmac.js | 76 ++-- .../test-crypto-key-objects-messageport.js | 4 +- test/parallel/test-crypto-key-objects.js | 68 ++-- test/parallel/test-crypto-keygen.js | 354 +++++++++--------- .../test-crypto-op-during-process-exit.js | 4 +- test/parallel/test-crypto-pbkdf2.js | 26 +- test/parallel/test-crypto-prime.js | 52 +-- test/parallel/test-crypto-random.js | 28 +- test/parallel/test-crypto-randomuuid.js | 4 +- test/parallel/test-crypto-rsa-dsa.js | 58 +-- test/parallel/test-crypto-scrypt.js | 10 +- test/parallel/test-crypto-secret-keygen.js | 30 +- test/parallel/test-crypto-secure-heap.js | 2 +- test/parallel/test-crypto-sign-verify.js | 58 +-- test/parallel/test-crypto-verify-failure.js | 4 +- test/parallel/test-crypto-x509.js | 30 +- test/parallel/test-crypto.js | 10 +- test/parallel/test-dgram-bind-fd-error.js | 4 +- test/parallel/test-dgram-bind.js | 2 +- test/parallel/test-dgram-close-signal.js | 2 +- test/parallel/test-dgram-connect.js | 12 +- test/parallel/test-dgram-createSocket-type.js | 4 +- test/parallel/test-dgram-custom-lookup.js | 2 +- test/parallel/test-dgram-membership.js | 20 +- test/parallel/test-dgram-multicast-setTTL.js | 2 +- .../parallel/test-dgram-send-address-types.js | 2 +- .../parallel/test-dgram-send-bad-arguments.js | 14 +- test/parallel/test-dgram-sendto.js | 2 +- test/parallel/test-dgram-setTTL.js | 2 +- .../parallel/test-dgram-socket-buffer-size.js | 16 +- ...t-diagnostics-channel-http-server-start.js | 2 +- ...gnostics-channel-object-channel-pub-sub.js | 2 +- ...gnostics-channel-safe-subscriber-errors.js | 2 +- .../test-diagnostics-channel-symbol-named.js | 2 +- test/parallel/test-disable-proto-throw.js | 4 +- .../test-dns-channel-cancel-promise.js | 4 +- test/parallel/test-dns-lookup-promises.js | 24 +- test/parallel/test-dns-lookup.js | 32 +- test/parallel/test-dns-lookupService.js | 4 +- test/parallel/test-dns-multi-channel.js | 6 +- test/parallel/test-dns-resolve-promises.js | 2 +- .../test-dns-resolveany-bad-ancount.js | 2 +- test/parallel/test-dns-resolveany.js | 4 +- test/parallel/test-dns-resolvens-typeerror.js | 6 +- .../test-dns-setserver-when-querying.js | 2 +- .../test-dns-setservers-type-check.js | 14 +- test/parallel/test-dns.js | 44 +-- ...ad-after-set-uncaught-exception-capture.js | 2 +- ...t-uncaught-exception-capture-after-load.js | 2 +- ...n-throw-from-uncaught-exception-handler.js | 2 +- .../test-domain-uncaught-exception.js | 12 +- ...domain-with-abort-on-uncaught-exception.js | 14 +- test/parallel/test-err-name-deprecation.js | 2 +- ...st-errors-systemerror-frozen-intrinsics.js | 2 +- ...stemerror-stackTraceLimit-custom-setter.js | 2 +- ...tackTraceLimit-deleted-and-Error-sealed.js | 2 +- ...ors-systemerror-stackTraceLimit-deleted.js | 2 +- ...error-stackTraceLimit-has-only-a-getter.js | 2 +- ...ystemerror-stackTraceLimit-not-writable.js | 2 +- test/parallel/test-errors-systemerror.js | 20 +- .../test-eslint-alphabetize-errors.js | 4 +- ...test-eslint-async-iife-no-unused-result.js | 2 +- test/parallel/test-eslint-crypto-check.js | 10 +- .../parallel/test-eslint-documented-errors.js | 8 +- test/parallel/test-eslint-eslint-check.js | 4 +- test/parallel/test-eslint-inspector-check.js | 4 +- ...est-eslint-lowercase-name-for-primitive.js | 2 +- .../test-eslint-no-array-destructuring.js | 6 +- .../test-eslint-no-unescaped-regexp-dot.js | 6 +- .../test-eslint-non-ascii-character.js | 4 +- .../test-eslint-prefer-assert-iferror.js | 6 +- .../test-eslint-prefer-assert-methods.js | 18 +- .../test-eslint-prefer-common-mustnotcall.js | 6 +- .../test-eslint-prefer-common-mustsucceed.js | 16 +- .../test-eslint-prefer-primordials.js | 46 +-- .../test-eslint-prefer-util-format-errors.js | 6 +- .../test-eslint-require-common-first.js | 6 +- test/parallel/test-eslint-required-modules.js | 18 +- .../parallel/test-event-capture-rejections.js | 8 +- test/parallel/test-event-emitter-errors.js | 8 +- .../test-event-emitter-invalid-listener.js | 2 +- .../test-event-emitter-max-listeners.js | 4 +- test/parallel/test-event-on-async-iterator.js | 30 +- test/parallel/test-events-once.js | 12 +- .../test-events-static-geteventlisteners.js | 2 +- .../test-eventtarget-memoryleakwarning.js | 2 +- .../test-eventtarget-whatwg-passive.js | 4 +- test/parallel/test-eventtarget.js | 18 +- test/parallel/test-file-validate-mode-flag.js | 12 +- test/parallel/test-file-write-stream.js | 6 +- test/parallel/test-file-write-stream2.js | 2 +- test/parallel/test-file-write-stream3.js | 4 +- test/parallel/test-file-write-stream4.js | 2 +- test/parallel/test-filehandle-close.js | 2 +- test/parallel/test-fs-access.js | 12 +- test/parallel/test-fs-append-file.js | 4 +- test/parallel/test-fs-buffer.js | 2 +- test/parallel/test-fs-chmod.js | 2 +- test/parallel/test-fs-chown-type-check.js | 12 +- test/parallel/test-fs-close-errors.js | 4 +- test/parallel/test-fs-copyfile.js | 20 +- test/parallel/test-fs-error-messages.js | 4 +- test/parallel/test-fs-fchmod.js | 12 +- test/parallel/test-fs-fchown.js | 6 +- .../test-fs-filehandle-use-after-close.js | 2 +- test/parallel/test-fs-filehandle.js | 2 +- test/parallel/test-fs-fmap.js | 2 +- test/parallel/test-fs-fsync.js | 2 +- test/parallel/test-fs-lchmod.js | 10 +- test/parallel/test-fs-lchown.js | 2 +- test/parallel/test-fs-link.js | 8 +- test/parallel/test-fs-long-path.js | 2 +- test/parallel/test-fs-make-callback.js | 2 +- test/parallel/test-fs-makeStatsCallback.js | 2 +- test/parallel/test-fs-mkdir.js | 10 +- test/parallel/test-fs-mkdtemp-prefix-check.js | 4 +- .../test-fs-non-number-arguments-throw.js | 6 +- test/parallel/test-fs-null-bytes.js | 2 +- test/parallel/test-fs-open.js | 16 +- test/parallel/test-fs-opendir.js | 14 +- ...s-promises-file-handle-aggregate-errors.js | 2 +- ...st-fs-promises-file-handle-close-errors.js | 2 +- .../test-fs-promises-file-handle-close.js | 2 +- .../test-fs-promises-file-handle-op-errors.js | 2 +- ...est-fs-promises-file-handle-read-worker.js | 4 +- .../test-fs-promises-file-handle-readFile.js | 8 +- .../test-fs-promises-file-handle-sync.js | 2 +- .../test-fs-promises-file-handle-writeFile.js | 2 +- test/parallel/test-fs-promises-readfile.js | 4 +- test/parallel/test-fs-promises-writefile.js | 14 +- test/parallel/test-fs-promises.js | 24 +- test/parallel/test-fs-read-empty-buffer.js | 6 +- test/parallel/test-fs-read-optional-params.js | 2 +- test/parallel/test-fs-read-stream-encoding.js | 2 +- test/parallel/test-fs-read-stream-err.js | 2 +- .../test-fs-read-stream-file-handle.js | 2 +- test/parallel/test-fs-read-stream-inherit.js | 2 +- test/parallel/test-fs-read-stream-pos.js | 2 +- .../test-fs-read-stream-throw-type-error.js | 4 +- test/parallel/test-fs-read-stream.js | 4 +- test/parallel/test-fs-read-type.js | 26 +- .../test-fs-readdir-stack-overflow.js | 2 +- test/parallel/test-fs-readdir-types.js | 12 +- test/parallel/test-fs-readdir.js | 4 +- test/parallel/test-fs-readfile-error.js | 2 +- test/parallel/test-fs-readlink-type-check.js | 4 +- test/parallel/test-fs-readv-sync.js | 4 +- test/parallel/test-fs-readv.js | 4 +- test/parallel/test-fs-realpath-pipe.js | 2 +- test/parallel/test-fs-rename-type-check.js | 8 +- test/parallel/test-fs-rm.js | 24 +- test/parallel/test-fs-rmdir-recursive.js | 18 +- test/parallel/test-fs-rmdir-type-check.js | 4 +- test/parallel/test-fs-stat.js | 10 +- test/parallel/test-fs-stream-fs-options.js | 12 +- test/parallel/test-fs-symlink.js | 4 +- test/parallel/test-fs-syncwritestream.js | 2 +- .../test-fs-timestamp-parsing-error.js | 4 +- test/parallel/test-fs-truncate.js | 12 +- test/parallel/test-fs-unlink-type-check.js | 4 +- .../test-fs-util-validateoffsetlengthwrite.js | 4 +- test/parallel/test-fs-utimes.js | 4 +- test/parallel/test-fs-watch-enoent.js | 2 +- test/parallel/test-fs-watch.js | 2 +- test/parallel/test-fs-watchfile.js | 4 +- test/parallel/test-fs-whatwg-url.js | 12 +- test/parallel/test-fs-write-buffer-large.js | 2 +- test/parallel/test-fs-write-buffer.js | 2 +- .../test-fs-write-file-invalid-path.js | 2 +- test/parallel/test-fs-write-file-sync.js | 2 +- .../test-fs-write-stream-double-close.js | 2 +- .../parallel/test-fs-write-stream-encoding.js | 8 +- test/parallel/test-fs-write-stream-err.js | 2 +- test/parallel/test-fs-write-stream-fs.js | 4 +- .../test-fs-write-stream-throw-type-error.js | 2 +- test/parallel/test-fs-write-stream.js | 2 +- test/parallel/test-fs-write.js | 14 +- test/parallel/test-fs-writev-sync.js | 4 +- test/parallel/test-fs-writev.js | 4 +- .../test-gc-http-client-connaborted.js | 2 +- test/parallel/test-gc-http-client-onerror.js | 2 +- test/parallel/test-gc-http-client-timeout.js | 2 +- .../test-heapdump-async-hooks-init-promise.js | 2 +- ...est-heapsnapshot-near-heap-limit-worker.js | 6 +- test/parallel/test-http-1.0-keep-alive.js | 40 +- test/parallel/test-http-abort-before-end.js | 2 +- test/parallel/test-http-abort-client.js | 4 +- test/parallel/test-http-abort-queued.js | 4 +- test/parallel/test-http-aborted.js | 6 +- .../test-http-addrequest-localaddress.js | 4 +- test/parallel/test-http-after-connect.js | 4 +- .../test-http-agent-abort-controller.js | 2 +- test/parallel/test-http-agent-close.js | 2 +- .../test-http-agent-destroyed-socket.js | 2 +- .../test-http-agent-domain-reused-gc.js | 4 +- .../parallel/test-http-agent-error-on-idle.js | 2 +- test/parallel/test-http-agent-false.js | 2 +- test/parallel/test-http-agent-getname.js | 6 +- test/parallel/test-http-agent-keepalive.js | 4 +- .../test-http-agent-maxsockets-respected.js | 4 +- test/parallel/test-http-agent-maxsockets.js | 4 +- .../test-http-agent-maxtotalsockets.js | 2 +- test/parallel/test-http-agent-null.js | 2 +- test/parallel/test-http-agent-remove.js | 2 +- test/parallel/test-http-agent-scheduling.js | 8 +- .../test-http-agent-timeout-option.js | 2 +- .../test-http-allow-req-after-204-res.js | 2 +- test/parallel/test-http-automatic-headers.js | 2 +- test/parallel/test-http-blank-header.js | 2 +- test/parallel/test-http-buffer-sanity.js | 2 +- test/parallel/test-http-chunk-problem.js | 2 +- test/parallel/test-http-chunked.js | 2 +- test/parallel/test-http-client-abort-event.js | 2 +- ...ttp-client-abort-keep-alive-destroy-res.js | 2 +- ...ient-abort-keep-alive-queued-tcp-socket.js | 2 +- ...ent-abort-keep-alive-queued-unix-socket.js | 2 +- .../test-http-client-abort-no-agent.js | 2 +- .../test-http-client-abort-response-event.js | 2 +- .../test-http-client-abort-unix-socket.js | 2 +- .../test-http-client-aborted-event.js | 6 +- ...est-http-client-agent-abort-close-event.js | 2 +- .../test-http-client-agent-end-close-event.js | 2 +- test/parallel/test-http-client-agent.js | 2 +- .../test-http-client-check-http-token.js | 2 +- .../test-http-client-default-headers-exist.js | 4 +- test/parallel/test-http-client-encoding.js | 2 +- test/parallel/test-http-client-finished.js | 2 +- .../test-http-client-headers-array.js | 4 +- .../test-http-client-headers-host-array.js | 6 +- .../test-http-client-immediate-error.js | 6 +- ...est-http-client-incomingmessage-destroy.js | 2 +- .../parallel/test-http-client-invalid-path.js | 4 +- ...client-keep-alive-release-before-finish.js | 2 +- .../test-http-client-override-global-agent.js | 2 +- test/parallel/test-http-client-parse-error.js | 4 +- test/parallel/test-http-client-pipe-end.js | 2 +- test/parallel/test-http-client-race-2.js | 2 +- test/parallel/test-http-client-race.js | 2 +- .../test-http-client-read-in-error.js | 2 +- test/parallel/test-http-client-readable.js | 2 +- ...est-http-client-reject-unexpected-agent.js | 2 +- ...-http-client-req-error-dont-double-fire.js | 2 +- .../test-http-client-res-destroyed.js | 4 +- .../test-http-client-response-domain.js | 2 +- test/parallel/test-http-client-set-timeout.js | 2 +- .../test-http-client-spurious-aborted.js | 4 +- .../test-http-client-timeout-event.js | 2 +- ...st-http-client-timeout-option-listeners.js | 2 +- ...t-http-client-timeout-option-with-agent.js | 2 +- .../test-http-client-timeout-option.js | 2 +- .../test-http-client-timeout-with-data.js | 2 +- test/parallel/test-http-client-timeout.js | 2 +- .../test-http-client-unescaped-path.js | 2 +- test/parallel/test-http-client-upload-buf.js | 2 +- test/parallel/test-http-client-upload.js | 2 +- test/parallel/test-http-conn-reset.js | 2 +- test/parallel/test-http-connect-req-res.js | 2 +- test/parallel/test-http-connect.js | 2 +- test/parallel/test-http-content-length.js | 8 +- test/parallel/test-http-createConnection.js | 4 +- test/parallel/test-http-date-header.js | 4 +- test/parallel/test-http-default-encoding.js | 2 +- test/parallel/test-http-default-port.js | 6 +- .../test-http-destroyed-socket-write2.js | 2 +- test/parallel/test-http-dns-error.js | 2 +- .../test-http-double-content-length.js | 2 +- .../test-http-dump-req-when-res-ends.js | 2 +- test/parallel/test-http-expect-continue.js | 4 +- test/parallel/test-http-expect-handling.js | 2 +- test/parallel/test-http-full-response.js | 2 +- test/parallel/test-http-generic-streams.js | 8 +- .../test-http-get-pipeline-problem.js | 4 +- test/parallel/test-http-head-request.js | 6 +- ...test-http-head-response-has-no-body-end.js | 2 +- .../test-http-head-response-has-no-body.js | 2 +- test/parallel/test-http-header-obstext.js | 2 +- test/parallel/test-http-header-overflow.js | 2 +- test/parallel/test-http-host-headers.js | 10 +- .../test-http-hostname-typechecking.js | 4 +- .../test-http-incoming-message-options.js | 2 +- .../parallel/test-http-information-headers.js | 4 +- .../test-http-information-processing.js | 4 +- .../test-http-insecure-parser-per-stream.js | 6 +- test/parallel/test-http-invalid-path-chars.js | 2 +- test/parallel/test-http-invalid-urls.js | 2 +- test/parallel/test-http-invalidheaderfield.js | 4 +- .../test-http-keep-alive-close-on-header.js | 6 +- .../test-http-keep-alive-timeout-custom.js | 4 +- test/parallel/test-http-keep-alive-timeout.js | 2 +- test/parallel/test-http-keep-alive.js | 6 +- test/parallel/test-http-keepalive-client.js | 2 +- test/parallel/test-http-keepalive-free.js | 2 +- test/parallel/test-http-keepalive-override.js | 4 +- test/parallel/test-http-keepalive-request.js | 2 +- .../test-http-localaddress-bind-error.js | 2 +- .../test-http-max-header-size-per-stream.js | 4 +- test/parallel/test-http-max-headers-count.js | 2 +- test/parallel/test-http-multi-line-headers.js | 2 +- test/parallel/test-http-mutable-headers.js | 14 +- test/parallel/test-http-no-read-no-dump.js | 2 +- test/parallel/test-http-outgoing-destroyed.js | 2 +- test/parallel/test-http-outgoing-end-cork.js | 2 +- .../test-http-outgoing-end-multiple.js | 2 +- test/parallel/test-http-outgoing-end-types.js | 2 +- .../test-http-outgoing-finish-writable.js | 2 +- test/parallel/test-http-outgoing-finish.js | 2 +- test/parallel/test-http-outgoing-finished.js | 2 +- ...tp-outgoing-internal-headernames-setter.js | 2 +- .../test-http-outgoing-internal-headers.js | 4 +- ...http-outgoing-message-capture-rejection.js | 6 +- .../test-http-outgoing-message-inheritance.js | 2 +- ...st-http-outgoing-message-write-callback.js | 4 +- .../parallel/test-http-outgoing-properties.js | 4 +- test/parallel/test-http-outgoing-proto.js | 22 +- .../test-http-outgoing-renderHeaders.js | 6 +- .../parallel/test-http-outgoing-settimeout.js | 4 +- .../test-http-outgoing-writableFinished.js | 2 +- .../test-http-outgoing-write-types.js | 2 +- .../test-http-parser-freed-before-upgrade.js | 4 +- test/parallel/test-http-parser-lazy-loaded.js | 2 +- test/parallel/test-http-pause-no-dump.js | 2 +- .../test-http-pause-resume-one-end.js | 2 +- test/parallel/test-http-pause.js | 2 +- test/parallel/test-http-perf_hooks.js | 4 +- test/parallel/test-http-pipe-fs.js | 4 +- test/parallel/test-http-proxy.js | 4 +- test/parallel/test-http-raw-headers.js | 4 +- .../parallel/test-http-readable-data-event.js | 4 +- test/parallel/test-http-request-agent.js | 4 +- ...test-http-request-dont-override-options.js | 2 +- test/parallel/test-http-request-end.js | 2 +- .../test-http-request-invalid-method-error.js | 2 +- .../test-http-request-large-payload.js | 2 +- .../parallel/test-http-res-write-after-end.js | 2 +- ...est-http-response-add-header-after-sent.js | 2 +- .../parallel/test-http-response-no-headers.js | 4 +- ...-http-response-remove-header-after-sent.js | 2 +- test/parallel/test-http-response-splitting.js | 2 +- .../test-http-response-status-message.js | 2 +- .../parallel/test-http-response-statuscode.js | 6 +- test/parallel/test-http-reuse-socket.js | 2 +- .../test-http-server-capture-rejections.js | 6 +- .../test-http-server-consumed-timeout.js | 2 +- .../test-http-server-de-chunked-trailer.js | 2 +- ...p-server-destroy-socket-on-client-error.js | 4 +- ...est-http-server-incomingmessage-destroy.js | 2 +- .../test-http-server-keep-alive-timeout.js | 2 +- .../parallel/test-http-server-multiheaders.js | 2 +- ...st-http-server-options-incoming-message.js | 6 +- ...est-http-server-options-server-response.js | 2 +- .../test-http-server-response-standalone.js | 4 +- test/parallel/test-http-server-stale-close.js | 2 +- .../test-http-server-unconsume-consume.js | 2 +- .../test-http-server-write-after-end.js | 2 +- .../test-http-server-write-end-after-end.js | 2 +- test/parallel/test-http-server.js | 2 +- test/parallel/test-http-set-header-chain.js | 2 +- test/parallel/test-http-set-timeout-server.js | 8 +- .../test-http-socket-encoding-error.js | 2 +- ...t-http-sync-write-error-during-continue.js | 4 +- test/parallel/test-http-timeout-overflow.js | 2 +- ...est-http-uncaught-from-request-callback.js | 4 +- .../test-http-unix-socket-keep-alive.js | 2 +- test/parallel/test-http-unix-socket.js | 6 +- test/parallel/test-http-upgrade-advertise.js | 4 +- test/parallel/test-http-upgrade-agent.js | 4 +- test/parallel/test-http-upgrade-client.js | 6 +- test/parallel/test-http-upgrade-client2.js | 2 +- .../test-http-upgrade-reconsume-stream.js | 4 +- ...p-url.parse-auth-with-header-in-request.js | 2 +- .../test-http-url.parse-https.request.js | 2 +- ....parse-only-support-http-https-protocol.js | 2 +- test/parallel/test-http-write-callbacks.js | 2 +- test/parallel/test-http-write-head.js | 6 +- test/parallel/test-http.js | 8 +- test/parallel/test-http2-altsvc.js | 12 +- test/parallel/test-http2-backpressure.js | 4 +- test/parallel/test-http2-binding.js | 6 +- test/parallel/test-http2-capture-rejection.js | 4 +- test/parallel/test-http2-clean-output.js | 10 +- test/parallel/test-http2-client-destroy.js | 6 +- .../test-http2-client-http1-server.js | 4 +- .../test-http2-client-jsstream-destroy.js | 6 +- .../test-http2-client-onconnect-errors.js | 18 +- ...est-http2-client-request-options-errors.js | 10 +- ...t-http2-client-rststream-before-connect.js | 6 +- .../test-http2-client-setLocalWindowSize.js | 4 +- ...est-http2-client-setNextStreamID-errors.js | 6 +- ...st-http2-client-settings-before-connect.js | 4 +- ...p2-client-stream-destroy-before-connect.js | 2 +- .../test-http2-client-unescaped-path.js | 2 +- .../test-http2-client-write-empty-string.js | 2 +- .../test-http2-close-while-writing.js | 4 +- ...test-http2-compat-expect-continue-check.js | 2 +- .../test-http2-compat-expect-continue.js | 2 +- .../test-http2-compat-expect-handling.js | 2 +- .../test-http2-compat-method-connect.js | 2 +- ...test-http2-compat-serverrequest-headers.js | 8 +- .../test-http2-compat-serverrequest-host.js | 4 +- .../test-http2-compat-serverrequest-pause.js | 2 +- ...t-http2-compat-serverrequest-settimeout.js | 2 +- ...est-http2-compat-serverrequest-trailers.js | 6 +- .../test-http2-compat-serverrequest.js | 4 +- ...ompat-serverresponse-createpushresponse.js | 8 +- ...est-http2-compat-serverresponse-destroy.js | 4 +- .../test-http2-compat-serverresponse-drain.js | 2 +- ...esponse-end-after-statuses-without-body.js | 2 +- .../test-http2-compat-serverresponse-end.js | 26 +- ...st-http2-compat-serverresponse-finished.js | 2 +- ...ttp2-compat-serverresponse-flushheaders.js | 4 +- ...at-serverresponse-headers-after-destroy.js | 2 +- ...est-http2-compat-serverresponse-headers.js | 22 +- ...-http2-compat-serverresponse-settimeout.js | 2 +- ...-http2-compat-serverresponse-statuscode.js | 12 +- ...rverresponse-statusmessage-property-set.js | 2 +- ...t-serverresponse-statusmessage-property.js | 2 +- ...tp2-compat-serverresponse-statusmessage.js | 2 +- ...st-http2-compat-serverresponse-trailers.js | 12 +- .../test-http2-compat-serverresponse-write.js | 2 +- ...2-compat-serverresponse-writehead-array.js | 2 +- ...t-http2-compat-serverresponse-writehead.js | 4 +- .../test-http2-compat-serverresponse.js | 2 +- ...http2-compat-short-stream-client-server.js | 2 +- ...est-http2-compat-socket-destroy-delayed.js | 2 +- test/parallel/test-http2-compat-socket-set.js | 4 +- test/parallel/test-http2-compat-socket.js | 4 +- ...2-connect-method-extended-cant-turn-off.js | 2 +- .../test-http2-connect-method-extended.js | 2 +- test/parallel/test-http2-connect-method.js | 14 +- test/parallel/test-http2-connect-options.js | 2 +- .../test-http2-connect-tls-with-delay.js | 6 +- test/parallel/test-http2-connect.js | 16 +- test/parallel/test-http2-cookies.js | 2 +- .../test-http2-create-client-connect.js | 2 +- ...test-http2-create-client-secure-session.js | 2 +- .../test-http2-create-client-session.js | 2 +- .../test-http2-createsecureserver-options.js | 4 +- .../test-http2-createserver-options.js | 6 +- test/parallel/test-http2-createwritereq.js | 4 +- .../test-http2-destroy-after-write.js | 2 +- .../test-http2-empty-frame-without-eof.js | 6 +- .../test-http2-forget-closed-streams.js | 4 +- .../test-http2-generic-streams-sendfile.js | 2 +- test/parallel/test-http2-generic-streams.js | 4 +- test/parallel/test-http2-getpackedsettings.js | 18 +- test/parallel/test-http2-head-request.js | 4 +- ...ttp2-https-fallback-http-server-options.js | 6 +- test/parallel/test-http2-https-fallback.js | 4 +- .../test-http2-info-headers-errors.js | 8 +- test/parallel/test-http2-info-headers.js | 10 +- .../test-http2-invalidargtypes-errors.js | 6 +- .../parallel/test-http2-invalidheaderfield.js | 10 +- .../test-http2-invalidheaderfields-client.js | 8 +- test/parallel/test-http2-large-write-close.js | 4 +- .../test-http2-large-write-destroy.js | 4 +- ...est-http2-large-write-multiple-requests.js | 4 +- ...-http2-large-writes-session-memory-leak.js | 2 +- .../test-http2-max-concurrent-streams.js | 2 +- .../parallel/test-http2-max-invalid-frames.js | 4 +- .../test-http2-max-session-memory-leak.js | 4 +- test/parallel/test-http2-methods.js | 2 +- ...t-http2-misbehaving-flow-control-paused.js | 2 +- .../test-http2-misbehaving-flow-control.js | 2 +- .../test-http2-misbehaving-multiplex.js | 4 +- test/parallel/test-http2-misc-util.js | 8 +- .../test-http2-misused-pseudoheaders.js | 4 +- .../test-http2-multi-content-length.js | 8 +- ...t-http2-multistream-destroy-on-read-tls.js | 6 +- test/parallel/test-http2-no-more-streams.js | 4 +- test/parallel/test-http2-onping.js | 6 +- ...-http2-options-max-headers-block-length.js | 4 +- .../test-http2-options-server-request.js | 4 +- .../test-http2-options-server-response.js | 2 +- test/parallel/test-http2-origin.js | 14 +- .../test-http2-pack-end-stream-flag.js | 2 +- test/parallel/test-http2-padding-aligned.js | 6 +- test/parallel/test-http2-perf_hooks.js | 2 +- .../test-http2-ping-settings-heapdump.js | 2 +- .../test-http2-ping-unsolicited-ack.js | 2 +- test/parallel/test-http2-ping.js | 10 +- test/parallel/test-http2-pipe-named-pipe.js | 2 +- test/parallel/test-http2-priority-event.js | 6 +- test/parallel/test-http2-reset-flood.js | 2 +- test/parallel/test-http2-respond-errors.js | 4 +- test/parallel/test-http2-respond-file-204.js | 6 +- test/parallel/test-http2-respond-file-304.js | 6 +- test/parallel/test-http2-respond-file-404.js | 8 +- .../test-http2-respond-file-error-dir.js | 6 +- ...st-http2-respond-file-error-pipe-offset.js | 6 +- .../test-http2-respond-file-errors.js | 20 +- .../test-http2-respond-file-fd-errors.js | 24 +- .../test-http2-respond-file-fd-invalid.js | 4 +- .../test-http2-respond-file-fd-range.js | 6 +- test/parallel/test-http2-respond-file-fd.js | 2 +- .../test-http2-respond-file-filehandle.js | 2 +- test/parallel/test-http2-respond-file-push.js | 6 +- .../parallel/test-http2-respond-file-range.js | 6 +- .../test-http2-respond-file-with-pipe.js | 4 +- test/parallel/test-http2-respond-file.js | 6 +- .../test-http2-respond-nghttperrors.js | 10 +- .../test-http2-respond-with-fd-errors.js | 10 +- ...ttp2-respond-with-file-connection-abort.js | 4 +- test/parallel/test-http2-sensitive-headers.js | 4 +- test/parallel/test-http2-serve-file.js | 2 +- .../test-http2-server-http1-client.js | 2 +- .../test-http2-server-push-disabled.js | 2 +- ...st-http2-server-push-stream-errors-args.js | 4 +- .../test-http2-server-push-stream-errors.js | 14 +- .../test-http2-server-push-stream-head.js | 4 +- .../parallel/test-http2-server-push-stream.js | 4 +- .../test-http2-server-rst-before-respond.js | 2 +- test/parallel/test-http2-server-rst-stream.js | 6 +- .../test-http2-server-sessionerror.js | 2 +- ...est-http2-server-settimeout-no-callback.js | 2 +- ...st-http2-server-shutdown-before-respond.js | 4 +- ...st-http2-server-shutdown-options-errors.js | 6 +- .../test-http2-server-shutdown-redundant.js | 6 +- test/parallel/test-http2-server-startup.js | 8 +- ...est-http2-server-stream-session-destroy.js | 6 +- .../test-http2-server-unknown-protocol.js | 4 +- ...-http2-session-gc-while-write-scheduled.js | 2 +- test/parallel/test-http2-session-settings.js | 12 +- .../test-http2-session-stream-state.js | 2 +- test/parallel/test-http2-session-unref.js | 2 +- .../test-http2-short-stream-client-server.js | 4 +- test/parallel/test-http2-single-headers.js | 4 +- ...test-http2-socket-proxy-handler-for-has.js | 4 +- test/parallel/test-http2-socket-proxy.js | 2 +- .../test-http2-status-code-invalid.js | 2 +- test/parallel/test-http2-timeouts.js | 6 +- test/parallel/test-http2-too-large-headers.js | 4 +- test/parallel/test-http2-too-many-headers.js | 4 +- test/parallel/test-http2-too-many-settings.js | 2 +- test/parallel/test-http2-trailers.js | 8 +- .../test-http2-unbound-socket-proxy.js | 6 +- test/parallel/test-http2-update-settings.js | 14 +- ...st-http2-util-assert-valid-pseudoheader.js | 2 +- test/parallel/test-http2-util-asserts.js | 4 +- test/parallel/test-http2-util-headers-list.js | 26 +- test/parallel/test-http2-util-nghttp2error.js | 2 +- .../test-http2-util-update-options-buffer.js | 2 +- test/parallel/test-http2-window-size.js | 8 +- ...tp2-write-finishes-after-stream-destroy.js | 4 +- .../parallel/test-http2-zero-length-header.js | 2 +- test/parallel/test-http2-zero-length-write.js | 2 +- test/parallel/test-https-abortcontroller.js | 2 +- .../test-https-agent-abort-controller.js | 4 +- .../test-https-agent-additional-options.js | 4 +- .../test-https-agent-create-connection.js | 10 +- .../test-https-agent-disable-session-reuse.js | 6 +- test/parallel/test-https-agent-servername.js | 4 +- .../test-https-agent-session-eviction.js | 6 +- .../test-https-agent-session-injection.js | 2 +- .../test-https-agent-session-reuse.js | 16 +- test/parallel/test-https-agent-sni.js | 8 +- .../parallel/test-https-agent-sockets-leak.js | 6 +- test/parallel/test-https-agent.js | 4 +- test/parallel/test-https-byteswritten.js | 4 +- .../test-https-client-checkServerIdentity.js | 6 +- test/parallel/test-https-client-get-url.js | 2 +- ...test-https-client-override-global-agent.js | 4 +- test/parallel/test-https-client-reject.js | 8 +- test/parallel/test-https-client-resume.js | 4 +- test/parallel/test-https-close.js | 4 +- .../test-https-connect-address-family.js | 2 +- test/parallel/test-https-drain.js | 4 +- test/parallel/test-https-eof-for-eom.js | 4 +- test/parallel/test-https-foafssl.js | 2 +- test/parallel/test-https-hwm.js | 2 +- .../test-https-localaddress-bind-error.js | 4 +- test/parallel/test-https-localaddress.js | 4 +- test/parallel/test-https-max-headers-count.js | 4 +- .../test-https-options-boolean-check.js | 6 +- test/parallel/test-https-pfx.js | 2 +- test/parallel/test-https-request-arguments.js | 4 +- .../parallel/test-https-resume-after-renew.js | 4 +- ...ttps-selfsigned-no-keycertsign-no-crash.js | 4 +- ...t-https-server-options-incoming-message.js | 6 +- ...st-https-server-options-server-response.js | 4 +- .../test-https-server-request-timeout.js | 2 +- .../parallel/test-https-set-timeout-server.js | 16 +- test/parallel/test-https-simple.js | 4 +- test/parallel/test-https-slow-headers.js | 2 +- test/parallel/test-https-socket-options.js | 6 +- test/parallel/test-https-strict.js | 6 +- test/parallel/test-https-timeout-server-2.js | 4 +- test/parallel/test-https-timeout-server.js | 2 +- test/parallel/test-https-timeout.js | 6 +- .../test-https-unix-socket-self-signed.js | 4 +- test/parallel/test-icu-punycode.js | 2 +- test/parallel/test-icu-transcode.js | 4 +- .../test-inspector-already-activated-cli.js | 2 +- .../test-inspector-async-hook-after-done.js | 2 +- test/parallel/test-inspector-bindings.js | 6 +- .../test-inspector-connect-main-thread.js | 4 +- test/parallel/test-inspector-esm.js | 12 +- test/parallel/test-inspector-module.js | 10 +- .../test-inspector-multisession-js.js | 2 +- ...r-vm-global-accessors-getter-sideeffect.js | 4 +- ...spector-vm-global-accessors-sideeffects.js | 8 +- .../test-inspector-wait-for-connection.js | 4 +- .../test-inspector-waiting-for-disconnect.js | 2 +- test/parallel/test-internal-dtrace.js | 2 +- test/parallel/test-internal-errors.js | 4 +- .../test-internal-module-map-asserts.js | 4 +- test/parallel/test-internal-module-require.js | 4 +- .../test-internal-socket-list-receive.js | 6 +- .../test-internal-socket-list-send.js | 18 +- .../test-internal-util-assertCrypto.js | 2 +- .../test-internal-validators-validateoneof.js | 6 +- .../test-internal-validators-validateport.js | 2 +- test/parallel/test-intl.js | 2 +- test/parallel/test-listen-fd-cluster.js | 4 +- .../test-listen-fd-detached-inherit.js | 4 +- test/parallel/test-listen-fd-detached.js | 4 +- test/parallel/test-listen-fd-server.js | 2 +- .../test-loaders-hidden-from-users.js | 4 +- .../test-loaders-unknown-builtin-module.mjs | 2 +- ...test-module-circular-dependency-warning.js | 2 +- test/parallel/test-module-create-require.js | 6 +- .../test-module-loading-deprecated.js | 2 +- test/parallel/test-module-loading-error.js | 6 +- test/parallel/test-module-nodemodulepaths.js | 22 +- .../test-net-better-error-messages-path.js | 2 +- ...net-better-error-messages-port-hostname.js | 6 +- test/parallel/test-net-binary.js | 2 +- test/parallel/test-net-client-bind-twice.js | 2 +- .../test-net-connect-immediate-finish.js | 6 +- test/parallel/test-net-connect-options-fd.js | 2 +- .../parallel/test-net-connect-options-ipv6.js | 2 +- .../parallel/test-net-connect-options-port.js | 6 +- ...t-net-deprecated-setsimultaneousaccepts.js | 4 +- test/parallel/test-net-dns-custom-lookup.js | 4 +- test/parallel/test-net-end-close.js | 4 +- test/parallel/test-net-end-destroyed.js | 2 +- test/parallel/test-net-isip.js | 4 +- .../test-net-listen-exclusive-random-ports.js | 2 +- test/parallel/test-net-listen-invalid-port.js | 6 +- test/parallel/test-net-normalize-args.js | 2 +- .../parallel/test-net-onread-static-buffer.js | 24 +- test/parallel/test-net-options-lookup.js | 8 +- ...t-net-server-call-listen-multiple-times.js | 2 +- .../test-net-server-listen-options-signal.js | 2 +- .../test-net-server-listen-options.js | 2 +- test/parallel/test-net-server-listen-path.js | 2 +- test/parallel/test-net-server-options.js | 4 +- test/parallel/test-net-socket-constructor.js | 2 +- test/parallel/test-net-socket-destroy-send.js | 2 +- test/parallel/test-net-socket-setnodelay.js | 20 +- test/parallel/test-net-socket-timeout.js | 2 +- .../test-net-socket-write-after-close.js | 2 +- test/parallel/test-net-socket-write-error.js | 2 +- test/parallel/test-net-write-after-end-nt.js | 2 +- test/parallel/test-net-write-arguments.js | 4 +- test/parallel/test-next-tick-errors.js | 2 +- test/parallel/test-nodeeventtarget.js | 6 +- test/parallel/test-npm-install.js | 6 +- test/parallel/test-os-checked-function.js | 2 +- test/parallel/test-os-eol.js | 4 +- test/parallel/test-os-homedir-no-envvar.js | 2 +- test/parallel/test-os-process-priority.js | 10 +- test/parallel/test-os.js | 8 +- test/parallel/test-outgoing-message-pipe.js | 2 +- test/parallel/test-path-parse-format.js | 4 +- test/parallel/test-pending-deprecation.js | 6 +- test/parallel/test-perf-hooks-histogram.js | 4 +- test/parallel/test-perf-hooks-usertiming.js | 6 +- .../test-performance-function-async.js | 2 +- test/parallel/test-performance-function.js | 10 +- test/parallel/test-performance-gc.js | 4 +- test/parallel/test-performance-global.js | 2 +- test/parallel/test-performanceobserver.js | 10 +- test/parallel/test-pipe-file-to-http.js | 2 +- ...tgoing-message-data-emitted-after-ended.js | 4 +- .../test-policy-dependency-conditions.js | 10 +- test/parallel/test-policy-parse-integrity.js | 14 +- .../test-policy-scopes-dependencies.js | 90 ++--- test/parallel/test-policy-scopes-integrity.js | 84 ++--- test/parallel/test-process-argv-0.js | 2 +- test/parallel/test-process-assert.js | 4 +- .../test-process-chdir-errormessage.js | 2 +- test/parallel/test-process-chdir.js | 2 +- test/parallel/test-process-cpuUsage.js | 6 +- .../test-process-emit-warning-from-native.js | 6 +- ...rocess-env-allowed-flags-are-documented.js | 6 +- test/parallel/test-process-env-sideeffects.js | 4 +- test/parallel/test-process-euid-egid.js | 4 +- .../test-process-exception-capture-errors.js | 4 +- test/parallel/test-process-exec-argv.js | 2 +- ...test-process-external-stdio-close-spawn.js | 2 +- test/parallel/test-process-hrtime.js | 8 +- test/parallel/test-process-initgroups.js | 6 +- test/parallel/test-process-kill-pid.js | 6 +- test/parallel/test-process-next-tick.js | 2 +- test/parallel/test-process-setgroups.js | 9 +- test/parallel/test-process-uid-gid.js | 4 +- test/parallel/test-process-warning.js | 2 +- test/parallel/test-process-wrap.js | 4 +- .../test-promise-unhandled-default.js | 2 +- test/parallel/test-promise-unhandled-error.js | 2 +- test/parallel/test-promise-unhandled-throw.js | 2 +- ...est-promises-unhandled-proxy-rejections.js | 2 +- .../test-promises-unhandled-rejections.js | 2 +- test/parallel/test-punycode.js | 42 ++- test/parallel/test-querystring-escape.js | 2 +- .../test-querystring-maxKeys-non-finite.js | 8 +- test/parallel/test-querystring.js | 10 +- ...est-queue-microtask-uncaught-asynchooks.js | 2 +- test/parallel/test-readable-from.js | 2 +- test/parallel/test-readable-large-hwm.js | 2 +- ...t-readline-async-iterators-backpressure.js | 2 +- .../test-readline-async-iterators-destroy.js | 4 +- .../parallel/test-readline-async-iterators.js | 4 +- test/parallel/test-readline-csi.js | 2 +- test/parallel/test-readline-input-onerror.js | 8 +- ...st-readline-interface-escapecodetimeout.js | 6 +- test/parallel/test-readline-interface.js | 34 +- test/parallel/test-readline-position.js | 2 +- test/parallel/test-readline-reopen.js | 4 +- test/parallel/test-readline-set-raw-mode.js | 2 +- .../test-readline-undefined-columns.js | 2 +- test/parallel/test-readline.js | 26 +- test/parallel/test-repl-autocomplete.js | 10 +- test/parallel/test-repl-cli-eval.js | 2 +- test/parallel/test-repl-context.js | 2 +- test/parallel/test-repl-definecommand.js | 4 +- test/parallel/test-repl-dynamic-import.js | 2 +- test/parallel/test-repl-editor.js | 20 +- test/parallel/test-repl-empty.js | 2 +- test/parallel/test-repl-end-emits-exit.js | 4 +- test/parallel/test-repl-envvars.js | 18 +- test/parallel/test-repl-eval.js | 2 +- ...test-repl-function-definition-edge-case.js | 2 +- test/parallel/test-repl-history-navigation.js | 34 +- test/parallel/test-repl-history-perm.js | 2 +- test/parallel/test-repl-load-multiline.js | 2 +- test/parallel/test-repl-mode.js | 4 +- test/parallel/test-repl-multiline.js | 2 +- test/parallel/test-repl-null-thrown.js | 2 +- test/parallel/test-repl-options.js | 10 +- test/parallel/test-repl-persistent-history.js | 24 +- .../parallel/test-repl-pretty-custom-stack.js | 12 +- .../test-repl-pretty-stack-custom-writer.js | 2 +- test/parallel/test-repl-pretty-stack.js | 14 +- test/parallel/test-repl-preview.js | 22 +- .../test-repl-programmatic-history.js | 24 +- test/parallel/test-repl-reset-event.js | 4 +- test/parallel/test-repl-reverse-search.js | 14 +- test/parallel/test-repl-sigint-nested-eval.js | 2 +- test/parallel/test-repl-sigint.js | 2 +- .../test-repl-strict-mode-previews.js | 4 +- .../parallel/test-repl-tab-complete-import.js | 2 +- test/parallel/test-repl-tab-complete.js | 12 +- test/parallel/test-repl-top-level-await.js | 2 +- .../test-repl-uncaught-exception-async.js | 2 +- ...st-repl-uncaught-exception-evalcallback.js | 2 +- test/parallel/test-repl-uncaught-exception.js | 14 +- test/parallel/test-repl-underscore.js | 2 +- test/parallel/test-repl-use-global.js | 2 +- test/parallel/test-repl.js | 246 ++++++------ test/parallel/test-require-dot.js | 2 +- test/parallel/test-require-mjs.js | 2 +- test/parallel/test-require-resolve.js | 4 +- test/parallel/test-require-symlink.js | 6 +- .../test-set-http-max-http-headers.js | 6 +- test/parallel/test-socket-write-after-fin.js | 2 +- test/parallel/test-socketaddress.js | 14 +- test/parallel/test-source-map-api.js | 10 +- test/parallel/test-stdin-script-child.js | 2 +- test/parallel/test-stdio-pipe-stderr.js | 2 +- test/parallel/test-stdout-pipeline-destroy.js | 4 +- test/parallel/test-stream-auto-destroy.js | 14 +- ...riters-in-synchronously-recursion-write.js | 4 +- test/parallel/test-stream-backpressure.js | 4 +- .../parallel/test-stream-base-typechecking.js | 2 +- test/parallel/test-stream-big-packet.js | 2 +- test/parallel/test-stream-big-push.js | 2 +- test/parallel/test-stream-catch-rejections.js | 4 +- .../test-stream-construct-async-error.js | 10 +- test/parallel/test-stream-construct.js | 50 +-- .../test-stream-decoder-objectmode.js | 2 +- .../test-stream-destroy-event-order.js | 2 +- test/parallel/test-stream-duplex-destroy.js | 16 +- test/parallel/test-stream-duplex-end.js | 6 +- test/parallel/test-stream-duplex-props.js | 4 +- .../test-stream-duplex-readable-end.js | 4 +- test/parallel/test-stream-finished.js | 46 +-- test/parallel/test-stream-inheritance.js | 2 +- .../test-stream-objectmode-undefined.js | 6 +- ...t-stream-pipe-await-drain-manual-resume.js | 4 +- ...tream-pipe-await-drain-push-while-write.js | 4 +- .../test-stream-pipe-error-unhandled.js | 4 +- .../test-stream-pipe-flow-after-unpipe.js | 4 +- test/parallel/test-stream-pipe-flow.js | 8 +- .../test-stream-pipe-manual-resume.js | 4 +- .../test-stream-pipe-multiple-pipes.js | 4 +- test/parallel/test-stream-pipe-needDrain.js | 4 +- ...test-stream-pipe-same-destination-twice.js | 6 +- .../test-stream-pipeline-async-iterator.js | 2 +- test/parallel/test-stream-pipeline-http2.js | 2 +- ...t-stream-pipeline-queued-end-in-destroy.js | 4 +- .../parallel/test-stream-pipeline-uncaught.js | 2 +- test/parallel/test-stream-pipeline.js | 112 +++--- test/parallel/test-stream-promises.js | 10 +- test/parallel/test-stream-push-order.js | 2 +- .../test-stream-readable-async-iterators.js | 54 +-- test/parallel/test-stream-readable-data.js | 2 +- test/parallel/test-stream-readable-destroy.js | 28 +- ...eam-readable-emit-readable-short-stream.js | 14 +- .../test-stream-readable-emittedReadable.js | 6 +- test/parallel/test-stream-readable-event.js | 6 +- .../test-stream-readable-infinite-read.js | 2 +- .../test-stream-readable-invalid-chunk.js | 8 +- .../test-stream-readable-needReadable.js | 8 +- .../test-stream-readable-next-no-null.js | 2 +- ...st-stream-readable-no-unneeded-readable.js | 2 +- ...stream-readable-object-multi-push-async.js | 10 +- .../test-stream-readable-pause-and-resume.js | 4 +- ...st-stream-readable-readable-then-resume.js | 2 +- .../parallel/test-stream-readable-readable.js | 6 +- ...est-stream-readable-reading-readingMore.js | 6 +- .../test-stream-readable-resume-hwm.js | 2 +- .../test-stream-readable-unpipe-resume.js | 2 +- ...tream-readable-with-unimplemented-_read.js | 2 +- .../test-stream-readableListening-state.js | 4 +- .../test-stream-transform-callback-twice.js | 4 +- ...tream-transform-constructor-set-methods.js | 4 +- .../parallel/test-stream-transform-destroy.js | 14 +- .../test-stream-transform-final-sync.js | 2 +- test/parallel/test-stream-transform-final.js | 2 +- .../test-stream-transform-flush-data.js | 2 +- ...st-stream-transform-split-highwatermark.js | 4 +- test/parallel/test-stream-uint8array.js | 10 +- .../parallel/test-stream-unshift-read-race.js | 2 +- test/parallel/test-stream-wrap-encoding.js | 8 +- test/parallel/test-stream-wrap.js | 2 +- .../test-stream-writable-callback-twice.js | 4 +- ...stream-writable-change-default-encoding.js | 2 +- ...stream-writable-constructor-set-methods.js | 2 +- test/parallel/test-stream-writable-destroy.js | 54 +-- .../test-stream-writable-end-cb-error.js | 2 +- .../test-stream-writable-finish-destroyed.js | 4 +- .../parallel/test-stream-writable-finished.js | 8 +- .../test-stream-writable-invalid-chunk.js | 2 +- .../test-stream-writable-needdrain-state.js | 2 +- test/parallel/test-stream-writable-null.js | 4 +- .../test-stream-writable-samecb-singletick.js | 4 +- .../parallel/test-stream-writable-writable.js | 8 +- .../test-stream-writable-write-cb-error.js | 6 +- .../test-stream-writable-write-cb-twice.js | 12 +- .../test-stream-writable-write-error.js | 10 +- test/parallel/test-stream-write-destroy.js | 2 +- test/parallel/test-stream-write-drain.js | 2 +- test/parallel/test-stream-write-final.js | 2 +- test/parallel/test-stream-writev.js | 4 +- .../parallel/test-stream2-large-read-stall.js | 2 +- test/parallel/test-stream2-objects.js | 14 +- test/parallel/test-stream2-push.js | 4 +- .../test-stream2-readable-wrap-destroy.js | 4 +- test/parallel/test-stream2-transform.js | 2 +- test/parallel/test-stream2-unpipe-leak.js | 2 +- test/parallel/test-stream2-writable.js | 14 +- test/parallel/test-streams-highwatermark.js | 2 +- test/parallel/test-string-decoder.js | 6 +- test/parallel/test-tcp-wrap-connect.js | 2 +- test/parallel/test-tcp-wrap-listen.js | 2 +- .../test-timers-enroll-invalid-msecs.js | 4 +- .../test-timers-immediate-promisified.js | 6 +- .../test-timers-immediate-queue-throw.js | 2 +- .../test-timers-max-duration-warning.js | 2 +- test/parallel/test-timers-refresh.js | 2 +- .../test-timers-throw-when-cb-not-function.js | 2 +- .../test-timers-timeout-promisified.js | 6 +- ...emove-other-unref-timers-only-one-fires.js | 4 +- ...-timers-unref-remove-other-unref-timers.js | 4 +- .../test-timers-unref-throw-then-ref.js | 2 +- test/parallel/test-tls-0-dns-altname.js | 4 +- test/parallel/test-tls-addca.js | 2 +- test/parallel/test-tls-alert-handling.js | 6 +- test/parallel/test-tls-alert.js | 2 +- .../test-tls-async-cb-after-socket-end.js | 4 +- test/parallel/test-tls-basic-validations.js | 24 +- test/parallel/test-tls-buffersize.js | 4 +- test/parallel/test-tls-ca-concat.js | 2 +- test/parallel/test-tls-cert-chains-concat.js | 2 +- test/parallel/test-tls-cert-chains-in-ca.js | 2 +- test/parallel/test-tls-cert-ext-encoding.js | 2 +- test/parallel/test-tls-cert-regression.js | 2 +- .../test-tls-check-server-identity.js | 122 +++--- test/parallel/test-tls-client-auth.js | 2 +- test/parallel/test-tls-client-destroy-soon.js | 4 +- .../test-tls-client-getephemeralkeyinfo.js | 4 +- test/parallel/test-tls-client-mindhsize.js | 4 +- test/parallel/test-tls-client-reject.js | 8 +- .../test-tls-client-renegotiation-13.js | 2 +- test/parallel/test-tls-client-resume.js | 4 +- test/parallel/test-tls-client-verify.js | 2 +- .../test-tls-clientcertengine-unsupported.js | 2 +- test/parallel/test-tls-close-error.js | 2 +- .../test-tls-close-event-after-write.js | 4 +- test/parallel/test-tls-close-notify.js | 4 +- test/parallel/test-tls-cnnic-whitelist.js | 6 +- .../test-tls-connect-abort-controller.js | 2 +- .../test-tls-connect-address-family.js | 2 +- .../parallel/test-tls-connect-given-socket.js | 4 +- .../parallel/test-tls-connect-hints-option.js | 2 +- test/parallel/test-tls-connect-hwm-option.js | 2 +- test/parallel/test-tls-connect-memleak.js | 2 +- test/parallel/test-tls-connect-no-host.js | 2 +- test/parallel/test-tls-connect-pipe.js | 2 +- .../test-tls-connect-secure-context.js | 2 +- test/parallel/test-tls-connect-simple.js | 6 +- .../test-tls-connect-stream-writes.js | 4 +- .../test-tls-connect-timeout-option.js | 2 +- .../parallel/test-tls-delayed-attach-error.js | 4 +- test/parallel/test-tls-delayed-attach.js | 6 +- .../parallel/test-tls-destroy-whilst-write.js | 4 +- test/parallel/test-tls-dhe.js | 2 +- .../test-tls-disable-renegotiation.js | 4 +- test/parallel/test-tls-ecdh-auto.js | 2 +- test/parallel/test-tls-ecdh-multiple.js | 2 +- test/parallel/test-tls-ecdh.js | 2 +- test/parallel/test-tls-empty-sni-context.js | 4 +- test/parallel/test-tls-enable-keylog-cli.js | 4 +- test/parallel/test-tls-enable-trace-cli.js | 6 +- test/parallel/test-tls-enable-trace.js | 2 +- test/parallel/test-tls-env-extra-ca.js | 2 +- test/parallel/test-tls-error-servername.js | 8 +- .../parallel/test-tls-exportkeyingmaterial.js | 18 +- test/parallel/test-tls-finished.js | 10 +- test/parallel/test-tls-generic-stream.js | 4 +- test/parallel/test-tls-getcertificate-x509.js | 4 +- test/parallel/test-tls-getcipher.js | 8 +- test/parallel/test-tls-getprotocol.js | 4 +- test/parallel/test-tls-handshake-error.js | 4 +- .../parallel/test-tls-hello-parser-failure.js | 2 +- test/parallel/test-tls-honorcipherorder.js | 2 +- test/parallel/test-tls-inception.js | 8 +- test/parallel/test-tls-invoke-queued.js | 4 +- .../test-tls-ip-servername-deprecation.js | 2 +- test/parallel/test-tls-js-stream.js | 6 +- test/parallel/test-tls-junk-closes-server.js | 2 +- test/parallel/test-tls-key-mismatch.js | 2 +- .../test-tls-keyengine-unsupported.js | 4 +- test/parallel/test-tls-max-send-fragment.js | 8 +- test/parallel/test-tls-min-max-version.js | 6 +- test/parallel/test-tls-multi-key.js | 4 +- test/parallel/test-tls-multi-pfx.js | 12 +- .../test-tls-multiple-cas-as-string.js | 2 +- .../test-tls-net-connect-prefer-path.js | 4 +- test/parallel/test-tls-no-cert-required.js | 2 +- test/parallel/test-tls-no-rsa-key.js | 4 +- test/parallel/test-tls-ocsp-callback.js | 4 +- test/parallel/test-tls-on-empty-socket.js | 4 +- .../parallel/test-tls-onread-static-buffer.js | 26 +- .../test-tls-options-boolean-check.js | 6 +- test/parallel/test-tls-over-http-tunnel.js | 8 +- test/parallel/test-tls-parse-cert-string.js | 6 +- test/parallel/test-tls-passphrase.js | 60 +-- test/parallel/test-tls-pause.js | 4 +- .../test-tls-peer-certificate-encoding.js | 4 +- .../test-tls-peer-certificate-multi-keys.js | 4 +- test/parallel/test-tls-peer-certificate.js | 2 +- .../test-tls-pfx-authorizationerror.js | 4 +- test/parallel/test-tls-psk-server.js | 2 +- test/parallel/test-tls-request-timeout.js | 4 +- .../test-tls-retain-handle-no-abort.js | 2 +- .../test-tls-reuse-host-from-socket.js | 2 +- .../test-tls-secure-context-usage-order.js | 4 +- test/parallel/test-tls-secure-session.js | 2 +- test/parallel/test-tls-securepair-fiftharg.js | 4 +- .../test-tls-server-capture-rejection.js | 2 +- .../test-tls-server-connection-server.js | 4 +- ...t-tls-server-parent-constructor-options.js | 6 +- test/parallel/test-tls-server-verify.js | 4 +- test/parallel/test-tls-session-cache.js | 4 +- test/parallel/test-tls-set-ciphers-error.js | 2 +- test/parallel/test-tls-set-ciphers.js | 2 +- test/parallel/test-tls-set-encoding.js | 4 +- test/parallel/test-tls-set-secure-context.js | 6 +- test/parallel/test-tls-set-sigalgs.js | 8 +- test/parallel/test-tls-sni-option.js | 20 +- test/parallel/test-tls-sni-server-client.js | 14 +- test/parallel/test-tls-sni-servername.js | 6 +- .../test-tls-socket-allow-half-open-option.js | 2 +- test/parallel/test-tls-socket-close.js | 2 +- ...socket-constructor-alpn-options-parsing.js | 2 +- .../test-tls-socket-default-options.js | 2 +- ...tls-socket-failed-handshake-emits-error.js | 2 +- ...t-tls-socket-snicallback-without-server.js | 2 +- .../test-tls-startcom-wosign-whitelist.js | 12 +- test/parallel/test-tls-starttls-server.js | 4 +- .../test-tls-streamwrap-buffersize.js | 2 +- test/parallel/test-tls-ticket-cluster.js | 2 +- test/parallel/test-tls-ticket.js | 4 +- test/parallel/test-tls-timeout-server-2.js | 4 +- test/parallel/test-tls-timeout-server.js | 2 +- test/parallel/test-tls-tlswrap-segfault.js | 4 +- .../test-tls-wrap-econnreset-localaddress.js | 2 +- test/parallel/test-tls-wrap-timeout.js | 4 +- test/parallel/test-tls-write-error.js | 4 +- test/parallel/test-tls-zero-clear-in.js | 4 +- .../test-trace-events-api-worker-disabled.js | 2 +- test/parallel/test-trace-events-api.js | 12 +- .../test-trace-events-async-hooks-dynamic.js | 2 +- .../test-trace-events-async-hooks-worker.js | 2 +- test/parallel/test-trace-events-binding.js | 2 +- test/parallel/test-trace-events-bootstrap.js | 2 +- test/parallel/test-trace-events-console.js | 2 +- ...-events-dynamic-enable-workers-disabled.js | 4 +- .../test-trace-events-dynamic-enable.js | 4 +- .../parallel/test-trace-events-environment.js | 2 +- test/parallel/test-trace-events-promises.js | 2 +- test/parallel/test-trace-events-vm.js | 2 +- test/parallel/test-tty-backwards-api.js | 2 +- test/parallel/test-ttywrap-invalid-fd.js | 12 +- test/parallel/test-unicode-node-options.js | 4 +- test/parallel/test-url-fileurltopath.js | 14 +- .../parallel/test-url-format-invalid-input.js | 2 +- test/parallel/test-url-format-whatwg.js | 2 +- test/parallel/test-url-format.js | 62 +-- test/parallel/test-url-parse-format.js | 158 ++++---- test/parallel/test-url-parse-invalid-input.js | 2 +- test/parallel/test-url-parse-query.js | 10 +- test/parallel/test-url-pathtofileurl.js | 4 +- test/parallel/test-util-callbackify.js | 12 +- .../test-util-deprecate-invalid-code.js | 2 +- test/parallel/test-util-format.js | 14 +- test/parallel/test-util-inherits.js | 8 +- ...est-util-inspect-getters-accessing-this.js | 4 +- test/parallel/test-util-inspect-proxy.js | 6 +- test/parallel/test-util-inspect.js | 88 ++--- test/parallel/test-util-internal.js | 2 +- test/parallel/test-util-promisify.js | 2 +- test/parallel/test-util-types.js | 4 +- test/parallel/test-uv-errmap.js | 2 +- test/parallel/test-uv-errno.js | 6 +- test/parallel/test-v8-coverage.js | 2 +- test/parallel/test-v8-flag-type-check.js | 2 +- test/parallel/test-v8-serdes.js | 6 +- test/parallel/test-v8-stop-coverage.js | 2 +- test/parallel/test-v8-take-coverage-noop.js | 2 +- test/parallel/test-v8-take-coverage.js | 4 +- test/parallel/test-validators.js | 4 +- test/parallel/test-vm-basic.js | 37 +- test/parallel/test-vm-cached-data.js | 10 +- test/parallel/test-vm-codegen.js | 6 +- test/parallel/test-vm-context.js | 8 +- .../test-vm-create-context-accessors.js | 4 +- test/parallel/test-vm-create-context-arg.js | 2 +- test/parallel/test-vm-getters.js | 2 +- .../test-vm-global-property-interceptors.js | 20 +- test/parallel/test-vm-inherited_properties.js | 4 +- test/parallel/test-vm-is-context.js | 2 +- test/parallel/test-vm-measure-memory-lazy.js | 2 +- .../test-vm-measure-memory-multi-context.js | 4 +- test/parallel/test-vm-measure-memory.js | 10 +- test/parallel/test-vm-module-basic.js | 12 +- test/parallel/test-vm-module-errors.js | 36 +- test/parallel/test-vm-module-import-meta.js | 6 +- test/parallel/test-vm-module-link.js | 2 +- test/parallel/test-vm-module-synthetic.js | 2 +- test/parallel/test-vm-options-validation.js | 4 +- test/parallel/test-vm-preserves-property.js | 2 +- test/parallel/test-vm-proxy-failure-CP.js | 2 +- .../test-vm-script-throw-in-tostring.js | 2 +- test/parallel/test-vm-set-property-proxy.js | 2 +- .../test-vm-sigint-existing-handler.js | 4 +- test/parallel/test-vm-sigint.js | 4 +- .../test-vm-timeout-escape-promise-2.js | 4 +- .../test-vm-timeout-escape-promise-module.js | 6 +- .../test-vm-timeout-escape-promise.js | 4 +- test/parallel/test-vm-timeout.js | 12 +- .../test-webcrypto-cryptokey-workers.js | 2 +- .../test-webcrypto-derivebits-ecdh.js | 44 +-- .../test-webcrypto-derivebits-hkdf.js | 100 ++--- .../test-webcrypto-derivebits-node-dh.js | 24 +- test/parallel/test-webcrypto-derivebits.js | 6 +- .../parallel/test-webcrypto-derivekey-ecdh.js | 26 +- test/parallel/test-webcrypto-derivekey.js | 16 +- test/parallel/test-webcrypto-digest.js | 16 +- test/parallel/test-webcrypto-ed25519-ed448.js | 40 +- .../test-webcrypto-encrypt-decrypt-aes.js | 32 +- .../test-webcrypto-encrypt-decrypt-rsa.js | 22 +- .../test-webcrypto-encrypt-decrypt.js | 10 +- .../test-webcrypto-export-import-dsa.js | 6 +- .../test-webcrypto-export-import-ec.js | 24 +- .../test-webcrypto-export-import-rsa.js | 28 +- test/parallel/test-webcrypto-export-import.js | 42 +-- test/parallel/test-webcrypto-keygen.js | 104 ++--- test/parallel/test-webcrypto-random.js | 2 +- .../parallel/test-webcrypto-rsa-pss-params.js | 8 +- .../test-webcrypto-sign-verify-ecdsa.js | 20 +- .../test-webcrypto-sign-verify-hmac.js | 14 +- .../test-webcrypto-sign-verify-node-dsa.js | 18 +- .../test-webcrypto-sign-verify-rsa.js | 18 +- test/parallel/test-webcrypto-sign-verify.js | 10 +- test/parallel/test-webcrypto-wrap-unwrap.js | 36 +- test/parallel/test-webcrypto-x25519-x448.js | 24 +- ...-whatwg-encoding-custom-fatal-streaming.js | 6 +- .../test-whatwg-encoding-custom-internals.js | 2 +- .../test-whatwg-encoding-custom-interop.js | 2 +- ...ng-custom-textdecoder-api-invalid-label.js | 6 +- ...hatwg-encoding-custom-textdecoder-fatal.js | 2 +- ...g-encoding-custom-textdecoder-ignorebom.js | 4 +- ...encoding-custom-textdecoder-invalid-arg.js | 2 +- ...g-encoding-custom-textdecoder-streaming.js | 2 +- ...ing-custom-textdecoder-utf16-surrogates.js | 12 +- ...test-whatwg-encoding-custom-textdecoder.js | 9 +- test/parallel/test-whatwg-url-constructor.js | 2 +- .../parallel/test-whatwg-url-custom-global.js | 4 +- ...test-whatwg-url-custom-href-side-effect.js | 2 +- .../test-whatwg-url-custom-parsing.js | 2 +- ...t-whatwg-url-custom-searchparams-append.js | 6 +- ...twg-url-custom-searchparams-constructor.js | 8 +- ...t-whatwg-url-custom-searchparams-delete.js | 6 +- ...-whatwg-url-custom-searchparams-entries.js | 12 +- ...-whatwg-url-custom-searchparams-foreach.js | 2 +- ...test-whatwg-url-custom-searchparams-get.js | 6 +- ...t-whatwg-url-custom-searchparams-getall.js | 6 +- ...test-whatwg-url-custom-searchparams-has.js | 6 +- ...est-whatwg-url-custom-searchparams-keys.js | 12 +- ...test-whatwg-url-custom-searchparams-set.js | 6 +- ...est-whatwg-url-custom-searchparams-sort.js | 2 +- ...twg-url-custom-searchparams-stringifier.js | 2 +- ...t-whatwg-url-custom-searchparams-values.js | 12 +- .../test-whatwg-url-custom-searchparams.js | 2 +- .../test-whatwg-url-custom-setters.js | 2 +- test/parallel/test-whatwg-url-origin.js | 2 +- test/parallel/test-whatwg-url-setters.js | 2 +- test/parallel/test-whatwg-url-toascii.js | 2 +- test/parallel/test-worker-broadcastchannel.js | 16 +- test/parallel/test-worker-cjs-workerdata.js | 2 +- test/parallel/test-worker-debug.js | 10 +- test/parallel/test-worker-execargv-invalid.js | 10 +- test/parallel/test-worker-heapdump-failure.js | 2 +- ...-worker-http2-generic-streams-terminate.js | 4 +- .../test-worker-invalid-workerdata.js | 2 +- test/parallel/test-worker-message-event.js | 14 +- .../test-worker-message-port-close.js | 2 +- .../test-worker-message-port-constructor.js | 6 +- ...r-message-port-inspect-during-init-hook.js | 2 +- ...rt-jstransferable-nested-untransferable.js | 4 +- ...-message-port-message-port-transferring.js | 2 +- .../parallel/test-worker-message-port-move.js | 4 +- ...est-worker-message-port-receive-message.js | 2 +- ...er-message-port-terminate-transfer-list.js | 2 +- ...-transfer-fake-js-transferable-internal.js | 2 +- ...sage-port-transfer-fake-js-transferable.js | 4 +- ...worker-message-port-transfer-filehandle.js | 6 +- ...est-worker-message-port-transfer-native.js | 4 +- test/parallel/test-worker-message-port.js | 12 +- test/parallel/test-worker-mjs-workerdata.js | 2 +- test/parallel/test-worker-nested-uncaught.js | 2 +- test/parallel/test-worker-on-process-exit.js | 2 +- test/parallel/test-worker-process-argv.js | 8 +- .../test-worker-process-env-shared.js | 2 +- test/parallel/test-worker-process-env.js | 4 +- test/parallel/test-worker-resource-limits.js | 2 +- test/parallel/test-worker-safe-getters.js | 2 +- .../test-worker-stack-overflow-stack-size.js | 4 +- test/parallel/test-worker-stack-overflow.js | 2 +- .../test-worker-stdio-from-preload-module.js | 2 +- ...orker-terminate-http2-respond-with-file.js | 2 +- .../test-worker-terminate-source-map.js | 2 +- test/parallel/test-worker-type-check.js | 2 +- test/parallel/test-worker-unsupported-path.js | 6 +- .../test-worker-unsupported-things.js | 6 +- .../test-worker-workerdata-messageport.js | 8 +- ...est-worker-workerdata-sharedarraybuffer.js | 2 +- .../test-wrap-js-stream-exceptions.js | 4 +- test/parallel/test-zlib-brotli.js | 22 +- .../parallel/test-zlib-convenience-methods.js | 4 +- .../test-zlib-deflate-constructors.js | 56 +-- .../test-zlib-deflate-raw-inherits.js | 2 +- test/parallel/test-zlib-destroy-pipe.js | 2 +- test/parallel/test-zlib-failed-init.js | 6 +- test/parallel/test-zlib-flush-drain.js | 2 +- test/parallel/test-zlib-flush-flags.js | 8 +- ...st-zlib-from-gzip-with-trailing-garbage.js | 2 +- ...-zlib-invalid-arg-value-brotli-compress.js | 6 +- test/parallel/test-zlib-invalid-input.js | 2 +- test/parallel/test-zlib-maxOutputLength.js | 2 +- .../test-zlib-not-string-or-buffer.js | 2 +- test/parallel/test-zlib-object-write.js | 2 +- test/parallel/test-zlib-write-after-close.js | 2 +- test/parallel/test-zlib-zero-windowBits.js | 2 +- test/pseudo-tty/readline-dumb-tty.js | 2 +- test/pseudo-tty/repl-dumb-tty.js | 2 +- test/pseudo-tty/test-assert-no-color.js | 2 +- .../test-set-raw-mode-reset-process-exit.js | 2 +- .../test-set-raw-mode-reset-signal.js | 2 +- test/pseudo-tty/test-set-raw-mode-reset.js | 2 +- test/pseudo-tty/test-trace-sigint-disabled.js | 2 +- test/pseudo-tty/test-trace-sigint-on-idle.js | 2 +- test/pseudo-tty/test-trace-sigint.js | 2 +- test/pummel/test-crypto-dh-hash-modp18.js | 2 +- test/pummel/test-fs-readfile-tostring-fail.js | 4 +- test/pummel/test-heapdump-dns.js | 2 +- test/pummel/test-heapdump-env.js | 2 +- test/pummel/test-heapdump-fs-promise.js | 2 +- test/pummel/test-heapdump-http2.js | 14 +- test/pummel/test-heapdump-inspector.js | 4 +- test/pummel/test-heapdump-tls.js | 2 +- test/pummel/test-heapdump-worker.js | 4 +- test/pummel/test-heapdump-zlib.js | 4 +- .../test-heapsnapshot-near-heap-limit-big.js | 4 +- ...st-heapsnapshot-near-heap-limit-bounded.js | 2 +- .../test-heapsnapshot-near-heap-limit.js | 2 +- .../test-http-many-keep-alive-connections.js | 4 +- test/pummel/test-http-upload-timeout.js | 2 +- test/pummel/test-https-large-response.js | 4 +- test/pummel/test-https-no-reader.js | 4 +- test/pummel/test-keep-alive.js | 2 +- test/pummel/test-regress-GH-892.js | 2 +- test/pummel/test-tls-server-large-request.js | 4 +- test/pummel/test-tls-throttle.js | 4 +- .../test-webcrypto-derivebits-pbkdf2.js | 104 ++--- test/pummel/test-worker-take-heapsnapshot.js | 2 +- test/report/test-report-config.js | 4 +- test/sequential/test-child-process-exit.js | 2 +- test/sequential/test-cluster-inspect-brk.js | 2 +- test/sequential/test-cpu-prof-default.js | 4 +- test/sequential/test-cpu-prof-dir-absolute.js | 4 +- test/sequential/test-cpu-prof-dir-and-name.js | 4 +- test/sequential/test-cpu-prof-dir-relative.js | 4 +- test/sequential/test-cpu-prof-dir-worker.js | 4 +- test/sequential/test-cpu-prof-drained.js | 4 +- test/sequential/test-cpu-prof-exit.js | 4 +- .../test-cpu-prof-invalid-options.js | 8 +- test/sequential/test-cpu-prof-kill.js | 4 +- test/sequential/test-cpu-prof-name.js | 4 +- test/sequential/test-cpu-prof-worker-argv.js | 6 +- .../test-crypto-timing-safe-equal.js | 2 +- .../test-diagnostic-dir-cpu-prof.js | 6 +- .../test-diagnostic-dir-heap-prof.js | 6 +- test/sequential/test-gc-http-client.js | 2 +- test/sequential/test-heap-prof.js | 30 +- test/sequential/test-heapdump.js | 2 +- test/sequential/test-http-econnrefused.js | 2 +- .../test-http-keep-alive-large-write.js | 4 +- .../test-http-keepalive-maxsockets.js | 4 +- test/sequential/test-http-max-sockets.js | 2 +- ...p-server-keep-alive-timeout-slow-server.js | 2 +- .../test-http2-max-session-memory.js | 2 +- .../test-http2-timeout-large-write-file.js | 4 +- .../test-http2-timeout-large-write.js | 4 +- .../test-https-server-keep-alive-timeout.js | 6 +- test/sequential/test-inspector-console.js | 2 +- test/sequential/test-inspector-contexts.js | 2 +- test/sequential/test-inspector-enabled.js | 2 +- test/sequential/test-inspector-open.js | 2 +- .../sequential/test-inspector-port-cluster.js | 44 +-- ...inspector-runtime-evaluate-with-timeout.js | 4 +- test/sequential/test-inspector.js | 54 +-- test/sequential/test-module-loading.js | 28 +- test/sequential/test-net-GH-5504.js | 6 +- .../test-net-connect-local-error.js | 2 +- .../test-net-listen-shared-ports.js | 2 +- test/sequential/test-next-tick-error-spin.js | 2 +- test/sequential/test-perf-hooks.js | 6 +- .../test-performance-eventloopdelay.js | 12 +- test/sequential/test-pipe.js | 2 +- test/sequential/test-repl-timeout-throw.js | 2 +- test/sequential/test-tls-connect.js | 2 +- test/sequential/test-tls-lookup.js | 6 +- test/sequential/test-tls-psk-client.js | 4 +- test/sequential/test-tls-session-timeout.js | 2 +- test/sequential/test-util-debug.js | 6 +- ...test-vm-timeout-escape-promise-module-2.js | 6 +- .../test-tick-processor-builtin.js | 2 +- .../test-tick-processor-cpp-core.js | 2 +- ...test-tick-processor-polyfill-brokenfile.js | 2 +- .../test-tick-processor-preprocess-flag.js | 2 +- .../test-tick-processor-unknown.js | 2 +- test/tick-processor/tick-processor-base.js | 4 +- test/tick-processor/util.js | 4 +- test/wasi/test-wasi-initialize-validation.js | 26 +- test/wasi/test-wasi-not-started.js | 6 +- test/wasi/test-wasi-start-validation.js | 26 +- test/wasi/test-wasi-symlinks.js | 4 +- test/wasi/test-wasi.js | 10 +- tools/build-addons.js | 2 +- tools/doc/addon-verify.js | 6 +- tools/doc/allhtml.js | 2 +- tools/doc/alljson.js | 4 +- tools/doc/html.js | 4 +- tools/doc/type-parser.js | 2 +- tools/eslint-rules/alphabetize-errors.js | 4 +- .../async-iife-no-unused-result.js | 8 +- tools/eslint-rules/crypto-check.js | 8 +- tools/eslint-rules/documented-errors.js | 4 +- tools/eslint-rules/eslint-check.js | 6 +- tools/eslint-rules/inspector-check.js | 6 +- .../lowercase-name-for-primitive.js | 6 +- tools/eslint-rules/no-unescaped-regexp-dot.js | 4 +- tools/eslint-rules/non-ascii-character.js | 4 +- tools/eslint-rules/prefer-assert-iferror.js | 8 +- tools/eslint-rules/prefer-assert-methods.js | 8 +- .../eslint-rules/prefer-common-mustnotcall.js | 2 +- .../eslint-rules/prefer-common-mustsucceed.js | 2 +- tools/eslint-rules/prefer-primordials.js | 18 +- .../eslint-rules/prefer-util-format-errors.js | 4 +- tools/eslint-rules/require-common-first.js | 2 +- tools/eslint-rules/required-modules.js | 4 +- tools/license2rtf.js | 2 +- .../node-lint-md-cli-rollup/rollup.config.js | 8 +- tools/update-authors.js | 6 +- 2011 files changed, 7014 insertions(+), 7005 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 27dd8aa10c37a1..bca7714a2198d5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -68,7 +68,7 @@ module.exports = { files: ['**/*.md/*.cjs', '**/*.md/*.js'], parserOptions: { sourceType: 'script', - ecmaFeatures: { impliedStrict: true } + ecmaFeatures: { impliedStrict: true }, }, rules: { strict: 'off' }, }, @@ -106,10 +106,10 @@ module.exports = { }], 'comma-dangle': ['error', { arrays: 'always-multiline', - exports: 'only-multiline', + exports: 'always-multiline', functions: 'only-multiline', - imports: 'only-multiline', - objects: 'only-multiline', + imports: 'always-multiline', + objects: 'always-multiline', }], 'comma-spacing': 'error', 'comma-style': 'error', diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index e5ba6188f1cc81..169e615246332e 100644 --- a/benchmark/_http-benchmarkers.js +++ b/benchmark/_http-benchmarkers.js @@ -106,7 +106,7 @@ class TestDoubleBenchmarker { const scheme = options.scheme || 'http'; const env = { test_url: `${scheme}://127.0.0.1:${options.port}${options.path}`, - ...process.env + ...process.env, }; const child = child_process.fork(this.executable, @@ -203,7 +203,7 @@ exports.run = function(options, callback) { connections: 100, duration: 5, benchmarker: exports.default_http_benchmarker, - ...options + ...options, }; if (!options.benchmarker) { callback(new Error('Could not locate required http benchmarker. See ' + diff --git a/benchmark/async_hooks/async-resource-vs-destroy.js b/benchmark/async_hooks/async-resource-vs-destroy.js index 09898bbe52f939..3bd9dd56934e32 100644 --- a/benchmark/async_hooks/async-resource-vs-destroy.js +++ b/benchmark/async_hooks/async-resource-vs-destroy.js @@ -9,7 +9,7 @@ const { createHook, executionAsyncResource, executionAsyncId, - AsyncLocalStorage + AsyncLocalStorage, } = require('async_hooks'); const { createServer } = require('http'); @@ -19,7 +19,7 @@ const bench = common.createBenchmark(main, { path: '/', connections: 500, duration: 5, - n: [1e6] + n: [1e6], }); function buildCurrentResource(getServe) { @@ -30,7 +30,7 @@ function buildCurrentResource(getServe) { return { server, - close + close, }; function getCLS() { @@ -71,7 +71,7 @@ function buildDestroy(getServe) { return { server, - close + close, }; function getCLS() { @@ -108,7 +108,7 @@ function buildAsyncLocalStorage(getServe) { return { server, - close + close, }; function getCLS() { @@ -160,12 +160,12 @@ function getServeCallbacks(getCLS, setCLS) { const types = { 'async-resource': buildCurrentResource, 'destroy': buildDestroy, - 'async-local-storage': buildAsyncLocalStorage + 'async-local-storage': buildAsyncLocalStorage, }; const asyncMethods = { 'callbacks': getServeCallbacks, - 'async': getServeAwait + 'async': getServeAwait, }; function main({ type, asyncMethod, connections, duration, path }) { @@ -178,7 +178,7 @@ function main({ type, asyncMethod, connections, duration, path }) { bench.http({ path, connections, - duration + duration, }, () => { close(); }); diff --git a/benchmark/async_hooks/gc-tracking.js b/benchmark/async_hooks/gc-tracking.js index 4a59a5a4b655c5..2b0a74ddac76d9 100644 --- a/benchmark/async_hooks/gc-tracking.js +++ b/benchmark/async_hooks/gc-tracking.js @@ -8,9 +8,9 @@ const bench = common.createBenchmark(main, { 'trackingEnabled', 'trackingEnabledWithDestroyHook', 'trackingDisabled', - ] + ], }, { - flags: ['--expose-gc'] + flags: ['--expose-gc'], }); function endAfterGC(n) { diff --git a/benchmark/async_hooks/http-server.js b/benchmark/async_hooks/http-server.js index c8e44849b7466f..da5f86f0e50601 100644 --- a/benchmark/async_hooks/http-server.js +++ b/benchmark/async_hooks/http-server.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { asyncHooks: ['init', 'before', 'after', 'all', 'disabled', 'none'], connections: [50, 500], - duration: 5 + duration: 5, }); function main({ asyncHooks, connections, duration }) { @@ -14,11 +14,11 @@ function main({ asyncHooks, connections, duration }) { before() {}, after() {}, destroy() {}, - promiseResolve() {} + promiseResolve() {}, }; if (asyncHooks !== 'all' || asyncHooks !== 'disabled') { hooks = { - [asyncHooks]: () => {} + [asyncHooks]: () => {}, }; } const hook = require('async_hooks').createHook(hooks); @@ -34,7 +34,7 @@ function main({ asyncHooks, connections, duration }) { bench.http({ connections, path, - duration + duration, }, () => { server.close(); }); diff --git a/benchmark/async_hooks/promises.js b/benchmark/async_hooks/promises.js index d60ae70192c8cb..f533d63f2a3135 100644 --- a/benchmark/async_hooks/promises.js +++ b/benchmark/async_hooks/promises.js @@ -6,25 +6,25 @@ let hook; const tests = { disabled() { hook = createHook({ - promiseResolve() {} + promiseResolve() {}, }); }, enabled() { hook = createHook({ - promiseResolve() {} + promiseResolve() {}, }).enable(); }, enabledWithDestroy() { hook = createHook({ promiseResolve() {}, - destroy() {} + destroy() {}, }).enable(); }, enabledWithInitOnly() { hook = createHook({ - init() {} + init() {}, }).enable(); - } + }, }; const bench = common.createBenchmark(main, { @@ -34,7 +34,7 @@ const bench = common.createBenchmark(main, { 'enabledWithDestroy', 'enabledWithInitOnly', 'disabled', - ] + ], }); const err = new Error('foobar'); diff --git a/benchmark/buffers/buffer-base64-decode.js b/benchmark/buffers/buffer-base64-decode.js index 6f62a3285dd92e..4a8ed4466df413 100644 --- a/benchmark/buffers/buffer-base64-decode.js +++ b/benchmark/buffers/buffer-base64-decode.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [32], - size: [8 << 20] + size: [8 << 20], }); function main({ n, size }) { diff --git a/benchmark/buffers/buffer-base64-encode.js b/benchmark/buffers/buffer-base64-encode.js index 9837828a353c2d..0571f3181ae4e2 100644 --- a/benchmark/buffers/buffer-base64-encode.js +++ b/benchmark/buffers/buffer-base64-encode.js @@ -24,9 +24,9 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { len: [64 * 1024 * 1024], - n: [32] + n: [32], }, { - test: { len: 256 } + test: { len: 256 }, }); function main({ n, len }) { diff --git a/benchmark/buffers/buffer-bytelength.js b/benchmark/buffers/buffer-bytelength.js index fbbe0f040da56a..0f24df0111342f 100644 --- a/benchmark/buffers/buffer-bytelength.js +++ b/benchmark/buffers/buffer-bytelength.js @@ -4,7 +4,7 @@ const common = require('../common'); const bench = common.createBenchmark(main, { encoding: ['utf8', 'base64', 'buffer'], len: [2, 16, 256], // x16 - n: [4e6] + n: [4e6], }); // 16 chars each diff --git a/benchmark/buffers/buffer-compare-instance-method.js b/benchmark/buffers/buffer-compare-instance-method.js index eb18fa518037f4..27857abc64a4b9 100644 --- a/benchmark/buffers/buffer-compare-instance-method.js +++ b/benchmark/buffers/buffer-compare-instance-method.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { size: [16, 512, 4096, 16386], args: [1, 2, 5], - n: [1e6] + n: [1e6], }); function main({ n, size, args }) { diff --git a/benchmark/buffers/buffer-compare-offset.js b/benchmark/buffers/buffer-compare-offset.js index 50b46864de2453..a927af6673714a 100644 --- a/benchmark/buffers/buffer-compare-offset.js +++ b/benchmark/buffers/buffer-compare-offset.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['offset', 'slice'], size: [16, 512, 4096, 16386], - n: [1e6] + n: [1e6], }); function compareUsingSlice(b0, b1, len, iter) { diff --git a/benchmark/buffers/buffer-compare.js b/benchmark/buffers/buffer-compare.js index 83ff5ec1d00427..d0debfa0c7c5b9 100644 --- a/benchmark/buffers/buffer-compare.js +++ b/benchmark/buffers/buffer-compare.js @@ -24,7 +24,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { size: [16, 512, 4096, 16386], - n: [1e6] + n: [1e6], }); function main({ n, size }) { diff --git a/benchmark/buffers/buffer-concat-fill.js b/benchmark/buffers/buffer-concat-fill.js index 8fb389fe6c8639..f43e14179ccc15 100644 --- a/benchmark/buffers/buffer-concat-fill.js +++ b/benchmark/buffers/buffer-concat-fill.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { extraSize: [1, 256, 4 * 256], - n: [8e5] + n: [8e5], }); function main({ n, extraSize }) { diff --git a/benchmark/buffers/buffer-concat.js b/benchmark/buffers/buffer-concat.js index 87910d2c8e385a..26edc649d8d349 100644 --- a/benchmark/buffers/buffer-concat.js +++ b/benchmark/buffers/buffer-concat.js @@ -5,7 +5,7 @@ const bench = common.createBenchmark(main, { pieces: [4, 16], pieceSize: [1, 16, 256], withTotalLength: [0, 1], - n: [8e5] + n: [8e5], }); function main({ n, pieces, pieceSize, withTotalLength }) { diff --git a/benchmark/buffers/buffer-copy.js b/benchmark/buffers/buffer-copy.js index 164f31420766d5..a3bf6693b146b5 100644 --- a/benchmark/buffers/buffer-copy.js +++ b/benchmark/buffers/buffer-copy.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { bytes: [0, 8, 128, 32 * 1024], partial: ['true', 'false'], - n: [6e6] + n: [6e6], }); function main({ n, bytes, partial }) { diff --git a/benchmark/buffers/buffer-creation.js b/benchmark/buffers/buffer-creation.js index 862bff4fbabe58..9612c6e9008983 100644 --- a/benchmark/buffers/buffer-creation.js +++ b/benchmark/buffers/buffer-creation.js @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, { 'slow-allocUnsafe', ], len: [10, 1024, 4096, 8192], - n: [6e5] + n: [6e5], }); function main({ len, n, type }) { diff --git a/benchmark/buffers/buffer-equals.js b/benchmark/buffers/buffer-equals.js index 99d2472bd3a088..a3d0e7005a2a0a 100644 --- a/benchmark/buffers/buffer-equals.js +++ b/benchmark/buffers/buffer-equals.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { size: [0, 512, 16386], difflen: ['true', 'false'], - n: [1e6] + n: [1e6], }); function main({ n, size, difflen }) { diff --git a/benchmark/buffers/buffer-fill.js b/benchmark/buffers/buffer-fill.js index 8d4d4996068224..f1ae896843eee0 100644 --- a/benchmark/buffers/buffer-fill.js +++ b/benchmark/buffers/buffer-fill.js @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, { 'fill(Buffer.alloc(1), 0)', ], size: [2 ** 13, 2 ** 16], - n: [2e4] + n: [2e4], }); function main({ n, type, size }) { diff --git a/benchmark/buffers/buffer-from.js b/benchmark/buffers/buffer-from.js index d0f7d42f5e4369..3b88fe3893d327 100644 --- a/benchmark/buffers/buffer-from.js +++ b/benchmark/buffers/buffer-from.js @@ -16,7 +16,7 @@ const bench = common.createBenchmark(main, { 'uint16array', ], len: [100, 2048], - n: [8e5] + n: [8e5], }); function main({ len, n, source }) { diff --git a/benchmark/buffers/buffer-hex.js b/benchmark/buffers/buffer-hex.js index 33d2b44d6a5950..6e61d71c9bacf1 100644 --- a/benchmark/buffers/buffer-hex.js +++ b/benchmark/buffers/buffer-hex.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { len: [64, 1024], - n: [1e6] + n: [1e6], }); function main({ len, n }) { diff --git a/benchmark/buffers/buffer-indexof-number.js b/benchmark/buffers/buffer-indexof-number.js index b00a46524fa3de..02a50babc229e0 100644 --- a/benchmark/buffers/buffer-indexof-number.js +++ b/benchmark/buffers/buffer-indexof-number.js @@ -5,7 +5,7 @@ const path = require('path'); const bench = common.createBenchmark(main, { value: ['@'.charCodeAt(0)], - n: [1e6] + n: [1e6], }); function main({ n, value }) { diff --git a/benchmark/buffers/buffer-indexof.js b/benchmark/buffers/buffer-indexof.js index 4c0993a1ef0ef9..b97be34f558b7e 100644 --- a/benchmark/buffers/buffer-indexof.js +++ b/benchmark/buffers/buffer-indexof.js @@ -21,7 +21,7 @@ const bench = common.createBenchmark(main, { search: searchStrings, encoding: ['utf8', 'ucs2'], type: ['buffer', 'string'], - n: [5e4] + n: [5e4], }); function main({ n, search, encoding, type }) { diff --git a/benchmark/buffers/buffer-iterate.js b/benchmark/buffers/buffer-iterate.js index 3e2a897903d435..57a15e42249742 100644 --- a/benchmark/buffers/buffer-iterate.js +++ b/benchmark/buffers/buffer-iterate.js @@ -7,13 +7,13 @@ const bench = common.createBenchmark(main, { size: [512, 4096, 16386], type: ['fast'], method: ['for', 'forOf', 'iterator'], - n: [1e3] + n: [1e3], }); const methods = { 'for': benchFor, 'forOf': benchForOf, - 'iterator': benchIterator + 'iterator': benchIterator, }; function main({ size, type, method, n }) { diff --git a/benchmark/buffers/buffer-normalize-encoding.js b/benchmark/buffers/buffer-normalize-encoding.js index 9cf51fa367eb4f..709063f50bbeb0 100644 --- a/benchmark/buffers/buffer-normalize-encoding.js +++ b/benchmark/buffers/buffer-normalize-encoding.js @@ -22,9 +22,9 @@ const bench = common.createBenchmark(main, { 'utf8', 'UTF8', ], - n: [1e6] + n: [1e6], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ encoding, n }) { diff --git a/benchmark/buffers/buffer-read-float.js b/benchmark/buffers/buffer-read-float.js index 656762d1d4f1d0..72d856b436b3c7 100644 --- a/benchmark/buffers/buffer-read-float.js +++ b/benchmark/buffers/buffer-read-float.js @@ -5,7 +5,7 @@ const bench = common.createBenchmark(main, { type: ['Double', 'Float'], endian: ['LE'], value: ['zero', 'big', 'small', 'inf', 'nan'], - n: [1e6] + n: [1e6], }); function main({ n, type, endian, value }) { diff --git a/benchmark/buffers/buffer-read-with-byteLength.js b/benchmark/buffers/buffer-read-with-byteLength.js index c51ab11ae986d7..57e46b8ce4453f 100644 --- a/benchmark/buffers/buffer-read-with-byteLength.js +++ b/benchmark/buffers/buffer-read-with-byteLength.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { buffer: ['fast'], type: types, n: [1e6], - byteLength: [1, 2, 3, 4, 5, 6] + byteLength: [1, 2, 3, 4, 5, 6], }); function main({ n, buf, type, byteLength }) { diff --git a/benchmark/buffers/buffer-read.js b/benchmark/buffers/buffer-read.js index e0ec13992c2fae..f3b2a5645174fe 100644 --- a/benchmark/buffers/buffer-read.js +++ b/benchmark/buffers/buffer-read.js @@ -21,7 +21,7 @@ const types = [ const bench = common.createBenchmark(main, { buffer: ['fast'], type: types, - n: [1e6] + n: [1e6], }); function main({ n, buf, type }) { diff --git a/benchmark/buffers/buffer-slice.js b/benchmark/buffers/buffer-slice.js index a64cbd2ab2db7c..779d5ee75c5deb 100644 --- a/benchmark/buffers/buffer-slice.js +++ b/benchmark/buffers/buffer-slice.js @@ -4,7 +4,7 @@ const SlowBuffer = require('buffer').SlowBuffer; const bench = common.createBenchmark(main, { type: ['fast', 'slow'], - n: [1e6] + n: [1e6], }); const buf = Buffer.allocUnsafe(1024); diff --git a/benchmark/buffers/buffer-swap.js b/benchmark/buffers/buffer-swap.js index e43957efbdb095..08a46d5bd1901e 100644 --- a/benchmark/buffers/buffer-swap.js +++ b/benchmark/buffers/buffer-swap.js @@ -6,9 +6,9 @@ const bench = common.createBenchmark(main, { aligned: ['true', 'false'], method: ['swap16', 'swap32', 'swap64'/* , 'htons', 'htonl', 'htonll' */], len: [64, 256, 768, 1024, 2056, 8192], - n: [1e6] + n: [1e6], }, { - test: { len: 16 } + test: { len: 16 }, }); // The htons and htonl methods below are used to benchmark the diff --git a/benchmark/buffers/buffer-tojson.js b/benchmark/buffers/buffer-tojson.js index be6d5fa367b5a3..9cd6883120d4b0 100644 --- a/benchmark/buffers/buffer-tojson.js +++ b/benchmark/buffers/buffer-tojson.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1e4], - len: [0, 256, 4 * 1024] + len: [0, 256, 4 * 1024], }); function main({ n, len }) { diff --git a/benchmark/buffers/buffer-tostring.js b/benchmark/buffers/buffer-tostring.js index 98d6ab3fa08311..3c65410a889fbd 100644 --- a/benchmark/buffers/buffer-tostring.js +++ b/benchmark/buffers/buffer-tostring.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { encoding: ['utf8', 'ascii', 'latin1', 'hex', 'UCS-2'], args: [0, 1, 3], len: [1, 64, 1024], - n: [1e6] + n: [1e6], }); function main({ encoding, args, len, n }) { diff --git a/benchmark/buffers/buffer-write-string.js b/benchmark/buffers/buffer-write-string.js index cd24d379728cda..9d9e8a93391737 100644 --- a/benchmark/buffers/buffer-write-string.js +++ b/benchmark/buffers/buffer-write-string.js @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, { ], args: [ '', 'offset', 'offset+length' ], len: [2048], - n: [1e6] + n: [1e6], }); function main({ len, n, encoding, args }) { diff --git a/benchmark/buffers/buffer-write.js b/benchmark/buffers/buffer-write.js index 5025dd2bca0407..239abc8a0da69e 100644 --- a/benchmark/buffers/buffer-write.js +++ b/benchmark/buffers/buffer-write.js @@ -29,7 +29,7 @@ const types = [ const bench = common.createBenchmark(main, { buffer: ['fast'], type: types, - n: [1e6] + n: [1e6], }); const INT8 = 0x7f; @@ -60,14 +60,14 @@ const mod = { writeUIntLE: INT8, writeUIntBE: INT16, writeIntLE: INT32, - writeIntBE: INT48 + writeIntBE: INT48, }; const byteLength = { writeUIntLE: 1, writeUIntBE: 2, writeIntLE: 4, - writeIntBE: 6 + writeIntBE: 6, }; function main({ n, buf, type }) { diff --git a/benchmark/buffers/buffer-zero.js b/benchmark/buffers/buffer-zero.js index 81b9731c0a213e..1acd21100dd1a9 100644 --- a/benchmark/buffers/buffer-zero.js +++ b/benchmark/buffers/buffer-zero.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1e6], - type: ['buffer', 'string'] + type: ['buffer', 'string'], }); const zeroBuffer = Buffer.alloc(0); diff --git a/benchmark/buffers/dataview-set.js b/benchmark/buffers/dataview-set.js index b7914fe45f175b..ff0eabd1cdfe3a 100644 --- a/benchmark/buffers/dataview-set.js +++ b/benchmark/buffers/dataview-set.js @@ -20,7 +20,7 @@ const types = [ const bench = common.createBenchmark(main, { type: types, - n: [1e6] + n: [1e6], }); const INT8 = 0x7f; @@ -36,7 +36,7 @@ const mod = { setInt32: INT32, setUint8: UINT8, setUint16: UINT16, - setUint32: UINT32 + setUint32: UINT32, }; function main({ n, type }) { diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js index f750e2cf3e68f2..f68cd6962c7a5e 100644 --- a/benchmark/child_process/child-process-exec-stdout.js +++ b/benchmark/child_process/child-process-exec-stdout.js @@ -9,7 +9,7 @@ if (!isWindows) messagesLength.push(32768); const bench = common.createBenchmark(childProcessExecStdout, { len: messagesLength, - dur: [5] + dur: [5], }); function childProcessExecStdout({ dur, len }) { diff --git a/benchmark/child_process/child-process-read-ipc.js b/benchmark/child_process/child-process-read-ipc.js index 280505026cd02e..dd8332d9817be4 100644 --- a/benchmark/child_process/child-process-read-ipc.js +++ b/benchmark/child_process/child-process-read-ipc.js @@ -15,7 +15,7 @@ if (process.argv[2] === 'child') { 64, 256, 1024, 4096, 16384, 65536, 65536 << 4, 65536 << 6 - 1, ], - dur: [5] + dur: [5], }); const spawn = require('child_process').spawn; diff --git a/benchmark/child_process/child-process-read.js b/benchmark/child_process/child-process-read.js index 01e9846be22b56..0364009d5320ed 100644 --- a/benchmark/child_process/child-process-read.js +++ b/benchmark/child_process/child-process-read.js @@ -14,7 +14,7 @@ if (os.platform() !== 'win32') const bench = common.createBenchmark(main, { len: messagesLength, - dur: [5] + dur: [5], }); function main({ dur, len }) { diff --git a/benchmark/child_process/spawn-echo.js b/benchmark/child_process/spawn-echo.js index 8f5c80cd23ba18..9b5a32d01ca8b3 100644 --- a/benchmark/child_process/spawn-echo.js +++ b/benchmark/child_process/spawn-echo.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1000] + n: [1000], }); const spawn = require('child_process').spawn; diff --git a/benchmark/cluster/echo.js b/benchmark/cluster/echo.js index 9def87cf8b0e98..bedfa063257d63 100644 --- a/benchmark/cluster/echo.js +++ b/benchmark/cluster/echo.js @@ -8,7 +8,7 @@ if (cluster.isMaster) { payload: ['string', 'object'], sendsPerBroadcast: [1, 10], serialization: ['json', 'advanced'], - n: [1e5] + n: [1e5], }); function main({ @@ -16,7 +16,7 @@ if (cluster.isMaster) { workers, sendsPerBroadcast, payload, - serialization + serialization, }) { const expectedPerBroadcast = sendsPerBroadcast * workers; let readies = 0; diff --git a/benchmark/compare.js b/benchmark/compare.js index 169948e006d660..503901f607ef02 100644 --- a/benchmark/compare.js +++ b/benchmark/compare.js @@ -71,7 +71,7 @@ if (showProgress) { const job = queue[i]; const child = fork(path.resolve(__dirname, job.filename), cli.optional.set, { - execPath: cli.optional[job.binary] + execPath: cli.optional[job.binary], }); child.on('message', (data) => { diff --git a/benchmark/crypto/aes-gcm-throughput.js b/benchmark/crypto/aes-gcm-throughput.js index 3f2b9ba45eb3f2..0ac88f6e6ee5ea 100644 --- a/benchmark/crypto/aes-gcm-throughput.js +++ b/benchmark/crypto/aes-gcm-throughput.js @@ -5,7 +5,7 @@ const keylen = { 'aes-128-gcm': 16, 'aes-192-gcm': 24, 'aes-256-gcm': 32 }; const bench = common.createBenchmark(main, { n: [500], cipher: ['aes-128-gcm', 'aes-192-gcm', 'aes-256-gcm'], - len: [1024, 4 * 1024, 16 * 1024, 64 * 1024, 256 * 1024, 1024 * 1024] + len: [1024, 4 * 1024, 16 * 1024, 64 * 1024, 256 * 1024, 1024 * 1024], }); function main({ n, len, cipher }) { diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js index 47a8931a540447..4e794f7afdbaac 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -6,9 +6,9 @@ const bench = common.createBenchmark(main, { cipher: ['AES192', 'AES256'], type: ['asc', 'utf', 'buf'], len: [2, 1024, 102400, 1024 * 1024], - api: ['legacy', 'stream'] + api: ['legacy', 'stream'], }, { - flags: ['--no-warnings'] + flags: ['--no-warnings'], }); function main({ api, cipher, type, len, writes }) { diff --git a/benchmark/crypto/get-ciphers.js b/benchmark/crypto/get-ciphers.js index 1bf910a6a80ba3..0ace9b49820db8 100644 --- a/benchmark/crypto/get-ciphers.js +++ b/benchmark/crypto/get-ciphers.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1, 5000], - v: ['crypto', 'tls'] + v: ['crypto', 'tls'], }); function main({ n, v }) { diff --git a/benchmark/crypto/hash-stream-creation.js b/benchmark/crypto/hash-stream-creation.js index c21eb6eaaaed99..fce1742f47f848 100644 --- a/benchmark/crypto/hash-stream-creation.js +++ b/benchmark/crypto/hash-stream-creation.js @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, { type: ['asc', 'utf', 'buf'], out: ['hex', 'binary', 'buffer'], len: [2, 1024, 102400, 1024 * 1024], - api: ['legacy', 'stream'] + api: ['legacy', 'stream'], }); function main({ api, type, len, out, writes, algo }) { diff --git a/benchmark/crypto/hash-stream-throughput.js b/benchmark/crypto/hash-stream-throughput.js index b86d70604616b5..db10c439e0e446 100644 --- a/benchmark/crypto/hash-stream-throughput.js +++ b/benchmark/crypto/hash-stream-throughput.js @@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, { algo: ['sha1', 'sha256', 'sha512'], type: ['asc', 'utf', 'buf'], len: [2, 1024, 102400, 1024 * 1024], - api: ['legacy', 'stream'] + api: ['legacy', 'stream'], }); function main({ api, type, len, algo, writes }) { diff --git a/benchmark/crypto/hkdf.js b/benchmark/crypto/hkdf.js index 4be15ab59071fe..61ae33cac0a0f6 100644 --- a/benchmark/crypto/hkdf.js +++ b/benchmark/crypto/hkdf.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const assert = require('assert'); const { hkdf, - hkdfSync + hkdfSync, } = require('crypto'); const bench = common.createBenchmark(main, { diff --git a/benchmark/crypto/keygen.js b/benchmark/crypto/keygen.js index e055a02cd2b116..380c4224bac46f 100644 --- a/benchmark/crypto/keygen.js +++ b/benchmark/crypto/keygen.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const assert = require('assert'); const { generateKeyPair, - generateKeyPairSync + generateKeyPairSync, } = require('crypto'); const bench = common.createBenchmark(main, { @@ -18,7 +18,7 @@ const methods = { for (let i = 0; i < n; ++i) { generateKeyPairSync('rsa', { modulusLength: 1024, - publicExponent: 0x10001 + publicExponent: 0x10001, }); } bench.end(n); @@ -35,7 +35,7 @@ const methods = { for (let i = 0; i < n; ++i) generateKeyPair('rsa', { modulusLength: 512, - publicExponent: 0x10001 + publicExponent: 0x10001, }, done); }, diff --git a/benchmark/crypto/oneshot-sign-verify.js b/benchmark/crypto/oneshot-sign-verify.js index c37360a0c9a988..d3c70eb042469e 100644 --- a/benchmark/crypto/oneshot-sign-verify.js +++ b/benchmark/crypto/oneshot-sign-verify.js @@ -9,7 +9,7 @@ const keyFixtures = { publicKey: fs.readFileSync(`${fixtures_keydir}/ec_p256_public.pem`) .toString(), privateKey: fs.readFileSync(`${fixtures_keydir}/ec_p256_private.pem`) - .toString() + .toString(), }; const data = crypto.randomBytes(256); @@ -20,7 +20,7 @@ let keyObjects; function getKeyObject({ privateKey, publicKey }) { return { privateKey: crypto.createPrivateKey(privateKey), - publicKey: crypto.createPublicKey(publicKey) + publicKey: crypto.createPublicKey(publicKey), }; } @@ -60,7 +60,7 @@ function measureAsyncSerial(n, privateKey, publicKey, keys) { data, { key: privateKey || keys[n - remaining].privateKey, - dsaEncoding: 'ieee-p1363' + dsaEncoding: 'ieee-p1363', }, (err, signature) => { crypto.verify( @@ -68,7 +68,7 @@ function measureAsyncSerial(n, privateKey, publicKey, keys) { data, { key: publicKey || keys[n - remaining].publicKey, - dsaEncoding: 'ieee-p1363' + dsaEncoding: 'ieee-p1363', }, signature, done); @@ -104,7 +104,7 @@ function measureAsyncParallel(n, privateKey, publicKey, keys) { function main({ n, mode, keyFormat }) { pems ||= [...Buffer.alloc(n)].map(() => ({ privateKey: keyFixtures.privateKey, - publicKey: keyFixtures.publicKey + publicKey: keyFixtures.publicKey, })); keyObjects ||= pems.map(getKeyObject); diff --git a/benchmark/crypto/randomInt.js b/benchmark/crypto/randomInt.js index 1f1dfa0160fa11..ac5286f1775e1c 100644 --- a/benchmark/crypto/randomInt.js +++ b/benchmark/crypto/randomInt.js @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, { mode: ['sync', 'async-sequential', 'async-parallel'], min: [-(2 ** 47) + 1, -10_000, -100], max: [100, 10_000, 2 ** 47], - n: [1e3, 1e5] + n: [1e3, 1e5], }); function main({ mode, min, max, n }) { diff --git a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js index 9791160263c9ec..3db97d5cac196f 100644 --- a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js +++ b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js @@ -19,7 +19,7 @@ keylen_list.forEach((key) => { const bench = common.createBenchmark(main, { n: [500], keylen: keylen_list, - len: [16, 32, 64] + len: [16, 32, 64], }); function main({ len, algo, keylen, n }) { diff --git a/benchmark/crypto/rsa-sign-verify-throughput.js b/benchmark/crypto/rsa-sign-verify-throughput.js index 846fa1b9a4bddb..ac8325de10cb70 100644 --- a/benchmark/crypto/rsa-sign-verify-throughput.js +++ b/benchmark/crypto/rsa-sign-verify-throughput.js @@ -20,7 +20,7 @@ const bench = common.createBenchmark(main, { writes: [500], algo: ['SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512'], keylen: keylen_list, - len: [1024, 102400, 2 * 102400, 3 * 102400, 1024 * 1024] + len: [1024, 102400, 2 * 102400, 3 * 102400, 1024 * 1024], }); function main({ len, algo, keylen, writes }) { diff --git a/benchmark/crypto/webcrypto-digest.js b/benchmark/crypto/webcrypto-digest.js index 2d95f868f66f7c..bcdb6d5e62fceb 100644 --- a/benchmark/crypto/webcrypto-digest.js +++ b/benchmark/crypto/webcrypto-digest.js @@ -5,8 +5,8 @@ const { createHash, webcrypto: { subtle, - getRandomValues - } + getRandomValues, + }, } = require('crypto'); const bench = common.createBenchmark(main, { @@ -20,7 +20,7 @@ const kMethods = { 'SHA-1': 'sha1', 'SHA-256': 'sha256', 'SHA-384': 'sha384', - 'SHA-512': 'sha512' + 'SHA-512': 'sha512', }; // This benchmark only looks at clock time and ignores factors diff --git a/benchmark/dgram/array-vs-concat.js b/benchmark/dgram/array-vs-concat.js index ae9a759a983c04..b5662acfc4033b 100644 --- a/benchmark/dgram/array-vs-concat.js +++ b/benchmark/dgram/array-vs-concat.js @@ -13,7 +13,7 @@ const bench = common.createBenchmark(main, { num: [100], chunks: [1, 2, 4, 8], type: ['concat', 'multi'], - dur: [5] + dur: [5], }); function main({ dur, len, num, type, chunks }) { diff --git a/benchmark/dgram/multi-buffer.js b/benchmark/dgram/multi-buffer.js index add77cd7845ce1..945d02c2d1c0e7 100644 --- a/benchmark/dgram/multi-buffer.js +++ b/benchmark/dgram/multi-buffer.js @@ -13,7 +13,7 @@ const bench = common.createBenchmark(main, { num: [100], chunks: [1, 2, 4, 8], type: ['send', 'recv'], - dur: [5] + dur: [5], }); function main({ dur, len, num, type, chunks }) { diff --git a/benchmark/dgram/offset-length.js b/benchmark/dgram/offset-length.js index eea0b75b773ca8..ac0fee731eab20 100644 --- a/benchmark/dgram/offset-length.js +++ b/benchmark/dgram/offset-length.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { len: [1, 64, 256, 1024], num: [100], type: ['send', 'recv'], - dur: [5] + dur: [5], }); function main({ dur, len, num, type }) { diff --git a/benchmark/dgram/single-buffer.js b/benchmark/dgram/single-buffer.js index b02f785bb052f2..6a7fa3dde22942 100644 --- a/benchmark/dgram/single-buffer.js +++ b/benchmark/dgram/single-buffer.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { len: [1, 64, 256, 1024], num: [100], type: ['send', 'recv'], - dur: [5] + dur: [5], }); function main({ dur, len, num, type }) { diff --git a/benchmark/diagnostics_channel/http.js b/benchmark/diagnostics_channel/http.js index 55fac8a706df15..caf37a05a45c3b 100644 --- a/benchmark/diagnostics_channel/http.js +++ b/benchmark/diagnostics_channel/http.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { chunks: 4, connections: [50, 500], chunkedEnc: 1, - duration: 5 + duration: 5, }); function main({ apm, connections, duration, type, len, chunks, chunkedEnc }) { @@ -24,7 +24,7 @@ function main({ apm, connections, duration, type, len, chunks, chunkedEnc }) { bench.http({ path, connections, - duration + duration, }, () => { server.close(); if (done) done(); @@ -44,14 +44,14 @@ function patch() { if (name === 'request') { als.enterWith({ url: req.url, - start: process.hrtime.bigint() + start: process.hrtime.bigint(), }); res.on('finish', () => { times.push({ ...als.getStore(), statusCode: res.statusCode, - end: process.hrtime.bigint() + end: process.hrtime.bigint(), }); }); } @@ -74,7 +74,7 @@ function diagnostics_channel() { function onStart(req) { als.enterWith({ url: req.url, - start: process.hrtime.bigint() + start: process.hrtime.bigint(), }); } @@ -82,7 +82,7 @@ function diagnostics_channel() { times.push({ ...als.getStore(), statusCode: res.statusCode, - end: process.hrtime.bigint() + end: process.hrtime.bigint(), }); } diff --git a/benchmark/diagnostics_channel/publish.js b/benchmark/diagnostics_channel/publish.js index 31a770c8627919..3a30012ba692b8 100644 --- a/benchmark/diagnostics_channel/publish.js +++ b/benchmark/diagnostics_channel/publish.js @@ -16,7 +16,7 @@ function main({ n, subscribers }) { } const data = { - foo: 'bar' + foo: 'bar', }; bench.start(); diff --git a/benchmark/dns/lookup-promises.js b/benchmark/dns/lookup-promises.js index a74c856cd3461a..e67a5ab9a7ae7f 100644 --- a/benchmark/dns/lookup-promises.js +++ b/benchmark/dns/lookup-promises.js @@ -6,7 +6,7 @@ const { lookup } = require('dns').promises; const bench = common.createBenchmark(main, { name: ['127.0.0.1', '::1'], all: ['true', 'false'], - n: [5e6] + n: [5e6], }); function main({ name, n, all }) { diff --git a/benchmark/dns/lookup.js b/benchmark/dns/lookup.js index 691daa8a879e2b..c9d1c0f7c39aa2 100644 --- a/benchmark/dns/lookup.js +++ b/benchmark/dns/lookup.js @@ -6,7 +6,7 @@ const lookup = require('dns').lookup; const bench = common.createBenchmark(main, { name: ['127.0.0.1', '::1'], all: ['true', 'false'], - n: [5e6] + n: [5e6], }); function main({ name, n, all }) { diff --git a/benchmark/domain/domain-fn-args.js b/benchmark/domain/domain-fn-args.js index 18906a9ce64099..d55658ccdbaabd 100644 --- a/benchmark/domain/domain-fn-args.js +++ b/benchmark/domain/domain-fn-args.js @@ -4,7 +4,7 @@ const domain = require('domain'); const bench = common.createBenchmark(main, { args: [0, 1, 2, 3], - n: [10] + n: [10], }); const bdomain = domain.create(); diff --git a/benchmark/es/defaultparams-bench.js b/benchmark/es/defaultparams-bench.js index fde4cb11ad448a..4befe99177175b 100644 --- a/benchmark/es/defaultparams-bench.js +++ b/benchmark/es/defaultparams-bench.js @@ -5,7 +5,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { method: ['withoutdefaults', 'withdefaults'], - n: [1e8] + n: [1e8], }); function oldStyleDefaults(x, y) { diff --git a/benchmark/es/destructuring-bench.js b/benchmark/es/destructuring-bench.js index d412b82757f083..10b61f44b3dcfa 100644 --- a/benchmark/es/destructuring-bench.js +++ b/benchmark/es/destructuring-bench.js @@ -5,7 +5,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { method: ['swap', 'destructure'], - n: [1e8] + n: [1e8], }); function runSwapManual(n) { diff --git a/benchmark/es/destructuring-object-bench.js b/benchmark/es/destructuring-object-bench.js index 29c83bd188e89d..23cc8ace1109fc 100644 --- a/benchmark/es/destructuring-object-bench.js +++ b/benchmark/es/destructuring-object-bench.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['normal', 'destructureObject'], - n: [1e8] + n: [1e8], }); function runNormal(n) { diff --git a/benchmark/es/foreach-bench.js b/benchmark/es/foreach-bench.js index 6992a1a5749438..6a86103580366b 100644 --- a/benchmark/es/foreach-bench.js +++ b/benchmark/es/foreach-bench.js @@ -5,7 +5,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['for', 'for-of', 'for-in', 'forEach'], count: [5, 10, 20, 100], - n: [5e6] + n: [5e6], }); function useFor(n, items, count) { diff --git a/benchmark/es/map-bench.js b/benchmark/es/map-bench.js index d0b8534cf7c906..2998d6f3cbf5d3 100644 --- a/benchmark/es/map-bench.js +++ b/benchmark/es/map-bench.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { 'object', 'nullProtoObject', 'nullProtoLiteralObject', 'storageObject', 'fakeMap', 'map', ], - n: [1e6] + n: [1e6], }); function runObject(n) { @@ -72,7 +72,7 @@ function fakeMap() { get(key) { return m[`$${key}`]; }, set(key, val) { m[`$${key}`] = val; }, get size() { return Object.keys(m).length; }, - has(key) { return Object.prototype.hasOwnProperty.call(m, `$${key}`); } + has(key) { return Object.prototype.hasOwnProperty.call(m, `$${key}`); }, }; } diff --git a/benchmark/es/restparams-bench.js b/benchmark/es/restparams-bench.js index 8129bc92533332..219bbdd725f4bb 100644 --- a/benchmark/es/restparams-bench.js +++ b/benchmark/es/restparams-bench.js @@ -5,7 +5,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { method: ['copy', 'rest', 'arguments'], - n: [1e8] + n: [1e8], }); function copyArguments() { diff --git a/benchmark/es/spread-assign.js b/benchmark/es/spread-assign.js index c34bb93e762d12..f0dcd56bb606b1 100644 --- a/benchmark/es/spread-assign.js +++ b/benchmark/es/spread-assign.js @@ -6,7 +6,7 @@ const util = require('util'); const bench = common.createBenchmark(main, { method: ['spread', 'assign', '_extend'], count: [5, 10, 20], - n: [1e6] + n: [1e6], }); function main({ n, context, count, rest, method }) { diff --git a/benchmark/es/spread-bench.js b/benchmark/es/spread-bench.js index 284debdfa09ad8..c5191a7879a9e4 100644 --- a/benchmark/es/spread-bench.js +++ b/benchmark/es/spread-bench.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { count: [5, 10, 20], context: ['context', 'null'], rest: [0, 1], - n: [5e6] + n: [5e6], }); function makeTest(count, rest) { diff --git a/benchmark/esm/cjs-parse.js b/benchmark/esm/cjs-parse.js index 325b362a057112..aae8109c2d4e54 100644 --- a/benchmark/esm/cjs-parse.js +++ b/benchmark/esm/cjs-parse.js @@ -9,7 +9,7 @@ const benchmarkDirectory = path.resolve(tmpdir.path, 'benchmark-esm-parse'); const bench = common.createBenchmark(main, { - n: [1e2] + n: [1e2], }); async function main({ n }) { diff --git a/benchmark/events/ee-listeners.js b/benchmark/events/ee-listeners.js index 9de8d04a175b4b..5d21322d09ec7b 100644 --- a/benchmark/events/ee-listeners.js +++ b/benchmark/events/ee-listeners.js @@ -5,7 +5,7 @@ const EventEmitter = require('events').EventEmitter; const bench = common.createBenchmark(main, { n: [5e6], listeners: [5, 50], - raw: ['true', 'false'] + raw: ['true', 'false'], }); function main({ n, listeners, raw }) { diff --git a/benchmark/events/ee-once.js b/benchmark/events/ee-once.js index bd0a39565332b2..a8767c8e54e2d5 100644 --- a/benchmark/events/ee-once.js +++ b/benchmark/events/ee-once.js @@ -4,7 +4,7 @@ const EventEmitter = require('events').EventEmitter; const bench = common.createBenchmark(main, { n: [2e7], - argc: [0, 1, 4, 5] + argc: [0, 1, 4, 5], }); function main({ n, argc }) { diff --git a/benchmark/events/eventtarget.js b/benchmark/events/eventtarget.js index d2c3ad034ff9b4..a834678d2c0fd4 100644 --- a/benchmark/events/eventtarget.js +++ b/benchmark/events/eventtarget.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1e6], - listeners: [1, 5, 10] + listeners: [1, 5, 10], }, { flags: ['--expose-internals'] }); function main({ n, listeners }) { diff --git a/benchmark/fixtures/coverage-many-branches.js b/benchmark/fixtures/coverage-many-branches.js index 9cb6360336e019..a0cec6366d2e09 100644 --- a/benchmark/fixtures/coverage-many-branches.js +++ b/benchmark/fixtures/coverage-many-branches.js @@ -44,8 +44,8 @@ function addSpecial(x, y) { mt = new CoveredClass(x, y, { special: { x: Math.random() * x, - y: Math.random() * y - } + y: Math.random() * y, + }, }); } return mt.addSpecial(); @@ -64,8 +64,8 @@ function multSpecial(x, y) { mt = new CoveredClass(x, y, { special: { x: Math.random() * x, - y: Math.random() * y - } + y: Math.random() * y, + }, }); } return mt.multSpecial(); diff --git a/benchmark/fixtures/require-cachable.js b/benchmark/fixtures/require-cachable.js index 4afda3cda47675..296146e9d75aeb 100644 --- a/benchmark/fixtures/require-cachable.js +++ b/benchmark/fixtures/require-cachable.js @@ -2,7 +2,7 @@ const { internalBinding } = require('internal/test/binding'); const { - moduleCategories: { canBeRequired } + moduleCategories: { canBeRequired }, } = internalBinding('native_module'); for (const key of canBeRequired) { diff --git a/benchmark/fixtures/simple-http-server.js b/benchmark/fixtures/simple-http-server.js index fb5b0d87c16e0d..ed3cc6bcbb4600 100644 --- a/benchmark/fixtures/simple-http-server.js +++ b/benchmark/fixtures/simple-http-server.js @@ -85,7 +85,7 @@ module.exports = http.createServer((req, res) => { default: res.writeHead(200, { 'Content-Type': 'text/plain', - 'Transfer-Encoding': 'chunked' + 'Transfer-Encoding': 'chunked', }); } req.pipe(res); @@ -118,12 +118,12 @@ module.exports = http.createServer((req, res) => { if (chunkedEnc) { res.writeHead(status, { 'Content-Type': 'text/plain', - 'Transfer-Encoding': 'chunked' + 'Transfer-Encoding': 'chunked', }); } else { res.writeHead(status, { 'Content-Type': 'text/plain', - 'Content-Length': len.toString() + 'Content-Length': len.toString(), }); } } diff --git a/benchmark/fixtures/simple-https-server.js b/benchmark/fixtures/simple-https-server.js index d3b07a110113d7..7f456440af6ac3 100644 --- a/benchmark/fixtures/simple-https-server.js +++ b/benchmark/fixtures/simple-https-server.js @@ -5,7 +5,7 @@ const https = require('https'); const options = { key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const storedBytes = Object.create(null); @@ -52,12 +52,12 @@ module.exports = https.createServer(options, (req, res) => { if (chunkedEnc) { res.writeHead(status, { 'Content-Type': 'text/plain', - 'Transfer-Encoding': 'chunked' + 'Transfer-Encoding': 'chunked', }); } else { res.writeHead(status, { 'Content-Type': 'text/plain', - 'Content-Length': len.toString() + 'Content-Length': len.toString(), }); } // send body in chunks diff --git a/benchmark/fs/bench-opendir.js b/benchmark/fs/bench-opendir.js index 20e178d9cc5236..77ea471fa5480f 100644 --- a/benchmark/fs/bench-opendir.js +++ b/benchmark/fs/bench-opendir.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { n: [100], dir: [ 'lib', 'test/parallel'], mode: [ 'async', 'sync', 'callback' ], - bufferSize: [ 4, 32, 1024 ] + bufferSize: [ 4, 32, 1024 ], }); async function main({ n, dir, mode, bufferSize }) { diff --git a/benchmark/fs/bench-readdir.js b/benchmark/fs/bench-readdir.js index 3731e35a5436f4..8fa0e7a3cbdc05 100644 --- a/benchmark/fs/bench-readdir.js +++ b/benchmark/fs/bench-readdir.js @@ -7,7 +7,7 @@ const path = require('path'); const bench = common.createBenchmark(main, { n: [10], dir: [ 'lib', 'test/parallel'], - withFileTypes: ['true', 'false'] + withFileTypes: ['true', 'false'], }); function main({ n, dir, withFileTypes }) { diff --git a/benchmark/fs/bench-readdirSync.js b/benchmark/fs/bench-readdirSync.js index c0144d3460f8ff..8ae1d061d1f153 100644 --- a/benchmark/fs/bench-readdirSync.js +++ b/benchmark/fs/bench-readdirSync.js @@ -7,7 +7,7 @@ const path = require('path'); const bench = common.createBenchmark(main, { n: [10], dir: [ 'lib', 'test/parallel'], - withFileTypes: ['true', 'false'] + withFileTypes: ['true', 'false'], }); diff --git a/benchmark/fs/bench-stat-promise.js b/benchmark/fs/bench-stat-promise.js index 99a5da5799b787..4429664f2dba76 100644 --- a/benchmark/fs/bench-stat-promise.js +++ b/benchmark/fs/bench-stat-promise.js @@ -5,7 +5,7 @@ const fsPromises = require('fs').promises; const bench = common.createBenchmark(main, { n: [20e4], - statType: ['fstat', 'lstat', 'stat'] + statType: ['fstat', 'lstat', 'stat'], }); async function run(n, statType) { diff --git a/benchmark/fs/bench-stat.js b/benchmark/fs/bench-stat.js index e1f51c762c8e5f..1441907e18cd78 100644 --- a/benchmark/fs/bench-stat.js +++ b/benchmark/fs/bench-stat.js @@ -5,7 +5,7 @@ const fs = require('fs'); const bench = common.createBenchmark(main, { n: [20e4], - statType: ['fstat', 'lstat', 'stat'] + statType: ['fstat', 'lstat', 'stat'], }); diff --git a/benchmark/fs/bench-statSync-failure.js b/benchmark/fs/bench-statSync-failure.js index 82cb24c09f4af2..608af21306a496 100644 --- a/benchmark/fs/bench-statSync-failure.js +++ b/benchmark/fs/bench-statSync-failure.js @@ -6,7 +6,7 @@ const path = require('path'); const bench = common.createBenchmark(main, { n: [1e6], - statSyncType: ['throw', 'noThrow'] + statSyncType: ['throw', 'noThrow'], }); diff --git a/benchmark/fs/bench-statSync.js b/benchmark/fs/bench-statSync.js index e75d6603fcfc64..4ec2e860fb6ba7 100644 --- a/benchmark/fs/bench-statSync.js +++ b/benchmark/fs/bench-statSync.js @@ -5,7 +5,7 @@ const fs = require('fs'); const bench = common.createBenchmark(main, { n: [1e6], - statSyncType: ['fstatSync', 'lstatSync', 'statSync'] + statSyncType: ['fstatSync', 'lstatSync', 'statSync'], }); diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js index 5984317ff91743..c8bf13d7af7991 100644 --- a/benchmark/fs/read-stream-throughput.js +++ b/benchmark/fs/read-stream-throughput.js @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, { encodingType: ['buf', 'asc', 'utf'], filesize: [1000 * 1024], highWaterMark: [1024, 4096, 65535, 1024 * 1024], - n: 1024 + n: 1024, }); function main(conf) { @@ -68,7 +68,7 @@ function runTest(filesize, highWaterMark, encoding, n) { assert(fs.statSync(filename).size === filesize * n); const rs = fs.createReadStream(filename, { highWaterMark, - encoding + encoding, }); rs.on('open', () => { diff --git a/benchmark/fs/readFileSync.js b/benchmark/fs/readFileSync.js index 47d210b7aa0463..8cf3b4c28fb25c 100644 --- a/benchmark/fs/readFileSync.js +++ b/benchmark/fs/readFileSync.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const fs = require('fs'); const bench = common.createBenchmark(main, { - n: [60e4] + n: [60e4], }); function main({ n }) { diff --git a/benchmark/fs/readfile-partitioned.js b/benchmark/fs/readfile-partitioned.js index 51700cfd649dfd..6cfe88e9477230 100644 --- a/benchmark/fs/readfile-partitioned.js +++ b/benchmark/fs/readfile-partitioned.js @@ -19,7 +19,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { dur: [5], len: [1024, 16 * 1024 * 1024], - concurrent: [1, 10] + concurrent: [1, 10], }); function main({ len, dur, concurrent }) { diff --git a/benchmark/fs/readfile-promises.js b/benchmark/fs/readfile-promises.js index 28633c3f06427b..dd6c43228af950 100644 --- a/benchmark/fs/readfile-promises.js +++ b/benchmark/fs/readfile-promises.js @@ -16,7 +16,7 @@ const filename = path.resolve(tmpdir.path, const bench = common.createBenchmark(main, { duration: [5], len: [1024, 16 * 1024 * 1024], - concurrent: [1, 10] + concurrent: [1, 10], }); function main({ len, duration, concurrent }) { diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js index 3f996e02ede876..b78fd6113a4164 100644 --- a/benchmark/fs/readfile.js +++ b/benchmark/fs/readfile.js @@ -16,7 +16,7 @@ const filename = path.resolve(tmpdir.path, const bench = common.createBenchmark(main, { duration: [5], len: [1024, 16 * 1024 * 1024], - concurrent: [1, 10] + concurrent: [1, 10], }); function main({ len, duration, concurrent }) { diff --git a/benchmark/fs/write-stream-throughput.js b/benchmark/fs/write-stream-throughput.js index 44a3bb23b041d1..ecd35b0187b325 100644 --- a/benchmark/fs/write-stream-throughput.js +++ b/benchmark/fs/write-stream-throughput.js @@ -13,7 +13,7 @@ const filename = path.resolve(tmpdir.path, const bench = common.createBenchmark(main, { dur: [5], encodingType: ['buf', 'asc', 'utf'], - size: [2, 1024, 65535, 1024 * 1024] + size: [2, 1024, 65535, 1024 * 1024], }); function main({ dur, encodingType, size }) { diff --git a/benchmark/fs/writefile-promises.js b/benchmark/fs/writefile-promises.js index 2ba25184ff3132..09b3313b602f20 100644 --- a/benchmark/fs/writefile-promises.js +++ b/benchmark/fs/writefile-promises.js @@ -17,7 +17,7 @@ const bench = common.createBenchmark(main, { duration: [5], encodingType: ['buf', 'asc', 'utf'], size: [2, 1024, 65535, 1024 * 1024], - concurrent: [1, 10] + concurrent: [1, 10], }); function main({ encodingType, duration, concurrent, size }) { diff --git a/benchmark/http/bench-parser.js b/benchmark/http/bench-parser.js index e514ce7e754cba..6b8bbd8808c720 100644 --- a/benchmark/http/bench-parser.js +++ b/benchmark/http/bench-parser.js @@ -4,9 +4,9 @@ const common = require('../common'); const bench = common.createBenchmark(main, { len: [4, 8, 16, 32], - n: [1e5] + n: [1e5], }, { - flags: ['--expose-internals', '--no-warnings'] + flags: ['--expose-internals', '--no-warnings'], }); function main({ len, n }) { diff --git a/benchmark/http/check_invalid_header_char.js b/benchmark/http/check_invalid_header_char.js index 245dc6fb8e1e7f..bea295785a8a17 100644 --- a/benchmark/http/check_invalid_header_char.js +++ b/benchmark/http/check_invalid_header_char.js @@ -23,7 +23,7 @@ const groupedInputs = { // Put it here so the benchmark result lines will not be super long. LONG_AND_INVALID: ['Here is a value that is really a folded header ' + - 'value\r\n this should be supported, but it is not currently'] + 'value\r\n this should be supported, but it is not currently'], }; const inputs = [ diff --git a/benchmark/http/chunked.js b/benchmark/http/chunked.js index 9ae7bb7495f29a..9f272c1ff3bc30 100644 --- a/benchmark/http/chunked.js +++ b/benchmark/http/chunked.js @@ -14,7 +14,7 @@ const bench = common.createBenchmark(main, { n: [1, 4, 8, 16], len: [1, 64, 256], c: [100], - duration: 5 + duration: 5, }); function main({ len, n, c, duration }) { @@ -35,7 +35,7 @@ function main({ len, n, c, duration }) { server.listen(common.PORT, () => { bench.http({ connections: c, - duration + duration, }, () => { server.close(); }); diff --git a/benchmark/http/client-request-body.js b/benchmark/http/client-request-body.js index 6e2323b3f07e8a..9a24aa17ce0c65 100644 --- a/benchmark/http/client-request-body.js +++ b/benchmark/http/client-request-body.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { dur: [5], type: ['asc', 'utf', 'buf'], len: [32, 256, 1024], - method: ['write', 'end'] + method: ['write', 'end'], }); function main({ dur, len, type, method }) { @@ -34,7 +34,7 @@ function main({ dur, len, type, method }) { host: '127.0.0.1', port: common.PORT, path: '/', - method: 'POST' + method: 'POST', }; const server = http.createServer((req, res) => { diff --git a/benchmark/http/cluster.js b/benchmark/http/cluster.js index 0d97b516ec506b..ea0d925d8c94c4 100644 --- a/benchmark/http/cluster.js +++ b/benchmark/http/cluster.js @@ -34,7 +34,7 @@ function main({ type, len, c, duration }) { bench.http({ path: path, connections: c, - duration + duration, }, () => { w1.destroy(); w2.destroy(); diff --git a/benchmark/http/create-clientrequest.js b/benchmark/http/create-clientrequest.js index 24d6e020c63bc0..b245b67ebdaae3 100644 --- a/benchmark/http/create-clientrequest.js +++ b/benchmark/http/create-clientrequest.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { // Use 'url' to avoid name clash with other http benchmark url: types.concat(['wpt']), arg: ['URL', 'string', 'options'], - e: [1] + e: [1], }); function noop() {} @@ -25,7 +25,7 @@ function main({ url: type, arg, e }) { switch (arg) { case 'options': { const options = data.map((i) => ({ - path: new URL(i).path, createConnection: noop + path: new URL(i).path, createConnection: noop, })); bench.start(); for (let i = 0; i < len; i++) { diff --git a/benchmark/http/end-vs-write-end.js b/benchmark/http/end-vs-write-end.js index 60174ef3adf4f2..03c1387cd716f9 100644 --- a/benchmark/http/end-vs-write-end.js +++ b/benchmark/http/end-vs-write-end.js @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, { len: [64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024], c: [100], method: ['write', 'end'], - duration: 5 + duration: 5, }); function main({ len, type, method, c, duration }) { @@ -51,7 +51,7 @@ function main({ len, type, method, c, duration }) { server.listen(common.PORT, () => { bench.http({ connections: c, - duration + duration, }, () => { server.close(); }); diff --git a/benchmark/http/headers.js b/benchmark/http/headers.js index a3d2b7810be676..1a7dea2ce4952c 100644 --- a/benchmark/http/headers.js +++ b/benchmark/http/headers.js @@ -6,7 +6,7 @@ const http = require('http'); const bench = common.createBenchmark(main, { n: [10, 600], len: [1, 100], - duration: 5 + duration: 5, }); function main({ len, n, duration }) { @@ -31,7 +31,7 @@ function main({ len, n, duration }) { bench.http({ path: '/', connections: 10, - duration + duration, }, () => { server.close(); }); diff --git a/benchmark/http/http_server_for_chunky_client.js b/benchmark/http/http_server_for_chunky_client.js index dafaf9122efc86..2f13964a7f7dfe 100644 --- a/benchmark/http/http_server_for_chunky_client.js +++ b/benchmark/http/http_server_for_chunky_client.js @@ -15,7 +15,7 @@ tmpdir.refresh(); const server = http.createServer({ maxHeaderSize: 64000 }, (req, res) => { const headers = { 'content-type': 'text/plain', - 'content-length': '2' + 'content-length': '2', }; res.writeHead(200, headers); res.end('ok'); diff --git a/benchmark/http/incoming_headers.js b/benchmark/http/incoming_headers.js index 983bd5632fcb7d..43ce7414a835ce 100644 --- a/benchmark/http/incoming_headers.js +++ b/benchmark/http/incoming_headers.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { connections: [50], // Concurrent connections headers: [20], // Number of header lines to append after the common headers w: [0, 6], // Amount of trailing whitespace - duration: 5 + duration: 5, }); function main({ connections, headers, w, duration }) { @@ -20,7 +20,7 @@ function main({ connections, headers, w, duration }) { 'Accept': 'text/plain', 'User-Agent': 'nodejs-benchmark', 'Date': new Date().toString(), - 'Cache-Control': 'no-cache' + 'Cache-Control': 'no-cache', }; for (let i = 0; i < headers; i++) { // Note: @@ -34,7 +34,7 @@ function main({ connections, headers, w, duration }) { path: '/', connections, headers, - duration + duration, }, () => { server.close(); }); diff --git a/benchmark/http/set-header.js b/benchmark/http/set-header.js index 48e0163a6ced10..47a6d362302733 100644 --- a/benchmark/http/set-header.js +++ b/benchmark/http/set-header.js @@ -4,7 +4,7 @@ const PORT = common.PORT; const bench = common.createBenchmark(main, { res: ['normal', 'setHeader', 'setHeaderWH'], - duration: 5 + duration: 5, }); const type = 'bytes'; @@ -26,7 +26,7 @@ function main({ res, duration }) { bench.http({ path: path, connections: c, - duration + duration, }, () => { server.close(); }); diff --git a/benchmark/http/simple.js b/benchmark/http/simple.js index 095b15ca4465fb..b3f6494f993c86 100644 --- a/benchmark/http/simple.js +++ b/benchmark/http/simple.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { chunks: [1, 4], c: [50, 500], chunkedEnc: [1, 0], - duration: 5 + duration: 5, }); function main({ type, len, chunks, c, chunkedEnc, duration }) { @@ -20,7 +20,7 @@ function main({ type, len, chunks, c, chunkedEnc, duration }) { bench.http({ path, connections: c, - duration + duration, }, () => { server.close(); }); diff --git a/benchmark/http/upgrade.js b/benchmark/http/upgrade.js index 8d365fe46df24e..b01a1a1736b32c 100644 --- a/benchmark/http/upgrade.js +++ b/benchmark/http/upgrade.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const net = require('net'); const bench = common.createBenchmark(main, { - n: [5, 1000] + n: [5, 1000], }); const reqData = 'GET / HTTP/1.1\r\n' + diff --git a/benchmark/http2/compat.js b/benchmark/http2/compat.js index 9ca7ab1ba08ef7..d37bb20c5cddc1 100644 --- a/benchmark/http2/compat.js +++ b/benchmark/http2/compat.js @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, { streams: [1, 10, 20, 40, 100, 200], clients: [2], benchmarker: ['test-double-http2'], - duration: 5 + duration: 5, }, { flags: ['--no-warnings'] }); function main({ requests, streams, clients, duration }) { @@ -32,7 +32,7 @@ function main({ requests, streams, clients, duration }) { maxConcurrentStreams: streams, clients, threads: clients, - duration + duration, }, () => { server.close(); }); }); } diff --git a/benchmark/http2/headers.js b/benchmark/http2/headers.js index 886f64be1c8b7b..ab890dbbf2573f 100644 --- a/benchmark/http2/headers.js +++ b/benchmark/http2/headers.js @@ -4,13 +4,13 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1e3], - nheaders: [0, 10, 100, 1000] + nheaders: [0, 10, 100, 1000], }, { flags: ['--no-warnings'] }); function main({ n, nheaders }) { const http2 = require('http2'); const server = http2.createServer({ - maxHeaderListPairs: 20000 + maxHeaderListPairs: 20000, }); const headersObject = { @@ -20,7 +20,7 @@ function main({ n, nheaders }) { 'accept-language': 'en', 'content-type': 'text/plain', 'referer': 'https://example.org/', - 'user-agent': 'SuperBenchmarker 3000' + 'user-agent': 'SuperBenchmarker 3000', }; for (let i = 0; i < nheaders; i++) { @@ -33,7 +33,7 @@ function main({ n, nheaders }) { }); server.listen(0, () => { const client = http2.connect(`http://localhost:${server.address().port}/`, { - maxHeaderListPairs: 20000 + maxHeaderListPairs: 20000, }); function doRequest(remaining) { diff --git a/benchmark/http2/respond-with-fd.js b/benchmark/http2/respond-with-fd.js index 547b6900b61f48..c365c7cea136b5 100644 --- a/benchmark/http2/respond-with-fd.js +++ b/benchmark/http2/respond-with-fd.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { streams: [1, 10, 20, 40, 100, 200], clients: [2], benchmarker: ['test-double-http2'], - duration: 5 + duration: 5, }, { flags: ['--no-warnings'] }); function main({ requests, streams, clients, duration }) { @@ -33,7 +33,7 @@ function main({ requests, streams, clients, duration }) { maxConcurrentStreams: streams, clients, duration, - threads: clients + threads: clients, }, () => server.close()); }); diff --git a/benchmark/http2/simple.js b/benchmark/http2/simple.js index d9ac513d3c3e68..5ee780ab98c7ec 100644 --- a/benchmark/http2/simple.js +++ b/benchmark/http2/simple.js @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, { streams: [1, 10, 20, 40, 100, 200], clients: [2], benchmarker: ['test-double-http2'], - duration: 5 + duration: 5, }, { flags: ['--no-warnings'] }); function main({ requests, streams, clients, duration }) { @@ -30,7 +30,7 @@ function main({ requests, streams, clients, duration }) { maxConcurrentStreams: streams, clients, duration, - threads: clients + threads: clients, }, () => { server.close(); }); }); } diff --git a/benchmark/http2/write.js b/benchmark/http2/write.js index caf93e2f2b62d5..992e637c405679 100644 --- a/benchmark/http2/write.js +++ b/benchmark/http2/write.js @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, { length: [64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024], size: [100000], benchmarker: ['test-double-http2'], - duration: 5 + duration: 5, }, { flags: ['--no-warnings'] }); function main({ streams, length, size, duration }) { diff --git a/benchmark/https/simple.js b/benchmark/https/simple.js index 243546c346f484..3b4af7caf63192 100644 --- a/benchmark/https/simple.js +++ b/benchmark/https/simple.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { c: [50, 500], chunkedEnc: [1, 0], benchmarker: ['test-double-https'], - duration: 5 + duration: 5, }); function main({ type, len, chunks, c, chunkedEnc, duration }) { @@ -21,7 +21,7 @@ function main({ type, len, chunks, c, chunkedEnc, duration }) { path, connections: c, scheme: 'https', - duration + duration, }, () => { server.close(); }); diff --git a/benchmark/misc/arguments.js b/benchmark/misc/arguments.js index 39f4020b1ad20e..eb63d2e5bdea1a 100644 --- a/benchmark/misc/arguments.js +++ b/benchmark/misc/arguments.js @@ -12,7 +12,7 @@ const methods = [ const bench = createBenchmark(main, { method: methods, - n: [1e6] + n: [1e6], }); function usingRestAndSpread(...args) { diff --git a/benchmark/misc/freelist.js b/benchmark/misc/freelist.js index d03c3674fdbfac..d0d4a033cff6d3 100644 --- a/benchmark/misc/freelist.js +++ b/benchmark/misc/freelist.js @@ -3,9 +3,9 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [100000] + n: [100000], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ n }) { diff --git a/benchmark/misc/getstringwidth.js b/benchmark/misc/getstringwidth.js index 9dd4b47df7182e..3ab563ffc38b8b 100644 --- a/benchmark/misc/getstringwidth.js +++ b/benchmark/misc/getstringwidth.js @@ -4,9 +4,9 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { type: ['ascii', 'mixed', 'emojiseq', 'fullwidth'], - n: [10e4] + n: [10e4], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ n, type }) { @@ -16,7 +16,7 @@ function main({ n, type }) { ascii: 'foobar'.repeat(100), mixed: 'foo'.repeat(100) + '😀' + 'bar'.repeat(100), emojiseq: '👨‍👨‍👧‍👦👨‍👩‍👦‍👦👨‍👩‍👧‍👧👩‍👩‍👧‍👦'.repeat(10), - fullwidth: '你好'.repeat(150) + fullwidth: '你好'.repeat(150), })[type]; bench.start(); diff --git a/benchmark/misc/hidestackframes.js b/benchmark/misc/hidestackframes.js index 5b14f2d95b22e2..b28be725a30969 100644 --- a/benchmark/misc/hidestackframes.js +++ b/benchmark/misc/hidestackframes.js @@ -5,9 +5,9 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { type: ['hide-stackframes-throw', 'direct-call-throw', 'hide-stackframes-noerr', 'direct-call-noerr'], - n: [10e4] + n: [10e4], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ n, type }) { diff --git a/benchmark/misc/object-property-bench.js b/benchmark/misc/object-property-bench.js index 9b33ac9a636889..acdaddca2cdf9e 100644 --- a/benchmark/misc/object-property-bench.js +++ b/benchmark/misc/object-property-bench.js @@ -6,7 +6,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['property', 'string', 'variable', 'symbol'], - n: [1e9] + n: [1e9], }); function runProperty(n) { diff --git a/benchmark/misc/print.js b/benchmark/misc/print.js index e048d22f7b76ab..55afd44c038332 100644 --- a/benchmark/misc/print.js +++ b/benchmark/misc/print.js @@ -4,7 +4,7 @@ const { spawn } = require('child_process'); const bench = common.createBenchmark(main, { dur: [1], - code: ['1', '"string"', 'process.versions', 'process'] + code: ['1', '"string"', 'process.versions', 'process'], }); function spawnProcess(code) { @@ -47,7 +47,7 @@ function start(state, code, bench, getNode) { function main({ dur, code }) { const state = { go: true, - throughput: 0 + throughput: 0, }; setTimeout(() => { diff --git a/benchmark/misc/punycode.js b/benchmark/misc/punycode.js index 9c674b5deefb8c..f424cc21fe6157 100644 --- a/benchmark/misc/punycode.js +++ b/benchmark/misc/punycode.js @@ -33,7 +33,7 @@ const bench = common.createBenchmark(main, { 'איקו״ם.ישראל.museum', '日本.icom.museum', 'الأردن.icom.museum', - ] + ], }); function usingPunycode(val) { diff --git a/benchmark/misc/startup.js b/benchmark/misc/startup.js index dea5a31753f8fe..8248f7d0e4f823 100644 --- a/benchmark/misc/startup.js +++ b/benchmark/misc/startup.js @@ -12,9 +12,9 @@ const bench = common.createBenchmark(main, { 'benchmark/fixtures/require-cachable', 'test/fixtures/semicolon', ], - mode: ['process', 'worker'] + mode: ['process', 'worker'], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function spawnProcess(script) { @@ -61,7 +61,7 @@ function start(state, script, bench, getNode) { function main({ dur, script, mode }) { const state = { go: true, - throughput: 0 + throughput: 0, }; setTimeout(() => { diff --git a/benchmark/misc/trace.js b/benchmark/misc/trace.js index 8620e99329b224..f308232804352a 100644 --- a/benchmark/misc/trace.js +++ b/benchmark/misc/trace.js @@ -4,17 +4,17 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [100000], - method: ['trace', 'isTraceCategoryEnabled'] + method: ['trace', 'isTraceCategoryEnabled'], }, { flags: [ '--expose-internals', '--no-warnings', '--trace-event-categories', 'foo', - ] + ], }); const { - TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN: kBeforeEvent + TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN: kBeforeEvent, } = common.binding('constants').trace; function doTrace(n, trace) { @@ -37,7 +37,7 @@ function doIsTraceCategoryEnabled(n, isTraceCategoryEnabled) { function main({ n, method }) { const { trace, - isTraceCategoryEnabled + isTraceCategoryEnabled, } = common.binding('trace_events'); switch (method) { diff --git a/benchmark/misc/util-extend-vs-object-assign.js b/benchmark/misc/util-extend-vs-object-assign.js index 83aec7b9c82231..e2ac0a5417e489 100644 --- a/benchmark/misc/util-extend-vs-object-assign.js +++ b/benchmark/misc/util-extend-vs-object-assign.js @@ -5,7 +5,7 @@ const util = require('util'); const bench = common.createBenchmark(main, { type: ['extend', 'assign'], - n: [10e4] + n: [10e4], }); function main({ n, type }) { diff --git a/benchmark/module/module-loader-circular.js b/benchmark/module/module-loader-circular.js index 6d392e0e1908db..0d4f1043ced07d 100644 --- a/benchmark/module/module-loader-circular.js +++ b/benchmark/module/module-loader-circular.js @@ -8,7 +8,7 @@ const benchmarkDirectory = path.resolve(tmpdir.path, 'benchmark-module-circular'); const bench = common.createBenchmark(main, { - n: [1e4] + n: [1e4], }); function main({ n }) { diff --git a/benchmark/module/module-loader-deep.js b/benchmark/module/module-loader-deep.js index 5b4f4b907a7ce6..e7fed6debea3fb 100644 --- a/benchmark/module/module-loader-deep.js +++ b/benchmark/module/module-loader-deep.js @@ -9,7 +9,7 @@ const benchmarkDirectory = path.join(tmpdir.path, 'nodejs-benchmark-module'); const bench = common.createBenchmark(main, { ext: ['', '.js'], files: [1e3], - cache: ['true', 'false'] + cache: ['true', 'false'], }); function main({ ext, cache, files }) { diff --git a/benchmark/module/module-loader.js b/benchmark/module/module-loader.js index f31ac8722cb208..c1bef9e66df150 100644 --- a/benchmark/module/module-loader.js +++ b/benchmark/module/module-loader.js @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, { dir: ['rel', 'abs'], files: [5e2], n: [1, 1e3], - cache: ['true', 'false'] + cache: ['true', 'false'], }); function main({ n, name, cache, files, dir }) { diff --git a/benchmark/napi/function_call/index.js b/benchmark/napi/function_call/index.js index 1e1d159c8ad83a..cde4c7ae223945 100644 --- a/benchmark/napi/function_call/index.js +++ b/benchmark/napi/function_call/index.js @@ -38,7 +38,7 @@ assert(js() === cxx()); const bench = common.createBenchmark(main, { type: ['js', 'cxx', 'napi'], - n: [1e6, 1e7, 5e7] + n: [1e6, 1e7, 5e7], }); function main({ n, type }) { diff --git a/benchmark/net/net-c2s.js b/benchmark/net/net-c2s.js index 424c8f6dd072b3..fdb0bb4968c025 100644 --- a/benchmark/net/net-c2s.js +++ b/benchmark/net/net-c2s.js @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, { type: ['utf', 'asc', 'buf'], dur: [5], }, { - test: { len: 1024 } + test: { len: 1024 }, }); let chunk; diff --git a/benchmark/net/net-pipe.js b/benchmark/net/net-pipe.js index 32e1085299a2ce..0b9107357cabb3 100644 --- a/benchmark/net/net-pipe.js +++ b/benchmark/net/net-pipe.js @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, { type: ['utf', 'asc', 'buf'], dur: [5], }, { - test: { len: 1024 } + test: { len: 1024 }, }); let chunk; diff --git a/benchmark/net/net-s2c.js b/benchmark/net/net-s2c.js index 835cc67567bcf2..07c5a8806920b0 100644 --- a/benchmark/net/net-s2c.js +++ b/benchmark/net/net-s2c.js @@ -9,9 +9,9 @@ const bench = common.createBenchmark(main, { type: ['utf', 'asc', 'buf'], recvbuflen: [0, 64 * 1024, 1024 * 1024], recvbufgenfn: ['true', 'false'], - dur: [5] + dur: [5], }, { - test: { sendchunklen: 256 } + test: { sendchunklen: 256 }, }); let chunk; @@ -65,8 +65,8 @@ function main({ dur, sendchunklen, type, recvbuflen, recvbufgenfn }) { buffer, callback: function(nread, buf) { received += nread; - } - } + }, + }, }; } diff --git a/benchmark/net/net-wrap-js-stream-passthrough.js b/benchmark/net/net-wrap-js-stream-passthrough.js index 3824cfb9c0e03c..bae976ad40b0ba 100644 --- a/benchmark/net/net-wrap-js-stream-passthrough.js +++ b/benchmark/net/net-wrap-js-stream-passthrough.js @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, { dur: [5], }, { test: { len: 64 }, - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); let chunk; diff --git a/benchmark/net/tcp-raw-c2s.js b/benchmark/net/tcp-raw-c2s.js index 9547c01f38bc32..edfab797d09967 100644 --- a/benchmark/net/tcp-raw-c2s.js +++ b/benchmark/net/tcp-raw-c2s.js @@ -11,17 +11,17 @@ const util = require('util'); const bench = common.createBenchmark(main, { len: [102400, 1024 * 1024 * 16], type: ['utf', 'asc', 'buf'], - dur: [5] + dur: [5], }, { test: { len: 1024 }, - flags: [ '--expose-internals', '--no-warnings' ] + flags: [ '--expose-internals', '--no-warnings' ], }); function main({ dur, len, type }) { const { TCP, TCPConnectWrap, - constants: TCPConstants + constants: TCPConstants, } = common.binding('tcp_wrap'); const { WriteWrap } = common.binding('stream_wrap'); const PORT = common.PORT; diff --git a/benchmark/net/tcp-raw-pipe.js b/benchmark/net/tcp-raw-pipe.js index e422ff749fd545..15279b32784d8d 100644 --- a/benchmark/net/tcp-raw-pipe.js +++ b/benchmark/net/tcp-raw-pipe.js @@ -11,17 +11,17 @@ const util = require('util'); const bench = common.createBenchmark(main, { len: [102400, 1024 * 1024 * 16], type: ['utf', 'asc', 'buf'], - dur: [5] + dur: [5], }, { test: { len: 1024 }, - flags: [ '--expose-internals', '--no-warnings' ] + flags: [ '--expose-internals', '--no-warnings' ], }); function main({ dur, len, type }) { const { TCP, TCPConnectWrap, - constants: TCPConstants + constants: TCPConstants, } = common.binding('tcp_wrap'); const { WriteWrap } = common.binding('stream_wrap'); const PORT = common.PORT; diff --git a/benchmark/net/tcp-raw-s2c.js b/benchmark/net/tcp-raw-s2c.js index be7279ca0c315c..7818719b7285a8 100644 --- a/benchmark/net/tcp-raw-s2c.js +++ b/benchmark/net/tcp-raw-s2c.js @@ -11,17 +11,17 @@ const util = require('util'); const bench = common.createBenchmark(main, { len: [102400, 1024 * 1024 * 16], type: ['utf', 'asc', 'buf'], - dur: [5] + dur: [5], }, { test: { len: 1024 }, - flags: [ '--expose-internals', '--no-warnings' ] + flags: [ '--expose-internals', '--no-warnings' ], }); function main({ dur, len, type }) { const { TCP, TCPConnectWrap, - constants: TCPConstants + constants: TCPConstants, } = common.binding('tcp_wrap'); const { WriteWrap } = common.binding('stream_wrap'); const PORT = common.PORT; diff --git a/benchmark/os/cpus.js b/benchmark/os/cpus.js index a8aa3ab6cbf46f..5637e786346847 100644 --- a/benchmark/os/cpus.js +++ b/benchmark/os/cpus.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const cpus = require('os').cpus; const bench = common.createBenchmark(main, { - n: [3e4] + n: [3e4], }); function main({ n }) { diff --git a/benchmark/os/loadavg.js b/benchmark/os/loadavg.js index 802e3c99ec0a59..db88c7127aa48e 100644 --- a/benchmark/os/loadavg.js +++ b/benchmark/os/loadavg.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const loadavg = require('os').loadavg; const bench = common.createBenchmark(main, { - n: [5e6] + n: [5e6], }); function main({ n }) { diff --git a/benchmark/os/networkInterfaces.js b/benchmark/os/networkInterfaces.js index 12e956b7f05ddc..114e47508cfed4 100644 --- a/benchmark/os/networkInterfaces.js +++ b/benchmark/os/networkInterfaces.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const networkInterfaces = require('os').networkInterfaces; const bench = common.createBenchmark(main, { - n: [1e4] + n: [1e4], }); function main({ n }) { diff --git a/benchmark/path/basename-posix.js b/benchmark/path/basename-posix.js index 6600068d4c53f6..8478ce8734efdb 100644 --- a/benchmark/path/basename-posix.js +++ b/benchmark/path/basename-posix.js @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, { '/foo/bar/baz/asdf/quux.html', ['/foo/bar/baz/asdf/quux.html', '.html'].join('|'), ], - n: [1e5] + n: [1e5], }); function main({ n, pathext }) { diff --git a/benchmark/path/basename-win32.js b/benchmark/path/basename-win32.js index dc26a134e29252..2d93fde453113f 100644 --- a/benchmark/path/basename-win32.js +++ b/benchmark/path/basename-win32.js @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, { '\\foo\\bar\\baz\\asdf\\quux.html', ['\\foo\\bar\\baz\\asdf\\quux.html', '.html'].join('|'), ], - n: [1e5] + n: [1e5], }); function main({ n, pathext }) { diff --git a/benchmark/path/dirname-posix.js b/benchmark/path/dirname-posix.js index c98753562fbc93..29c374dba987d7 100644 --- a/benchmark/path/dirname-posix.js +++ b/benchmark/path/dirname-posix.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { 'foo/bar', '/foo/bar/baz/asdf/quux', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/dirname-win32.js b/benchmark/path/dirname-win32.js index 9eb5478b3b4d3b..28e6f3564b63ce 100644 --- a/benchmark/path/dirname-win32.js +++ b/benchmark/path/dirname-win32.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { 'foo\\bar', 'D:\\foo\\bar\\baz\\asdf\\quux', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/extname-posix.js b/benchmark/path/extname-posix.js index 0e01d59a745883..b2aae0647f01b9 100644 --- a/benchmark/path/extname-posix.js +++ b/benchmark/path/extname-posix.js @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, { '/foo/bar/baz/asdf/quux', '/foo/bar/baz/asdf/quux.foobarbazasdfquux', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/extname-win32.js b/benchmark/path/extname-win32.js index 6d8437e5c5d819..1a4e6f73c7d341 100644 --- a/benchmark/path/extname-win32.js +++ b/benchmark/path/extname-win32.js @@ -15,7 +15,7 @@ const bench = common.createBenchmark(main, { 'D:\\foo\\bar\\baz\\asdf\\quux', '\\foo\\bar\\baz\\asdf\\quux.foobarbazasdfquux', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/format-posix.js b/benchmark/path/format-posix.js index 7720bbc3b705ed..0076f041e92038 100644 --- a/benchmark/path/format-posix.js +++ b/benchmark/path/format-posix.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { props: [ ['/', '/home/user/dir', 'index.html', '.html', 'index'].join('|'), ], - n: [1e6] + n: [1e6], }); function main({ n, props }) { diff --git a/benchmark/path/format-win32.js b/benchmark/path/format-win32.js index fab7599ab58386..70f7070147c2f2 100644 --- a/benchmark/path/format-win32.js +++ b/benchmark/path/format-win32.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { props: [ ['C:\\', 'C:\\path\\dir', 'index.html', '.html', 'index'].join('|'), ], - n: [1e6] + n: [1e6], }); function main({ n, props }) { diff --git a/benchmark/path/isAbsolute-posix.js b/benchmark/path/isAbsolute-posix.js index 90d06502d1fb02..3c70aacc14d37b 100644 --- a/benchmark/path/isAbsolute-posix.js +++ b/benchmark/path/isAbsolute-posix.js @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, { '/baz/..', 'bar/baz', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/isAbsolute-win32.js b/benchmark/path/isAbsolute-win32.js index 15da64f5e973a3..494f419b7b103e 100644 --- a/benchmark/path/isAbsolute-win32.js +++ b/benchmark/path/isAbsolute-win32.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { 'C:baz\\..', 'bar\\baz', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/join-posix.js b/benchmark/path/join-posix.js index 6619e4dea852db..2e7836650af455 100644 --- a/benchmark/path/join-posix.js +++ b/benchmark/path/join-posix.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { paths: [ ['/foo', 'bar', '', 'baz/asdf', 'quux', '..'].join('|'), ], - n: [1e5] + n: [1e5], }); function main({ n, paths }) { diff --git a/benchmark/path/join-win32.js b/benchmark/path/join-win32.js index 958dee706d499a..3ad1c0c7ba2a61 100644 --- a/benchmark/path/join-win32.js +++ b/benchmark/path/join-win32.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { paths: [ ['C:\\foo', 'bar', '', 'baz\\asdf', 'quux', '..'].join('|'), ], - n: [1e5] + n: [1e5], }); function main({ n, paths }) { diff --git a/benchmark/path/makeLong-win32.js b/benchmark/path/makeLong-win32.js index 864a9cfffe63b9..5ac515cb2aac8d 100644 --- a/benchmark/path/makeLong-win32.js +++ b/benchmark/path/makeLong-win32.js @@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, { '\\\\foo\\bar', '\\\\?\\foo', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/normalize-posix.js b/benchmark/path/normalize-posix.js index e0722097025020..3e90bfc21aec46 100644 --- a/benchmark/path/normalize-posix.js +++ b/benchmark/path/normalize-posix.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { '/foo/bar', '/foo/bar//baz/asdf/quux/..', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/normalize-win32.js b/benchmark/path/normalize-win32.js index 84e16ca3c2d0e9..33af7953ff547d 100644 --- a/benchmark/path/normalize-win32.js +++ b/benchmark/path/normalize-win32.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { 'C:\\foo\\bar', 'C:\\foo\\bar\\\\baz\\asdf\\quux\\..', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/parse-posix.js b/benchmark/path/parse-posix.js index 7fb1d55099f722..550f900da3d782 100644 --- a/benchmark/path/parse-posix.js +++ b/benchmark/path/parse-posix.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { 'foo/bar', '/foo/bar/baz/asdf/.quux', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/parse-win32.js b/benchmark/path/parse-win32.js index ea4bc34a849259..7173d1f8c4f382 100644 --- a/benchmark/path/parse-win32.js +++ b/benchmark/path/parse-win32.js @@ -13,7 +13,7 @@ const bench = common.createBenchmark(main, { 'foo\\bar', '\\foo\\bar\\baz\\asdf\\.quux', ], - n: [1e5] + n: [1e5], }); function main({ n, path }) { diff --git a/benchmark/path/relative-posix.js b/benchmark/path/relative-posix.js index 0285c2c968dcb2..cb8978087c99d6 100644 --- a/benchmark/path/relative-posix.js +++ b/benchmark/path/relative-posix.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { ['/foo/bar/baz/quux', '/foo/bar/baz/quux'].join('|'), ['/foo/bar/baz/quux', '/var/log'].join('|'), ], - n: [1e5] + n: [1e5], }); function main({ n, paths }) { diff --git a/benchmark/path/relative-win32.js b/benchmark/path/relative-win32.js index 401919aa20d802..e513b828533ddb 100644 --- a/benchmark/path/relative-win32.js +++ b/benchmark/path/relative-win32.js @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, { ['C:\\foo\\BAR\\BAZ', 'C:\\foo\\bar\\baz'].join('|'), ['C:\\foo\\bar\\baz\\quux', 'C:\\'].join('|'), ], - n: [1e5] + n: [1e5], }); function main({ n, paths }) { diff --git a/benchmark/path/resolve-posix.js b/benchmark/path/resolve-posix.js index dbae350c62a35f..4881947fe46b6d 100644 --- a/benchmark/path/resolve-posix.js +++ b/benchmark/path/resolve-posix.js @@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, { ['foo/bar', '/tmp/file/', '..', 'a/../subfile'].join('|'), ['a/b/c/', '../../..'].join('|'), ], - n: [1e5] + n: [1e5], }); function main({ n, paths }) { diff --git a/benchmark/path/resolve-win32.js b/benchmark/path/resolve-win32.js index 7def7aa1025d50..822b98c2b86c52 100644 --- a/benchmark/path/resolve-win32.js +++ b/benchmark/path/resolve-win32.js @@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, { ['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'].join('|'), ['c:/blah\\blah', 'd:/games', 'c:../a'].join('|'), ], - n: [1e5] + n: [1e5], }); function main({ n, paths }) { diff --git a/benchmark/perf_hooks/usertiming.js b/benchmark/perf_hooks/usertiming.js index ae797351ad78cc..19ffc20bf675bf 100644 --- a/benchmark/perf_hooks/usertiming.js +++ b/benchmark/perf_hooks/usertiming.js @@ -8,7 +8,7 @@ const { } = require('perf_hooks'); const bench = common.createBenchmark(main, { - n: [1e5] + n: [1e5], }); function test() { diff --git a/benchmark/policy/policy-startup.js b/benchmark/policy/policy-startup.js index 1588123d8007d9..24591a1f299135 100644 --- a/benchmark/policy/policy-startup.js +++ b/benchmark/policy/policy-startup.js @@ -4,11 +4,11 @@ const common = require('../common.js'); const configs = { - n: [1024] + n: [1024], }; const options = { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }; const bench = common.createBenchmark(main, configs, options); @@ -25,7 +25,7 @@ function main(conf) { integrity: `sha256-${hash(`// ./_${i}`, 'sha256')}`, dependencies: Object.fromEntries(Array.from({ // Average 3 deps per 4 modules - length: Math.floor((i % 4) / 2) + length: Math.floor((i % 4) / 2), }, (_, ii) => { return [`_${ii}`, `./_${i - ii}`]; })), diff --git a/benchmark/process/bench-env.js b/benchmark/process/bench-env.js index e96c1d02507214..82d990453753ab 100644 --- a/benchmark/process/bench-env.js +++ b/benchmark/process/bench-env.js @@ -4,7 +4,7 @@ const common = require('../common'); const bench = common.createBenchmark(main, { n: [1e6], - operation: ['get', 'set', 'enumerate', 'query', 'delete'] + operation: ['get', 'set', 'enumerate', 'query', 'delete'], }); diff --git a/benchmark/process/bench-hrtime.js b/benchmark/process/bench-hrtime.js index 2da9035f806cf9..d42359131316a6 100644 --- a/benchmark/process/bench-hrtime.js +++ b/benchmark/process/bench-hrtime.js @@ -5,7 +5,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { n: [1e6], - type: ['raw', 'diff', 'bigint'] + type: ['raw', 'diff', 'bigint'], }); function main({ n, type }) { diff --git a/benchmark/process/coverage.js b/benchmark/process/coverage.js index 3dc0cbe52b4c0d..97c8f057bde62e 100644 --- a/benchmark/process/coverage.js +++ b/benchmark/process/coverage.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1e5] + n: [1e5], }); const path = require('path'); const { rmSync } = require('fs'); @@ -21,8 +21,8 @@ function main({ n }) { env: { NODE_V8_COVERAGE: coverageDir, N: n, - ...process.env - } + ...process.env, + }, }); bench.end(n); rmSync(coverageDir, { recursive: true, force: true }); diff --git a/benchmark/process/memoryUsage.js b/benchmark/process/memoryUsage.js index 1c743d81f1f465..1df73db2ea4f38 100644 --- a/benchmark/process/memoryUsage.js +++ b/benchmark/process/memoryUsage.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1e5] + n: [1e5], }); function main({ n }) { diff --git a/benchmark/process/next-tick-breadth-args.js b/benchmark/process/next-tick-breadth-args.js index bd3b24ddc29fc5..cbd087333c1162 100644 --- a/benchmark/process/next-tick-breadth-args.js +++ b/benchmark/process/next-tick-breadth-args.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1e7] + n: [1e7], }); function main({ n }) { diff --git a/benchmark/process/next-tick-breadth.js b/benchmark/process/next-tick-breadth.js index eb34ea830acfe7..21c5dab4919234 100644 --- a/benchmark/process/next-tick-breadth.js +++ b/benchmark/process/next-tick-breadth.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1e7] + n: [1e7], }); function main({ n }) { diff --git a/benchmark/process/next-tick-depth-args.js b/benchmark/process/next-tick-depth-args.js index 7c6b2346fd5fad..007817dfc26627 100644 --- a/benchmark/process/next-tick-depth-args.js +++ b/benchmark/process/next-tick-depth-args.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [7e6] + n: [7e6], }); function main({ n }) { diff --git a/benchmark/process/next-tick-depth.js b/benchmark/process/next-tick-depth.js index 5b0f817475f9b6..325be9b71cefc4 100644 --- a/benchmark/process/next-tick-depth.js +++ b/benchmark/process/next-tick-depth.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [7e6] + n: [7e6], }); function main({ n }) { diff --git a/benchmark/process/next-tick-exec-args.js b/benchmark/process/next-tick-exec-args.js index 7893e2c70903e5..729f8a063cbb60 100644 --- a/benchmark/process/next-tick-exec-args.js +++ b/benchmark/process/next-tick-exec-args.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [4e6] + n: [4e6], }); function main({ n }) { diff --git a/benchmark/process/next-tick-exec.js b/benchmark/process/next-tick-exec.js index eefe2b7ceb765f..932baaf7e6a995 100644 --- a/benchmark/process/next-tick-exec.js +++ b/benchmark/process/next-tick-exec.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [4e6] + n: [4e6], }); function main({ n }) { diff --git a/benchmark/process/queue-microtask-breadth.js b/benchmark/process/queue-microtask-breadth.js index 610dfc584ef738..c0c30a67b7e6d3 100644 --- a/benchmark/process/queue-microtask-breadth.js +++ b/benchmark/process/queue-microtask-breadth.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [4e5] + n: [4e5], }); function main({ n }) { diff --git a/benchmark/process/queue-microtask-depth.js b/benchmark/process/queue-microtask-depth.js index 407feb1b3270c4..e45c00d2c71a76 100644 --- a/benchmark/process/queue-microtask-depth.js +++ b/benchmark/process/queue-microtask-depth.js @@ -1,7 +1,7 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [12e5] + n: [12e5], }); function main({ n }) { diff --git a/benchmark/process/resourceUsage.js b/benchmark/process/resourceUsage.js index 83871db680b3b7..e035ee2c8d6864 100644 --- a/benchmark/process/resourceUsage.js +++ b/benchmark/process/resourceUsage.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1e5] + n: [1e5], }); function main({ n }) { diff --git a/benchmark/querystring/querystring-stringify.js b/benchmark/querystring/querystring-stringify.js index d1b724fcf2c14d..28b72a68506fd1 100644 --- a/benchmark/querystring/querystring-stringify.js +++ b/benchmark/querystring/querystring-stringify.js @@ -12,22 +12,22 @@ function main({ type, n }) { noencode: { foo: 'bar', baz: 'quux', - xyzzy: 'thud' + xyzzy: 'thud', }, encodemany: { '\u0080\u0083\u0089': 'bar', '\u008C\u008E\u0099': 'quux', - 'xyzzy': '\u00A5q\u00A3r' + 'xyzzy': '\u00A5q\u00A3r', }, encodelast: { foo: 'bar', baz: 'quux', - xyzzy: 'thu\u00AC' + xyzzy: 'thu\u00AC', }, array: { foo: [], baz: ['bar'], - xyzzy: ['bar', 'quux', 'thud'] + xyzzy: ['bar', 'quux', 'thud'], }, multiprimitives: { foo: false, diff --git a/benchmark/streams/creation.js b/benchmark/streams/creation.js index 760ab5c89dca96..0fb0b1ddb696ea 100644 --- a/benchmark/streams/creation.js +++ b/benchmark/streams/creation.js @@ -9,7 +9,7 @@ const { const bench = common.createBenchmark(main, { n: [50e6], - kind: ['duplex', 'readable', 'transform', 'writable'] + kind: ['duplex', 'readable', 'transform', 'writable'], }); function main({ n, kind }) { diff --git a/benchmark/streams/pipe-object-mode.js b/benchmark/streams/pipe-object-mode.js index 33588819f00a6c..f6f0e5a6ba0016 100644 --- a/benchmark/streams/pipe-object-mode.js +++ b/benchmark/streams/pipe-object-mode.js @@ -4,7 +4,7 @@ const common = require('../common'); const { Readable, Writable } = require('stream'); const bench = common.createBenchmark(main, { - n: [5e6] + n: [5e6], }); function main({ n }) { diff --git a/benchmark/streams/pipe.js b/benchmark/streams/pipe.js index 0df1afdbe10134..a19267b4244993 100644 --- a/benchmark/streams/pipe.js +++ b/benchmark/streams/pipe.js @@ -4,7 +4,7 @@ const common = require('../common'); const { Readable, Writable } = require('stream'); const bench = common.createBenchmark(main, { - n: [5e6] + n: [5e6], }); function main({ n }) { diff --git a/benchmark/streams/readable-async-iterator.js b/benchmark/streams/readable-async-iterator.js index 3d06eda7458105..e8e8355444069a 100644 --- a/benchmark/streams/readable-async-iterator.js +++ b/benchmark/streams/readable-async-iterator.js @@ -21,7 +21,7 @@ async function main({ n, sync }) { this.push(1); }); } - } + }, }); bench.start(); diff --git a/benchmark/streams/readable-bigread.js b/benchmark/streams/readable-bigread.js index 1bd1dab4edb07f..0d963c6803299e 100644 --- a/benchmark/streams/readable-bigread.js +++ b/benchmark/streams/readable-bigread.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [1e3] + n: [1e3], }); function main({ n }) { diff --git a/benchmark/streams/readable-bigunevenread.js b/benchmark/streams/readable-bigunevenread.js index 684986a778aba2..f02c464d71cf9a 100644 --- a/benchmark/streams/readable-bigunevenread.js +++ b/benchmark/streams/readable-bigunevenread.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [1e3] + n: [1e3], }); function main({ n }) { diff --git a/benchmark/streams/readable-boundaryread.js b/benchmark/streams/readable-boundaryread.js index edc90d04de161d..5872c62f4aebd1 100644 --- a/benchmark/streams/readable-boundaryread.js +++ b/benchmark/streams/readable-boundaryread.js @@ -5,7 +5,7 @@ const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { n: [200e1], - type: ['string', 'buffer'] + type: ['string', 'buffer'], }); function main({ n, type }) { diff --git a/benchmark/streams/readable-readall.js b/benchmark/streams/readable-readall.js index d14fd7756586e9..b62b1d05b13876 100644 --- a/benchmark/streams/readable-readall.js +++ b/benchmark/streams/readable-readall.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [50e2] + n: [50e2], }); function main({ n }) { diff --git a/benchmark/streams/readable-unevenread.js b/benchmark/streams/readable-unevenread.js index 9da8410131bfff..f12c89617c0a52 100644 --- a/benchmark/streams/readable-unevenread.js +++ b/benchmark/streams/readable-unevenread.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [1e3] + n: [1e3], }); function main({ n }) { diff --git a/benchmark/streams/writable-manywrites.js b/benchmark/streams/writable-manywrites.js index 025a5017ee6446..e6ab65162c366c 100644 --- a/benchmark/streams/writable-manywrites.js +++ b/benchmark/streams/writable-manywrites.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { sync: ['yes', 'no'], writev: ['yes', 'no'], callback: ['yes', 'no'], - len: [1024, 32 * 1024] + len: [1024, 32 * 1024], }); function main({ n, sync, writev, callback, len }) { diff --git a/benchmark/string_decoder/string-decoder-create.js b/benchmark/string_decoder/string-decoder-create.js index 641e562fdeab3d..efd01e8bbe7e61 100644 --- a/benchmark/string_decoder/string-decoder-create.js +++ b/benchmark/string_decoder/string-decoder-create.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { encoding: [ 'ascii', 'utf8', 'utf-8', 'base64', 'ucs2', 'UTF-8', 'AscII', 'UTF-16LE', ], - n: [25e6] + n: [25e6], }); function main({ encoding, n }) { diff --git a/benchmark/string_decoder/string-decoder.js b/benchmark/string_decoder/string-decoder.js index afc0dde62e7937..8acb9c15bfd6f3 100644 --- a/benchmark/string_decoder/string-decoder.js +++ b/benchmark/string_decoder/string-decoder.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { encoding: ['ascii', 'utf8', 'base64-utf8', 'base64-ascii', 'utf16le'], inLen: [32, 128, 1024, 4096], chunkLen: [16, 64, 256, 1024], - n: [25e5] + n: [25e5], }); const UTF8_ALPHA = 'Blåbærsyltetøy'; diff --git a/benchmark/timers/immediate.js b/benchmark/timers/immediate.js index 3bd4c097dce5a0..ccd26b86759c1c 100644 --- a/benchmark/timers/immediate.js +++ b/benchmark/timers/immediate.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [5e6], - type: ['depth', 'depth1', 'breadth', 'breadth1', 'breadth4', 'clear'] + type: ['depth', 'depth1', 'breadth', 'breadth1', 'breadth4', 'clear'], }); function main({ n, type }) { diff --git a/benchmark/timers/set-immediate-breadth-args.js b/benchmark/timers/set-immediate-breadth-args.js index 6d556f9186b7c7..cdfeebe94a07a7 100644 --- a/benchmark/timers/set-immediate-breadth-args.js +++ b/benchmark/timers/set-immediate-breadth-args.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [5e6] + n: [5e6], }); function main({ n }) { diff --git a/benchmark/timers/set-immediate-breadth.js b/benchmark/timers/set-immediate-breadth.js index 87bf9ee2c39479..a39b34acfce40e 100644 --- a/benchmark/timers/set-immediate-breadth.js +++ b/benchmark/timers/set-immediate-breadth.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1e7] + n: [1e7], }); function main({ n }) { diff --git a/benchmark/timers/set-immediate-depth-args.js b/benchmark/timers/set-immediate-depth-args.js index a01a400d5f4bc5..a6563d439afcd1 100644 --- a/benchmark/timers/set-immediate-depth-args.js +++ b/benchmark/timers/set-immediate-depth-args.js @@ -2,7 +2,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [5e6] + n: [5e6], }); function main({ n }) { diff --git a/benchmark/timers/timers-cancel-unpooled.js b/benchmark/timers/timers-cancel-unpooled.js index 70f8fd96c9cbf1..2e627a0367402e 100644 --- a/benchmark/timers/timers-cancel-unpooled.js +++ b/benchmark/timers/timers-cancel-unpooled.js @@ -4,7 +4,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { n: [1e6], - direction: ['start', 'end'] + direction: ['start', 'end'], }); function main({ n, direction }) { diff --git a/benchmark/timers/timers-insert-unpooled.js b/benchmark/timers/timers-insert-unpooled.js index 5ee255b5e15fd2..ece457e38974bd 100644 --- a/benchmark/timers/timers-insert-unpooled.js +++ b/benchmark/timers/timers-insert-unpooled.js @@ -4,7 +4,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { n: [1e6], - direction: ['start', 'end'] + direction: ['start', 'end'], }); function main({ direction, n }) { diff --git a/benchmark/tls/convertprotocols.js b/benchmark/tls/convertprotocols.js index 87c447436a44db..8a8a44facb80f9 100644 --- a/benchmark/tls/convertprotocols.js +++ b/benchmark/tls/convertprotocols.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const tls = require('tls'); const bench = common.createBenchmark(main, { - n: [1, 50000] + n: [1, 50000], }); function main({ n }) { diff --git a/benchmark/tls/secure-pair.js b/benchmark/tls/secure-pair.js index 76658fc3c42ad7..61f493c90f81e8 100644 --- a/benchmark/tls/secure-pair.js +++ b/benchmark/tls/secure-pair.js @@ -3,9 +3,9 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { dur: [5], securing: ['SecurePair', 'TLSSocket', 'clear'], - size: [100, 1024, 1024 * 1024] + size: [100, 1024, 1024 * 1024], }, { - flags: ['--no-warnings'] + flags: ['--no-warnings'], }); const fixtures = require('../../test/common/fixtures'); diff --git a/benchmark/tls/throughput-c2s.js b/benchmark/tls/throughput-c2s.js index f3a96abcbc0174..14611e68f398a4 100644 --- a/benchmark/tls/throughput-c2s.js +++ b/benchmark/tls/throughput-c2s.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { dur: [5], type: ['buf', 'asc', 'utf'], - size: [100, 1024, 1024 * 1024, 4 * 1024 * 1024, 16 * 1024 * 1024] + size: [100, 1024, 1024 * 1024, 4 * 1024 * 1024, 16 * 1024 * 1024], }); const fixtures = require('../../test/common/fixtures'); @@ -33,7 +33,7 @@ function main({ dur, type, size }) { key: fixtures.readKey('rsa_private.pem'), cert: fixtures.readKey('rsa_cert.crt'), ca: fixtures.readKey('rsa_ca.crt'), - ciphers: 'AES256-GCM-SHA384' + ciphers: 'AES256-GCM-SHA384', }; const server = tls.createServer(options, onConnection); diff --git a/benchmark/tls/throughput-s2c.js b/benchmark/tls/throughput-s2c.js index a505a719d30884..ab72c0853aa700 100644 --- a/benchmark/tls/throughput-s2c.js +++ b/benchmark/tls/throughput-s2c.js @@ -5,7 +5,7 @@ const bench = common.createBenchmark(main, { type: ['buf', 'asc', 'utf'], sendchunklen: [256, 32 * 1024, 128 * 1024, 16 * 1024 * 1024], recvbuflen: [0, 64 * 1024, 1024 * 1024], - recvbufgenfn: ['true', 'false'] + recvbufgenfn: ['true', 'false'], }); const fixtures = require('../../test/common/fixtures'); @@ -40,7 +40,7 @@ function main({ dur, type, sendchunklen, recvbuflen, recvbufgenfn }) { key: fixtures.readKey('rsa_private.pem'), cert: fixtures.readKey('rsa_cert.crt'), ca: fixtures.readKey('rsa_ca.crt'), - ciphers: 'AES256-GCM-SHA384' + ciphers: 'AES256-GCM-SHA384', }; let socketOpts; @@ -67,8 +67,8 @@ function main({ dur, type, sendchunklen, recvbuflen, recvbufgenfn }) { buffer, callback: function(nread, buf) { received += nread; - } - } + }, + }, }; } diff --git a/benchmark/tls/tls-connect.js b/benchmark/tls/tls-connect.js index 3fc2ecb614978b..360e90c1942332 100644 --- a/benchmark/tls/tls-connect.js +++ b/benchmark/tls/tls-connect.js @@ -5,7 +5,7 @@ const tls = require('tls'); const common = require('../common.js'); const bench = common.createBenchmark(main, { concurrency: [1, 10], - dur: [5] + dur: [5], }); let clientConn = 0; @@ -21,7 +21,7 @@ function main(conf) { key: fixtures.readKey('rsa_private.pem'), cert: fixtures.readKey('rsa_cert.crt'), ca: fixtures.readKey('rsa_ca.crt'), - ciphers: 'AES256-GCM-SHA384' + ciphers: 'AES256-GCM-SHA384', }; const server = tls.createServer(options, onConnection); @@ -42,7 +42,7 @@ function onConnection(conn) { function makeConnection() { const options = { port: common.PORT, - rejectUnauthorized: false + rejectUnauthorized: false, }; const conn = tls.connect(options, () => { clientConn++; diff --git a/benchmark/url/legacy-vs-whatwg-url-get-prop.js b/benchmark/url/legacy-vs-whatwg-url-get-prop.js index fe0c464f52b3c9..df888f13b98775 100644 --- a/benchmark/url/legacy-vs-whatwg-url-get-prop.js +++ b/benchmark/url/legacy-vs-whatwg-url-get-prop.js @@ -7,7 +7,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { type: common.urlDataTypes, method: ['legacy', 'whatwg'], - e: [1] + e: [1], }); function useLegacy(data) { @@ -20,7 +20,7 @@ function useLegacy(data) { port: obj.port, pathname: obj.pathname, search: obj.search, - hash: obj.hash + hash: obj.hash, }; const len = data.length; // It's necessary to assign the values to an object @@ -51,7 +51,7 @@ function useWHATWG(data) { port: obj.port, pathname: obj.pathname, search: obj.search, - hash: obj.hash + hash: obj.hash, }; const len = data.length; bench.start(); diff --git a/benchmark/url/legacy-vs-whatwg-url-parse.js b/benchmark/url/legacy-vs-whatwg-url-parse.js index 94115d1305bb95..a54d81e15fd6ed 100644 --- a/benchmark/url/legacy-vs-whatwg-url-parse.js +++ b/benchmark/url/legacy-vs-whatwg-url-parse.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { withBase: ['true', 'false'], type: common.urlDataTypes, e: [1], - method: ['legacy', 'whatwg'] + method: ['legacy', 'whatwg'], }); function useLegacy(data) { diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js index fc21ea7c85d14b..fb2ce8ffa770d3 100644 --- a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js +++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js @@ -6,7 +6,7 @@ const searchParams = common.searchParams; const bench = common.createBenchmark(main, { searchParam: Object.keys(searchParams), method: ['legacy', 'whatwg'], - n: [1e6] + n: [1e6], }); function useLegacy(n, input) { diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js index b9c2861719bc0f..171a8838a31ff6 100644 --- a/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js +++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js @@ -6,7 +6,7 @@ const searchParams = common.searchParams; const bench = common.createBenchmark(main, { searchParam: Object.keys(searchParams), method: ['legacy', 'whatwg'], - n: [1e6] + n: [1e6], }); function useLegacy(n, input, prop) { diff --git a/benchmark/url/legacy-vs-whatwg-url-serialize.js b/benchmark/url/legacy-vs-whatwg-url-serialize.js index e3254ede3acee8..b36cde12b70847 100644 --- a/benchmark/url/legacy-vs-whatwg-url-serialize.js +++ b/benchmark/url/legacy-vs-whatwg-url-serialize.js @@ -7,7 +7,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { type: common.urlDataTypes, method: ['legacy', 'whatwg'], - e: [1] + e: [1], }); function useLegacy(data) { diff --git a/benchmark/url/url-format.js b/benchmark/url/url-format.js index be5632d2b67367..d5cda90f72a2ea 100644 --- a/benchmark/url/url-format.js +++ b/benchmark/url/url-format.js @@ -9,7 +9,7 @@ const inputs = { const bench = common.createBenchmark(main, { type: Object.keys(inputs), - n: [25e6] + n: [25e6], }); function main({ type, n }) { diff --git a/benchmark/url/url-parse.js b/benchmark/url/url-parse.js index b3e83188b2192f..163dd790f8142b 100644 --- a/benchmark/url/url-parse.js +++ b/benchmark/url/url-parse.js @@ -4,12 +4,12 @@ const url = require('url'); const inputs = { normal: 'http://foo.com/bar', - escaped: 'https://foo.bar/{}^`/abcd' + escaped: 'https://foo.bar/{}^`/abcd', }; const bench = common.createBenchmark(main, { type: Object.keys(inputs), - n: [1e7] + n: [1e7], }); function main({ type, n }) { diff --git a/benchmark/url/url-resolve.js b/benchmark/url/url-resolve.js index 9f6e958a00bba0..9f33dea70e70d6 100644 --- a/benchmark/url/url-resolve.js +++ b/benchmark/url/url-resolve.js @@ -9,13 +9,13 @@ const paths = { 'sibling': '../foo/bar?baz=boom', 'foo/bar': 'foo/bar', 'withscheme': 'http://nodejs.org', - 'down': './foo/bar?baz' + 'down': './foo/bar?baz', }; const bench = common.createBenchmark(main, { href: Object.keys(hrefs), path: Object.keys(paths), - n: [1e5] + n: [1e5], }); function main({ n, href, path }) { diff --git a/benchmark/url/url-searchparams-iteration.js b/benchmark/url/url-searchparams-iteration.js index ce530c5227fab3..89f78fb16841a4 100644 --- a/benchmark/url/url-searchparams-iteration.js +++ b/benchmark/url/url-searchparams-iteration.js @@ -4,7 +4,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { loopMethod: ['forEach', 'iterator'], - n: [1e6] + n: [1e6], }); const str = 'one=single&two=first&three=first&two=2nd&three=2nd&three=3rd'; diff --git a/benchmark/url/url-searchparams-read.js b/benchmark/url/url-searchparams-read.js index e1cb39fbe71cd8..26d3a0223be852 100644 --- a/benchmark/url/url-searchparams-read.js +++ b/benchmark/url/url-searchparams-read.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { accessMethod: ['get', 'getAll', 'has'], param: ['one', 'two', 'three', 'nonexistent'], - n: [2e7] + n: [2e7], }); const str = 'one=single&two=first&three=first&two=2nd&three=2nd&three=3rd'; diff --git a/benchmark/url/url-searchparams-sort.js b/benchmark/url/url-searchparams-sort.js index a1873fd612f873..fcd55cd397950f 100644 --- a/benchmark/url/url-searchparams-sort.js +++ b/benchmark/url/url-searchparams-sort.js @@ -13,7 +13,7 @@ const inputs = { // 88 parameters long: 'g&r&t&h&s&r&d&w&b&n&h&k&x&m&k&h&o&e&x&c&c&g&e&b&p&p&s&n&j&b&y&z&' + 'u&l&o&r&w&a&u&l&m&f&j&q&p&f&e&y&e&n&e&l&m&w&u&w&t&n&t&q&v&y&c&o&' + - 'k&f&j&i&l&m&g&j&d&i&z&q&p&x&q&q&d&n&y&w&g&i&v&r' + 'k&f&j&i&l&m&g&j&d&i&z&q&p&x&q&q&d&n&y&w&g&i&v&r', }; function getParams(str) { @@ -26,9 +26,9 @@ function getParams(str) { const bench = common.createBenchmark(main, { type: Object.keys(inputs), - n: [1e6] + n: [1e6], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ type, n }) { diff --git a/benchmark/url/usvstring.js b/benchmark/url/usvstring.js index 37141ff5512249..93a50846fb999f 100644 --- a/benchmark/url/usvstring.js +++ b/benchmark/url/usvstring.js @@ -7,13 +7,13 @@ const inputs = { '\ud800\udfff', someinvalid: 'asasfdfasd\uda23', allinvalid: '\udc45\uda23 \udf00\udc00 \udfaa\uda12 \udc00\udfaa', - nonstring: { toString() { return 'asdf'; } } + nonstring: { toString() { return 'asdf'; } }, }; const bench = common.createBenchmark(main, { input: Object.keys(inputs), - n: [5e7] + n: [5e7], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ input, n }) { diff --git a/benchmark/url/whatwg-url-idna.js b/benchmark/url/whatwg-url-idna.js index 853a19776df5d2..0f4139fc02bb2f 100644 --- a/benchmark/url/whatwg-url-idna.js +++ b/benchmark/url/whatwg-url-idna.js @@ -5,30 +5,30 @@ const { domainToASCII, domainToUnicode } = require('url'); const domains = { empty: { ascii: '', - unicode: '' + unicode: '', }, none: { ascii: 'passports', - unicode: 'passports' + unicode: 'passports', }, some: { ascii: 'Paßstraße', - unicode: 'xn--Pastrae-1vae' + unicode: 'xn--Pastrae-1vae', }, all: { ascii: '他们不说中文', - unicode: 'xn--ihqwczyycu19kkg2c' + unicode: 'xn--ihqwczyycu19kkg2c', }, nonstring: { ascii: { toString() { return ''; } }, - unicode: { toString() { return ''; } } - } + unicode: { toString() { return ''; } }, + }, }; const bench = common.createBenchmark(main, { domain: Object.keys(domains), to: ['ascii', 'unicode'], - n: [5e6] + n: [5e6], }); function main({ n, to, domain }) { diff --git a/benchmark/url/whatwg-url-properties.js b/benchmark/url/whatwg-url-properties.js index f0ba2931e51f1e..0c1bc225ba1985 100644 --- a/benchmark/url/whatwg-url-properties.js +++ b/benchmark/url/whatwg-url-properties.js @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, { e: [1], prop: ['href', 'origin', 'protocol', 'username', 'password', 'host', 'hostname', 'port', - 'pathname', 'search', 'searchParams', 'hash'] + 'pathname', 'search', 'searchParams', 'hash'], }); function setAndGet(data, prop) { diff --git a/benchmark/util/format.js b/benchmark/util/format.js index f7a6caa81c96b6..4078fe5e3da7cd 100644 --- a/benchmark/util/format.js +++ b/benchmark/util/format.js @@ -19,7 +19,7 @@ const inputs = { const bench = common.createBenchmark(main, { n: [1e5], - type: Object.keys(inputs) + type: Object.keys(inputs), }); function main({ n, type }) { diff --git a/benchmark/util/inspect-array.js b/benchmark/util/inspect-array.js index 958030d99bd192..7b2394d80e9cfe 100644 --- a/benchmark/util/inspect-array.js +++ b/benchmark/util/inspect-array.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { 'sparseArray', 'mixedArray', 'denseArray_showHidden', - ] + ], }); function main({ n, len, type }) { diff --git a/benchmark/util/inspect-proxy.js b/benchmark/util/inspect-proxy.js index 02379cdc770f3b..23cac3282f0916 100644 --- a/benchmark/util/inspect-proxy.js +++ b/benchmark/util/inspect-proxy.js @@ -6,7 +6,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1e5], showProxy: [0, 1], - isProxy: [0, 1] + isProxy: [0, 1], }); function main({ n, showProxy, isProxy }) { diff --git a/benchmark/util/inspect.js b/benchmark/util/inspect.js index 0a19e65ea234be..ace4e588ae5135 100644 --- a/benchmark/util/inspect.js +++ b/benchmark/util/inspect.js @@ -6,7 +6,7 @@ const common = require('../common.js'); const opts = { showHidden: { showHidden: true }, colors: { colors: true }, - none: undefined + none: undefined, }; const bench = common.createBenchmark(main, { n: [2e4], @@ -25,7 +25,7 @@ const bench = common.createBenchmark(main, { 'TypedArray_extra', 'Number', ], - option: Object.keys(opts) + option: Object.keys(opts), }); function benchmark(n, obj, options) { diff --git a/benchmark/util/normalize-encoding.js b/benchmark/util/normalize-encoding.js index 03769cb3b229cb..cd65caca4a4056 100644 --- a/benchmark/util/normalize-encoding.js +++ b/benchmark/util/normalize-encoding.js @@ -9,7 +9,7 @@ const groupedInputs = { group_upper: ['UTF-8', 'UTF8', 'UCS2', 'UTF16LE', 'BASE64', 'UCS2'], group_uncommon: ['foo'], - group_misc: ['', 'utf16le', 'hex', 'HEX', 'BINARY'] + group_misc: ['', 'utf16le', 'hex', 'HEX', 'BINARY'], }; const inputs = [ @@ -21,9 +21,9 @@ const inputs = [ const bench = common.createBenchmark(main, { input: inputs.concat(Object.keys(groupedInputs)), - n: [1e5] + n: [1e5], }, { - flags: '--expose-internals' + flags: '--expose-internals', }); function getInput(input) { diff --git a/benchmark/util/priority-queue.js b/benchmark/util/priority-queue.js index ea4601a0021b9a..2301c5a1ef6892 100644 --- a/benchmark/util/priority-queue.js +++ b/benchmark/util/priority-queue.js @@ -3,7 +3,7 @@ const common = require('../common'); const bench = common.createBenchmark(main, { - n: [1e5] + n: [1e5], }, { flags: ['--expose-internals'] }); function main({ n, type }) { diff --git a/benchmark/util/type-check.js b/benchmark/util/type-check.js index 792f61cf6fb217..2bb956f4ed87ee 100644 --- a/benchmark/util/type-check.js +++ b/benchmark/util/type-check.js @@ -11,27 +11,27 @@ const args = { ArrayBufferView: { 'true': dataView, 'false-primitive': true, - 'false-object': arrayBuffer + 'false-object': arrayBuffer, }, TypedArray: { 'true': int32Array, 'false-primitive': true, - 'false-object': arrayBuffer + 'false-object': arrayBuffer, }, Uint8Array: { 'true': uint8Array, 'false-primitive': true, - 'false-object': int32Array - } + 'false-object': int32Array, + }, }; const bench = common.createBenchmark(main, { type: Object.keys(args), version: ['native', 'js'], argument: ['true', 'false-primitive', 'false-object'], - n: [1e5] + n: [1e5], }, { - flags: ['--expose-internals', '--no-warnings'] + flags: ['--expose-internals', '--no-warnings'], }); function main({ type, argument, version, n }) { diff --git a/benchmark/v8/get-stats.js b/benchmark/v8/get-stats.js index d5ce102774df6e..21c6efb2f8588d 100644 --- a/benchmark/v8/get-stats.js +++ b/benchmark/v8/get-stats.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { 'getHeapStatistics', 'getHeapSpaceStatistics', ], - n: [1e6] + n: [1e6], }); function main({ method, n }) { diff --git a/benchmark/vm/create-context.js b/benchmark/vm/create-context.js index d74cafe6a0a7b0..d9e948f2c9c2e0 100644 --- a/benchmark/vm/create-context.js +++ b/benchmark/vm/create-context.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [100] + n: [100], }); const vm = require('vm'); diff --git a/benchmark/vm/run-in-context.js b/benchmark/vm/run-in-context.js index 980a08e7e56e8c..1234c5609832e7 100644 --- a/benchmark/vm/run-in-context.js +++ b/benchmark/vm/run-in-context.js @@ -5,7 +5,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1], breakOnSigint: [0, 1], - withSigintListener: [0, 1] + withSigintListener: [0, 1], }); const vm = require('vm'); diff --git a/benchmark/vm/run-in-this-context.js b/benchmark/vm/run-in-this-context.js index c612c1ea49ecf6..517812ecfc95e6 100644 --- a/benchmark/vm/run-in-this-context.js +++ b/benchmark/vm/run-in-this-context.js @@ -5,7 +5,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1], breakOnSigint: [0, 1], - withSigintListener: [0, 1] + withSigintListener: [0, 1], }); const vm = require('vm'); diff --git a/benchmark/worker/atomics-wait.js b/benchmark/worker/atomics-wait.js index a771b1813731ed..7270f9f01c98ec 100644 --- a/benchmark/worker/atomics-wait.js +++ b/benchmark/worker/atomics-wait.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - n: [1e7] + n: [1e7], }); function main({ n }) { diff --git a/benchmark/worker/echo.js b/benchmark/worker/echo.js index 7988ffc7e121eb..face91b2b35d23 100644 --- a/benchmark/worker/echo.js +++ b/benchmark/worker/echo.js @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, { workers: [1], payload: ['string', 'object'], sendsPerBroadcast: [1, 10], - n: [1e5] + n: [1e5], }); const workerPath = path.resolve(__dirname, '..', 'fixtures', 'echo.worker.js'); diff --git a/benchmark/worker/messageport.js b/benchmark/worker/messageport.js index 2f0d6f0621e8c8..d689c0d18d3bae 100644 --- a/benchmark/worker/messageport.js +++ b/benchmark/worker/messageport.js @@ -5,7 +5,7 @@ const { MessageChannel } = require('worker_threads'); const bench = common.createBenchmark(main, { payload: ['string', 'object'], style: ['eventtarget', 'eventemitter'], - n: [1e6] + n: [1e6], }); function main(conf) { diff --git a/benchmark/zlib/createInflate.js b/benchmark/zlib/createInflate.js index 30ccaef7a14fb2..a7aa6882cf432a 100644 --- a/benchmark/zlib/createInflate.js +++ b/benchmark/zlib/createInflate.js @@ -5,7 +5,7 @@ const zlib = require('zlib'); const bench = common.createBenchmark(main, { inputLen: [16 * 1024 * 1024], chunkLen: [1024], - n: [1e2] + n: [1e2], }); function main({ n, inputLen, chunkLen }) { diff --git a/benchmark/zlib/creation.js b/benchmark/zlib/creation.js index c2d063c20d8d02..90b22780d2d312 100644 --- a/benchmark/zlib/creation.js +++ b/benchmark/zlib/creation.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { 'BrotliCompress', 'BrotliDecompress', ], options: ['true', 'false'], - n: [5e5] + n: [5e5], }); function main({ n, type, options }) { diff --git a/benchmark/zlib/deflate.js b/benchmark/zlib/deflate.js index 5baedc924d4bc8..ab9ff333224a0e 100644 --- a/benchmark/zlib/deflate.js +++ b/benchmark/zlib/deflate.js @@ -5,7 +5,7 @@ const zlib = require('zlib'); const bench = common.createBenchmark(main, { method: ['createDeflate', 'deflate', 'deflateSync'], inputLen: [1024], - n: [4e5] + n: [4e5], }); function main({ n, method, inputLen }) { diff --git a/benchmark/zlib/inflate.js b/benchmark/zlib/inflate.js index 09379c00c1250b..2fd13862477705 100644 --- a/benchmark/zlib/inflate.js +++ b/benchmark/zlib/inflate.js @@ -5,7 +5,7 @@ const zlib = require('zlib'); const bench = common.createBenchmark(main, { method: ['inflate', 'inflateSync'], inputLen: [1024], - n: [4e5] + n: [4e5], }); function main({ n, method, inputLen }) { diff --git a/benchmark/zlib/pipe.js b/benchmark/zlib/pipe.js index 76b0ddc6c65a25..a9c86e3de660a9 100644 --- a/benchmark/zlib/pipe.js +++ b/benchmark/zlib/pipe.js @@ -7,12 +7,12 @@ const bench = common.createBenchmark(main, { inputLen: [1024], duration: [5], type: ['string', 'buffer'], - algorithm: ['gzip', 'brotli'] + algorithm: ['gzip', 'brotli'], }, { test: { inputLen: 1024, - duration: 0.2 - } + duration: 0.2, + }, }); function main({ inputLen, duration, type, algorithm }) { diff --git a/doc/api/assert.md b/doc/api/assert.md index 7eb952ace7be71..aff7f54d58b60b 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -172,7 +172,7 @@ import assert from 'assert'; const { message } = new assert.AssertionError({ actual: 1, expected: 2, - operator: 'strictEqual' + operator: 'strictEqual', }); // Verify error output: @@ -197,7 +197,7 @@ const assert = require('assert'); const { message } = new assert.AssertionError({ actual: 1, expected: 2, - operator: 'strictEqual' + operator: 'strictEqual', }); // Verify error output: @@ -554,18 +554,18 @@ import assert from 'assert'; const obj1 = { a: { - b: 1 - } + b: 1, + }, }; const obj2 = { a: { - b: 2 - } + b: 2, + }, }; const obj3 = { a: { - b: 1 - } + b: 1, + }, }; const obj4 = Object.create(obj1); @@ -589,18 +589,18 @@ const assert = require('assert'); const obj1 = { a: { - b: 1 - } + b: 1, + }, }; const obj2 = { a: { - b: 2 - } + b: 2, + }, }; const obj3 = { a: { - b: 1 - } + b: 1, + }, }; const obj4 = Object.create(obj1); @@ -1504,18 +1504,18 @@ import assert from 'assert'; const obj1 = { a: { - b: 1 - } + b: 1, + }, }; const obj2 = { a: { - b: 2 - } + b: 2, + }, }; const obj3 = { a: { - b: 1 - } + b: 1, + }, }; const obj4 = Object.create(obj1); @@ -1537,18 +1537,18 @@ const assert = require('assert'); const obj1 = { a: { - b: 1 - } + b: 1, + }, }; const obj2 = { a: { - b: 2 - } + b: 2, + }, }; const obj3 = { a: { - b: 1 - } + b: 1, + }, }; const obj4 = Object.create(obj1); @@ -1900,7 +1900,7 @@ await assert.rejects( }, { name: 'TypeError', - message: 'Wrong value' + message: 'Wrong value', } ); ``` @@ -1915,7 +1915,7 @@ const assert = require('assert/strict'); }, { name: 'TypeError', - message: 'Wrong value' + message: 'Wrong value', } ); })(); @@ -2102,7 +2102,7 @@ err.code = 404; err.foo = 'bar'; err.info = { nested: true, - baz: 'text' + baz: 'text', }; err.reg = /abc/i; @@ -2115,8 +2115,8 @@ assert.throws( message: 'Wrong value', info: { nested: true, - baz: 'text' - } + baz: 'text', + }, // Only properties on the validation object will be tested for. // Using nested objects requires all properties to be present. Otherwise // the validation is going to fail. @@ -2138,12 +2138,12 @@ throws( info: { nested: true, // It is not possible to use regular expressions for nested properties! - baz: 'text' + baz: 'text', }, // The `reg` property contains a regular expression and only if the // validation object contains an identical regular expression, it is going // to pass. - reg: /abc/i + reg: /abc/i, } ); @@ -2171,7 +2171,7 @@ err.code = 404; err.foo = 'bar'; err.info = { nested: true, - baz: 'text' + baz: 'text', }; err.reg = /abc/i; @@ -2184,8 +2184,8 @@ assert.throws( message: 'Wrong value', info: { nested: true, - baz: 'text' - } + baz: 'text', + }, // Only properties on the validation object will be tested for. // Using nested objects requires all properties to be present. Otherwise // the validation is going to fail. @@ -2207,12 +2207,12 @@ throws( info: { nested: true, // It is not possible to use regular expressions for nested properties! - baz: 'text' + baz: 'text', }, // The `reg` property contains a regular expression and only if the // validation object contains an identical regular expression, it is going // to pass. - reg: /abc/i + reg: /abc/i, } ); diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 55cc0542561334..af0d159e6a5e08 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -107,7 +107,7 @@ const async_hooks = require('async_hooks'); const asyncHook = async_hooks.createHook({ init(asyncId, type, triggerAsyncId, resource) { }, - destroy(asyncId) { } + destroy(asyncId) { }, }); ``` @@ -279,7 +279,7 @@ async_hooks.createHook({ fs.writeSync( fd, `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`); - } + }, }).enable(); net.createServer((conn) => {}).listen(8080); @@ -524,7 +524,7 @@ const { createServer } = require('http'); const { executionAsyncId, executionAsyncResource, - createHook + createHook, } = require('async_hooks'); const sym = Symbol('state'); // Private symbol to avoid pollution @@ -534,7 +534,7 @@ createHook({ if (cr) { resource[sym] = cr[sym]; } - } + }, }).enable(); const server = createServer((req, res) => { diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 2ac6f1c35c41b3..e65f27acbcd4ab 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -562,7 +562,7 @@ A third argument may be used to specify additional options, with these defaults: ```js const defaults = { cwd: undefined, - env: process.env + env: process.env, }; ``` @@ -704,7 +704,7 @@ const { spawn } = require('child_process'); const subprocess = spawn(process.argv[0], ['child_program.js'], { detached: true, - stdio: 'ignore' + stdio: 'ignore', }); subprocess.unref(); @@ -720,7 +720,7 @@ const err = fs.openSync('./out.log', 'a'); const subprocess = spawn('prg', [], { detached: true, - stdio: [ 'ignore', out, err ] + stdio: [ 'ignore', out, err ], }); subprocess.unref(); @@ -1308,7 +1308,7 @@ const subprocess = spawn( console.log(process.pid, 'is alive') }, 500);"`, ], { - stdio: ['inherit', 'inherit', 'inherit'] + stdio: ['inherit', 'inherit', 'inherit'], } ); @@ -1362,7 +1362,7 @@ const { spawn } = require('child_process'); const subprocess = spawn(process.argv[0], ['child_program.js'], { detached: true, - stdio: 'ignore' + stdio: 'ignore', }); subprocess.unref(); @@ -1642,7 +1642,7 @@ const subprocess = child_process.spawn('ls', { 0, // Use parent's stdin for child. 'pipe', // Pipe child's stdout to parent. fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - ] + ], }); assert.strictEqual(subprocess.stdio[0], null); @@ -1703,7 +1703,7 @@ const { spawn } = require('child_process'); const subprocess = spawn(process.argv[0], ['child_program.js'], { detached: true, - stdio: 'ignore' + stdio: 'ignore', }); subprocess.unref(); diff --git a/doc/api/cluster.md b/doc/api/cluster.md index d12c1f12d256d8..78ee1ea1e523c0 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -822,12 +822,12 @@ const cluster = require('cluster'); cluster.setupPrimary({ exec: 'worker.js', args: ['--use', 'https'], - silent: true + silent: true, }); cluster.fork(); // https worker cluster.setupPrimary({ exec: 'worker.js', - args: ['--use', 'http'] + args: ['--use', 'http'], }); cluster.fork(); // http worker ``` diff --git a/doc/api/crypto.md b/doc/api/crypto.md index e9a2be8f26ef90..59ce83145b39f6 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -308,7 +308,7 @@ Example: Using `Cipher` objects as streams: const { scrypt, randomFill, - createCipheriv + createCipheriv, } = await import('crypto'); const algorithm = 'aes-192-cbc'; @@ -341,7 +341,7 @@ scrypt(password, 'salt', 24, (err, key) => { const { scrypt, randomFill, - createCipheriv + createCipheriv, } = require('crypto'); const algorithm = 'aes-192-cbc'; @@ -379,7 +379,7 @@ import { } from 'fs'; import { - pipeline + pipeline, } from 'stream'; const { @@ -418,7 +418,7 @@ const { } = require('fs'); const { - pipeline + pipeline, } = require('stream'); const { @@ -1875,7 +1875,7 @@ const { const key = await subtle.generateKey({ name: 'HMAC', hash: 'SHA-256', - length: 256 + length: 256, }, true, ['sign', 'verify']); const keyObject = KeyObject.from(key); @@ -1895,7 +1895,7 @@ const { const key = await subtle.generateKey({ name: 'HMAC', hash: 'SHA-256', - length: 256 + length: 256, }, true, ['sign', 'verify']); const keyObject = KeyObject.from(key); @@ -2064,7 +2064,7 @@ const { } = await import('crypto'); const { privateKey, publicKey } = generateKeyPairSync('ec', { - namedCurve: 'sect239k1' + namedCurve: 'sect239k1', }); const sign = createSign('SHA256'); @@ -2087,7 +2087,7 @@ const { } = require('crypto'); const { privateKey, publicKey } = generateKeyPairSync('ec', { - namedCurve: 'sect239k1' + namedCurve: 'sect239k1', }); const sign = createSign('SHA256'); @@ -3026,7 +3026,7 @@ Example: generating the sha256 sum of a file ```mjs import { - createReadStream + createReadStream, } from 'fs'; const { @@ -3112,7 +3112,7 @@ Example: generating the sha256 HMAC of a file ```mjs import { - createReadStream + createReadStream, } from 'fs'; const { @@ -3417,14 +3417,14 @@ generateKeyPair('rsa', { modulusLength: 4096, publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: 'aes-256-cbc', - passphrase: 'top secret' - } + passphrase: 'top secret', + }, }, (err, publicKey, privateKey) => { // Handle errors and use the generated key pair. }); @@ -3439,14 +3439,14 @@ generateKeyPair('rsa', { modulusLength: 4096, publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: 'aes-256-cbc', - passphrase: 'top secret' - } + passphrase: 'top secret', + }, }, (err, publicKey, privateKey) => { // Handle errors and use the generated key pair. }); @@ -3517,14 +3517,14 @@ const { modulusLength: 4096, publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: 'aes-256-cbc', - passphrase: 'top secret' - } + passphrase: 'top secret', + }, }); ``` @@ -3540,14 +3540,14 @@ const { modulusLength: 4096, publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: 'aes-256-cbc', - passphrase: 'top secret' - } + passphrase: 'top secret', + }, }); ``` @@ -5226,11 +5226,11 @@ const nonce = randomBytes(12); const aad = Buffer.from('0123456789', 'hex'); const cipher = createCipheriv('aes-192-ccm', key, nonce, { - authTagLength: 16 + authTagLength: 16, }); const plaintext = 'Hello world'; cipher.setAAD(aad, { - plaintextLength: Buffer.byteLength(plaintext) + plaintextLength: Buffer.byteLength(plaintext), }); const ciphertext = cipher.update(plaintext, 'utf8'); cipher.final(); @@ -5239,11 +5239,11 @@ const tag = cipher.getAuthTag(); // Now transmit { ciphertext, nonce, tag }. const decipher = createDecipheriv('aes-192-ccm', key, nonce, { - authTagLength: 16 + authTagLength: 16, }); decipher.setAuthTag(tag); decipher.setAAD(aad, { - plaintextLength: ciphertext.length + plaintextLength: ciphertext.length, }); const receivedPlaintext = decipher.update(ciphertext, null, 'utf8'); @@ -5270,11 +5270,11 @@ const nonce = randomBytes(12); const aad = Buffer.from('0123456789', 'hex'); const cipher = createCipheriv('aes-192-ccm', key, nonce, { - authTagLength: 16 + authTagLength: 16, }); const plaintext = 'Hello world'; cipher.setAAD(aad, { - plaintextLength: Buffer.byteLength(plaintext) + plaintextLength: Buffer.byteLength(plaintext), }); const ciphertext = cipher.update(plaintext, 'utf8'); cipher.final(); @@ -5283,11 +5283,11 @@ const tag = cipher.getAuthTag(); // Now transmit { ciphertext, nonce, tag }. const decipher = createDecipheriv('aes-192-ccm', key, nonce, { - authTagLength: 16 + authTagLength: 16, }); decipher.setAuthTag(tag); decipher.setAAD(aad, { - plaintextLength: ciphertext.length + plaintextLength: ciphertext.length, }); const receivedPlaintext = decipher.update(ciphertext, null, 'utf8'); diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 8813f9bffaf384..663a2343d275fc 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -276,7 +276,7 @@ An example socket listening on an exclusive port is shown below. socket.bind({ address: 'localhost', port: 8000, - exclusive: true + exclusive: true, }); ``` diff --git a/doc/api/diagnostics_channel.md b/doc/api/diagnostics_channel.md index 7a22b2f56eec1d..b5a5cc95112267 100644 --- a/doc/api/diagnostics_channel.md +++ b/doc/api/diagnostics_channel.md @@ -48,7 +48,7 @@ channel.subscribe((message, name) => { if (channel.hasSubscribers) { // Publish data to the channel channel.publish({ - some: 'data' + some: 'data', }); } ``` @@ -130,7 +130,7 @@ const diagnostics_channel = require('diagnostics_channel'); const channel = diagnostics_channel.channel('my-channel'); channel.publish({ - some: 'message' + some: 'message', }); ``` diff --git a/doc/api/esm.md b/doc/api/esm.md index 32168c29dd0faf..2528188d0e35aa 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -852,11 +852,11 @@ export function resolve(specifier, context, defaultResolve) { // passed along to the later hooks below. if (specifier.startsWith('https://')) { return { - url: specifier + url: specifier, }; } else if (parentURL && parentURL.startsWith('https://')) { return { - url: new URL(specifier, parentURL).href + url: new URL(specifier, parentURL).href, }; } @@ -868,7 +868,7 @@ export function getFormat(url, context, defaultGetFormat) { // This loader assumes all network-provided JavaScript is ES module code. if (url.startsWith('https://')) { return { - format: 'module' + format: 'module', }; } @@ -934,7 +934,7 @@ export function resolve(specifier, context, defaultResolve) { // specifiers ending in the CoffeeScript file extensions. if (extensionsRegex.test(specifier)) { return { - url: new URL(specifier, parentURL).href + url: new URL(specifier, parentURL).href, }; } @@ -948,7 +948,7 @@ export function getFormat(url, context, defaultGetFormat) { // purposes of this loader, all CoffeeScript URLs are ES modules. if (extensionsRegex.test(url)) { return { - format: 'module' + format: 'module', }; } @@ -961,7 +961,7 @@ export function transformSource(source, context, defaultTransformSource) { if (extensionsRegex.test(url)) { return { - source: CoffeeScript.compile(source, { bare: true }) + source: CoffeeScript.compile(source, { bare: true }), }; } diff --git a/doc/api/events.md b/doc/api/events.md index 540b663bd56968..122e671c58536f 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -1128,7 +1128,7 @@ added: v15.4.0 ```js const { setMaxListeners, - EventEmitter + EventEmitter, } = require('events'); const target = new EventTarget(); @@ -1235,13 +1235,13 @@ async function handler2(event) { const handler3 = { handleEvent(event) { console.log(event.type); // Prints 'foo' - } + }, }; const handler4 = { async handleEvent(event) { console.log(event.type); // Prints 'foo' - } + }, }; const target = new EventTarget(); diff --git a/doc/api/fs.md b/doc/api/fs.md index f4d1c555ff890e..9cb979b495321c 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -6032,7 +6032,7 @@ import { open, constants } from 'fs'; const { O_RDWR, O_CREAT, - O_EXCL + O_EXCL, } = constants; open('/path/to/my/file', O_RDWR | O_CREAT | O_EXCL, (err, fd) => { diff --git a/doc/api/http.md b/doc/api/http.md index 5ec542e9011575..1f7a140ae2635b 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -103,7 +103,7 @@ http.get({ hostname: 'localhost', port: 80, path: '/', - agent: false // Create a new agent just for this one request + agent: false, // Create a new agent just for this one request }, (res) => { // Do stuff with response }); @@ -462,7 +462,7 @@ proxy.listen(1337, '127.0.0.1', () => { port: 1337, host: '127.0.0.1', method: 'CONNECT', - path: 'www.google.com:80' + path: 'www.google.com:80', }; const req = http.request(options); @@ -520,7 +520,7 @@ const http = require('http'); const options = { host: '127.0.0.1', port: 8080, - path: '/length_request' + path: '/length_request', }; // Make a request @@ -614,8 +614,8 @@ server.listen(1337, '127.0.0.1', () => { host: '127.0.0.1', headers: { 'Connection': 'Upgrade', - 'Upgrade': 'websocket' - } + 'Upgrade': 'websocket', + }, }; const req = http.request(options); @@ -1894,7 +1894,7 @@ const body = 'hello world'; response .writeHead(200, { 'Content-Length': Buffer.byteLength(body), - 'Content-Type': 'text/plain' + 'Content-Type': 'text/plain', }) .end(body); ``` @@ -2010,7 +2010,7 @@ server fully transmitted a message before a connection was terminated: const req = http.request({ host: '127.0.0.1', port: 8080, - method: 'POST' + method: 'POST', }, (res) => { res.resume(); res.on('end', () => { @@ -2764,7 +2764,7 @@ http.get('http://localhost:8000/', (res) => { const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ - data: 'Hello World!' + data: 'Hello World!', })); }); @@ -2899,7 +2899,7 @@ upload a file with a POST request, then write to the `ClientRequest` object. ```js const postData = querystring.stringify({ - 'msg': 'Hello World!' + 'msg': 'Hello World!', }); const options = { @@ -2909,8 +2909,8 @@ const options = { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', - 'Content-Length': Buffer.byteLength(postData) - } + 'Content-Length': Buffer.byteLength(postData), + }, }; const req = http.request(options, (res) => { diff --git a/doc/api/http2.md b/doc/api/http2.md index 83b80150ade554..4af65194203793 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -53,7 +53,7 @@ const fs = require('fs'); const server = http2.createSecureServer({ key: fs.readFileSync('localhost-privkey.pem'), - cert: fs.readFileSync('localhost-cert.pem') + cert: fs.readFileSync('localhost-cert.pem'), }); server.on('error', (err) => console.error(err)); @@ -61,7 +61,7 @@ server.on('stream', (stream, headers) => { // stream is a Duplex stream.respond({ 'content-type': 'text/html; charset=utf-8', - ':status': 200 + ':status': 200, }); stream.end('

Hello World

'); }); @@ -84,7 +84,7 @@ The following illustrates an HTTP/2 client: const http2 = require('http2'); const fs = require('fs'); const client = http2.connect('https://localhost:8443', { - ca: fs.readFileSync('localhost-cert.pem') + ca: fs.readFileSync('localhost-cert.pem'), }); client.on('error', (err) => console.error(err)); @@ -280,7 +280,7 @@ session.on('stream', (stream, headers, flags) => { // ... stream.respond({ ':status': 200, - 'content-type': 'text/plain; charset=utf-8' + 'content-type': 'text/plain; charset=utf-8', }); stream.write('hello '); stream.end('world'); @@ -301,7 +301,7 @@ const server = http2.createServer(); server.on('stream', (stream, headers) => { stream.respond({ 'content-type': 'text/html; charset=utf-8', - ':status': 200 + ':status': 200, }); stream.on('error', (error) => console.error(error)); stream.end('

Hello World

'); @@ -868,7 +868,7 @@ const http2 = require('http2'); const clientSession = http2.connect('https://localhost:1234'); const { HTTP2_HEADER_PATH, - HTTP2_HEADER_STATUS + HTTP2_HEADER_STATUS, } = http2.constants; const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); @@ -935,7 +935,7 @@ encoding used. ```js stream.respond({ 'content-type': 'text/html; charset=utf-8', - ':status': 200 + ':status': 200, }); ``` @@ -1563,7 +1563,7 @@ server.on('stream', (stream) => { const headers = { 'content-length': stat.size, 'last-modified': stat.mtime.toUTCString(), - 'content-type': 'text/plain; charset=utf-8' + 'content-type': 'text/plain; charset=utf-8', }; stream.respondWithFD(fd, headers); stream.on('close', () => fs.closeSync(fd)); @@ -1608,7 +1608,7 @@ server.on('stream', (stream) => { const headers = { 'content-length': stat.size, 'last-modified': stat.mtime.toUTCString(), - 'content-type': 'text/plain; charset=utf-8' + 'content-type': 'text/plain; charset=utf-8', }; stream.respondWithFD(fd, headers, { waitForTrailers: true }); stream.on('wantTrailers', () => { @@ -1841,7 +1841,7 @@ const { HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS, - HTTP2_HEADER_CONTENT_TYPE + HTTP2_HEADER_CONTENT_TYPE, } = http2.constants; const server = http2.createServer(); @@ -1851,7 +1851,7 @@ server.on('stream', (stream, headers, flags) => { // ... stream.respond({ [HTTP2_HEADER_STATUS]: 200, - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain; charset=utf-8' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain; charset=utf-8', }); stream.write('hello '); stream.end('world'); @@ -2039,7 +2039,7 @@ const { HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS, - HTTP2_HEADER_CONTENT_TYPE + HTTP2_HEADER_CONTENT_TYPE, } = http2.constants; const options = getOptionsSomehow(); @@ -2051,7 +2051,7 @@ server.on('stream', (stream, headers, flags) => { // ... stream.respond({ [HTTP2_HEADER_STATUS]: 200, - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain; charset=utf-8' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain; charset=utf-8', }); stream.write('hello '); stream.end('world'); @@ -2292,7 +2292,7 @@ const server = http2.createServer(); server.on('stream', (stream, headers) => { stream.respond({ 'content-type': 'text/html; charset=utf-8', - ':status': 200 + ':status': 200, }); stream.end('

Hello World

'); }); @@ -2423,7 +2423,7 @@ const fs = require('fs'); const options = { key: fs.readFileSync('server-key.pem'), - cert: fs.readFileSync('server-cert.pem') + cert: fs.readFileSync('server-cert.pem'), }; // Create a secure HTTP/2 server @@ -2432,7 +2432,7 @@ const server = http2.createSecureServer(options); server.on('stream', (stream, headers) => { stream.respond({ 'content-type': 'text/html; charset=utf-8', - ':status': 200 + ':status': 200, }); stream.end('

Hello World

'); }); @@ -2645,7 +2645,7 @@ to send more than one value per header field). const headers = { ':status': '200', 'content-type': 'text-plain', - 'ABC': ['has', 'more', 'than', 'one', 'value'] + 'ABC': ['has', 'more', 'than', 'one', 'value'], }; stream.respond(headers); @@ -2696,7 +2696,7 @@ const headers = { 'content-type': 'text-plain', 'cookie': 'some-cookie', 'other-sensitive-header': 'very secret data', - [http2.sensitiveHeaders]: ['cookie', 'other-sensitive-header'] + [http2.sensitiveHeaders]: ['cookie', 'other-sensitive-header'], }; stream.respond(headers); @@ -2880,7 +2880,7 @@ const client = http2.connect('http://localhost:8001'); // for CONNECT requests or an error will be thrown. const req = client.request({ ':method': 'CONNECT', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }); req.on('response', (headers) => { @@ -2986,7 +2986,7 @@ function onRequest(req, res) { res.writeHead(200, { 'content-type': 'application/json' }); res.end(JSON.stringify({ alpnProtocol, - httpVersion: req.httpVersion + httpVersion: req.httpVersion, })); } ``` diff --git a/doc/api/https.md b/doc/api/https.md index f4c1f0487a779a..29c39b6fefd086 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -172,7 +172,7 @@ const fs = require('fs'); const options = { key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') + cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), }; https.createServer(options, (req, res) => { @@ -189,7 +189,7 @@ const fs = require('fs'); const options = { pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - passphrase: 'sample' + passphrase: 'sample', }; https.createServer(options, (req, res) => { @@ -300,7 +300,7 @@ const options = { hostname: 'encrypted.google.com', port: 443, path: '/', - method: 'GET' + method: 'GET', }; const req = https.request(options, (res) => { @@ -327,7 +327,7 @@ const options = { path: '/', method: 'GET', key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') + cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), }; options.agent = new https.Agent(options); @@ -346,7 +346,7 @@ const options = { method: 'GET', key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - agent: false + agent: false, }; const req = https.request(options, (res) => { diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 3e31c638cece40..79668d6bc0c579 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -3741,7 +3741,7 @@ reasons. Consider the following JavaScript: const obj = {}; Object.defineProperties(obj, { 'foo': { value: 123, writable: true, configurable: true, enumerable: true }, - 'bar': { value: 456, writable: true, configurable: true, enumerable: true } + 'bar': { value: 456, writable: true, configurable: true, enumerable: true }, }); ``` diff --git a/doc/api/net.md b/doc/api/net.md index 5066179046c8c1..4f7b9bbfb190b1 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -417,7 +417,7 @@ shown below. server.listen({ host: 'localhost', port: 80, - exclusive: true + exclusive: true, }); ``` @@ -433,7 +433,7 @@ const controller = new AbortController(); server.listen({ host: 'localhost', port: 80, - signal: controller.signal + signal: controller.signal, }); // Later, when you want to close the server. controller.abort(); @@ -820,8 +820,8 @@ net.connect({ callback: function(nread, buf) { // Received data is available in `buf` from 0 to `nread`. console.log(buf.toString('utf8', 0, nread)); - } - } + }, + }, }); ``` diff --git a/doc/api/os.md b/doc/api/os.md index f3d3f2d65249a4..ac7462e2773a4e 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -80,8 +80,8 @@ The properties included on each object include: nice: 0, sys: 30340, idle: 1070356870, - irq: 0 - } + irq: 0, + }, }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', @@ -91,8 +91,8 @@ The properties included on each object include: nice: 0, sys: 26980, idle: 1071569080, - irq: 0 - } + irq: 0, + }, }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', @@ -102,8 +102,8 @@ The properties included on each object include: nice: 0, sys: 21750, idle: 1070919370, - irq: 0 - } + irq: 0, + }, }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', @@ -113,8 +113,8 @@ The properties included on each object include: nice: 0, sys: 19430, idle: 1070905480, - irq: 20 - } + irq: 20, + }, }, ] ``` diff --git a/doc/api/packages.md b/doc/api/packages.md index f91184208af43e..9abe299626e4fb 100644 --- a/doc/api/packages.md +++ b/doc/api/packages.md @@ -907,7 +907,7 @@ CommonJS and ES module instances of the package: // ./node_modules/pkg/index.mjs import state from './state.cjs'; export { - state + state, }; ``` diff --git a/doc/api/path.md b/doc/api/path.md index 839c45da906677..aa33b3d5f226ff 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -229,7 +229,7 @@ For example, on POSIX: path.format({ root: '/ignored', dir: '/home/user/dir', - base: 'file.txt' + base: 'file.txt', }); // Returns: '/home/user/dir/file.txt' @@ -239,7 +239,7 @@ path.format({ path.format({ root: '/', base: 'file.txt', - ext: 'ignored' + ext: 'ignored', }); // Returns: '/file.txt' @@ -247,7 +247,7 @@ path.format({ path.format({ root: '/', name: 'file', - ext: '.txt' + ext: '.txt', }); // Returns: '/file.txt' ``` @@ -257,7 +257,7 @@ On Windows: ```js path.format({ dir: 'C:\\path\\dir', - base: 'file.txt' + base: 'file.txt', }); // Returns: 'C:\\path\\dir\\file.txt' ``` diff --git a/doc/api/perf_hooks.md b/doc/api/perf_hooks.md index 80a3c46f36a281..6d750be57c7628 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -238,7 +238,7 @@ event type in order for the timing details to be accessed. ```js const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); function someFunction() { @@ -553,7 +553,7 @@ added: v8.5.0 ```js const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const obs = new PerformanceObserver((list, observer) => { @@ -605,7 +605,7 @@ or `options.type`: ```js const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const obs = new PerformanceObserver((list, observer) => { @@ -639,7 +639,7 @@ with respect to `performanceEntry.startTime`. ```js const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const obs = new PerformanceObserver((perfObserverList, observer) => { @@ -685,7 +685,7 @@ equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to ```js const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const obs = new PerformanceObserver((perfObserverList, observer) => { @@ -737,7 +737,7 @@ is equal to `type`. ```js const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const obs = new PerformanceObserver((perfObserverList, observer) => { @@ -958,7 +958,7 @@ to execute the callback). const async_hooks = require('async_hooks'); const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const set = new Set(); @@ -977,7 +977,7 @@ const hook = async_hooks.createHook({ `Timeout-${id}-Init`, `Timeout-${id}-Destroy`); } - } + }, }); hook.enable(); @@ -1001,7 +1001,7 @@ dependencies: 'use strict'; const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const mod = require('module'); diff --git a/doc/api/process.md b/doc/api/process.md index e0ab670747516b..bb62a986d24c19 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -973,7 +973,7 @@ specific process warnings. These can be listened for by adding a handler to the // Emit a warning with a code and additional detail. process.emitWarning('Something happened!', { code: 'MY_WARNING', - detail: 'This is some additional information' + detail: 'This is some additional information', }); // Emits: // (node:56338) [MY_WARNING] Warning: Something happened! diff --git a/doc/api/readline.md b/doc/api/readline.md index d67beab5d05922..f4e72fb57dbfc0 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -21,7 +21,7 @@ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, - output: process.stdout + output: process.stdout, }); rl.question('What do you think of Node.js? ', (answer) => { @@ -617,7 +617,7 @@ instance. const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, - output: process.stdout + output: process.stdout, }); ``` @@ -750,7 +750,7 @@ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, - prompt: 'OHAI> ' + prompt: 'OHAI> ', }); rl.prompt(); @@ -786,7 +786,7 @@ async function processLineByLine() { const rl = readline.createInterface({ input: fileStream, - crlfDelay: Infinity + crlfDelay: Infinity, }); // Note: we use the crlfDelay option to recognize all instances of CR LF // ('\r\n') in input.txt as a single line break. @@ -808,7 +808,7 @@ const readline = require('readline'); const rl = readline.createInterface({ input: fs.createReadStream('sample.txt'), - crlfDelay: Infinity + crlfDelay: Infinity, }); rl.on('line', (line) => { @@ -828,7 +828,7 @@ const { createInterface } = require('readline'); try { const rl = createInterface({ input: createReadStream('big-file.txt'), - crlfDelay: Infinity + crlfDelay: Infinity, }); rl.on('line', (line) => { diff --git a/doc/api/repl.md b/doc/api/repl.md index 075fa91581c428..6b6202ee5bbad2 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -132,7 +132,7 @@ const r = repl.start('> '); Object.defineProperty(r.context, 'm', { configurable: false, enumerable: true, - value: msg + value: msg, }); ``` @@ -478,7 +478,7 @@ replServer.defineCommand('sayhello', { this.clearBufferedCommand(); console.log(`Hello, ${name}!`); this.displayPrompt(); - } + }, }); replServer.defineCommand('saybye', function saybye() { console.log('Goodbye!'); @@ -720,7 +720,7 @@ let connections = 0; repl.start({ prompt: 'Node.js via stdin> ', input: process.stdin, - output: process.stdout + output: process.stdout, }); net.createServer((socket) => { @@ -728,7 +728,7 @@ net.createServer((socket) => { repl.start({ prompt: 'Node.js via Unix socket> ', input: socket, - output: socket + output: socket, }).on('exit', () => { socket.end(); }); @@ -739,7 +739,7 @@ net.createServer((socket) => { repl.start({ prompt: 'Node.js via TCP socket> ', input: socket, - output: socket + output: socket, }).on('exit', () => { socket.end(); }); diff --git a/doc/api/stream.md b/doc/api/stream.md index cc18b643b7158e..1c3fd7d00cd8ab 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1964,7 +1964,7 @@ const myWritable = new Writable({ }, destroy() { // Free resources... - } + }, }); ``` @@ -2069,7 +2069,7 @@ const myWritable = new Writable({ }, writev(chunks, callback) { // ... - } + }, }); ``` @@ -2088,7 +2088,7 @@ const myWritable = new Writable({ writev(chunks, callback) { // ... }, - signal: controller.signal + signal: controller.signal, }); // Later, abort the operation closing the stream controller.abort(); @@ -2271,7 +2271,7 @@ const myWritable = new Writable({ } else { callback(); } - } + }, }); ``` @@ -2416,7 +2416,7 @@ const { Readable } = require('stream'); const myReadable = new Readable({ read(size) { // ... - } + }, }); ``` @@ -2431,7 +2431,7 @@ const read = new Readable({ read(size) { // ... }, - signal: controller.signal + signal: controller.signal, }); // Later, abort the operation closing the stream controller.abort(); @@ -2633,7 +2633,7 @@ const myReadable = new Readable({ } else { // Do some work. } - } + }, }); ``` @@ -2749,7 +2749,7 @@ const myDuplex = new Duplex({ }, write(chunk, encoding, callback) { // ... - } + }, }); ``` @@ -2780,7 +2780,7 @@ pipeline( } catch (err) { callback(err); } - } + }, }), fs.createWriteStream('valid-object.json'), (err) => { @@ -2860,7 +2860,7 @@ const myTransform = new Transform({ // Push the data onto the readable queue. callback(null, '0'.repeat(data.length % 2) + data); - } + }, }); myTransform.setEncoding('ascii'); @@ -2941,7 +2941,7 @@ const { Transform } = require('stream'); const myTransform = new Transform({ transform(chunk, encoding, callback) { // ... - } + }, }); ``` diff --git a/doc/api/tls.md b/doc/api/tls.md index b82de483f9b825..6e1f6a5b216586 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -1969,7 +1969,7 @@ const options = { requestCert: true, // This is necessary only if the client uses a self-signed certificate. - ca: [ fs.readFileSync('client-cert.pem') ] + ca: [ fs.readFileSync('client-cert.pem') ], }; const server = tls.createServer(options, (socket) => { diff --git a/doc/api/url.md b/doc/api/url.md index 1063baefc849bb..f6453a2f5c5490 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -706,7 +706,7 @@ joins all array elements with commas. ```js const params = new URLSearchParams({ user: 'abc', - query: ['first', 'second'] + query: ['first', 'second'], }); console.log(params.getAll('query')); // Prints [ 'first,second' ] @@ -1323,8 +1323,8 @@ url.format({ pathname: '/some/path', query: { page: 1, - format: 'json' - } + format: 'json', + }, }); // => 'https://example.com/some/path?page=1&format=json' diff --git a/doc/api/util.md b/doc/api/util.md index 35b93ba198f3b9..bcbaf139e4427d 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -654,7 +654,7 @@ const o = { 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', 'test', 'foo']], 4], - b: new Map([['za', 1], ['zb', 'test']]) + b: new Map([['za', 1], ['zb', 'test']]), }; console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); @@ -722,7 +722,7 @@ const assert = require('assert'); const o1 = { b: [2, 3, 1], a: '`a` comes before `b`', - c: new Set([2, 3, 1]) + c: new Set([2, 3, 1]), }; console.log(inspect(o1, { sorted: true })); // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } @@ -732,7 +732,7 @@ console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); const o2 = { c: new Set([2, 1, 3]), a: '`a` comes before `b`', - b: [2, 3, 1] + b: [2, 3, 1], }; assert.strict.equal( inspect(o1, { sorted: true }), @@ -858,7 +858,7 @@ class Box { } const newOptions = Object.assign({}, options, { - depth: options.depth === null ? null : options.depth - 1 + depth: options.depth === null ? null : options.depth - 1, }); // Five space padding because that's the size of "Box< ". diff --git a/doc/api/v8.md b/doc/api/v8.md index 41e4c7456284ca..38f44b4865c04f 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -280,7 +280,7 @@ const { writeHeapSnapshot } = require('v8'); const { Worker, isMainThread, - parentPort + parentPort, } = require('worker_threads'); if (isMainThread) { diff --git a/doc/api/vm.md b/doc/api/vm.md index 8177a7b38556be..59bfd2a58a0659 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -166,7 +166,7 @@ const vm = require('vm'); const context = { animal: 'cat', - count: 2 + count: 2, }; const script = new vm.Script('count += 1; name = "kitty";'); @@ -767,7 +767,7 @@ const module = new vm.SourceTextModule( // Object.prototype in the top context rather than that in // the contextified object. meta.prop = {}; - } + }, }); // Since module has no dependencies, the linker function will never be called. await module.link(() => {}); @@ -794,7 +794,7 @@ const contextifiedObject = vm.createContext({ secret: 42 }); // Object.prototype in the top context rather than that in // the contextified object. meta.prop = {}; - } + }, }); // Since module has no dependencies, the linker function will never be called. await module.link(() => {}); @@ -1235,7 +1235,7 @@ const vm = require('vm'); const contextObject = { animal: 'cat', - count: 2 + count: 2, }; vm.runInNewContext('count += 1; name = "kitty"', contextObject); diff --git a/doc/api/wasi.md b/doc/api/wasi.md index d5213b9c9eb460..6ed735426eb852 100644 --- a/doc/api/wasi.md +++ b/doc/api/wasi.md @@ -18,8 +18,8 @@ const wasi = new WASI({ args: process.argv, env: process.env, preopens: { - '/sandbox': '/some/real/path/that/wasm/can/access' - } + '/sandbox': '/some/real/path/that/wasm/can/access', + }, }); const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; @@ -37,8 +37,8 @@ const wasi = new WASI({ args: process.argv, env: process.env, preopens: { - '/sandbox': '/some/real/path/that/wasm/can/access' - } + '/sandbox': '/some/real/path/that/wasm/can/access', + }, }); const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md index 66d577192f5648..8d010d8e7aad9b 100644 --- a/doc/api/webcrypto.md +++ b/doc/api/webcrypto.md @@ -16,11 +16,11 @@ const { subtle } = require('crypto').webcrypto; const key = await subtle.generateKey({ name: 'HMAC', hash: 'SHA-256', - length: 256 + length: 256, }, true, ['sign', 'verify']); const digest = await subtle.sign({ - name: 'HMAC' + name: 'HMAC', }, key, 'I love cupcakes'); })(); @@ -41,7 +41,7 @@ const { subtle } = require('crypto').webcrypto; async function generateAesKey(length = 256) { const key = await subtle.generateKey({ name: 'AES-CBC', - length + length, }, true, ['encrypt', 'decrypt']); return key; @@ -56,7 +56,7 @@ const { subtle } = require('crypto').webcrypto; async function generateEcKey(namedCurve = 'P-521') { const { publicKey, - privateKey + privateKey, } = await subtle.generateKey({ name: 'ECDSA', namedCurve, @@ -94,7 +94,7 @@ const { subtle } = require('crypto').webcrypto; async function generateHmacKey(hash = 'SHA-256') { const key = await subtle.generateKey({ name: 'HMAC', - hash + hash, }, true, ['sign', 'verify']); return key; @@ -110,7 +110,7 @@ const publicExponent = new Uint8Array([1, 0, 1]); async function generateRsaKey(modulusLength = 2048, hash = 'SHA-256') { const { publicKey, - privateKey + privateKey, } = await subtle.generateKey({ name: 'RSASSA-PKCS1-v1_5', modulusLength, @@ -140,7 +140,7 @@ async function aesEncrypt(plaintext) { return { key, iv, - ciphertext + ciphertext, }; } @@ -163,7 +163,7 @@ const { subtle } = require('crypto').webcrypto; async function generateAndExportHmacKey(format = 'jwk', hash = 'SHA-512') { const key = await subtle.generateKey({ name: 'HMAC', - hash + hash, }, true, ['sign', 'verify']); return subtle.exportKey(format, key); @@ -172,7 +172,7 @@ async function generateAndExportHmacKey(format = 'jwk', hash = 'SHA-512') { async function importHmacKey(keyData, format = 'jwk', hash = 'SHA-512') { const key = await subtle.importKey(format, keyData, { name: 'HMAC', - hash + hash, }, true, ['sign', 'verify']); return key; @@ -190,11 +190,11 @@ async function generateAndWrapHmacKey(format = 'jwk', hash = 'SHA-512') { wrappingKey, ] = await Promise.all([ subtle.generateKey({ - name: 'HMAC', hash + name: 'HMAC', hash, }, true, ['sign', 'verify']), subtle.generateKey({ name: 'AES-KW', - length: 256 + length: 256, }, true, ['wrapKey', 'unwrapKey']), ]); @@ -263,7 +263,7 @@ async function pbkdf2(pass, salt, iterations = 1000, length = 256) { name: 'PBKDF2', hash: 'SHA-512', salt: ec.encode(salt), - iterations + iterations, }, key, length); return bits; } @@ -280,10 +280,10 @@ async function pbkdf2Key(pass, salt, iterations = 1000, length = 256) { name: 'PBKDF2', hash: 'SHA-512', salt: ec.encode(salt), - iterations + iterations, }, keyMaterial, { name: 'AES-GCM', - length: 256 + length: 256, }, true, ['encrypt', 'decrypt']); return key; } diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 05490a8bb50745..8d2e4c0804982f 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -23,14 +23,14 @@ instances. ```js const { - Worker, isMainThread, parentPort, workerData + Worker, isMainThread, parentPort, workerData, } = require('worker_threads'); if (isMainThread) { module.exports = function parseJSAsync(script) { return new Promise((resolve, reject) => { const worker = new Worker(__filename, { - workerData: script + workerData: script, }); worker.on('message', resolve); worker.on('error', reject); @@ -343,7 +343,7 @@ with all other `BroadcastChannel` instances bound to the same channel name. const { isMainThread, BroadcastChannel, - Worker + Worker, } = require('worker_threads'); const bc = new BroadcastChannel('hello'); @@ -820,7 +820,7 @@ the thread barrier. ```js const assert = require('assert'); const { - Worker, MessageChannel, MessagePort, isMainThread, parentPort + Worker, MessageChannel, MessagePort, isMainThread, parentPort, } = require('worker_threads'); if (isMainThread) { const worker = new Worker(__filename); diff --git a/doc/api/zlib.md b/doc/api/zlib.md index 3187195a0e0a3a..d4de75a53a9201 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -26,7 +26,7 @@ const { createGzip } = require('zlib'); const { pipeline } = require('stream'); const { createReadStream, - createWriteStream + createWriteStream, } = require('fs'); const gzip = createGzip(); @@ -557,8 +557,8 @@ const stream = zlib.createBrotliCompress({ params: { [zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT, [zlib.constants.BROTLI_PARAM_QUALITY]: 4, - [zlib.constants.BROTLI_PARAM_SIZE_HINT]: fs.statSync(inputFile).size - } + [zlib.constants.BROTLI_PARAM_SIZE_HINT]: fs.statSync(inputFile).size, + }, }); ``` diff --git a/doc/changelogs/CHANGELOG_V12.md b/doc/changelogs/CHANGELOG_V12.md index 44511609490f22..8b59cee7644060 100644 --- a/doc/changelogs/CHANGELOG_V12.md +++ b/doc/changelogs/CHANGELOG_V12.md @@ -1487,7 +1487,7 @@ const { Console } = require('console'); const customConsole = new Console({ stdout: process.stdout, stderr: process.stderr, - groupIndentation: 10 + groupIndentation: 10, }); customConsole.log('foo'); diff --git a/doc/changelogs/CHANGELOG_V14.md b/doc/changelogs/CHANGELOG_V14.md index b479e7b56c00e9..3f3f53b6444a56 100644 --- a/doc/changelogs/CHANGELOG_V14.md +++ b/doc/changelogs/CHANGELOG_V14.md @@ -2637,7 +2637,7 @@ const { Console } = require('console'); const customConsole = new Console({ stdout: process.stdout, stderr: process.stderr, - groupIndentation: 10 + groupIndentation: 10, }); customConsole.log('foo'); diff --git a/doc/changelogs/CHANGELOG_V15.md b/doc/changelogs/CHANGELOG_V15.md index 1855da132b18f6..0e5ed6fc1873bf 100644 --- a/doc/changelogs/CHANGELOG_V15.md +++ b/doc/changelogs/CHANGELOG_V15.md @@ -1066,7 +1066,7 @@ const read = new Readable({ read(size) { // ... }, - signal: controller.signal + signal: controller.signal, }); // Later, abort the operation closing the stream controller.abort(); diff --git a/doc/guides/using-internal-errors.md b/doc/guides/using-internal-errors.md index fe7bafb7be6827..5bdf0b5f4cce48 100644 --- a/doc/guides/using-internal-errors.md +++ b/doc/guides/using-internal-errors.md @@ -121,7 +121,7 @@ assert.throws(() => { socket.bind(); }, common.expectsError({ code: 'ERR_SOCKET_ALREADY_BOUND', - type: Error + type: Error, })); ``` diff --git a/doc/guides/writing-and-running-benchmarks.md b/doc/guides/writing-and-running-benchmarks.md index 7e00e65a7b8b67..6f2f75fea01cfc 100644 --- a/doc/guides/writing-and-running-benchmarks.md +++ b/doc/guides/writing-and-running-benchmarks.md @@ -480,12 +480,12 @@ const configs = { // Most benchmarks just use one value for all runs. n: [1024], type: ['fast', 'slow'], // Custom configurations - size: [16, 128, 1024] // Custom configurations + size: [16, 128, 1024], // Custom configurations }; const options = { // Add --expose-internals in order to require internal modules in main - flags: ['--zero-fill-buffers'] + flags: ['--zero-fill-buffers'], }; // `main` and `configs` are required, `options` is optional. @@ -529,7 +529,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { kb: [64, 128, 256, 1024], connections: [100, 500], - duration: 5 + duration: 5, }); function main(conf) { diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md index 7d33ee15858cc5..70e70cb7074396 100644 --- a/doc/guides/writing-tests.md +++ b/doc/guides/writing-tests.md @@ -46,7 +46,7 @@ const server = http.createServer(common.mustCall((req, res) => { // 11 server.listen(0, () => { // 14 http.get({ // 15 port: server.address().port, // 16 - headers: { 'Test': 'Düsseldorf' } // 17 + headers: { 'Test': 'Düsseldorf' }, // 17 }, common.mustCall((res) => { // 18 assert.strictEqual(res.statusCode, 200); // 19 server.close(); // 20 @@ -116,7 +116,7 @@ const server = http.createServer(common.mustCall((req, res) => { server.listen(0, () => { http.get({ port: server.address().port, - headers: { 'Test': 'Düsseldorf' } + headers: { 'Test': 'Düsseldorf' }, }, common.mustCall((res) => { assert.strictEqual(res.statusCode, 200); server.close(); @@ -192,7 +192,7 @@ const server = http.createServer((req, res) => { listening++; const options = { agent: null, - port: server.address().port + port: server.address().port, }; http.get(options, (res) => { response++; @@ -214,7 +214,7 @@ const server = http.createServer(common.mustCall((req, res) => { })).listen(0, common.mustCall(() => { const options = { agent: null, - port: server.address().port + port: server.address().port, }; http.get(options, common.mustCall((res) => { res.resume(); diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 8bc74c9cd43327..a6b1c42422a15c 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -244,7 +244,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/* legacy */, __proto__: null, host: options, port, - localAddress + localAddress, }; } @@ -532,5 +532,5 @@ function asyncResetHandle(socket) { module.exports = { Agent, - globalAgent: new Agent() + globalAgent: new Agent(), }; diff --git a/lib/_http_client.js b/lib/_http_client.js index f3b88b62730175..ed59af8193342f 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -64,7 +64,7 @@ const { ERR_INVALID_ARG_TYPE, ERR_INVALID_HTTP_TOKEN, ERR_INVALID_PROTOCOL, - ERR_UNESCAPED_CHARACTERS + ERR_UNESCAPED_CHARACTERS, } = codes; const { validateInteger, @@ -72,7 +72,7 @@ const { const { getTimerDuration } = require('internal/timers'); const { DTRACE_HTTP_CLIENT_REQUEST, - DTRACE_HTTP_CLIENT_RESPONSE + DTRACE_HTTP_CLIENT_RESPONSE, } = require('internal/dtrace'); const { addAbortSignal, finished } = require('stream'); @@ -593,7 +593,7 @@ function parserOnIncomingClient(res, shouldKeepAlive) { httpVersionMajor: res.httpVersionMajor, httpVersionMinor: res.httpVersionMinor, headers: res.headers, - rawHeaders: res.rawHeaders + rawHeaders: res.rawHeaders, }); return 1; // Skip body but don't treat as Upgrade. @@ -887,5 +887,5 @@ ClientRequest.prototype.clearTimeout = function clearTimeout(cb) { }; module.exports = { - ClientRequest + ClientRequest, }; diff --git a/lib/_http_common.js b/lib/_http_common.js index e3e732a8a180c6..636272a423a762 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -37,7 +37,7 @@ const incoming = require('_http_incoming'); const { IncomingMessage, readStart, - readStop + readStop, } = incoming; let debug = require('internal/util/debuglog').debuglog('http', (fn) => { diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index e0f1354e6c969c..3c573a695c5ef8 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -27,7 +27,7 @@ const { StringPrototypeCharCodeAt, StringPrototypeSlice, StringPrototypeToLowerCase, - Symbol + Symbol, } = primordials; const { Readable, finished } = require('stream'); @@ -53,7 +53,7 @@ function IncomingMessage(socket) { if (socket) { streamOptions = { - highWaterMark: socket.readableHighWaterMark + highWaterMark: socket.readableHighWaterMark, }; } @@ -101,7 +101,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'connection', { }, set: function(val) { this.socket = val; - } + }, }); ObjectDefineProperty(IncomingMessage.prototype, 'headers', { @@ -120,7 +120,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'headers', { }, set: function(val) { this[kHeaders] = val; - } + }, }); ObjectDefineProperty(IncomingMessage.prototype, 'trailers', { @@ -139,7 +139,7 @@ ObjectDefineProperty(IncomingMessage.prototype, 'trailers', { }, set: function(val) { this[kTrailers] = val; - } + }, }); IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) { @@ -384,5 +384,5 @@ function onError(self, error, cb) { module.exports = { IncomingMessage, readStart, - readStop + readStop, }; diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 4d3b58cc84d00c..08b9a22cb5e9c1 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -50,7 +50,7 @@ const checkIsHttpToken = common._checkIsHttpToken; const checkInvalidHeaderChar = common._checkInvalidHeaderChar; const { defaultTriggerAsyncIdScope, - symbols: { async_id_symbol } + symbols: { async_id_symbol }, } = require('internal/async_hooks'); const { codes: { @@ -66,9 +66,9 @@ const { ERR_STREAM_ALREADY_FINISHED, ERR_STREAM_WRITE_AFTER_END, ERR_STREAM_NULL_VALUES, - ERR_STREAM_DESTROYED + ERR_STREAM_DESTROYED, }, - hideStackFrames + hideStackFrames, } = require('internal/errors'); const { validateString } = require('internal/validators'); const { isUint8Array } = require('internal/util/types'); @@ -148,32 +148,32 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'writableFinished', { this.outputSize === 0 && (!this.socket || this.socket.writableLength === 0) ); - } + }, }); ObjectDefineProperty(OutgoingMessage.prototype, 'writableObjectMode', { get() { return false; - } + }, }); ObjectDefineProperty(OutgoingMessage.prototype, 'writableLength', { get() { return this.outputSize + (this.socket ? this.socket.writableLength : 0); - } + }, }); ObjectDefineProperty(OutgoingMessage.prototype, 'writableHighWaterMark', { get() { return this.socket ? this.socket.writableHighWaterMark : HIGH_WATER_MARK; - } + }, }); ObjectDefineProperty(OutgoingMessage.prototype, 'writableCorked', { get() { const corked = this.socket ? this.socket.writableCorked : 0; return corked + this[kCorked]; - } + }, }); ObjectDefineProperty(OutgoingMessage.prototype, '_headers', { @@ -193,7 +193,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headers', { headers[StringPrototypeToLowerCase(name)] = [name, val[name]]; } } - }, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066') + }, 'OutgoingMessage.prototype._headers is deprecated', 'DEP0066'), }); ObjectDefineProperty(OutgoingMessage.prototype, 'connection', { @@ -202,7 +202,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'connection', { }, set: function(val) { this.socket = val; - } + }, }); ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', { @@ -236,7 +236,7 @@ ObjectDefineProperty(OutgoingMessage.prototype, '_headerNames', { header[0] = val[keys[i]]; } } - }, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066') + }, 'OutgoingMessage.prototype._headerNames is deprecated', 'DEP0066'), }); @@ -328,7 +328,7 @@ OutgoingMessage.prototype._send = function _send(data, encoding, callback) { this.outputData.unshift({ data: header, encoding: 'latin1', - callback: null + callback: null, }); this.outputSize += header.length; this._onPendingData(header.length); @@ -380,7 +380,7 @@ function _storeHeader(firstLine, headers) { date: false, expect: false, trailer: false, - header: firstLine + header: firstLine, }; if (headers) { @@ -682,17 +682,17 @@ OutgoingMessage.prototype._implicitHeader = function _implicitHeader() { ObjectDefineProperty(OutgoingMessage.prototype, 'headersSent', { configurable: true, enumerable: true, - get: function() { return !!this._header; } + get: function() { return !!this._header; }, }); ObjectDefineProperty(OutgoingMessage.prototype, 'writableEnded', { - get: function() { return this.finished; } + get: function() { return this.finished; }, }); ObjectDefineProperty(OutgoingMessage.prototype, 'writableNeedDrain', { get: function() { return !this.destroyed && !this.finished && this[kNeedDrain]; - } + }, }); const crlf_buf = Buffer.from(CRLF); @@ -996,5 +996,5 @@ function(err, event) { module.exports = { validateHeaderName, validateHeaderValue, - OutgoingMessage + OutgoingMessage, }; diff --git a/lib/_http_server.js b/lib/_http_server.js index 97df58a007daba..fe3ef8ef2d8af0 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -51,16 +51,16 @@ const { OutgoingMessage } = require('_http_outgoing'); const { kOutHeaders, kNeedDrain, - emitStatistics + emitStatistics, } = require('internal/http'); const { defaultTriggerAsyncIdScope, - getOrSetAsyncId + getOrSetAsyncId, } = require('internal/async_hooks'); const { IncomingMessage } = require('_http_incoming'); const { connResetException, - codes + codes, } = require('internal/errors'); const { ERR_HTTP_REQUEST_TIMEOUT, @@ -69,16 +69,16 @@ const { ERR_HTTP_SOCKET_ENCODING, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - ERR_INVALID_CHAR + ERR_INVALID_CHAR, } = codes; const { validateInteger, - validateBoolean + validateBoolean, } = require('internal/validators'); const Buffer = require('buffer').Buffer; const { DTRACE_HTTP_SERVER_REQUEST, - DTRACE_HTTP_SERVER_RESPONSE + DTRACE_HTTP_SERVER_RESPONSE, } = require('internal/dtrace'); const { setTimeout, clearTimeout } = require('timers'); @@ -160,7 +160,7 @@ const STATUS_CODES = { 508: 'Loop Detected', // RFC 5842 7.2 509: 'Bandwidth Limit Exceeded', 510: 'Not Extended', // RFC 2774 7 - 511: 'Network Authentication Required' // RFC 6585 6 + 511: 'Network Authentication Required', // RFC 6585 6 }; const kOnMessageBegin = HTTPParser.kOnMessageBegin | 0; @@ -194,7 +194,7 @@ function ServerResponse(req) { if (hasObserver('http')) { this[kServerResponseStatistics] = { - startTime: process.hrtime() + startTime: process.hrtime(), }; } } @@ -485,7 +485,7 @@ function connectionListenerInternal(server, socket) { // need to pause TCP socket/HTTP parser, and wait until the data will be // sent to the client. outgoingData: 0, - keepAliveTimeoutSet: false + keepAliveTimeoutSet: false, }; state.onData = socketOnData.bind(undefined, server, socket, parser, state); @@ -787,7 +787,7 @@ function resOnFinish(req, res, socket, state, server) { request: req, response: res, socket, - server + server, }); } @@ -884,7 +884,7 @@ function parserOnIncoming(server, socket, state, req, keepAlive) { request: req, response: res, socket, - server + server, }); } @@ -992,5 +992,5 @@ module.exports = { Server, ServerResponse, _connectionListener: connectionListener, - kServerResponse + kServerResponse, }; diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 66ebc7b77869f7..9a2642bf22d360 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -40,7 +40,7 @@ const { const { assertCrypto, - deprecate + deprecate, } = require('internal/util'); assertCrypto(); @@ -76,7 +76,7 @@ const { ERR_TLS_REQUIRED_SERVER_NAME, ERR_TLS_SESSION_ATTACK, ERR_TLS_SNI_FROM_SERVER, - ERR_TLS_INVALID_STATE + ERR_TLS_INVALID_STATE, } = codes; const { onpskexchange: kOnPskExchange } = internalBinding('symbols'); const { @@ -92,7 +92,7 @@ const { validateUint32, } = require('internal/validators'); const { - InternalX509Certificate + InternalX509Certificate, } = require('internal/crypto/x509'); const traceTls = getOptionValue('--trace-tls'); const tlsKeylog = getOptionValue('--tls-keylog'); @@ -633,7 +633,7 @@ function defineHandleReading(socket, handle) { }, set: (value) => { socket[kRes].reading = value; - } + }, }); } @@ -1380,7 +1380,7 @@ Server.prototype.setSecureContext = function(options) { Server.prototype._getServerData = function() { return { - ticketKeys: this.getTicketKeys().toString('hex') + ticketKeys: this.getTicketKeys().toString('hex'), }; }; @@ -1608,7 +1608,7 @@ exports.connect = function connect(...args) { ciphers: tls.DEFAULT_CIPHERS, checkServerIdentity: tls.checkServerIdentity, minDHSize: 1024, - ...options + ...options, }; if (!options.keepAlive) diff --git a/lib/assert.js b/lib/assert.js index 61d6bda6b37632..c3ec6519a38660 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -162,7 +162,7 @@ function fail(actual, expected, message, operator, stackStartFn) { expected, operator: operator === undefined ? 'fail' : operator, stackStartFn: stackStartFn || fail, - message + message, }; const err = new AssertionError(errArgs); if (internalMessage) { @@ -406,7 +406,7 @@ function innerOk(fn, argLen, value, message) { expected: true, message, operator: '==', - stackStartFn: fn + stackStartFn: fn, }); err.generatedMessage = generatedMessage; throw err; @@ -443,7 +443,7 @@ assert.equal = function equal(actual, expected, message) { expected, message, operator: '==', - stackStartFn: equal + stackStartFn: equal, }); } }; @@ -467,7 +467,7 @@ assert.notEqual = function notEqual(actual, expected, message) { expected, message, operator: '!=', - stackStartFn: notEqual + stackStartFn: notEqual, }); } }; @@ -490,7 +490,7 @@ assert.deepEqual = function deepEqual(actual, expected, message) { expected, message, operator: 'deepEqual', - stackStartFn: deepEqual + stackStartFn: deepEqual, }); } }; @@ -513,7 +513,7 @@ assert.notDeepEqual = function notDeepEqual(actual, expected, message) { expected, message, operator: 'notDeepEqual', - stackStartFn: notDeepEqual + stackStartFn: notDeepEqual, }); } }; @@ -538,7 +538,7 @@ assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { expected, message, operator: 'deepStrictEqual', - stackStartFn: deepStrictEqual + stackStartFn: deepStrictEqual, }); } }; @@ -563,7 +563,7 @@ function notDeepStrictEqual(actual, expected, message) { expected, message, operator: 'notDeepStrictEqual', - stackStartFn: notDeepStrictEqual + stackStartFn: notDeepStrictEqual, }); } } @@ -585,7 +585,7 @@ assert.strictEqual = function strictEqual(actual, expected, message) { expected, message, operator: 'strictEqual', - stackStartFn: strictEqual + stackStartFn: strictEqual, }); } }; @@ -607,7 +607,7 @@ assert.notStrictEqual = function notStrictEqual(actual, expected, message) { expected, message, operator: 'notStrictEqual', - stackStartFn: notStrictEqual + stackStartFn: notStrictEqual, }); } }; @@ -640,7 +640,7 @@ function compareExceptionKey(actual, expected, key, message, keys, fn) { actual: a, expected: b, operator: 'deepStrictEqual', - stackStartFn: fn + stackStartFn: fn, }); err.actual = actual; err.expected = expected; @@ -652,7 +652,7 @@ function compareExceptionKey(actual, expected, key, message, keys, fn) { expected, message, operator: fn.name, - stackStartFn: fn + stackStartFn: fn, }); } } @@ -681,7 +681,7 @@ function expectedException(actual, expected, message, fn) { expected, message, operator: 'deepStrictEqual', - stackStartFn: fn + stackStartFn: fn, }); err.operator = fn.name; throw err; @@ -756,7 +756,7 @@ function expectedException(actual, expected, message, fn) { expected, message, operator: fn.name, - stackStartFn: fn + stackStartFn: fn, }); err.generatedMessage = generatedMessage; throw err; @@ -850,7 +850,7 @@ function expectsError(stackStartFn, actual, error, message) { expected: error, operator: stackStartFn.name, message: `Missing expected ${fnType}${details}`, - stackStartFn + stackStartFn, }); } @@ -899,7 +899,7 @@ function expectsNoError(stackStartFn, actual, error, message) { operator: stackStartFn.name, message: `Got unwanted ${fnType}${details}\n` + `Actual message: "${actual && actual.message}"`, - stackStartFn + stackStartFn, }); } throw actual; @@ -968,7 +968,7 @@ assert.ifError = function ifError(err) { expected: null, operator: 'ifError', message, - stackStartFn: ifError + stackStartFn: ifError, }); // Make sure we actually have a stack trace! @@ -1027,7 +1027,7 @@ function internalMatch(string, regexp, message, fn) { expected: regexp, message, operator: fn.name, - stackStartFn: fn + stackStartFn: fn, }); err.generatedMessage = generatedMessage; throw err; @@ -1071,7 +1071,7 @@ assert.strict = ObjectAssign(strict, assert, { equal: assert.strictEqual, deepEqual: assert.deepStrictEqual, notEqual: assert.notStrictEqual, - notDeepEqual: assert.notDeepStrictEqual + notDeepEqual: assert.notDeepStrictEqual, }); assert.strict.strict = assert.strict; diff --git a/lib/async_hooks.js b/lib/async_hooks.js index 13c32065fc9188..c47c3260a43661 100644 --- a/lib/async_hooks.js +++ b/lib/async_hooks.js @@ -16,7 +16,7 @@ const { const { ERR_ASYNC_CALLBACK, ERR_ASYNC_TYPE, - ERR_INVALID_ASYNC_ID + ERR_INVALID_ASYNC_ID, } = require('internal/errors').codes; const { validateFunction, @@ -54,7 +54,7 @@ const { const { async_id_symbol, trigger_async_id_symbol, init_symbol, before_symbol, after_symbol, destroy_symbol, - promise_resolve_symbol + promise_resolve_symbol, } = internal_async_hooks.symbols; // Get constants @@ -241,7 +241,7 @@ class AsyncResource { enumerable: true, value: this, writable: true, - } + }, }); return ret; } @@ -260,7 +260,7 @@ const storageHook = createHook({ for (let i = 0; i < storageList.length; ++i) { storageList[i]._propagate(resource, currentResource); } - } + }, }); const defaultAlsResourceOpts = { requireManualDestroy: true }; diff --git a/lib/buffer.js b/lib/buffer.js index 18b90f40527921..64156a4544e6f6 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -63,28 +63,28 @@ const { swap32: _swap32, swap64: _swap64, kMaxLength, - kStringMaxLength + kStringMaxLength, } = internalBinding('buffer'); const { getOwnNonIndexProperties, propertyFilter: { ALL_PROPERTIES, - ONLY_ENUMERABLE + ONLY_ENUMERABLE, }, } = internalBinding('util'); const { customInspectSymbol, isInsideNodeModules, normalizeEncoding, - kIsEncodingSymbol + kIsEncodingSymbol, } = require('internal/util'); const { isAnyArrayBuffer, isArrayBufferView, - isUint8Array + isUint8Array, } = require('internal/util/types'); const { - inspect: utilInspect + inspect: utilInspect, } = require('internal/util/inspect'); const { encodings } = internalBinding('string_decoder'); @@ -95,16 +95,16 @@ const { ERR_INVALID_ARG_VALUE, ERR_INVALID_BUFFER_SIZE, ERR_OUT_OF_RANGE, - ERR_UNKNOWN_ENCODING + ERR_UNKNOWN_ENCODING, }, - hideStackFrames + hideStackFrames, } = require('internal/errors'); const { validateArray, validateBuffer, validateNumber, validateInteger, - validateString + validateString, } = require('internal/validators'); // Provide validateInteger() but with kMaxLength as the default maximum value. const validateOffset = (value, name, min = 0, max = kMaxLength) => @@ -114,7 +114,7 @@ const { FastBuffer, markAsUntransferable, addBufferPrototypeMethods, - createUnsafeBuffer + createUnsafeBuffer, } = require('internal/buffer'); const { @@ -129,13 +129,13 @@ const constants = ObjectDefineProperties({}, { MAX_LENGTH: { value: kMaxLength, writable: false, - enumerable: true + enumerable: true, }, MAX_STRING_LENGTH: { value: kStringMaxLength, writable: false, - enumerable: true - } + enumerable: true, + }, }); Buffer.poolSize = 8 * 1024; @@ -279,7 +279,7 @@ function Buffer(arg, encodingOrOffset, length) { ObjectDefineProperty(Buffer, SymbolSpecies, { enumerable: false, configurable: true, - get() { return FastBuffer; } + get() { return FastBuffer; }, }); /** @@ -590,7 +590,7 @@ const encodingOps = { write: (buf, string, offset, len) => buf.utf8Write(string, offset, len), slice: (buf, start, end) => buf.utf8Slice(start, end), indexOf: (buf, val, byteOffset, dir) => - indexOfString(buf, val, byteOffset, encodingsMap.utf8, dir) + indexOfString(buf, val, byteOffset, encodingsMap.utf8, dir), }, ucs2: { encoding: 'ucs2', @@ -599,7 +599,7 @@ const encodingOps = { write: (buf, string, offset, len) => buf.ucs2Write(string, offset, len), slice: (buf, start, end) => buf.ucs2Slice(start, end), indexOf: (buf, val, byteOffset, dir) => - indexOfString(buf, val, byteOffset, encodingsMap.utf16le, dir) + indexOfString(buf, val, byteOffset, encodingsMap.utf16le, dir), }, utf16le: { encoding: 'utf16le', @@ -608,7 +608,7 @@ const encodingOps = { write: (buf, string, offset, len) => buf.ucs2Write(string, offset, len), slice: (buf, start, end) => buf.ucs2Slice(start, end), indexOf: (buf, val, byteOffset, dir) => - indexOfString(buf, val, byteOffset, encodingsMap.utf16le, dir) + indexOfString(buf, val, byteOffset, encodingsMap.utf16le, dir), }, latin1: { encoding: 'latin1', @@ -617,7 +617,7 @@ const encodingOps = { write: (buf, string, offset, len) => buf.latin1Write(string, offset, len), slice: (buf, start, end) => buf.latin1Slice(start, end), indexOf: (buf, val, byteOffset, dir) => - indexOfString(buf, val, byteOffset, encodingsMap.latin1, dir) + indexOfString(buf, val, byteOffset, encodingsMap.latin1, dir), }, ascii: { encoding: 'ascii', @@ -630,7 +630,7 @@ const encodingOps = { fromStringFast(val, encodingOps.ascii), byteOffset, encodingsMap.ascii, - dir) + dir), }, base64: { encoding: 'base64', @@ -643,7 +643,7 @@ const encodingOps = { fromStringFast(val, encodingOps.base64), byteOffset, encodingsMap.base64, - dir) + dir), }, base64url: { encoding: 'base64url', @@ -657,7 +657,7 @@ const encodingOps = { fromStringFast(val, encodingOps.base64url), byteOffset, encodingsMap.base64url, - dir) + dir), }, hex: { encoding: 'hex', @@ -670,8 +670,8 @@ const encodingOps = { fromStringFast(val, encodingOps.hex), byteOffset, encodingsMap.hex, - dir) - } + dir), + }, }; function getEncodingOps(encoding) { encoding += ''; @@ -757,7 +757,7 @@ ObjectDefineProperty(Buffer.prototype, 'parent', { if (!(this instanceof Buffer)) return undefined; return this.buffer; - } + }, }); ObjectDefineProperty(Buffer.prototype, 'offset', { enumerable: true, @@ -765,7 +765,7 @@ ObjectDefineProperty(Buffer.prototype, 'offset', { if (!(this instanceof Buffer)) return undefined; return this.byteOffset; - } + }, }); Buffer.prototype.copy = @@ -852,7 +852,7 @@ Buffer.prototype[customInspectSymbol] = function inspect(recurseTimes, ctx) { str += StringPrototypeSlice(utilInspect(obj, { ...ctx, breakLength: Infinity, - compact: true + compact: true, }), 27, -2); } } @@ -1181,7 +1181,7 @@ let transcode; if (internalBinding('config').hasIntl) { const { icuErrName, - transcode: _transcode + transcode: _transcode, } = internalBinding('icu'); // Transcodes the Buffer from one encoding to another, returning a new @@ -1260,12 +1260,12 @@ ObjectDefineProperties(module.exports, { constants: { configurable: false, enumerable: true, - value: constants + value: constants, }, INSPECT_MAX_BYTES: { configurable: true, enumerable: true, get() { return INSPECT_MAX_BYTES; }, - set(val) { INSPECT_MAX_BYTES = val; } - } + set(val) { INSPECT_MAX_BYTES = val; }, + }, }); diff --git a/lib/child_process.js b/lib/child_process.js index 26e1bb33d0c9ef..e34438c7aaf3a6 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -47,7 +47,7 @@ const { promisify, convertToValidSignal, createDeferredPromise, - getSystemErrorName + getSystemErrorName, } = require('internal/util'); const { isArrayBufferView } = require('internal/util/types'); let debug = require('internal/util/debuglog').debuglog( @@ -82,7 +82,7 @@ const { getValidStdio, setupChannel, ChildProcess, - stdioStringToArray + stdioStringToArray, } = child_process; const MAX_BUFFER = 1024 * 1024; @@ -170,7 +170,7 @@ function normalizeExecArgs(command, options, callback) { return { file: command, options: options, - callback: callback + callback: callback, }; } @@ -202,7 +202,7 @@ const customPromiseExecFunction = (orig) => { ObjectDefineProperty(exec, promisify.custom, { enumerable: false, - value: customPromiseExecFunction(exec) + value: customPromiseExecFunction(exec), }); function execFile(file /* , args, options, callback */) { @@ -240,7 +240,7 @@ function execFile(file /* , args, options, callback */) { cwd: null, env: null, shell: false, - ...options + ...options, }; // Validate the timeout, if present. @@ -259,7 +259,7 @@ function execFile(file /* , args, options, callback */) { signal: options.signal, uid: options.uid, windowsHide: !!options.windowsHide, - windowsVerbatimArguments: !!options.windowsVerbatimArguments + windowsVerbatimArguments: !!options.windowsVerbatimArguments, }); let encoding; @@ -425,7 +425,7 @@ function execFile(file /* , args, options, callback */) { ObjectDefineProperty(execFile, promisify.custom, { enumerable: false, - value: customPromiseExecFunction(execFile) + value: customPromiseExecFunction(execFile), }); function normalizeSpawnArguments(file, args, options) { @@ -581,7 +581,7 @@ function normalizeSpawnArguments(file, args, options) { envPairs, file, windowsHide: !!options.windowsHide, - windowsVerbatimArguments: !!windowsVerbatimArguments + windowsVerbatimArguments: !!windowsVerbatimArguments, }; } @@ -649,7 +649,7 @@ function spawn(file, args, options) { function spawnSync(file, args, options) { options = { maxBuffer: MAX_BUFFER, - ...normalizeSpawnArguments(file, args, options) + ...normalizeSpawnArguments(file, args, options), }; debug('spawnSync', options); @@ -785,5 +785,5 @@ module.exports = { execSync, fork, spawn, - spawnSync + spawnSync, }; diff --git a/lib/crypto.js b/lib/crypto.js index e2355b0f5d53f6..0b5a86d3596195 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -31,7 +31,7 @@ const { const { assertCrypto, - deprecate + deprecate, } = require('internal/util'); assertCrypto(); @@ -60,15 +60,15 @@ const { } = require('internal/crypto/random'); const { pbkdf2, - pbkdf2Sync + pbkdf2Sync, } = require('internal/crypto/pbkdf2'); const { scrypt, - scryptSync + scryptSync, } = require('internal/crypto/scrypt'); const { hkdf, - hkdfSync + hkdfSync, } = require('internal/crypto/hkdf'); const { generateKeyPair, @@ -86,7 +86,7 @@ const { DiffieHellman, DiffieHellmanGroup, ECDH, - diffieHellman + diffieHellman, } = require('internal/crypto/diffiehellman'); const { Cipher, @@ -103,14 +103,14 @@ const { Sign, signOneShot, Verify, - verifyOneShot + verifyOneShot, } = require('internal/crypto/sig'); const { Hash, - Hmac + Hmac, } = require('internal/crypto/hash'); const { - X509Certificate + X509Certificate, } = require('internal/crypto/x509'); const { getCiphers, @@ -248,24 +248,24 @@ function getFipsForced() { } ObjectDefineProperty(constants, 'defaultCipherList', { - value: getOptionValue('--tls-cipher-list') + value: getOptionValue('--tls-cipher-list'), }); ObjectDefineProperties(module.exports, { createCipher: { enumerable: false, value: deprecate(createCipher, - 'crypto.createCipher is deprecated.', 'DEP0106') + 'crypto.createCipher is deprecated.', 'DEP0106'), }, createDecipher: { enumerable: false, value: deprecate(createDecipher, - 'crypto.createDecipher is deprecated.', 'DEP0106') + 'crypto.createDecipher is deprecated.', 'DEP0106'), }, // crypto.fips is deprecated. DEP0093. Use crypto.getFips()/crypto.setFips() fips: { get: fipsForced ? getFipsForced : getFipsCrypto, - set: fipsForced ? setFipsForced : setFipsCrypto + set: fipsForced ? setFipsForced : setFipsCrypto, }, DEFAULT_ENCODING: { enumerable: false, @@ -273,18 +273,18 @@ ObjectDefineProperties(module.exports, { get: deprecate(getDefaultEncoding, 'crypto.DEFAULT_ENCODING is deprecated.', 'DEP0091'), set: deprecate(setDefaultEncoding, - 'crypto.DEFAULT_ENCODING is deprecated.', 'DEP0091') + 'crypto.DEFAULT_ENCODING is deprecated.', 'DEP0091'), }, constants: { configurable: false, enumerable: true, - value: constants + value: constants, }, webcrypto: { configurable: false, enumerable: true, - get() { return lazyRequire('internal/crypto/webcrypto'); } + get() { return lazyRequire('internal/crypto/webcrypto'); }, }, // Aliases for randomBytes are deprecated. @@ -295,7 +295,7 @@ ObjectDefineProperties(module.exports, { writable: true, value: pendingDeprecation ? deprecate(randomBytes, 'crypto.prng is deprecated.', 'DEP0115') : - randomBytes + randomBytes, }, pseudoRandomBytes: { enumerable: false, @@ -304,7 +304,7 @@ ObjectDefineProperties(module.exports, { value: pendingDeprecation ? deprecate(randomBytes, 'crypto.pseudoRandomBytes is deprecated.', 'DEP0115') : - randomBytes + randomBytes, }, rng: { enumerable: false, @@ -312,6 +312,6 @@ ObjectDefineProperties(module.exports, { writable: true, value: pendingDeprecation ? deprecate(randomBytes, 'crypto.rng is deprecated.', 'DEP0115') : - randomBytes - } + randomBytes, + }, }); diff --git a/lib/dgram.js b/lib/dgram.js index 4630be4dff8c5c..bcf22c6c3495b7 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -48,7 +48,7 @@ const { ERR_SOCKET_DGRAM_IS_CONNECTED, ERR_SOCKET_DGRAM_NOT_CONNECTED, ERR_SOCKET_DGRAM_NOT_RUNNING, - ERR_INVALID_FD_TYPE + ERR_INVALID_FD_TYPE, } = errors.codes; const { isInt32, @@ -63,14 +63,14 @@ const { isArrayBufferView } = require('internal/util/types'); const EventEmitter = require('events'); const { defaultTriggerAsyncIdScope, - symbols: { async_id_symbol, owner_symbol } + symbols: { async_id_symbol, owner_symbol }, } = require('internal/async_hooks'); const { UV_UDP_REUSEADDR } = internalBinding('constants').os; const { constants: { UV_UDP_IPV6ONLY }, UDP, - SendWrap + SendWrap, } = internalBinding('udp_wrap'); const BIND_STATE_UNBOUND = 0; @@ -128,7 +128,7 @@ function Socket(type, listener) { reuseAddr: options && options.reuseAddr, // Use UV_UDP_REUSEADDR if true. ipv6Only: options && options.ipv6Only, recvBufferSize, - sendBufferSize + sendBufferSize, }; if (options?.signal !== undefined) { @@ -273,7 +273,7 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) { port: null, addressType: this.type, fd, - flags: null + flags: null, }, (err) => { // Callback to handle error. const ex = errnoException(err, 'open'); @@ -341,7 +341,7 @@ Socket.prototype.bind = function(port_, address_ /* , callback */) { port: port, addressType: this.type, fd: -1, - flags: flags + flags: flags, }, (err) => { // Callback to handle error. const ex = exceptionWithHostPort(err, 'bind', ip, port); @@ -979,7 +979,7 @@ ObjectDefineProperty(Socket.prototype, '_handle', { }, 'Socket.prototype._handle is deprecated', 'DEP0112'), set: deprecate(function(val) { this[kStateSymbol].handle = val; - }, 'Socket.prototype._handle is deprecated', 'DEP0112') + }, 'Socket.prototype._handle is deprecated', 'DEP0112'), }); @@ -989,7 +989,7 @@ ObjectDefineProperty(Socket.prototype, '_receiving', { }, 'Socket.prototype._receiving is deprecated', 'DEP0112'), set: deprecate(function(val) { this[kStateSymbol].receiving = val; - }, 'Socket.prototype._receiving is deprecated', 'DEP0112') + }, 'Socket.prototype._receiving is deprecated', 'DEP0112'), }); @@ -999,7 +999,7 @@ ObjectDefineProperty(Socket.prototype, '_bindState', { }, 'Socket.prototype._bindState is deprecated', 'DEP0112'), set: deprecate(function(val) { this[kStateSymbol].bindState = val; - }, 'Socket.prototype._bindState is deprecated', 'DEP0112') + }, 'Socket.prototype._bindState is deprecated', 'DEP0112'), }); @@ -1009,7 +1009,7 @@ ObjectDefineProperty(Socket.prototype, '_queue', { }, 'Socket.prototype._queue is deprecated', 'DEP0112'), set: deprecate(function(val) { this[kStateSymbol].queue = val; - }, 'Socket.prototype._queue is deprecated', 'DEP0112') + }, 'Socket.prototype._queue is deprecated', 'DEP0112'), }); @@ -1019,7 +1019,7 @@ ObjectDefineProperty(Socket.prototype, '_reuseAddr', { }, 'Socket.prototype._reuseAddr is deprecated', 'DEP0112'), set: deprecate(function(val) { this[kStateSymbol].reuseAddr = val; - }, 'Socket.prototype._reuseAddr is deprecated', 'DEP0112') + }, 'Socket.prototype._reuseAddr is deprecated', 'DEP0112'), }); @@ -1037,7 +1037,7 @@ Socket.prototype._stopReceiving = deprecate(function() { // want to runtime-deprecate it at some point. There's no hurry, though. ObjectDefineProperty(UDP.prototype, 'owner', { get() { return this[owner_symbol]; }, - set(v) { return this[owner_symbol] = v; } + set(v) { return this[owner_symbol] = v; }, }); @@ -1048,5 +1048,5 @@ module.exports = { 'DEP0112' ), createSocket, - Socket + Socket, }; diff --git a/lib/diagnostics_channel.js b/lib/diagnostics_channel.js index 1792980ec1b958..68dabdcd1efa38 100644 --- a/lib/diagnostics_channel.js +++ b/lib/diagnostics_channel.js @@ -13,7 +13,7 @@ const { const { codes: { ERR_INVALID_ARG_TYPE, - } + }, } = require('internal/errors'); const { validateFunction, @@ -117,5 +117,5 @@ function hasSubscribers(name) { module.exports = { channel, hasSubscribers, - Channel + Channel, }; diff --git a/lib/dns.js b/lib/dns.js index b75ca1ca7da082..ae655d7c563c02 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -82,7 +82,7 @@ function onlookupall(err, addresses) { const addr = addresses[i]; addresses[i] = { address: addr, - family: family || isIP(addr) + family: family || isIP(addr), }; } @@ -317,7 +317,7 @@ module.exports = { NOTINITIALIZED: 'ENOTINITIALIZED', LOADIPHLPAPI: 'ELOADIPHLPAPI', ADDRGETNETWORKPARAMS: 'EADDRGETNETWORKPARAMS', - CANCELLED: 'ECANCELLED' + CANCELLED: 'ECANCELLED', }; bindDefaultResolver(module.exports, getDefaultResolver()); @@ -332,6 +332,6 @@ ObjectDefineProperties(module.exports, { promises.setServers = defaultResolverSetServers; } return promises; - } - } + }, + }, }); diff --git a/lib/domain.js b/lib/domain.js index 74cd59c54e705b..c60e2b6b5e8957 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -45,7 +45,7 @@ const EventEmitter = require('events'); const { ERR_DOMAIN_CALLBACK_NOT_AVAILABLE, ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE, - ERR_UNHANDLED_ERROR + ERR_UNHANDLED_ERROR, } = require('internal/errors').codes; const { createHook } = require('async_hooks'); const { useDomainTrampoline } = require('internal/async_hooks'); @@ -64,7 +64,7 @@ ObjectDefineProperty(process, 'domain', { }, set: function(arg) { return _domain[0] = arg; - } + }, }); const pairing = new SafeMap(); @@ -77,7 +77,7 @@ const asyncHook = createHook({ configurable: true, enumerable: false, value: process.domain, - writable: true + writable: true, }); } }, @@ -102,7 +102,7 @@ const asyncHook = createHook({ }, destroy(asyncId) { pairing.delete(asyncId); // cleaning up - } + }, }); // When domains are in use, they claim full ownership of the @@ -229,7 +229,7 @@ Domain.prototype._errorHandler = function(er) { configurable: true, enumerable: false, value: this, - writable: true + writable: true, }); er.domainThrown = true; } @@ -354,7 +354,7 @@ Domain.prototype.add = function(ee) { configurable: true, enumerable: false, value: this, - writable: true + writable: true, }); ArrayPrototypePush(this.members, ee); }; @@ -386,7 +386,7 @@ function intercepted(_this, self, cb, fnargs) { configurable: true, enumerable: false, value: self, - writable: true + writable: true, }); self.emit('error', er); return; @@ -431,7 +431,7 @@ Domain.prototype.bind = function(cb) { configurable: true, enumerable: false, value: this, - writable: true + writable: true, }); return runBound; @@ -446,7 +446,7 @@ EventEmitter.init = function() { configurable: true, enumerable: false, value: null, - writable: true + writable: true, }); if (exports.active && !(this instanceof exports.Domain)) { this.domain = exports.active; @@ -480,7 +480,7 @@ EventEmitter.prototype.emit = function emit(...args) { configurable: true, enumerable: false, value: domain, - writable: true + writable: true, }); er.domainThrown = false; } diff --git a/lib/events.js b/lib/events.js index 7d219606a28b1b..4716aabd037cf9 100644 --- a/lib/events.js +++ b/lib/events.js @@ -40,7 +40,7 @@ const { String, Symbol, SymbolFor, - SymbolAsyncIterator + SymbolAsyncIterator, } = primordials; const kRejection = SymbolFor('nodejs.rejection'); @@ -52,12 +52,12 @@ const { codes: { ERR_INVALID_ARG_TYPE, ERR_OUT_OF_RANGE, - ERR_UNHANDLED_ERROR + ERR_UNHANDLED_ERROR, }, } = require('internal/errors'); const { - inspect + inspect, } = require('internal/util/inspect'); const { @@ -96,7 +96,7 @@ ObjectDefineProperty(EventEmitter, 'captureRejections', { EventEmitter.prototype[kCapture] = value; }, - enumerable: true + enumerable: true, }); EventEmitter.errorMonitor = kErrorMonitor; @@ -105,7 +105,7 @@ EventEmitter.errorMonitor = kErrorMonitor; ObjectDefineProperty(EventEmitter.prototype, kCapture, { value: false, writable: true, - enumerable: false + enumerable: false, }); EventEmitter.prototype._events = undefined; @@ -133,7 +133,7 @@ ObjectDefineProperty(EventEmitter, 'defaultMaxListeners', { arg); } defaultMaxListeners = arg; - } + }, }); ObjectDefineProperties(EventEmitter, { @@ -148,7 +148,7 @@ ObjectDefineProperties(EventEmitter, { enumerable: false, configurable: false, writable: false, - } + }, }); EventEmitter.setMaxListeners = @@ -333,7 +333,7 @@ EventEmitter.prototype.emit = function emit(type, ...args) { ErrorCaptureStackTrace(capture, EventEmitter.prototype.emit); ObjectDefineProperty(er, kEnhanceStackBeforeInspector, { value: enhanceStackTrace.bind(this, er, capture), - configurable: true + configurable: true, }); } catch {} @@ -840,7 +840,7 @@ function on(emitter, event, options) { [SymbolAsyncIterator]() { return this; - } + }, }, AsyncIteratorPrototype); eventTargetAgnosticAddListener(emitter, event, eventHandler); diff --git a/lib/fs.js b/lib/fs.js index 310397bbed39e1..f873a40ca6b13a 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -58,7 +58,7 @@ const { W_OK, X_OK, O_WRONLY, - O_SYMLINK + O_SYMLINK, } = constants; const pathModule = require('path'); @@ -79,7 +79,7 @@ const { }, AbortError, uvErrmapGet, - uvException + uvException, } = require('internal/errors'); const { FSReqCallback } = binding; @@ -116,12 +116,12 @@ const { validateRmOptionsSync, validateRmdirOptions, validateStringAfterArrayBufferView, - warnOnNonPortableTemplate + warnOnNonPortableTemplate, } = require('internal/fs/utils'); const { Dir, opendir, - opendirSync + opendirSync, } = require('internal/fs/dir'); const { CHAR_FORWARD_SLASH, @@ -269,7 +269,7 @@ function exists(path, callback) { ObjectDefineProperty(exists, internalUtil.promisify.custom, { value: (path) => { return new Promise((resolve) => fs.exists(path, resolve)); - } + }, }); // fs.existsSync never throws, it only returns true or false. @@ -620,7 +620,7 @@ function read(fd, buffer, offset, length, position, callback) { buffer = Buffer.alloc(16384), offset = 0, length = buffer.byteLength, - position + position, } = options); } @@ -916,7 +916,7 @@ function writev(fd, buffers, position, callback) { ObjectDefineProperty(writev, internalUtil.customPromisifyArgs, { value: ['bytesWritten', 'buffer'], - enumerable: false + enumerable: false, }); /** @@ -2293,7 +2293,7 @@ function watchFile(filename, options, listener) { // behavioral changes to a minimum. interval: 5007, persistent: true, - ...options + ...options, }; validateFunction(listener, 'listener'); @@ -2977,7 +2977,7 @@ module.exports = fs = { }, // For tests - _toUnixTimestamp: toUnixTimestamp + _toUnixTimestamp: toUnixTimestamp, }; ObjectDefineProperties(fs, { @@ -2988,7 +2988,7 @@ ObjectDefineProperties(fs, { constants: { configurable: false, enumerable: true, - value: constants + value: constants, }, promises: { configurable: true, @@ -2997,6 +2997,6 @@ ObjectDefineProperties(fs, { if (promises === null) promises = require('internal/fs/promises').exports; return promises; - } - } + }, + }, }); diff --git a/lib/http.js b/lib/http.js index 38f1297be7921f..70060b3d4f3375 100644 --- a/lib/http.js +++ b/lib/http.js @@ -34,13 +34,13 @@ const { IncomingMessage } = require('_http_incoming'); const { validateHeaderName, validateHeaderValue, - OutgoingMessage + OutgoingMessage, } = require('_http_outgoing'); const { _connectionListener, STATUS_CODES, Server, - ServerResponse + ServerResponse, } = require('_http_server'); let maxHeaderSize; @@ -123,7 +123,7 @@ module.exports = { validateHeaderName, validateHeaderValue, get, - request + request, }; ObjectDefineProperty(module.exports, 'maxHeaderSize', { @@ -136,7 +136,7 @@ ObjectDefineProperty(module.exports, 'maxHeaderSize', { } return maxHeaderSize; - } + }, }); ObjectDefineProperty(module.exports, 'globalAgent', { @@ -147,5 +147,5 @@ ObjectDefineProperty(module.exports, 'globalAgent', { }, set(value) { httpAgent.globalAgent = value; - } + }, }); diff --git a/lib/http2.js b/lib/http2.js index 14b4f57acdabd1..8db4d918629a1b 100644 --- a/lib/http2.js +++ b/lib/http2.js @@ -10,7 +10,7 @@ const { getUnpackedSettings, sensitiveHeaders, Http2ServerRequest, - Http2ServerResponse + Http2ServerResponse, } = require('internal/http2/core'); module.exports = { @@ -23,5 +23,5 @@ module.exports = { getUnpackedSettings, sensitiveHeaders, Http2ServerRequest, - Http2ServerResponse + Http2ServerResponse, }; diff --git a/lib/https.js b/lib/https.js index 080efe40faabba..61f77e248d392e 100644 --- a/lib/https.js +++ b/lib/https.js @@ -41,7 +41,7 @@ const { Agent: HttpAgent } = require('_http_agent'); const { Server: HttpServer, _connectionListener, - kServerResponse + kServerResponse, } = require('_http_server'); const { ClientRequest } = require('_http_client'); let debug = require('internal/util/debuglog').debuglog('https', (fn) => { @@ -128,7 +128,7 @@ function createConnection(port, host, options) { debug('reuse session for %j', options._agentKey); options = { session, - ...options + ...options, }; } } @@ -165,7 +165,7 @@ function Agent(options) { this._sessionCache = { map: {}, - list: [] + list: [], }; } ObjectSetPrototypeOf(Agent.prototype, HttpAgent.prototype); @@ -329,5 +329,5 @@ module.exports = { Server, createServer, get, - request + request, }; diff --git a/lib/inspector.js b/lib/inspector.js index d7518eff261f3a..3b0a8f075432d9 100644 --- a/lib/inspector.js +++ b/lib/inspector.js @@ -37,7 +37,7 @@ const { open, url, isEnabled, - waitForDebugger + waitForDebugger, } = internalBinding('inspector'); const connectionSymbol = Symbol('connectionProperty'); @@ -156,5 +156,5 @@ module.exports = { // This is dynamically added during bootstrap, // where the console from the VM is still available console: require('internal/util/inspector').consoleFromVM, - Session + Session, }; diff --git a/lib/internal/abort_controller.js b/lib/internal/abort_controller.js index 6c80aa7bf4f2b3..fedbdb05e52218 100644 --- a/lib/internal/abort_controller.js +++ b/lib/internal/abort_controller.js @@ -17,7 +17,7 @@ const { defineEventHandler, EventTarget, Event, - kTrustEvent + kTrustEvent, } = require('internal/event_target'); const { customInspectSymbol, @@ -26,7 +26,7 @@ const { inspect } = require('internal/util/inspect'); const { codes: { ERR_INVALID_THIS, - } + }, } = require('internal/errors'); const kAborted = Symbol('kAborted'); @@ -36,7 +36,7 @@ function customInspect(self, obj, depth, options) { return self; const opts = ObjectAssign({}, options, { - depth: options.depth === null ? null : options.depth - 1 + depth: options.depth === null ? null : options.depth - 1, }); return `${self.constructor.name} ${inspect(obj, opts)}`; @@ -60,7 +60,7 @@ class AbortSignal extends EventTarget { [customInspectSymbol](depth, options) { return customInspect(this, { - aborted: this.aborted + aborted: this.aborted, }, depth, options); } @@ -70,7 +70,7 @@ class AbortSignal extends EventTarget { } ObjectDefineProperties(AbortSignal.prototype, { - aborted: { enumerable: true } + aborted: { enumerable: true }, }); ObjectDefineProperty(AbortSignal.prototype, SymbolToStringTag, { @@ -93,7 +93,7 @@ function abortSignal(signal) { if (signal[kAborted]) return; signal[kAborted] = true; const event = new Event('abort', { - [kTrustEvent]: true + [kTrustEvent]: true, }); signal.dispatchEvent(event); } @@ -125,14 +125,14 @@ class AbortController { [customInspectSymbol](depth, options) { return customInspect(this, { - signal: this.signal + signal: this.signal, }, depth, options); } } ObjectDefineProperties(AbortController.prototype, { signal: { enumerable: true }, - abort: { enumerable: true } + abort: { enumerable: true }, }); ObjectDefineProperty(AbortController.prototype, SymbolToStringTag, { diff --git a/lib/internal/assert/assertion_error.js b/lib/internal/assert/assertion_error.js index 837c37b1221540..518a2edff27dd8 100644 --- a/lib/internal/assert/assertion_error.js +++ b/lib/internal/assert/assertion_error.js @@ -42,7 +42,7 @@ const kReadableOperator = { 'Expected "actual" not to be reference-equal to "expected":', notDeepEqual: 'Expected "actual" not to be loosely deep-equal to:', notIdentical: 'Values have same structure but are not reference-equal:', - notDeepEqualUnequal: 'Expected values not to be loosely deep-equal:' + notDeepEqualUnequal: 'Expected values not to be loosely deep-equal:', }; // Comparing short primitives should just show === / !== instead of using the @@ -334,11 +334,11 @@ class AssertionError extends Error { stackStartFn, details, // Compatibility with older versions. - stackStartFunction + stackStartFunction, } = options; let { actual, - expected + expected, } = options; const limit = Error.stackTraceLimit; @@ -444,7 +444,7 @@ class AssertionError extends Error { value: 'AssertionError [ERR_ASSERTION]', enumerable: false, writable: true, - configurable: true + configurable: true, }); this.code = 'ERR_ASSERTION'; if (details) { @@ -493,7 +493,7 @@ class AssertionError extends Error { const result = inspect(this, { ...ctx, customInspect: false, - depth: 0 + depth: 0, }); // Reset the properties after inspection. diff --git a/lib/internal/assert/calltracker.js b/lib/internal/assert/calltracker.js index d45fb67d611e8b..b2dfb656d795a0 100644 --- a/lib/internal/assert/calltracker.js +++ b/lib/internal/assert/calltracker.js @@ -41,7 +41,7 @@ class CallTracker { actual: 0, // eslint-disable-next-line no-restricted-syntax stackTrace: new Error(), - name: fn.name || 'calls' + name: fn.name || 'calls', }; const callChecks = this.#callChecks; callChecks.add(context); @@ -75,7 +75,7 @@ class CallTracker { actual: context.actual, expected: context.exact, operator: context.name, - stack: context.stackTrace + stack: context.stackTrace, }); } } diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index eac2471ff79fb2..9d8c21e0934fa0 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -38,7 +38,7 @@ const { setCallbackTrampoline } = async_wrap; const { async_hook_fields, async_id_fields, - execution_async_resources + execution_async_resources, } = async_wrap; // Store the pair executionAsyncId and triggerAsyncId in a AliasedFloat64Array // in Environment::AsyncHooks::async_ids_stack_ which tracks the resource @@ -76,7 +76,7 @@ const active_hooks = { // Keep track of the field counts held in active_hooks.tmp_array. Because the // async_hook_fields can't be reassigned, store each uint32 in an array that // is written back to async_hook_fields when active_hooks.array is restored. - tmp_fields: null + tmp_fields: null, }; const { registerDestroyHook } = async_wrap; @@ -255,7 +255,7 @@ function emitHookFactory(symbol, name) { // Set the name property of the function as it looks good in the stack trace. ObjectDefineProperty(fn, 'name', { - value: name + value: name, }); return fn; } @@ -552,10 +552,10 @@ module.exports = { symbols: { async_id_symbol, trigger_async_id_symbol, init_symbol, before_symbol, after_symbol, destroy_symbol, - promise_resolve_symbol, owner_symbol + promise_resolve_symbol, owner_symbol, }, constants: { - kInit, kBefore, kAfter, kDestroy, kTotals, kPromiseResolve + kInit, kBefore, kAfter, kDestroy, kTotals, kPromiseResolve, }, enableHooks, disableHooks, @@ -586,6 +586,6 @@ module.exports = { before: emitBeforeNative, after: emitAfterNative, destroy: emitDestroyNative, - promise_resolve: emitPromiseResolveNative - } + promise_resolve: emitPromiseResolveNative, + }, }; diff --git a/lib/internal/blob.js b/lib/internal/blob.js index 927b9f54046bf2..72a939e254fcc8 100644 --- a/lib/internal/blob.js +++ b/lib/internal/blob.js @@ -45,7 +45,7 @@ const { codes: { ERR_INVALID_ARG_TYPE, ERR_BUFFER_TOO_LARGE, - } + }, } = require('internal/errors'); const { @@ -135,7 +135,7 @@ class Blob extends JSTransferable { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `Blob ${inspect({ @@ -150,7 +150,7 @@ class Blob extends JSTransferable { const length = this[kLength]; return { data: { handle, type, length }, - deserializeInfo: 'internal/blob:InternalBlob' + deserializeInfo: 'internal/blob:InternalBlob', }; } @@ -202,7 +202,7 @@ class Blob extends JSTransferable { const { promise, resolve, - reject + reject, } = createDeferredPromise(); job.ondone = (err, ab) => { if (err !== undefined) diff --git a/lib/internal/blocklist.js b/lib/internal/blocklist.js index a73f3f19de07ff..c0bce00321fc8b 100644 --- a/lib/internal/blocklist.js +++ b/lib/internal/blocklist.js @@ -3,7 +3,7 @@ const { Boolean, ObjectSetPrototypeOf, - Symbol + Symbol, } = primordials; const { @@ -49,11 +49,11 @@ class BlockList extends JSTransferable { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `BlockList ${inspect({ - rules: this.rules + rules: this.rules, }, opts)}`; } diff --git a/lib/internal/bootstrap/environment.js b/lib/internal/bootstrap/environment.js index 79a67dae378202..7c77ccbc5cff0d 100644 --- a/lib/internal/bootstrap/environment.js +++ b/lib/internal/bootstrap/environment.js @@ -6,7 +6,7 @@ /* global markBootstrapComplete */ const { - prepareMainThreadExecution + prepareMainThreadExecution, } = require('internal/bootstrap/pre_execution'); prepareMainThreadExecution(); diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index c392da2468fce6..71d211d864e172 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -66,7 +66,7 @@ ObjectDefineProperty(process, 'moduleLoadList', { value: moduleLoadList, configurable: true, enumerable: true, - writable: false + writable: false, }); @@ -174,7 +174,7 @@ let internalBinding; const loaderId = 'internal/bootstrap/loaders'; const { moduleIds, - compileFunction + compileFunction, } = internalBinding('native_module'); const getOwn = (target, property, receiver) => { @@ -326,7 +326,7 @@ class NativeModule { const loaderExports = { internalBinding, NativeModule, - require: nativeModuleRequire + require: nativeModuleRequire, }; function nativeModuleRequire(id) { diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 81a9547b9071bc..db0b4dec6dea14 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -79,7 +79,7 @@ const deprecationHandler = { if (!this.warned) { process.emitWarning(this.message, { type: 'DeprecationWarning', - code: this.code + code: this.code, }); this.warned = true; } @@ -117,7 +117,7 @@ const deprecationHandler = { setPrototypeOf(target, proto) { this.maybeWarn(); return ObjectSetPrototypeOf(target, proto); - } + }, }; // eslint-disable-next-line node-core/prefer-primordials @@ -132,7 +132,7 @@ ObjectDefineProperty(process, 'config', { set(value) { deprecationHandler.maybeWarn(); processConfig = value; - } + }, }); require('internal/worker/js_transferable').setup(); @@ -186,7 +186,7 @@ internalBinding('async_wrap').setupHooks(nativeHooks); const { setupTaskQueue, - queueMicrotask + queueMicrotask, } = require('internal/process/task_queues'); if (!config.noBrowserGlobals) { @@ -203,7 +203,7 @@ if (!config.noBrowserGlobals) { exposeInterface(globalThis, 'URLSearchParams', URLSearchParams); const { - TextEncoder, TextDecoder + TextEncoder, TextDecoder, } = require('internal/encoding'); // https://encoding.spec.whatwg.org/#textencoder exposeInterface(globalThis, 'TextEncoder', TextEncoder); @@ -272,11 +272,11 @@ ObjectDefineProperty(process, 'allowedNodeEnvironmentFlags', { value, configurable: true, enumerable: true, - writable: true + writable: true, }); }, enumerable: true, - configurable: true + configurable: true, }); // process.assert @@ -302,21 +302,21 @@ const features = { // Make it possible to build snapshot with code cache get cached_builtins() { return nativeModule.hasCachedBuiltins(); - } + }, }; ObjectDefineProperty(process, 'features', { enumerable: true, writable: false, configurable: false, - value: features + value: features, }); { const { onGlobalUncaughtException, setUncaughtExceptionCaptureCallback, - hasUncaughtExceptionCaptureCallback + hasUncaughtExceptionCaptureCallback, } = require('internal/process/execution'); // For legacy reasons this is still called `_fatalException`, even @@ -365,14 +365,14 @@ require('v8'); function setupPrepareStackTrace() { const { setEnhanceStackForFatalException, - setPrepareStackTraceCallback + setPrepareStackTraceCallback, } = internalBinding('errors'); const { prepareStackTrace, fatalExceptionStackEnhancers: { beforeInspector, - afterInspector - } + afterInspector, + }, } = require('internal/errors'); // Tell our PrepareStackTraceCallback passed to the V8 API // to call prepareStackTrace(). @@ -390,14 +390,14 @@ function setupProcessObject() { enumerable: false, writable: true, configurable: false, - value: 'process' + value: 'process', }); // Make process globally available to users by putting it on the global proxy ObjectDefineProperty(globalThis, 'process', { value: process, enumerable: false, writable: true, - configurable: true + configurable: true, }); } @@ -406,7 +406,7 @@ function setupGlobalProxy() { value: 'global', writable: false, enumerable: false, - configurable: true + configurable: true, }); } @@ -468,7 +468,7 @@ function exposeNamespace(target, name, namespaceObject) { writable: true, enumerable: false, configurable: true, - value: namespaceObject + value: namespaceObject, }); } @@ -478,7 +478,7 @@ function exposeInterface(target, name, interfaceObject) { writable: true, enumerable: false, configurable: true, - value: interfaceObject + value: interfaceObject, }); } @@ -488,7 +488,7 @@ function defineOperation(target, name, method) { writable: true, enumerable: true, configurable: true, - value: method + value: method, }); } @@ -506,6 +506,6 @@ function defineLazyGlobal(target, name, loader) { set(val) { value = val; overridden = true; - } + }, }); } diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index e52da0868e1ad2..f2394fadf2bd6a 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -11,7 +11,7 @@ const { const { getOptionValue, - shouldNotRegisterESMLoader + shouldNotRegisterESMLoader, } = require('internal/options'); const { reconnectZeroFillToggle } = require('internal/buffer'); @@ -85,7 +85,7 @@ function patchProcessObject(expandArgv1) { // deserialization). const { hrtime, - hrtimeBigInt + hrtimeBigInt, } = require('internal/process/per_thread').getFastAPIs(binding); process.hrtime = hrtime; @@ -94,7 +94,7 @@ function patchProcessObject(expandArgv1) { ObjectDefineProperty(process, 'argv0', { enumerable: true, configurable: false, - value: process.argv[0] + value: process.argv[0], }); process.argv[0] = process.execPath; @@ -131,14 +131,14 @@ function addReadOnlyProcessAlias(name, option, enumerable = true) { writable: false, configurable: true, enumerable, - value + value, }); } } function setupWarningHandler() { const { - onWarning + onWarning, } = require('internal/process/warning'); if (!getOptionValue('--no-warnings') && process.env.NODE_NO_WARNINGS !== '1') { @@ -184,7 +184,7 @@ function initializeReport() { configurable: true, get() { return report; - } + }, }); } @@ -231,7 +231,7 @@ function setupInspectorHooks() { if (internalBinding('config').hasInspector) { const { enable, - disable + disable, } = require('internal/inspector_async_hook'); internalBinding('inspector').registerAsyncHook(enable, disable); } @@ -285,7 +285,7 @@ function initializeDeprecations() { writable: false, enumerable: true, configurable: true, - value: noBrowserGlobals + value: noBrowserGlobals, }); } @@ -311,7 +311,7 @@ function initializeDeprecations() { _process = value; }, enumerable: false, - configurable: true + configurable: true, }); let _Buffer = Buffer; @@ -323,7 +323,7 @@ function initializeDeprecations() { _Buffer = value; }, enumerable: false, - configurable: true + configurable: true, }); } @@ -383,7 +383,7 @@ function initializePolicy() { for (let i = 0; i < integrityEntries.length; i++) { const { algorithm, - value: expected + value: expected, } = integrityEntries[i]; const hash = createHash(algorithm); hash.update(src); @@ -427,7 +427,7 @@ function initializeESMLoader() { const { setImportModuleDynamicallyCallback, - setInitializeImportMetaObjectCallback + setInitializeImportMetaObjectCallback, } = internalBinding('module_wrap'); const esm = require('internal/process/esm_loader'); // Setup per-isolate callbacks that locate data or callbacks that we keep @@ -450,7 +450,7 @@ function loadPreloadModules() { if (preloadModules && preloadModules.length > 0) { const { Module: { - _preloadModules + _preloadModules, }, } = require('internal/modules/cjs/loader'); _preloadModules(preloadModules); @@ -471,5 +471,5 @@ module.exports = { setupInspectorHooks, initializeReport, initializeCJSLoader, - initializeWASI + initializeWASI, }; diff --git a/lib/internal/bootstrap/switches/does_not_own_process_state.js b/lib/internal/bootstrap/switches/does_not_own_process_state.js index 69946e802e1115..21be25384ff673 100644 --- a/lib/internal/bootstrap/switches/does_not_own_process_state.js +++ b/lib/internal/bootstrap/switches/does_not_own_process_state.js @@ -23,7 +23,7 @@ if (credentials.implementsPosixCredentials) { // ---- compare the setups side-by-side ----- const { - codes: { ERR_WORKER_UNSUPPORTED_OPERATION } + codes: { ERR_WORKER_UNSUPPORTED_OPERATION }, } = require('internal/errors'); function wrappedUmask(mask) { diff --git a/lib/internal/bootstrap/switches/does_own_process_state.js b/lib/internal/bootstrap/switches/does_own_process_state.js index 2924e7f8cc17fa..e12295abf5dd8d 100644 --- a/lib/internal/bootstrap/switches/does_own_process_state.js +++ b/lib/internal/bootstrap/switches/does_own_process_state.js @@ -25,18 +25,18 @@ if (credentials.implementsPosixCredentials) { const { parseFileMode, validateArray, - validateString + validateString, } = require('internal/validators'); function wrapPosixCredentialSetters(credentials) { const { codes: { ERR_INVALID_ARG_TYPE, - ERR_UNKNOWN_CREDENTIAL - } + ERR_UNKNOWN_CREDENTIAL, + }, } = require('internal/errors'); const { - validateUint32 + validateUint32, } = require('internal/validators'); const { @@ -45,7 +45,7 @@ function wrapPosixCredentialSetters(credentials) { setegid: _setegid, seteuid: _seteuid, setgid: _setgid, - setuid: _setuid + setuid: _setuid, } = credentials; function initgroups(user, extraGroup) { @@ -99,7 +99,7 @@ function wrapPosixCredentialSetters(credentials) { setegid: wrapIdSetter('Group', _setegid), seteuid: wrapIdSetter('User', _seteuid), setgid: wrapIdSetter('Group', _setgid), - setuid: wrapIdSetter('User', _setuid) + setuid: wrapIdSetter('User', _setuid), }; } diff --git a/lib/internal/bootstrap/switches/is_main_thread.js b/lib/internal/bootstrap/switches/is_main_thread.js index 08623898edafac..0f81eb036c0481 100644 --- a/lib/internal/bootstrap/switches/is_main_thread.js +++ b/lib/internal/bootstrap/switches/is_main_thread.js @@ -17,7 +17,7 @@ function defineStream(name, getter) { ObjectDefineProperty(process, name, { configurable: true, enumerable: true, - get: getter + get: getter, }); } @@ -28,7 +28,7 @@ defineStream('stderr', getStderr); // Worker threads don't receive signals. const { startListeningIfSignal, - stopListeningIfSignal + stopListeningIfSignal, } = require('internal/process/signal'); process.on('newListener', startListeningIfSignal); process.on('removeListener', stopListeningIfSignal); @@ -66,13 +66,13 @@ function createWritableStdioStream(fd) { stream = new net.Socket({ handle: process[kChannelHandle], readable: false, - writable: true + writable: true, }); } else { stream = new net.Socket({ fd, readable: false, - writable: true + writable: true, }); } @@ -86,7 +86,7 @@ function createWritableStdioStream(fd) { stream = new Writable({ write(buf, enc, cb) { cb(); - } + }, }); } @@ -151,7 +151,7 @@ function getStdin() { stdin = new tty.ReadStream(fd, { highWaterMark: 0, readable: true, - writable: false + writable: false, }); break; @@ -173,14 +173,14 @@ function getStdin() { handle: process.channel, readable: true, writable: false, - manualStart: true + manualStart: true, }); } else { stdin = new net.Socket({ fd: fd, readable: true, writable: false, - manualStart: true + manualStart: true, }); } // Make sure the stdin can't be `.end()`-ed diff --git a/lib/internal/bootstrap/switches/is_not_main_thread.js b/lib/internal/bootstrap/switches/is_not_main_thread.js index 379ad0a587a22a..5f56f33d57f455 100644 --- a/lib/internal/bootstrap/switches/is_not_main_thread.js +++ b/lib/internal/bootstrap/switches/is_not_main_thread.js @@ -9,7 +9,7 @@ function defineStream(name, getter) { ObjectDefineProperty(process, name, { configurable: true, enumerable: true, - get: getter + get: getter, }); } @@ -20,7 +20,7 @@ defineStream('stderr', getStderr); // Worker threads don't receive signals. const { startListeningIfSignal, - stopListeningIfSignal + stopListeningIfSignal, } = require('internal/process/signal'); process.removeListener('newListener', startListeningIfSignal); process.removeListener('removeListener', stopListeningIfSignal); @@ -29,7 +29,7 @@ process.removeListener('removeListener', stopListeningIfSignal); // ---- compare the setups side-by-side ----- const { - createWorkerStdio + createWorkerStdio, } = require('internal/worker/io'); let workerStdio; diff --git a/lib/internal/buffer.js b/lib/internal/buffer.js index bd38cf48a7fc6e..bafc93b5f5245d 100644 --- a/lib/internal/buffer.js +++ b/lib/internal/buffer.js @@ -12,7 +12,7 @@ const { const { ERR_BUFFER_OUT_OF_BOUNDS, ERR_INVALID_ARG_TYPE, - ERR_OUT_OF_RANGE + ERR_OUT_OF_RANGE, } = require('internal/errors').codes; const { validateNumber } = require('internal/validators'); const { @@ -30,7 +30,7 @@ const { hexWrite, ucs2Write, utf8Write, - getZeroFillToggle + getZeroFillToggle, } = internalBinding('buffer'); const { untransferable_object_private_symbol, @@ -1080,5 +1080,5 @@ module.exports = { createUnsafeBuffer, readUInt16BE, readUInt32BE, - reconnectZeroFillToggle + reconnectZeroFillToggle, }; diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 7ff0832538f1e7..689f294549c140 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -26,8 +26,8 @@ const { ERR_IPC_DISCONNECTED, ERR_IPC_ONE_PIPE, ERR_IPC_SYNC_FORK, - ERR_MISSING_ARGS - } + ERR_MISSING_ARGS, + }, } = require('internal/errors'); const { validateArray, @@ -47,7 +47,7 @@ const { kReadBytesOrError, kArrayBufferOffset, kLastWriteWasAsync, - streamBaseState + streamBaseState, } = internalBinding('stream_wrap'); const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap'); const { TCP } = internalBinding('tcp_wrap'); @@ -68,7 +68,7 @@ const { UV_ENFILE, UV_ENOENT, UV_ENOSYS, - UV_ESRCH + UV_ESRCH, } = internalBinding('uv'); const { SocketListSend, SocketListReceive } = SocketList; @@ -94,7 +94,7 @@ const handleConversion = { got(message, handle, emit) { emit(handle); - } + }, }, 'net.Server': { @@ -109,7 +109,7 @@ const handleConversion = { server.listen(handle, () => { emit(server); }); - } + }, }, 'net.Socket': { @@ -183,7 +183,7 @@ const handleConversion = { const socket = new net.Socket({ handle: handle, readable: true, - writable: true + writable: true, }); // If the socket was created by net.Server we will track the socket @@ -192,12 +192,12 @@ const handleConversion = { // Add socket to connections list const socketList = getSocketList('got', this, message.key); socketList.add({ - socket: socket + socket: socket, }); } emit(socket); - } + }, }, 'dgram.Native': { @@ -209,7 +209,7 @@ const handleConversion = { got(message, handle, emit) { emit(handle); - } + }, }, 'dgram.Socket': { @@ -227,8 +227,8 @@ const handleConversion = { socket.bind(handle, () => { emit(socket); }); - } - } + }, + }, }; function stdioStringToArray(stdio, channel) { @@ -582,7 +582,7 @@ function setupChannel(target, channel, serializationMode) { target.channel = val; }, channelDeprecationMsg, 'DEP0129'), configurable: true, - enumerable: false + enumerable: false, }); target._handleQueue = null; @@ -593,7 +593,7 @@ function setupChannel(target, channel, serializationMode) { const { initMessageChannel, parseChannelMessages, - writeChannelMessage + writeChannelMessage, } = serialization[serializationMode]; let pendingHandle = null; @@ -761,7 +761,7 @@ function setupChannel(target, channel, serializationMode) { message = { cmd: 'NODE_HANDLE', type: null, - msg: message + msg: message, }; if (handle instanceof net.Socket) { @@ -984,7 +984,7 @@ function getValidStdio(stdio, sync) { const a = { type: stdio === 'overlapped' ? 'overlapped' : 'pipe', readable: i === 0, - writable: i !== 0 + writable: i !== 0, }; if (!sync) @@ -1007,17 +1007,17 @@ function getValidStdio(stdio, sync) { ArrayPrototypePush(acc, { type: 'pipe', handle: ipc, - ipc: true + ipc: true, }); } else if (stdio === 'inherit') { ArrayPrototypePush(acc, { type: 'inherit', - fd: i + fd: i, }); } else if (typeof stdio === 'number' || typeof stdio.fd === 'number') { ArrayPrototypePush(acc, { type: 'fd', - fd: typeof stdio === 'number' ? stdio : stdio.fd + fd: typeof stdio === 'number' ? stdio : stdio.fd, }); } else if (getHandleWrapType(stdio) || getHandleWrapType(stdio.handle) || getHandleWrapType(stdio._handle)) { @@ -1029,7 +1029,7 @@ function getValidStdio(stdio, sync) { type: 'wrap', wrapType: getHandleWrapType(handle), handle: handle, - _stdio: stdio + _stdio: stdio, }); } else if (isArrayBufferView(stdio) || typeof stdio === 'string') { if (!sync) { @@ -1097,5 +1097,5 @@ module.exports = { setupChannel, getValidStdio, stdioStringToArray, - spawnSync + spawnSync, }; diff --git a/lib/internal/cluster/child.js b/lib/internal/cluster/child.js index 00638e7784550b..4b7dc9fd415bd1 100644 --- a/lib/internal/cluster/child.js +++ b/lib/internal/cluster/child.js @@ -32,7 +32,7 @@ cluster._setupWorker = function() { const worker = new Worker({ id: +process.env.NODE_UNIQUE_ID | 0, process: process, - state: 'online' + state: 'online', }); cluster.worker = worker; @@ -88,7 +88,7 @@ cluster._getServer = function(obj, options, cb) { act: 'queryServer', index, data: null, - ...options + ...options, }; message.address = address; diff --git a/lib/internal/cluster/primary.js b/lib/internal/cluster/primary.js index 69e97eb8a6837f..f0c1d2d0b8b710 100644 --- a/lib/internal/cluster/primary.js +++ b/lib/internal/cluster/primary.js @@ -65,7 +65,7 @@ cluster.setupPrimary = function(options) { execArgv: process.execArgv, silent: false, ...cluster.settings, - ...options + ...options, }; // Tell V8 to write profile data for each process to a separate file. @@ -150,7 +150,7 @@ function createWorkerProcess(id, env) { execArgv: execArgv, stdio: cluster.settings.stdio, gid: cluster.settings.gid, - uid: cluster.settings.uid + uid: cluster.settings.uid, }); } @@ -179,7 +179,7 @@ cluster.fork = function(env) { const workerProcess = createWorkerProcess(id, env); const worker = new Worker({ id: id, - process: workerProcess + process: workerProcess, }); worker.on('message', function(message, handle) { @@ -331,7 +331,7 @@ function queryServer(worker, message) { key, ack: message.seq, data, - ...reply + ...reply, }, handle); }); } @@ -341,7 +341,7 @@ function listening(worker, message) { addressType: message.addressType, address: message.address, port: message.port, - fd: message.fd + fd: message.fd, }; worker.state = 'listening'; diff --git a/lib/internal/cluster/utils.js b/lib/internal/cluster/utils.js index 732d33e46936a8..5776eac2cfdc17 100644 --- a/lib/internal/cluster/utils.js +++ b/lib/internal/cluster/utils.js @@ -7,7 +7,7 @@ const { module.exports = { sendHelper, - internal + internal, }; const callbacks = new SafeMap(); diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 22b84e5e42b956..6bda5812dd55cb 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -52,7 +52,7 @@ const { previewEntries } = internalBinding('util'); const { Buffer: { isBuffer } } = require('buffer'); const { inspect, - formatWithOptions + formatWithOptions, } = require('internal/util/inspect'); const { isTypedArray, isSet, isMap, isSetIterator, isMapIterator, @@ -108,7 +108,7 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) { options = { stdout: options, stderr: arguments[1], - ignoreErrors: arguments[2] + ignoreErrors: arguments[2], }; } @@ -157,7 +157,7 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) { // from the prototype chain of the subclass. this[key] = FunctionPrototypeBind(this[key], this); ObjectDefineProperty(this[key], 'name', { - value: key + value: key, }); }); @@ -168,14 +168,14 @@ function Console(options /* or: stdout, stderr, ignoreErrors = true */) { const consolePropAttributes = { writable: true, enumerable: false, - configurable: true + configurable: true, }; // Fixup global.console instanceof global.console.Console ObjectDefineProperty(Console, SymbolHasInstance, { value(instance) { return instance[kIsConsole]; - } + }, }); const kColorInspectOptions = { colors: true }; @@ -188,9 +188,9 @@ ObjectDefineProperties(Console.prototype, { value: function(stdout, stderr) { ObjectDefineProperties(this, { '_stdout': { ...consolePropAttributes, value: stdout }, - '_stderr': { ...consolePropAttributes, value: stderr } + '_stderr': { ...consolePropAttributes, value: stderr }, }); - } + }, }, [kBindStreamsLazy]: { ...consolePropAttributes, @@ -207,7 +207,7 @@ ObjectDefineProperties(Console.prototype, { if (!stdout) stdout = object.stdout; return stdout; }, - set(value) { stdout = value; } + set(value) { stdout = value; }, }, '_stderr': { enumerable: false, @@ -216,10 +216,10 @@ ObjectDefineProperties(Console.prototype, { if (!stderr) { stderr = object.stderr; } return stderr; }, - set(value) { stderr = value; } - } + set(value) { stderr = value; }, + }, }); - } + }, }, [kBindProperties]: { ...consolePropAttributes, @@ -227,15 +227,15 @@ ObjectDefineProperties(Console.prototype, { ObjectDefineProperties(this, { '_stdoutErrorHandler': { ...consolePropAttributes, - value: createWriteErrorHandler(this, kUseStdout) + value: createWriteErrorHandler(this, kUseStdout), }, '_stderrErrorHandler': { ...consolePropAttributes, - value: createWriteErrorHandler(this, kUseStderr) + value: createWriteErrorHandler(this, kUseStderr), }, '_ignoreErrors': { ...consolePropAttributes, - value: Boolean(ignoreErrors) + value: Boolean(ignoreErrors), }, '_times': { ...consolePropAttributes, value: new SafeMap() }, // Corresponds to https://console.spec.whatwg.org/#count-map @@ -245,16 +245,16 @@ ObjectDefineProperties(Console.prototype, { [kGroupIndent]: { ...consolePropAttributes, value: '' }, [kGroupIndentationWidth]: { ...consolePropAttributes, - value: groupIndentation + value: groupIndentation, }, [SymbolToStringTag]: { writable: false, enumerable: false, configurable: true, - value: 'console' - } + value: 'console', + }, }); - } + }, }, [kWriteToConsole]: { ...consolePropAttributes, @@ -296,7 +296,7 @@ ObjectDefineProperties(Console.prototype, { } finally { stream.removeListener('error', noop); } - } + }, }, [kGetInspectOptions]: { ...consolePropAttributes, @@ -317,7 +317,7 @@ ObjectDefineProperties(Console.prototype, { } return color ? kColorInspectOptions : kNoColorInspectOptions; - } + }, }, [kFormatForStdout]: { ...consolePropAttributes, @@ -325,7 +325,7 @@ ObjectDefineProperties(Console.prototype, { const opts = this[kGetInspectOptions](this._stdout); ArrayPrototypeUnshift(args, opts); return ReflectApply(formatWithOptions, null, args); - } + }, }, [kFormatForStderr]: { ...consolePropAttributes, @@ -333,7 +333,7 @@ ObjectDefineProperties(Console.prototype, { const opts = this[kGetInspectOptions](this._stderr); ArrayPrototypeUnshift(args, opts); return ReflectApply(formatWithOptions, null, args); - } + }, }, }); @@ -373,7 +373,7 @@ const consoleMethods = { this[kWriteToConsole](kUseStdout, inspect(object, { customInspect: false, ...this[kGetInspectOptions](this._stdout), - ...options + ...options, })); }, @@ -408,7 +408,7 @@ const consoleMethods = { trace: function trace(...args) { const err = { name: 'Trace', - message: this[kFormatForStderr](args) + message: this[kFormatForStderr](args), }; ErrorCaptureStackTrace(err, trace); this.error(err.stack); @@ -501,7 +501,7 @@ const consoleMethods = { depth, maxArrayLength: 3, breakLength: Infinity, - ...this[kGetInspectOptions](this._stdout) + ...this[kGetInspectOptions](this._stdout), }; return inspect(v, opt); }; @@ -676,5 +676,5 @@ module.exports = { Console, kBindStreamsLazy, kBindProperties, - formatTime // exported for tests + formatTime, // exported for tests }; diff --git a/lib/internal/console/global.js b/lib/internal/console/global.js index d6c0c24d529dcc..4bd320bbfe8821 100644 --- a/lib/internal/console/global.js +++ b/lib/internal/console/global.js @@ -23,7 +23,7 @@ const { const { Console, kBindStreamsLazy, - kBindProperties + kBindProperties, } = require('internal/console/constructor'); const globalConsole = ObjectCreate({}); diff --git a/lib/internal/constants.js b/lib/internal/constants.js index bf539a9f37d134..8d7204f6cb48f7 100644 --- a/lib/internal/constants.js +++ b/lib/internal/constants.js @@ -52,5 +52,5 @@ module.exports = { CHAR_0: 48, /* 0 */ CHAR_9: 57, /* 9 */ - EOL: isWindows ? '\r\n' : '\n' + EOL: isWindows ? '\r\n' : '\n', }; diff --git a/lib/internal/crypto/aes.js b/lib/internal/crypto/aes.js index a35e3469a514bc..d014a4be452ecf 100644 --- a/lib/internal/crypto/aes.js +++ b/lib/internal/crypto/aes.js @@ -48,7 +48,7 @@ const { const { codes: { ERR_INVALID_ARG_TYPE, - } + }, } = require('internal/errors'); const { diff --git a/lib/internal/crypto/cipher.js b/lib/internal/crypto/cipher.js index 1b6ad0e7ea601c..446451ed3f6aa2 100644 --- a/lib/internal/crypto/cipher.js +++ b/lib/internal/crypto/cipher.js @@ -19,7 +19,7 @@ const { crypto: { RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, - } + }, } = internalBinding('constants'); const { @@ -27,7 +27,7 @@ const { ERR_CRYPTO_INVALID_STATE, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - } + }, } = require('internal/errors'); const { diff --git a/lib/internal/crypto/diffiehellman.js b/lib/internal/crypto/diffiehellman.js index 2e38e95ea1d774..1e25af79758f1d 100644 --- a/lib/internal/crypto/diffiehellman.js +++ b/lib/internal/crypto/diffiehellman.js @@ -31,7 +31,7 @@ const { ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - } + }, } = require('internal/errors'); const { @@ -77,7 +77,7 @@ const { POINT_CONVERSION_COMPRESSED, POINT_CONVERSION_HYBRID, POINT_CONVERSION_UNCOMPRESSED, - } + }, } = internalBinding('constants'); const DH_GENERATOR = 2; @@ -137,7 +137,7 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) { ObjectDefineProperty(this, 'verifyError', { enumerable: true, value: this[kHandle].verifyError, - writable: false + writable: false, }); } @@ -149,7 +149,7 @@ function DiffieHellmanGroup(name) { ObjectDefineProperty(this, 'verifyError', { enumerable: true, value: this[kHandle].verifyError, - writable: false + writable: false, }); } @@ -387,7 +387,7 @@ async function dhGenerateKey( name, primeLength, generator, - group + group, } = algorithm; let { prime } = algorithm; @@ -570,7 +570,7 @@ async function dhImportKey( keyObject = createPublicKey({ key: keyData, format: 'der', - type: 'spki' + type: 'spki', }); break; } @@ -579,7 +579,7 @@ async function dhImportKey( keyObject = createPrivateKey({ key: keyData, format: 'der', - type: 'pkcs8' + type: 'pkcs8', }); break; } diff --git a/lib/internal/crypto/dsa.js b/lib/internal/crypto/dsa.js index b615c3a9cb932f..32b2438323673d 100644 --- a/lib/internal/crypto/dsa.js +++ b/lib/internal/crypto/dsa.js @@ -20,7 +20,7 @@ const { codes: { ERR_INVALID_ARG_TYPE, ERR_MISSING_OPTION, - } + }, } = require('internal/errors'); const { @@ -76,7 +76,7 @@ async function dsaGenerateKey( name, modulusLength, divisorLength, - hash + hash, } = algorithm; if (hash === undefined) @@ -106,7 +106,7 @@ async function dsaGenerateKey( name, modulusLength, divisorLength, - hash: { name: hash.name } + hash: { name: hash.name }, }; const publicKey = @@ -162,7 +162,7 @@ async function dsaImportKey( keyObject = createPublicKey({ key: keyData, format: 'der', - type: 'spki' + type: 'spki', }); break; } @@ -171,7 +171,7 @@ async function dsaImportKey( keyObject = createPrivateKey({ key: keyData, format: 'der', - type: 'pkcs8' + type: 'pkcs8', }); break; } @@ -236,7 +236,7 @@ async function dsaImportKey( name: algorithm.name, modulusLength, divisorLength, - hash: algorithm.hash + hash: algorithm.hash, }, keyUsages, extractable); } diff --git a/lib/internal/crypto/ec.js b/lib/internal/crypto/ec.js index ee14eed7d083a7..6ea0f6ff9e6e0c 100644 --- a/lib/internal/crypto/ec.js +++ b/lib/internal/crypto/ec.js @@ -30,7 +30,7 @@ const { codes: { ERR_INVALID_ARG_TYPE, ERR_MISSING_OPTION, - } + }, } = require('internal/errors'); const { @@ -288,7 +288,7 @@ async function ecImportKey( keyObject = createPublicKey({ key: keyData, format: 'der', - type: 'spki' + type: 'spki', }); break; } @@ -297,7 +297,7 @@ async function ecImportKey( keyObject = createPrivateKey({ key: keyData, format: 'der', - type: 'pkcs8' + type: 'pkcs8', }); break; } @@ -429,7 +429,7 @@ async function ecImportKey( if (checkNamedCurve) { const { - namedCurve: checkNamedCurve + namedCurve: checkNamedCurve, } = keyObject[kHandle].keyDetail({}); if (kNamedCurveAliases[namedCurve] !== checkNamedCurve) throw lazyDOMException('Named curve mismatch', 'DataError'); diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js index 6c502f52b66503..80354293632e62 100644 --- a/lib/internal/crypto/hash.js +++ b/lib/internal/crypto/hash.js @@ -37,7 +37,7 @@ const { ERR_CRYPTO_HASH_FINALIZED, ERR_CRYPTO_HASH_UPDATE_FAILED, ERR_INVALID_ARG_TYPE, - } + }, } = require('internal/errors'); const { @@ -66,7 +66,7 @@ function Hash(algorithm, options) { validateUint32(xofLen, 'options.outputLength'); this[kHandle] = new _Hash(algorithm, xofLen); this[kState] = { - [kFinalized]: false + [kFinalized]: false, }; ReflectApply(LazyTransform, this, [options]); } @@ -133,7 +133,7 @@ function Hmac(hmac, key, options) { this[kHandle] = new _Hmac(); this[kHandle].init(hmac, key); this[kState] = { - [kFinalized]: false + [kFinalized]: false, }; ReflectApply(LazyTransform, this, [options]); } diff --git a/lib/internal/crypto/hashnames.js b/lib/internal/crypto/hashnames.js index be5064532c86c9..ae11d6b40f5adc 100644 --- a/lib/internal/crypto/hashnames.js +++ b/lib/internal/crypto/hashnames.js @@ -54,7 +54,7 @@ const kHashNames = { [kHashContextJwkRsaOaep]: 'RSA-OAEP-512', [kHashContextJwkHmac]: 'HS512', [kHashContextJwkDsa]: 'NODE-DSA-SHA-512', - } + }, }; { diff --git a/lib/internal/crypto/keygen.js b/lib/internal/crypto/keygen.js index 06490e24a9c24f..cf1d86084ac79e 100644 --- a/lib/internal/crypto/keygen.js +++ b/lib/internal/crypto/keygen.js @@ -54,7 +54,7 @@ const { ERR_INCOMPATIBLE_OPTION_PAIR, ERR_INVALID_ARG_VALUE, ERR_MISSING_OPTION, - } + }, } = require('internal/errors'); const { isArrayBufferView } = require('internal/util/types'); @@ -88,7 +88,7 @@ function generateKeyPair(type, options, callback) { ObjectDefineProperty(generateKeyPair, customPromisifyArgs, { value: ['publicKey', 'privateKey'], - enumerable: false + enumerable: false, }); function generateKeyPairSync(type, options) { @@ -108,7 +108,7 @@ function handleError(ret) { // If no encoding was chosen, return key objects instead. return { publicKey: wrapKey(publicKey, PublicKeyObject), - privateKey: wrapKey(privateKey, PrivateKeyObject) + privateKey: wrapKey(privateKey, PrivateKeyObject), }; } @@ -121,7 +121,7 @@ function parseKeyEncoding(keyType, options = {}) { } else if (typeof publicKeyEncoding === 'object') { ({ format: publicFormat, - type: publicType + type: publicType, } = parsePublicKeyEncoding(publicKeyEncoding, keyType, 'publicKeyEncoding')); } else { @@ -137,7 +137,7 @@ function parseKeyEncoding(keyType, options = {}) { format: privateFormat, type: privateType, cipher, - passphrase + passphrase, } = parsePrivateKeyEncoding(privateKeyEncoding, keyType, 'privateKeyEncoding')); } else { diff --git a/lib/internal/crypto/keys.js b/lib/internal/crypto/keys.js index c24b2d14eb5001..d274f01969786d 100644 --- a/lib/internal/crypto/keys.js +++ b/lib/internal/crypto/keys.js @@ -40,7 +40,7 @@ const { ERR_CRYPTO_JWK_UNSUPPORTED_CURVE, ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE, ERR_CRYPTO_INVALID_JWK, - } + }, } = require('internal/errors'); const { @@ -112,7 +112,7 @@ const { value: handle, enumerable: false, configurable: false, - writable: false + writable: false, }); } @@ -158,7 +158,7 @@ const { return { ...details, publicExponent: - bigIntArrayToUnsignedBigInt(new Uint8Array(details.publicExponent)) + bigIntArrayToUnsignedBigInt(new Uint8Array(details.publicExponent)), }; } return details; @@ -225,7 +225,7 @@ const { } const { format, - type + type, } = parsePublicKeyEncoding(options, this.asymmetricKeyType); return this[kHandle].export(format, type); } @@ -249,7 +249,7 @@ const { format, type, cipher, - passphrase + passphrase, } = parsePrivateKeyEncoding(options, this.asymmetricKeyType); return this[kHandle].export(format, type, cipher, passphrase); } @@ -328,7 +328,7 @@ function parseKeyEncoding(enc, keyType, isPublic, objName) { const { format, - type + type, } = parseKeyFormatAndType(enc, keyType, isPublic, objName); let cipher, passphrase, encoding; @@ -484,7 +484,7 @@ function getKeyObjectHandleFromJwk(key, ctx) { kty: key.kty, crv: key.crv, x: key.x, - y: key.y + y: key.y, }; if (!isPublic) { @@ -507,7 +507,7 @@ function getKeyObjectHandleFromJwk(key, ctx) { const jwk = { kty: key.kty, n: key.n, - e: key.e + e: key.e, }; if (!isPublic) { @@ -564,7 +564,7 @@ function prepareAsymmetricKey(key, ctx) { (ctx === kConsumePrivate || ctx === kCreatePrivate) ? false : undefined; return { data: getArrayBufferOrView(data, 'key', encoding), - ...parseKeyEncoding(key, undefined, isPublic) + ...parseKeyEncoding(key, undefined, isPublic), }; } throw new ERR_INVALID_ARG_TYPE( @@ -662,14 +662,14 @@ class CryptoKey extends JSTransferable { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `CryptoKey ${inspect({ type: this.type, extractable: this.extractable, algorithm: this.algorithm, - usages: this.usages + usages: this.usages, }, opts)}`; } @@ -702,7 +702,7 @@ class CryptoKey extends JSTransferable { usages, extractable, }, - deserializeInfo: 'internal/crypto/keys:InternalCryptoKey' + deserializeInfo: 'internal/crypto/keys:InternalCryptoKey', }; } diff --git a/lib/internal/crypto/mac.js b/lib/internal/crypto/mac.js index 5ee1f0918db7e1..1acca44d4985ff 100644 --- a/lib/internal/crypto/mac.js +++ b/lib/internal/crypto/mac.js @@ -30,7 +30,7 @@ const { codes: { ERR_MISSING_OPTION, ERR_INVALID_ARG_TYPE, - } + }, } = require('internal/errors'); const { diff --git a/lib/internal/crypto/random.js b/lib/internal/crypto/random.js index cf84507515a505..92e6f6bc4f1601 100644 --- a/lib/internal/crypto/random.js +++ b/lib/internal/crypto/random.js @@ -36,7 +36,7 @@ const { ERR_INVALID_ARG_TYPE, ERR_OUT_OF_RANGE, ERR_OPERATION_FAILED, - } + }, } = require('internal/errors'); const { diff --git a/lib/internal/crypto/rsa.js b/lib/internal/crypto/rsa.js index e7b793fa184817..ceac5379e5fb99 100644 --- a/lib/internal/crypto/rsa.js +++ b/lib/internal/crypto/rsa.js @@ -26,7 +26,7 @@ const { codes: { ERR_INVALID_ARG_TYPE, ERR_MISSING_OPTION, - } + }, } = require('internal/errors'); const { @@ -132,7 +132,7 @@ async function rsaKeyGenerate( name, modulusLength, publicExponent, - hash + hash, } = algorithm; if (hash === undefined) @@ -186,7 +186,7 @@ async function rsaKeyGenerate( name, modulusLength, publicExponent, - hash: { name: hash.name } + hash: { name: hash.name }, }; let publicUsages; @@ -258,7 +258,7 @@ async function rsaImportKey( keyObject = createPublicKey({ key: keyData, format: 'der', - type: 'spki' + type: 'spki', }); break; } @@ -267,7 +267,7 @@ async function rsaImportKey( keyObject = createPrivateKey({ key: keyData, format: 'der', - type: 'pkcs8' + type: 'pkcs8', }); break; } @@ -332,7 +332,7 @@ async function rsaImportKey( name: algorithm.name, modulusLength, publicExponent: new Uint8Array(publicExponent), - hash: algorithm.hash + hash: algorithm.hash, }, keyUsages, extractable); } diff --git a/lib/internal/crypto/scrypt.js b/lib/internal/crypto/scrypt.js index 45a04905bfd447..7e656ecf8280c8 100644 --- a/lib/internal/crypto/scrypt.js +++ b/lib/internal/crypto/scrypt.js @@ -24,7 +24,7 @@ const { codes: { ERR_CRYPTO_SCRYPT_INVALID_PARAMETER, ERR_CRYPTO_SCRYPT_NOT_SUPPORTED, - } + }, } = require('internal/errors'); const { diff --git a/lib/internal/crypto/sig.js b/lib/internal/crypto/sig.js index a204f35e60a15b..ac3d9f4087c24a 100644 --- a/lib/internal/crypto/sig.js +++ b/lib/internal/crypto/sig.js @@ -11,7 +11,7 @@ const { ERR_CRYPTO_SIGN_KEY_REQUIRED, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - } + }, } = require('internal/errors'); const { @@ -161,7 +161,7 @@ function signOneShot(algorithm, data, key, callback) { data: keyData, format: keyFormat, type: keyType, - passphrase: keyPassphrase + passphrase: keyPassphrase, } = preparePrivateKey(key); const job = new SignJob( @@ -213,7 +213,7 @@ Verify.prototype.verify = function verify(options, signature, sigEncoding) { data, format, type, - passphrase + passphrase, } = preparePublicOrPrivateKey(options, true); sigEncoding = sigEncoding || getDefaultEncoding(); @@ -267,7 +267,7 @@ function verifyOneShot(algorithm, data, key, signature, callback) { data: keyData, format: keyFormat, type: keyType, - passphrase: keyPassphrase + passphrase: keyPassphrase, } = preparePublicOrPrivateKey(key); const job = new SignJob( diff --git a/lib/internal/crypto/util.js b/lib/internal/crypto/util.js index 8343940b99e169..c89bff291c2426 100644 --- a/lib/internal/crypto/util.js +++ b/lib/internal/crypto/util.js @@ -24,8 +24,8 @@ const { getOptionValue } = require('internal/options'); const { crypto: { - ENGINE_METHOD_ALL - } + ENGINE_METHOD_ALL, + }, } = internalBinding('constants'); const normalizeHashName = require('internal/crypto/hashnames'); @@ -37,13 +37,13 @@ const { ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, - } + }, } = require('internal/errors'); const { validateArray, validateNumber, - validateString + validateString, } = require('internal/validators'); const { Buffer } = require('buffer'); diff --git a/lib/internal/crypto/webcrypto.js b/lib/internal/crypto/webcrypto.js index 900ac7a6e8ad7b..916bdd43b30d98 100644 --- a/lib/internal/crypto/webcrypto.js +++ b/lib/internal/crypto/webcrypto.js @@ -31,7 +31,7 @@ const { TextDecoder, TextEncoder } = require('internal/encoding'); const { codes: { ERR_INVALID_ARG_TYPE, - } + }, } = require('internal/errors'); const { @@ -707,7 +707,7 @@ ObjectDefineProperties( configurable: true, writable: true, value: CryptoKey, - } + }, }); ObjectDefineProperties( @@ -789,7 +789,7 @@ ObjectDefineProperties( configurable: true, writable: true, value: unwrapKey, - } + }, }); module.exports = crypto; diff --git a/lib/internal/crypto/x509.js b/lib/internal/crypto/x509.js index ff8e6086576662..ef27a4cdf99e75 100644 --- a/lib/internal/crypto/x509.js +++ b/lib/internal/crypto/x509.js @@ -43,7 +43,7 @@ const { codes: { ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - } + }, } = require('internal/errors'); const { @@ -121,7 +121,7 @@ class X509Certificate extends JSTransferable { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `X509Certificate ${inspect({ @@ -142,7 +142,7 @@ class X509Certificate extends JSTransferable { const handle = this[kHandle]; return { data: { handle }, - deserializeInfo: 'internal/crypto/x509:InternalX509Certificate' + deserializeInfo: 'internal/crypto/x509:InternalX509Certificate', }; } diff --git a/lib/internal/dgram.js b/lib/internal/dgram.js index f27baf5e0ef60b..f602f39614f690 100644 --- a/lib/internal/dgram.js +++ b/lib/internal/dgram.js @@ -88,5 +88,5 @@ function _createSocketHandle(address, port, addressType, fd, flags) { module.exports = { kStateSymbol, _createSocketHandle, - newHandle + newHandle, }; diff --git a/lib/internal/dns/promises.js b/lib/internal/dns/promises.js index e0158eef81307e..dd3a1e1cd5ac0f 100644 --- a/lib/internal/dns/promises.js +++ b/lib/internal/dns/promises.js @@ -24,7 +24,7 @@ const { ChannelWrap, GetAddrInfoReqWrap, GetNameInfoReqWrap, - QueryReqWrap + QueryReqWrap, } = internalBinding('cares_wrap'); const { ERR_INVALID_ARG_TYPE, @@ -60,7 +60,7 @@ function onlookupall(err, addresses) { addresses[i] = { address, - family: family ? family : isIP(addresses[i]) + family: family ? family : isIP(addresses[i]), }; } diff --git a/lib/internal/dtrace.js b/lib/internal/dtrace.js index 8eb1df7807fbcd..1ecd9570e99cc0 100644 --- a/lib/internal/dtrace.js +++ b/lib/internal/dtrace.js @@ -8,7 +8,7 @@ const { DTRACE_HTTP_SERVER_REQUEST = () => {}, DTRACE_HTTP_SERVER_RESPONSE = () => {}, DTRACE_NET_SERVER_CONNECTION = () => {}, - DTRACE_NET_STREAM_END = () => {} + DTRACE_NET_STREAM_END = () => {}, } = (config.hasDtrace ? internalBinding('dtrace') : {}); module.exports = { @@ -17,5 +17,5 @@ module.exports = { DTRACE_HTTP_SERVER_REQUEST, DTRACE_HTTP_SERVER_RESPONSE, DTRACE_NET_SERVER_CONNECTION, - DTRACE_NET_STREAM_END + DTRACE_NET_STREAM_END, }; diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index f6e52238a1270c..c1d58e835efab9 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -20,7 +20,7 @@ const { ERR_ENCODING_NOT_SUPPORTED, ERR_INVALID_ARG_TYPE, ERR_INVALID_THIS, - ERR_NO_ICU + ERR_NO_ICU, } = require('internal/errors').codes; const kHandle = Symbol('handle'); const kFlags = Symbol('flags'); @@ -30,20 +30,20 @@ const kEncoder = Symbol('encoder'); const { getConstructorOf, - customInspectSymbol: inspect + customInspectSymbol: inspect, } = require('internal/util'); const { isAnyArrayBuffer, isArrayBufferView, - isUint8Array + isUint8Array, } = require('internal/util/types'); const { validateString } = require('internal/validators'); const { encodeInto, - encodeUtf8String + encodeUtf8String, } = internalBinding('buffer'); let Buffer; @@ -351,7 +351,7 @@ class TextEncoder { return this; const ctor = getConstructorOf(this); const obj = ObjectCreate({ - constructor: ctor === null ? TextEncoder : ctor + constructor: ctor === null ? TextEncoder : ctor, }); obj.encoding = this.encoding; // Lazy to avoid circular dependency @@ -551,7 +551,7 @@ ObjectDefineProperties( // Lazy to avoid circular dependency const { inspect } = require('internal/util/inspect'); return `${constructor.name} ${inspect(obj)}`; - } + }, }) ); @@ -560,12 +560,12 @@ ObjectDefineProperties(TextDecoder.prototype, { [inspect]: { enumerable: false }, [SymbolToStringTag]: { configurable: true, - value: 'TextDecoder' - } + value: 'TextDecoder', + }, }); module.exports = { getEncodingFromLabel, TextDecoder, - TextEncoder + TextEncoder, }; diff --git a/lib/internal/error_serdes.js b/lib/internal/error_serdes.js index 47392752df6318..23d509e9359897 100644 --- a/lib/internal/error_serdes.js +++ b/lib/internal/error_serdes.js @@ -28,7 +28,8 @@ const kSerializedObject = 1; const kInspectedError = 2; const errors = { - Error, TypeError, RangeError, URIError, SyntaxError, ReferenceError, EvalError + Error, TypeError, RangeError, URIError, + SyntaxError, ReferenceError, EvalError, }; const errorConstructorNames = new SafeSet(ObjectKeys(errors)); @@ -68,7 +69,7 @@ function GetConstructors(object) { const desc = ObjectGetOwnPropertyDescriptor(current, 'constructor'); if (desc && desc.value) { ObjectDefineProperty(constructors, constructors.length, { - value: desc.value, enumerable: true + value: desc.value, enumerable: true, }); } } @@ -101,7 +102,7 @@ function serializeError(error) { if (errorConstructorNames.has(name)) { const serialized = serialize({ constructor: name, - properties: TryGetAllProperties(error) + properties: TryGetAllProperties(error), }); return Buffer.concat([Buffer.from([kSerializedError]), serialized]); } @@ -125,7 +126,7 @@ function deserializeError(error) { const ctor = errors[constructor]; ObjectDefineProperty(properties, SymbolToStringTag, { value: { value: 'Error', configurable: true }, - enumerable: true + enumerable: true, }); return ObjectCreate(ctor.prototype, properties); case kSerializedObject: diff --git a/lib/internal/errors.js b/lib/internal/errors.js index a226b2d6898d4c..63c6d5899915b1 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -200,7 +200,7 @@ const addCodeToName = hideStackFrames(function addCodeToName(err, name, code) { value: name, enumerable: false, writable: true, - configurable: true + configurable: true, }); } else { delete err.name; @@ -246,7 +246,7 @@ class SystemError extends Error { value: message, enumerable: false, writable: true, - configurable: true + configurable: true, }); addCodeToName(this, 'SystemError', key); @@ -256,7 +256,7 @@ class SystemError extends Error { value: context, enumerable: true, configurable: true, - writable: false + writable: false, }); ObjectDefineProperty(this, 'errno', { @@ -267,7 +267,7 @@ class SystemError extends Error { context.errno = value; }, enumerable: true, - configurable: true + configurable: true, }); ObjectDefineProperty(this, 'syscall', { @@ -278,7 +278,7 @@ class SystemError extends Error { context.syscall = value; }, enumerable: true, - configurable: true + configurable: true, }); if (context.path !== undefined) { @@ -297,7 +297,7 @@ class SystemError extends Error { lazyBuffer().from(value.toString()) : undefined; }, enumerable: true, - configurable: true + configurable: true, }); } @@ -312,7 +312,7 @@ class SystemError extends Error { lazyBuffer().from(value.toString()) : undefined; }, enumerable: true, - configurable: true + configurable: true, }); } } @@ -325,7 +325,7 @@ class SystemError extends Error { return lazyInternalUtilInspect().inspect(this, { ...ctx, getters: true, - customInspect: false + customInspect: false, }); } } @@ -762,8 +762,8 @@ const fatalExceptionStackEnhancers = { const { inspect, inspectDefaultOptions: { - colors: defaultColors - } + colors: defaultColors, + }, } = lazyInternalUtilInspect(); const colors = useColors && ((internalBinding('util').guessHandleType(2) === 'TTY' && @@ -773,12 +773,12 @@ const fatalExceptionStackEnhancers = { return inspect(error, { colors, customInspect: false, - depth: MathMax(inspect.defaultOptions.depth, 5) + depth: MathMax(inspect.defaultOptions.depth, 5), }); } catch { return originalStack; } - } + }, }; // Node uses an AbortError that isn't exactly the same as the DOMException @@ -815,7 +815,7 @@ module.exports = { maybeOverridePrepareStackTrace, overrideStackTrace, kEnhanceStackBeforeInspector, - fatalExceptionStackEnhancers + fatalExceptionStackEnhancers, }; // To declare an error message, use the E(sym, val, def) function above. The sym diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index 026746825b7767..52ea175cbc28f2 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -31,7 +31,7 @@ const { ERR_EVENT_RECURSION, ERR_MISSING_ARGS, ERR_INVALID_THIS, - } + }, } = require('internal/errors'); const { validateObject, validateString } = require('internal/validators'); @@ -82,7 +82,7 @@ const isTrustedSet = new SafeWeakSet(); const isTrusted = ObjectGetOwnPropertyDescriptor({ get isTrusted() { return isTrustedSet.has(this); - } + }, }, 'isTrusted').get; class Event { @@ -108,7 +108,7 @@ class Event { ObjectDefineProperty(this, 'isTrusted', { get: isTrusted, enumerable: true, - configurable: false + configurable: false, }); this[kTarget] = null; } @@ -119,7 +119,7 @@ class Event { return name; const opts = ObjectAssign({}, options, { - depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth + depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth, }); return `${name} ${inspect({ @@ -482,7 +482,7 @@ class EventTarget { return name; const opts = ObjectAssign({}, options, { - depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth + depth: NumberIsInteger(options.depth) ? options.depth - 1 : options.depth, }); return `${name} ${inspect({}, opts)}`; @@ -492,7 +492,7 @@ class EventTarget { ObjectDefineProperties(EventTarget.prototype, { addEventListener: { enumerable: true }, removeEventListener: { enumerable: true }, - dispatchEvent: { enumerable: true } + dispatchEvent: { enumerable: true }, }); ObjectDefineProperty(EventTarget.prototype, SymbolToStringTag, { writable: false, @@ -613,7 +613,7 @@ function validateEventListenerOptions(options) { passive: Boolean(options.passive), signal: options.signal, weak: options[kWeakHandler], - isNodeStyleListener: Boolean(options[kIsNodeStyleListener]) + isNodeStyleListener: Boolean(options[kIsNodeStyleListener]), }; } @@ -684,7 +684,7 @@ function defineEventHandler(emitter, name) { this[kHandlers].set(name, wrappedHandler); }, configurable: true, - enumerable: true + enumerable: true, }); } diff --git a/lib/internal/freeze_intrinsics.js b/lib/internal/freeze_intrinsics.js index ea613966980c96..468c9c86447c31 100644 --- a/lib/internal/freeze_intrinsics.js +++ b/lib/internal/freeze_intrinsics.js @@ -129,7 +129,7 @@ const { Atomics, Intl, SharedArrayBuffer, - WebAssembly + WebAssembly, } = globalThis; module.exports = function() { @@ -139,7 +139,7 @@ module.exports = function() { clearTimeout, setImmediate, setInterval, - setTimeout + setTimeout, } = require('timers'); const intrinsicPrototypes = [ @@ -509,7 +509,7 @@ module.exports = function() { value: newValue, writable: true, enumerable: true, - configurable: true + configurable: true, }); } } @@ -518,7 +518,7 @@ module.exports = function() { get: getter, set: setter, enumerable: desc.enumerable, - configurable: desc.configurable + configurable: desc.configurable, }); } } diff --git a/lib/internal/fs/dir.js b/lib/internal/fs/dir.js index 917319661a647d..aa1cd2eb084aa9 100644 --- a/lib/internal/fs/dir.js +++ b/lib/internal/fs/dir.js @@ -18,8 +18,8 @@ const { codes: { ERR_DIR_CLOSED, ERR_DIR_CONCURRENT_OPERATION, - ERR_MISSING_ARGS - } + ERR_MISSING_ARGS, + }, } = require('internal/errors'); const { FSReqCallback } = binding; @@ -28,11 +28,11 @@ const { getDirent, getOptions, getValidatedPath, - handleErrorFromBinding + handleErrorFromBinding, } = require('internal/fs/utils'); const { validateCallback, - validateUint32 + validateUint32, } = require('internal/validators'); const kDirHandle = Symbol('kDirHandle'); @@ -60,8 +60,8 @@ class Dir { this[kDirOptions] = { bufferSize: 32, ...getOptions(options, { - encoding: 'utf8' - }) + encoding: 'utf8', + }), }; validateUint32(this[kDirOptions].bufferSize, 'options.bufferSize', true); @@ -238,7 +238,7 @@ function opendir(path, options, callback) { path = getValidatedPath(path); options = getOptions(options, { - encoding: 'utf8' + encoding: 'utf8', }); function opendirCallback(error, handle) { @@ -262,7 +262,7 @@ function opendir(path, options, callback) { function opendirSync(path, options) { path = getValidatedPath(path); options = getOptions(options, { - encoding: 'utf8' + encoding: 'utf8', }); const ctx = { path }; @@ -280,5 +280,5 @@ function opendirSync(path, options) { module.exports = { Dir, opendir, - opendirSync + opendirSync, }; diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index 0253a29c7d5c57..7b969bc5a1af05 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -21,7 +21,7 @@ const { O_SYMLINK, O_WRONLY, S_IFMT, - S_IFREG + S_IFREG, } = internalBinding('constants').fs; const binding = internalBinding('fs'); const { Buffer } = require('buffer'); @@ -64,7 +64,7 @@ const { validateRmOptions, validateRmdirOptions, validateStringAfterArrayBufferView, - warnOnNonPortableTemplate + warnOnNonPortableTemplate, } = require('internal/fs/utils'); const { opendir } = require('internal/fs/dir'); const { @@ -93,7 +93,7 @@ const kUnref = Symbol('kUnref'); const { kUsePromises } = binding; const { - JSTransferable, kDeserialize, kTransfer, kTransferList + JSTransferable, kDeserialize, kTransfer, kTransferList, } = require('internal/worker/js_transferable'); const getDirectoryEntriesPromise = promisify(getDirents); @@ -223,7 +223,7 @@ class FileHandle extends EventEmitterMixin(JSTransferable) { return { data: { handle }, - deserializeInfo: 'internal/fs/promises:FileHandle' + deserializeInfo: 'internal/fs/promises:FileHandle', }; } @@ -566,7 +566,7 @@ async function mkdir(path, options) { } const { recursive = false, - mode = 0o777 + mode = 0o777, } = options || {}; path = getValidatedPath(path); validateBoolean(recursive, 'options.recursive'); diff --git a/lib/internal/fs/read_file_context.js b/lib/internal/fs/read_file_context.js index afa4b7852f6790..67fb05778b55af 100644 --- a/lib/internal/fs/read_file_context.js +++ b/lib/internal/fs/read_file_context.js @@ -10,7 +10,7 @@ const { constants: { kReadFileBufferLength, kReadFileUnknownBufferLength, - } + }, } = require('internal/fs/utils'); const { Buffer } = require('buffer'); diff --git a/lib/internal/fs/rimraf.js b/lib/internal/fs/rimraf.js index 675c2448c4568c..1b9379cda77746 100644 --- a/lib/internal/fs/rimraf.js +++ b/lib/internal/fs/rimraf.js @@ -26,7 +26,7 @@ const { stat, statSync, unlink, - unlinkSync + unlinkSync, } = fs; const { sep } = require('path'); const { setTimeout } = require('timers'); diff --git a/lib/internal/fs/streams.js b/lib/internal/fs/streams.js index b388bad80c74a5..7ab8bffddd955f 100644 --- a/lib/internal/fs/streams.js +++ b/lib/internal/fs/streams.js @@ -101,7 +101,7 @@ const FileHandleOperations = (handle) => { PromisePrototypeThen(handle.writev(buffers, pos), (r) => cb(null, r.bytesWritten, r.buffers), (err) => cb(err, 0, buffers)); - } + }, }; }; @@ -219,7 +219,7 @@ ObjectDefineProperty(ReadStream.prototype, 'autoClose', { }, set(val) { this._readableState.autoDestroy = val; - } + }, }); const openReadFs = deprecate(function() { @@ -298,7 +298,7 @@ ReadStream.prototype.close = function(cb) { ObjectDefineProperty(ReadStream.prototype, 'pending', { get() { return this.fd === null; }, - configurable: true + configurable: true, }); function WriteStream(path, options) { @@ -380,7 +380,7 @@ ObjectDefineProperty(WriteStream.prototype, 'autoClose', { }, set(val) { this._writableState.autoDestroy = val; - } + }, }); const openWriteFs = deprecate(function() { @@ -484,10 +484,10 @@ WriteStream.prototype.destroySoon = WriteStream.prototype.end; ObjectDefineProperty(WriteStream.prototype, 'pending', { get() { return this.fd === null; }, - configurable: true + configurable: true, }); module.exports = { ReadStream, - WriteStream + WriteStream, }; diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 322b1519ef2807..3cb9034e600186 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -31,16 +31,16 @@ const { ERR_FS_INVALID_SYMLINK_TYPE, ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, - ERR_OUT_OF_RANGE + ERR_OUT_OF_RANGE, }, hideStackFrames, - uvException + uvException, } = require('internal/errors'); const { isArrayBufferView, isUint8Array, isDate, - isBigUint64Array + isBigUint64Array, } = require('internal/util/types'); const { once } = require('internal/util'); const { toPathIfFileURL } = require('internal/url'); @@ -91,13 +91,13 @@ const { UV_DIRENT_FIFO, UV_DIRENT_SOCKET, UV_DIRENT_CHAR, - UV_DIRENT_BLOCK + UV_DIRENT_BLOCK, }, os: { errno: { - EISDIR - } - } + EISDIR, + }, + }, } = internalBinding('constants'); // The access modes can be any of F_OK, R_OK, W_OK or X_OK. Some might not be @@ -720,7 +720,7 @@ const defaultRmOptions = { recursive: false, force: false, retryDelay: 100, - maxRetries: 0 + maxRetries: 0, }; const defaultRmdirOptions = { @@ -751,7 +751,7 @@ const validateRmOptions = hideStackFrames((path, options, expectDir, cb) => { message: 'is a directory', path, syscall: 'rm', - errno: EISDIR + errno: EISDIR, })); } return cb(null, options); @@ -776,7 +776,7 @@ const validateRmOptionsSync = hideStackFrames((path, options, expectDir) => { message: 'is a directory', path, syscall: 'rm', - errno: EISDIR + errno: EISDIR, }); } } @@ -910,5 +910,5 @@ module.exports = { validateRmOptionsSync, validateRmdirOptions, validateStringAfterArrayBufferView, - warnOnNonPortableTemplate + warnOnNonPortableTemplate, }; diff --git a/lib/internal/fs/watchers.js b/lib/internal/fs/watchers.js index b45af42d12ff7d..4d4b48c2f7b013 100644 --- a/lib/internal/fs/watchers.js +++ b/lib/internal/fs/watchers.js @@ -18,7 +18,7 @@ const { createDeferredPromise } = require('internal/util'); const { kFsStatsFieldsNumber, - StatWatcher: _StatWatcher + StatWatcher: _StatWatcher, } = internalBinding('fs'); const { FSEvent } = internalBinding('fs_event_wrap'); @@ -27,12 +27,12 @@ const { EventEmitter } = require('events'); const { getStatsFromBinding, - getValidatedPath + getValidatedPath, } = require('internal/fs/utils'); const { defaultTriggerAsyncIdScope, - symbols: { owner_symbol } + symbols: { owner_symbol }, } = require('internal/async_hooks'); const { toNamespacedPath } = require('path'); @@ -119,7 +119,7 @@ StatWatcher.prototype[kFSStatWatcherStart] = function(filename, const error = uvException({ errno: err, syscall: 'watch', - path: filename + path: filename, }); error.filename = filename; throw error; @@ -204,7 +204,7 @@ function FSWatcher() { const error = uvException({ errno: status, syscall: 'watch', - path: filename + path: filename, }); error.filename = filename; this.emit('error', error); @@ -246,7 +246,7 @@ FSWatcher.prototype[kFSWatchStart] = function(filename, syscall: 'watch', path: filename, message: err === UV_ENOSPC ? - 'System limit for number of file watchers reached' : '' + 'System limit for number of file watchers reached' : '', }); error.filename = filename; throw error; @@ -292,7 +292,7 @@ function emitCloseNT(self) { // want to runtime-deprecate it at some point. There's no hurry, though. ObjectDefineProperty(FSEvent.prototype, 'owner', { get() { return this[owner_symbol]; }, - set(v) { return this[owner_symbol] = v; } + set(v) { return this[owner_symbol] = v; }, }); async function* watch(filename, options = {}) { @@ -332,7 +332,7 @@ async function* watch(filename, options = {}) { const error = uvException({ errno: status, syscall: 'watch', - path: filename + path: filename, }); error.filename = filename; handle.close(); @@ -350,7 +350,7 @@ async function* watch(filename, options = {}) { syscall: 'watch', path: filename, message: err === UV_ENOSPC ? - 'System limit for number of file watchers reached' : '' + 'System limit for number of file watchers reached' : '', }); error.filename = filename; handle.close(); diff --git a/lib/internal/heap_utils.js b/lib/internal/heap_utils.js index 126fe3f7e46a0c..dc80baabb766cf 100644 --- a/lib/internal/heap_utils.js +++ b/lib/internal/heap_utils.js @@ -1,6 +1,6 @@ 'use strict'; const { - Symbol + Symbol, } = primordials; const { kUpdateTimer, @@ -37,5 +37,5 @@ class HeapSnapshotStream extends Readable { } module.exports = { - HeapSnapshotStream + HeapSnapshotStream, }; diff --git a/lib/internal/histogram.js b/lib/internal/histogram.js index 2df321300fb87e..4d65404f74815a 100644 --- a/lib/internal/histogram.js +++ b/lib/internal/histogram.js @@ -11,7 +11,7 @@ const { } = primordials; const { - Histogram: _Histogram + Histogram: _Histogram, } = internalBinding('performance'); const { @@ -59,7 +59,7 @@ class Histogram extends JSTransferable { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `Histogram ${inspect({ @@ -119,7 +119,7 @@ class Histogram extends JSTransferable { const handle = this[kHandle]; return { data: { handle }, - deserializeInfo: 'internal/histogram:InternalHistogram' + deserializeInfo: 'internal/histogram:InternalHistogram', }; } @@ -157,7 +157,7 @@ class RecordableHistogram extends Histogram { const handle = this[kHandle]; return { data: { handle }, - deserializeInfo: 'internal/histogram:InternalRecordableHistogram' + deserializeInfo: 'internal/histogram:InternalRecordableHistogram', }; } } diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index a1ee6cdbbc7777..5ee0cc0a91c683 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -34,8 +34,8 @@ const { HTTP_STATUS_CONTINUE, HTTP_STATUS_EXPECTATION_FAILED, HTTP_STATUS_METHOD_NOT_ALLOWED, - HTTP_STATUS_OK - } + HTTP_STATUS_OK, + }, } = internalBinding('http2'); const { codes: { @@ -48,9 +48,9 @@ const { ERR_HTTP2_STATUS_INVALID, ERR_INVALID_ARG_VALUE, ERR_INVALID_HTTP_TOKEN, - ERR_STREAM_WRITE_AFTER_END + ERR_STREAM_WRITE_AFTER_END, }, - hideStackFrames + hideStackFrames, } = require('internal/errors'); const { validateCallback, @@ -61,7 +61,7 @@ const { kRequest, kProxySocket, assertValidPseudoHeader, - getAuthority + getAuthority, } = require('internal/http2/util'); const { _checkIsHttpToken: checkIsHttpToken } = require('_http_common'); @@ -276,7 +276,7 @@ const proxySocketHandler = { ref[prop] = value; return true; } - } + }, }; function onStreamCloseRequest() { @@ -814,7 +814,7 @@ class Http2ServerResponse extends Stream { const options = { endStream: state.ending, waitForTrailers: true, - sendDate: state.sendDate + sendDate: state.sendDate, }; this[kStream].respond(headers, options); } @@ -825,7 +825,7 @@ class Http2ServerResponse extends Stream { if (stream.headersSent || this[kState].closed) return false; stream.additionalHeaders({ - [HTTP2_HEADER_STATUS]: HTTP_STATUS_CONTINUE + [HTTP2_HEADER_STATUS]: HTTP_STATUS_CONTINUE, }); return true; } diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 1654f2460cdd5a..8dad46bdebc7ca 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -37,7 +37,7 @@ const { const { assertCrypto, customInspectSymbol: kInspect, - promisify + promisify, } = require('internal/util'); assertCrypto(); @@ -55,7 +55,7 @@ const { setImmediate, setTimeout, clearTimeout } = require('timers'); const { kIncomingMessage, - _checkIsHttpToken: checkIsHttpToken + _checkIsHttpToken: checkIsHttpToken, } = require('_http_common'); const { kServerResponse } = require('_http_server'); const JSStreamSocket = require('internal/js_stream_socket'); @@ -113,10 +113,10 @@ const { ERR_INVALID_CHAR, ERR_INVALID_HTTP_TOKEN, ERR_OUT_OF_RANGE, - ERR_SOCKET_CLOSED + ERR_SOCKET_CLOSED, }, hideStackFrames, - AbortError + AbortError, } = require('internal/errors'); const { isUint32, @@ -126,7 +126,7 @@ const { validateNumber, validateString, validateUint32, - validateAbortSignal + validateAbortSignal, } = require('internal/validators'); const fsPromisesInternal = require('internal/fs/promises'); const { utcDate } = require('internal/http'); @@ -157,7 +157,7 @@ const { sessionName, toHeaderObject, updateOptionsBuffer, - updateSettingsBuffer + updateSettingsBuffer, } = require('internal/http2/util'); const { writeGeneric, @@ -168,7 +168,7 @@ const { kUpdateTimer, kHandle, kSession, - setStreamTimeout + setStreamTimeout, } = require('internal/stream_base_commons'); const { kTimeout } = require('internal/timers'); const { isArrayBufferView } = require('internal/util/types'); @@ -179,7 +179,7 @@ const binding = internalBinding('http2'); const { ShutdownWrap, kReadBytesOrError, - streamBaseState + streamBaseState, } = internalBinding('stream_wrap'); const { UV_EOF } = internalBinding('uv'); @@ -307,7 +307,7 @@ const { HTTP_STATUS_MISDIRECTED_REQUEST, STREAM_OPTION_EMPTY_PAYLOAD, - STREAM_OPTION_GET_TRAILERS + STREAM_OPTION_GET_TRAILERS, } = constants; const STREAM_FLAGS_PENDING = 0x0; @@ -903,7 +903,7 @@ const proxySocketHandler = { socket[prop] = value; return true; } - } + }, }; // pingCallback() returns a function that is invoked when an HTTP2 PING @@ -989,7 +989,7 @@ function trackAssignmentsTypedArray(typedArray) { modifiedEntries[prop] = 1; } return ReflectSet(obj, prop, value); - } + }, }); } @@ -1215,7 +1215,7 @@ class Http2Session extends EventEmitter { pendingAck: 0, shutdownWritableCalled: false, writeQueueSize: 0, - originSet: undefined + originSet: undefined, }; this[kEncrypted] = undefined; @@ -1374,7 +1374,7 @@ class Http2Session extends EventEmitter { destroyed: this.destroyed, state: this.state, localSettings: this.localSettings, - remoteSettings: this.remoteSettings + remoteSettings: this.remoteSettings, }; return `Http2Session ${format(obj)}`; } @@ -1947,7 +1947,7 @@ class Http2Stream extends Duplex { rstCode: NGHTTP2_NO_ERROR, writeQueueSize: 0, trailersReady: false, - endAfterHeaders: false + endAfterHeaders: false, }; // Fields used by the compat API to avoid megamorphisms. @@ -1996,7 +1996,7 @@ class Http2Stream extends Duplex { destroyed: this.destroyed, state: this.state, readableState: this._readableState, - writableState: this._writableState + writableState: this._writableState, }; return `Http2Stream ${format(obj)}`; } @@ -2505,7 +2505,7 @@ function doSendFD(session, options, fd, headers, streamOptions, err, stat) { const statOptions = { offset: options.offset !== undefined ? options.offset : 0, - length: options.length !== undefined ? options.length : -1 + length: options.length !== undefined ? options.length : -1, }; // options.statCheck is a user-provided function that can be used to @@ -2565,7 +2565,7 @@ function doSendFileFD(session, options, fd, headers, streamOptions, err, stat) { const statOptions = { offset: options.offset !== undefined ? options.offset : 0, - length: options.length !== undefined ? options.length : -1 + length: options.length !== undefined ? options.length : -1, }; // options.statCheck is a user-provided function that can be used to @@ -2943,7 +2943,7 @@ const setTimeoutValue = { configurable: true, enumerable: true, writable: true, - value: setStreamTimeout + value: setStreamTimeout, }; ObjectDefineProperty(Http2Stream.prototype, 'setTimeout', setTimeoutValue); ObjectDefineProperty(Http2Session.prototype, 'setTimeout', setTimeoutValue); @@ -3292,7 +3292,7 @@ ObjectDefineProperty(connect, promisify.custom, { return new Promise((resolve) => { const server = connect(authority, options, () => resolve(server)); }); - } + }, }); function createSecureServer(options, handler) { @@ -3388,7 +3388,7 @@ module.exports = { Http2Session, Http2Stream, Http2ServerRequest, - Http2ServerResponse + Http2ServerResponse, }; /* eslint-enable no-use-before-define */ diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index f8252fffba65f5..c14459f22969fe 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -26,11 +26,11 @@ const { ERR_HTTP2_INVALID_PSEUDOHEADER, ERR_HTTP2_INVALID_SETTING_VALUE, ERR_INVALID_ARG_TYPE, - ERR_INVALID_HTTP_TOKEN + ERR_INVALID_HTTP_TOKEN, }, addCodeToName, getMessage, - hideStackFrames + hideStackFrames, } = require('internal/errors'); const kSensitiveHeaders = Symbol('nodejs.http2.sensitiveHeaders'); @@ -97,7 +97,7 @@ const { HTTP2_METHOD_DELETE, HTTP2_METHOD_GET, - HTTP2_METHOD_HEAD + HTTP2_METHOD_HEAD, } = binding.constants; // This set is defined strictly by the HTTP/2 specification. Only @@ -343,7 +343,7 @@ function getSettings(session, remote) { maxHeaderListSize: settingsBuffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE], maxHeaderSize: settingsBuffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE], enableConnectProtocol: - !!settingsBuffer[IDX_SETTINGS_ENABLE_CONNECT_PROTOCOL] + !!settingsBuffer[IDX_SETTINGS_ENABLE_CONNECT_PROTOCOL], }; } @@ -417,7 +417,7 @@ function getSessionState(session) { deflateDynamicTableSize: sessionState[IDX_SESSION_STATE_HD_DEFLATE_DYNAMIC_TABLE_SIZE], inflateDynamicTableSize: - sessionState[IDX_SESSION_STATE_HD_INFLATE_DYNAMIC_TABLE_SIZE] + sessionState[IDX_SESSION_STATE_HD_INFLATE_DYNAMIC_TABLE_SIZE], }; } @@ -429,7 +429,7 @@ function getStreamState(stream) { sumDependencyWeight: streamState[IDX_STREAM_STATE_SUM_DEPENDENCY_WEIGHT], localClose: streamState[IDX_STREAM_STATE_LOCAL_CLOSE], remoteClose: streamState[IDX_STREAM_STATE_REMOTE_CLOSE], - localWindowSize: streamState[IDX_STREAM_STATE_LOCAL_WINDOW_SIZE] + localWindowSize: streamState[IDX_STREAM_STATE_LOCAL_WINDOW_SIZE], }; } @@ -669,5 +669,5 @@ module.exports = { sessionName, toHeaderObject, updateOptionsBuffer, - updateSettingsBuffer + updateSettingsBuffer, }; diff --git a/lib/internal/inspector/inspect_client.js b/lib/internal/inspector/inspect_client.js index ba1e9bc30ce5ce..6b265cb9af5ce3 100644 --- a/lib/internal/inspector/inspect_client.js +++ b/lib/internal/inspector/inspect_client.js @@ -191,7 +191,7 @@ class Client extends EventEmitter { const { closed, payload: payloadBuffer, - rest + rest, } = decodeFrameHybi17(this._unprocessed); this._unprocessed = rest; diff --git a/lib/internal/inspector/inspect_repl.js b/lib/internal/inspector/inspect_repl.js index 0fcde39bfc3e2c..b3204d262ac2f2 100644 --- a/lib/internal/inspector/inspect_repl.js +++ b/lib/internal/inspector/inspect_repl.js @@ -522,7 +522,7 @@ function createRepl(inspector) { ArrayPrototypeMap(this, (callFrame, idx) => { const { location: { scriptId, lineNumber, columnNumber }, - functionName + functionName, } = callFrame; const name = functionName || '(anonymous)'; diff --git a/lib/internal/inspector_async_hook.js b/lib/internal/inspector_async_hook.js index bd3aa635051c5b..d7bb663431e33a 100644 --- a/lib/internal/inspector_async_hook.js +++ b/lib/internal/inspector_async_hook.js @@ -72,5 +72,5 @@ function disable() { module.exports = { enable, - disable + disable, }; diff --git a/lib/internal/legacy/processbinding.js b/lib/internal/legacy/processbinding.js index 3d48e3c9882e58..4b15dd1c12df1c 100644 --- a/lib/internal/legacy/processbinding.js +++ b/lib/internal/legacy/processbinding.js @@ -32,5 +32,5 @@ module.exports = { 'isAnyArrayBuffer', ], key); }))); - } + }, }; diff --git a/lib/internal/linkedlist.js b/lib/internal/linkedlist.js index 55f7be233476a3..dc14a51d49067b 100644 --- a/lib/internal/linkedlist.js +++ b/lib/internal/linkedlist.js @@ -50,5 +50,5 @@ module.exports = { peek, remove, append, - isEmpty + isEmpty, }; diff --git a/lib/internal/main/check_syntax.js b/lib/internal/main/check_syntax.js index a3b9bf2923769e..f898a3f9730d81 100644 --- a/lib/internal/main/check_syntax.js +++ b/lib/internal/main/check_syntax.js @@ -4,11 +4,11 @@ // instead of actually running the file. const { - prepareMainThreadExecution + prepareMainThreadExecution, } = require('internal/bootstrap/pre_execution'); const { - readStdin + readStdin, } = require('internal/process/execution'); const { pathToFileURL } = require('url'); diff --git a/lib/internal/main/eval_stdin.js b/lib/internal/main/eval_stdin.js index d97dbece8f0f56..113215c8a219a4 100644 --- a/lib/internal/main/eval_stdin.js +++ b/lib/internal/main/eval_stdin.js @@ -3,7 +3,7 @@ // Stdin is not a TTY, we will read it and execute it. const { - prepareMainThreadExecution + prepareMainThreadExecution, } = require('internal/bootstrap/pre_execution'); const { getOptionValue } = require('internal/options'); @@ -11,7 +11,7 @@ const { getOptionValue } = require('internal/options'); const { evalModule, evalScript, - readStdin + readStdin, } = require('internal/process/execution'); prepareMainThreadExecution(); diff --git a/lib/internal/main/eval_string.js b/lib/internal/main/eval_string.js index ad068b935dfee0..dc161fe2c491a1 100644 --- a/lib/internal/main/eval_string.js +++ b/lib/internal/main/eval_string.js @@ -8,7 +8,7 @@ const { } = primordials; const { - prepareMainThreadExecution + prepareMainThreadExecution, } = require('internal/bootstrap/pre_execution'); const { evalModule, evalScript } = require('internal/process/execution'); const { addBuiltinLibsToObject } = require('internal/modules/cjs/helpers'); diff --git a/lib/internal/main/inspect.js b/lib/internal/main/inspect.js index d9dab0dc92b118..eb0f61480a260e 100644 --- a/lib/internal/main/inspect.js +++ b/lib/internal/main/inspect.js @@ -3,7 +3,7 @@ // `node inspect ...` or `node debug ...` const { - prepareMainThreadExecution + prepareMainThreadExecution, } = require('internal/bootstrap/pre_execution'); prepareMainThreadExecution(); diff --git a/lib/internal/main/print_help.js b/lib/internal/main/print_help.js index 029701307980b1..d9b084f0e458a8 100644 --- a/lib/internal/main/print_help.js +++ b/lib/internal/main/print_help.js @@ -18,7 +18,7 @@ const { types } = internalBinding('options'); const hasCrypto = Boolean(process.versions.openssl); const { - prepareMainThreadExecution + prepareMainThreadExecution, } = require('internal/bootstrap/pre_execution'); const typeLookup = []; @@ -111,7 +111,7 @@ function format( let maxFirstColumnUsed = 0; for (const { - 0: name, 1: { helpText, type, value } + 0: name, 1: { helpText, type, value }, } of ArrayPrototypeSort([...options.entries()])) { if (!helpText) continue; @@ -162,7 +162,7 @@ function format( options, aliases, firstColumn: maxFirstColumnUsed + 2, - secondColumn + secondColumn, }); } @@ -186,13 +186,13 @@ function print(stream) { ' node inspect [options] [ script.js | host:port ] [arguments]\n\n' + 'Options:\n'); stream.write(indent(format({ - options, aliases, firstColumn, secondColumn + options, aliases, firstColumn, secondColumn, }), 2)); stream.write('\nEnvironment variables:\n'); stream.write(format({ - options: envVars, firstColumn, secondColumn + options: envVars, firstColumn, secondColumn, })); stream.write('\nDocumentation can be found at https://nodejs.org/\n'); diff --git a/lib/internal/main/prof_process.js b/lib/internal/main/prof_process.js index bd835bfe630fa4..f6c6256d8af553 100644 --- a/lib/internal/main/prof_process.js +++ b/lib/internal/main/prof_process.js @@ -1,7 +1,7 @@ 'use strict'; const { - prepareMainThreadExecution + prepareMainThreadExecution, } = require('internal/bootstrap/pre_execution'); prepareMainThreadExecution(); diff --git a/lib/internal/main/repl.js b/lib/internal/main/repl.js index a8356687ccedf5..b3478801780228 100644 --- a/lib/internal/main/repl.js +++ b/lib/internal/main/repl.js @@ -4,12 +4,12 @@ // the main module is not specified and stdin is a TTY. const { - prepareMainThreadExecution + prepareMainThreadExecution, } = require('internal/bootstrap/pre_execution'); const esmLoader = require('internal/process/esm_loader'); const { - evalScript + evalScript, } = require('internal/process/execution'); const console = require('internal/console/global'); diff --git a/lib/internal/main/run_main_module.js b/lib/internal/main/run_main_module.js index ca5d1122c59d94..ad778315c57b4f 100644 --- a/lib/internal/main/run_main_module.js +++ b/lib/internal/main/run_main_module.js @@ -1,7 +1,7 @@ 'use strict'; const { - prepareMainThreadExecution + prepareMainThreadExecution, } = require('internal/bootstrap/pre_execution'); prepareMainThreadExecution(true); diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js index e22fd17fa2d214..34439c106dc4c7 100644 --- a/lib/internal/main/worker_thread.js +++ b/lib/internal/main/worker_thread.js @@ -25,12 +25,12 @@ const { initializeFrozenIntrinsics, initializeReport, loadPreloadModules, - setupTraceCategoryState + setupTraceCategoryState, } = require('internal/bootstrap/pre_execution'); const { threadId, - getEnvMessagePort + getEnvMessagePort, } = internalBinding('worker'); const workerIo = require('internal/worker/io'); @@ -46,11 +46,11 @@ const { STDIO_PAYLOAD, STDIO_WANTS_MORE_DATA, }, - kStdioWantsMoreDataCallback + kStdioWantsMoreDataCallback, } = workerIo; const { - onGlobalUncaughtException + onGlobalUncaughtException, } = require('internal/process/execution'); const publicWorker = require('worker_threads'); @@ -84,12 +84,12 @@ if (process.env.NODE_CHANNEL_FD) { const workerThreadSetup = require('internal/process/worker_thread_only'); ObjectDefineProperty(process, 'channel', { enumerable: false, - get: workerThreadSetup.unavailable('process.channel') + get: workerThreadSetup.unavailable('process.channel'), }); ObjectDefineProperty(process, 'connected', { enumerable: false, - get: workerThreadSetup.unavailable('process.connected') + get: workerThreadSetup.unavailable('process.connected'), }); process.send = workerThreadSetup.unavailable('process.send()'); @@ -110,7 +110,7 @@ port.on('message', (message) => { publicPort, manifestSrc, manifestURL, - hasStdin + hasStdin, } = message; setupTraceCategoryState(); @@ -232,7 +232,7 @@ function workerOnGlobalUncaughtException(error, fromPromise) { if (serialized) port.postMessage({ type: ERROR_MESSAGE, - error: serialized + error: serialized, }); else port.postMessage({ type: COULD_NOT_SERIALIZE_ERROR }); diff --git a/lib/internal/modules/cjs/helpers.js b/lib/internal/modules/cjs/helpers.js index 94602b5309efff..6843c339387f9b 100644 --- a/lib/internal/modules/cjs/helpers.js +++ b/lib/internal/modules/cjs/helpers.js @@ -14,7 +14,7 @@ const { } = primordials; const { ERR_MANIFEST_DEPENDENCY_MISSING, - ERR_UNKNOWN_BUILTIN_MODULE + ERR_UNKNOWN_BUILTIN_MODULE, } = require('internal/errors').codes; const { NativeModule } = require('internal/bootstrap/loaders'); @@ -165,14 +165,14 @@ function addBuiltinLibsToObject(object) { get: () => lib, set: setReal, configurable: true, - enumerable: false + enumerable: false, }); return lib; }, set: setReal, configurable: true, - enumerable: false + enumerable: false, }); }); } diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index fbfc17ba6d1885..50158954461169 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -69,14 +69,14 @@ const cjsParseCache = new SafeWeakMap(); // Set first due to cycle with ESM loader functions. module.exports = { wrapSafe, Module, toRealPath, readPackageScope, cjsParseCache, - get hasLoadedAnyUserCJSModule() { return hasLoadedAnyUserCJSModule; } + get hasLoadedAnyUserCJSModule() { return hasLoadedAnyUserCJSModule; }, }; const { NativeModule } = require('internal/bootstrap/loaders'); const { getSourceMapsEnabled, maybeCacheSourceMap, - rekeySourceMap + rekeySourceMap, } = require('internal/source_map/source_map_cache'); const { pathToFileURL, fileURLToPath, isURLInstance } = require('internal/url'); const { deprecate } = require('internal/util'); @@ -94,7 +94,7 @@ const { normalizeReferrerURL, stripBOM, cjsConditions, - loadNativeModule + loadNativeModule, } = require('internal/modules/cjs/helpers'); const { getOptionValue } = require('internal/options'); const preserveSymlinks = getOptionValue('--preserve-symlinks'); @@ -120,11 +120,11 @@ const pendingDeprecation = getOptionValue('--pending-deprecation'); const { CHAR_FORWARD_SLASH, CHAR_BACKWARD_SLASH, - CHAR_COLON + CHAR_COLON, } = require('internal/constants'); const { - isProxy + isProxy, } = require('internal/util/types'); const asyncESM = require('internal/process/esm_loader'); @@ -133,7 +133,7 @@ const { kEvaluated } = internalBinding('module_wrap'); const { encodedSepRegEx, packageExportsResolve, - packageImportsResolve + packageImportsResolve, } = require('internal/modules/esm/resolve'); const isWindows = process.platform === 'win32'; @@ -213,7 +213,7 @@ let wrapperProxy = new Proxy(wrapper, { defineProperty(target, property, descriptor) { patched = true; return ObjectDefineProperty(target, property, descriptor); - } + }, }); ObjectDefineProperty(Module, 'wrap', { @@ -224,7 +224,7 @@ ObjectDefineProperty(Module, 'wrap', { set(value) { patched = true; wrap = value; - } + }, }); ObjectDefineProperty(Module, 'wrapper', { @@ -235,7 +235,7 @@ ObjectDefineProperty(Module, 'wrapper', { set(value) { patched = true; wrapperProxy = value; - } + }, }); const isPreloadingDesc = { get() { return isPreloading; } }; @@ -303,7 +303,7 @@ function readPackage(requestPath) { main: parsed.main, exports: parsed.exports, imports: parsed.imports, - type: parsed.type + type: parsed.type, }; packageJsonCache.set(jsonPath, filtered); return filtered; @@ -388,7 +388,7 @@ function tryFile(requestPath, isMain) { function toRealPath(requestPath) { return fs.realpathSync(requestPath, { - [internalFS.realpathCacheKey]: realpathCache + [internalFS.realpathCacheKey]: realpathCache, }); } @@ -723,7 +723,7 @@ const CircularRequirePrototypeWarningProxy = new Proxy({}, { return ObjectGetOwnPropertyDescriptor(target, prop); emitCircularRequireWarning(prop); return undefined; - } + }, }); function getExportsForCircularRequire(module) { diff --git a/lib/internal/modules/esm/get_format.js b/lib/internal/modules/esm/get_format.js index f02bb5cde70772..a8927f8f9e288b 100644 --- a/lib/internal/modules/esm/get_format.js +++ b/lib/internal/modules/esm/get_format.js @@ -18,7 +18,7 @@ const extensionFormatMap = { '__proto__': null, '.cjs': 'commonjs', '.js': 'module', - '.mjs': 'module' + '.mjs': 'module', }; const legacyExtensionFormatMap = { @@ -27,7 +27,7 @@ const legacyExtensionFormatMap = { '.js': 'commonjs', '.json': 'commonjs', '.mjs': 'module', - '.node': 'commonjs' + '.node': 'commonjs', }; if (experimentalWasmModules) @@ -50,7 +50,7 @@ function defaultGetFormat(url, context, defaultGetFormatUnused) { '__proto__': null, 'text/javascript': 'module', 'application/json': experimentalJsonModules ? 'json' : null, - 'application/wasm': experimentalWasmModules ? 'wasm' : null + 'application/wasm': experimentalWasmModules ? 'wasm' : null, })[mime] || null; return { format }; } else if (parsed.protocol === 'file:') { diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js index de9863ed71ce8a..882c9dd624f800 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -19,7 +19,7 @@ const { ERR_INVALID_RETURN_PROPERTY, ERR_INVALID_RETURN_PROPERTY_VALUE, ERR_INVALID_RETURN_VALUE, - ERR_UNKNOWN_MODULE_FORMAT + ERR_UNKNOWN_MODULE_FORMAT, } = require('internal/errors').codes; const { URL, pathToFileURL, isURLInstance } = require('internal/url'); const ModuleMap = require('internal/modules/esm/module_map'); @@ -160,7 +160,7 @@ class Loader { callbackMap.set(module, { importModuleDynamically: (specifier, { url }) => { return this.import(specifier, url); - } + }, }); return module; diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js index 7b503376af0950..1ef6a4030fb4c3 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -815,7 +815,7 @@ function defaultResolve(specifier, context = {}, defaultResolveUnused) { parsed = new URL(specifier); if (parsed.protocol === 'data:') { return { - url: specifier + url: specifier, }; } } catch {} @@ -825,7 +825,7 @@ function defaultResolve(specifier, context = {}, defaultResolveUnused) { throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(parsed); if (NativeModule.canBeRequiredByUsers(specifier)) { return { - url: 'node:' + specifier + url: 'node:' + specifier, }; } if (parentURL && StringPrototypeStartsWith(parentURL, 'data:')) { @@ -877,7 +877,7 @@ function defaultResolve(specifier, context = {}, defaultResolveUnused) { if (isMain ? !preserveSymlinksMain : !preserveSymlinks) { const urlPath = fileURLToPath(url); const real = realpathSync(urlPath, { - [internalFS.realpathCacheKey]: realpathCache + [internalFS.realpathCacheKey]: realpathCache, }); const old = url; url = pathToFileURL( @@ -896,7 +896,7 @@ module.exports = { getPackageScopeConfig, getPackageType, packageExportsResolve, - packageImportsResolve + packageImportsResolve, }; // cycle diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index 6d295089e42c70..37766efd279467 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -32,11 +32,11 @@ const { readFileSync } = require('fs'); const { extname, isAbsolute } = require('path'); const { stripBOM, - loadNativeModule + loadNativeModule, } = require('internal/modules/cjs/helpers'); const { Module: CJSModule, - cjsParseCache + cjsParseCache, } = require('internal/modules/cjs/loader'); const internalURLModule = require('internal/url'); const { defaultGetSource } = require( @@ -52,7 +52,7 @@ let debug = require('internal/util/debuglog').debuglog('esm', (fn) => { const { emitExperimentalWarning } = require('internal/util'); const { ERR_UNKNOWN_BUILTIN_MODULE, - ERR_INVALID_RETURN_PROPERTY_VALUE + ERR_INVALID_RETURN_PROPERTY_VALUE, } = require('internal/errors').codes; const { maybeCacheSourceMap } = require('internal/source_map/source_map_cache'); const moduleWrap = internalBinding('module_wrap'); @@ -332,7 +332,7 @@ translators.set('json', async function jsonStrategy(url) { const exports = JSONParse(stripBOM(source)); module = { exports, - loaded: true + loaded: true, }; } catch (err) { // TODO (BridgeAR): We could add a NodeCore error that wraps the JSON diff --git a/lib/internal/net.js b/lib/internal/net.js index 8ae3170228dc32..e1311d304baed3 100644 --- a/lib/internal/net.js +++ b/lib/internal/net.js @@ -65,5 +65,5 @@ module.exports = { isIPv4, isIPv6, makeSyncWrite, - normalizedArgsSymbol: Symbol('normalizedArgs') + normalizedArgsSymbol: Symbol('normalizedArgs'), }; diff --git a/lib/internal/options.js b/lib/internal/options.js index a1d4bd984c4881..fa77a7d517257c 100644 --- a/lib/internal/options.js +++ b/lib/internal/options.js @@ -28,5 +28,5 @@ module.exports = { aliases, getOptionValue, getAllowUnauthorized, - shouldNotRegisterESMLoader + shouldNotRegisterESMLoader, }; diff --git a/lib/internal/per_context/domexception.js b/lib/internal/per_context/domexception.js index 06bb3fa3053cd5..d3bcc466f9765b 100644 --- a/lib/internal/per_context/domexception.js +++ b/lib/internal/per_context/domexception.js @@ -43,7 +43,7 @@ class DOMException extends Error { super(); internalsMap.set(this, { message: `${message}`, - name: `${name}` + name: `${name}`, }); } @@ -80,7 +80,7 @@ ObjectDefineProperties(DOMException.prototype, { [SymbolToStringTag]: { configurable: true, value: 'DOMException' }, name: { enumerable: true, configurable: true }, message: { enumerable: true, configurable: true }, - code: { enumerable: true, configurable: true } + code: { enumerable: true, configurable: true }, }); function forEachCode(fn) { diff --git a/lib/internal/per_context/primordials.js b/lib/internal/per_context/primordials.js index 78f778b65703c5..67ce9eca2db6f9 100644 --- a/lib/internal/per_context/primordials.js +++ b/lib/internal/per_context/primordials.js @@ -58,12 +58,12 @@ function getNewKey(key) { function copyAccessor(dest, prefix, key, { enumerable, get, set }) { ReflectDefineProperty(dest, `${prefix}Get${key}`, { value: uncurryThis(get), - enumerable + enumerable, }); if (set !== undefined) { ReflectDefineProperty(dest, `${prefix}Set${key}`, { value: uncurryThis(set), - enumerable + enumerable, }); } } diff --git a/lib/internal/perf/nodetiming.js b/lib/internal/perf/nodetiming.js index 5ff6dd38cd86d3..6fc65664367abf 100644 --- a/lib/internal/perf/nodetiming.js +++ b/lib/internal/perf/nodetiming.js @@ -26,7 +26,7 @@ const { NODE_PERFORMANCE_MILESTONE_LOOP_START, NODE_PERFORMANCE_MILESTONE_LOOP_EXIT, NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE, - NODE_PERFORMANCE_MILESTONE_ENVIRONMENT + NODE_PERFORMANCE_MILESTONE_ENVIRONMENT, }, loopIdleTime, milestones, @@ -55,25 +55,25 @@ class PerformanceNodeTiming { name: { enumerable: true, configurable: true, - value: 'node' + value: 'node', }, entryType: { enumerable: true, configurable: true, - value: 'node' + value: 'node', }, startTime: { enumerable: true, configurable: true, - value: 0 + value: 0, }, duration: { enumerable: true, configurable: true, - get: now + get: now, }, nodeStart: { @@ -81,7 +81,7 @@ class PerformanceNodeTiming { configurable: true, get() { return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_NODE_START); - } + }, }, v8Start: { @@ -89,7 +89,7 @@ class PerformanceNodeTiming { configurable: true, get() { return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_V8_START); - } + }, }, environment: { @@ -97,7 +97,7 @@ class PerformanceNodeTiming { configurable: true, get() { return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_ENVIRONMENT); - } + }, }, loopStart: { @@ -105,7 +105,7 @@ class PerformanceNodeTiming { configurable: true, get() { return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_LOOP_START); - } + }, }, loopExit: { @@ -113,7 +113,7 @@ class PerformanceNodeTiming { configurable: true, get() { return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_LOOP_EXIT); - } + }, }, bootstrapComplete: { @@ -122,14 +122,14 @@ class PerformanceNodeTiming { get() { return getMilestoneTimestamp( NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); - } + }, }, idleTime: { enumerable: true, configurable: true, get: loopIdleTime, - } + }, }); } @@ -138,7 +138,7 @@ class PerformanceNodeTiming { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `PerformanceNodeTiming ${inspect(this.toJSON(), opts)}`; diff --git a/lib/internal/perf/observe.js b/lib/internal/perf/observe.js index c96925c723f64e..93cf0e8b58969d 100644 --- a/lib/internal/perf/observe.js +++ b/lib/internal/perf/observe.js @@ -166,7 +166,7 @@ class PerformanceObserverEntryList { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `PerformanceObserverEntryList ${inspect(this[kBuffer], opts)}`; @@ -270,7 +270,7 @@ class PerformanceObserver { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `PerformanceObserver ${inspect({ diff --git a/lib/internal/perf/perf.js b/lib/internal/perf/perf.js index d049d3c68fff04..99c665a76246e9 100644 --- a/lib/internal/perf/perf.js +++ b/lib/internal/perf/perf.js @@ -53,7 +53,7 @@ class PerformanceEntry { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `${this.constructor.name} ${inspect(this.toJSON(), opts)}`; diff --git a/lib/internal/perf/timerify.js b/lib/internal/perf/timerify.js index 1108f5efb91392..3f1304cbcbbc01 100644 --- a/lib/internal/perf/timerify.js +++ b/lib/internal/perf/timerify.js @@ -15,11 +15,11 @@ const { } = require('internal/perf/perf'); const { - validateObject + validateObject, } = require('internal/validators'); const { - isHistogram + isHistogram, } = require('internal/histogram'); const { @@ -62,7 +62,7 @@ function timerify(fn, options = {}) { validateObject(options, 'options'); const { - histogram + histogram, } = options; if (histogram !== undefined && @@ -110,8 +110,8 @@ function timerify(fn, options = {}) { name: { configurable: false, enumerable: true, - value: `timerified ${fn.name}` - } + value: `timerified ${fn.name}`, + }, }); ObjectDefineProperties(fn, { @@ -119,7 +119,7 @@ function timerify(fn, options = {}) { configurable: false, enumerable: false, value: timerified, - } + }, }); return timerified; diff --git a/lib/internal/perf/usertiming.js b/lib/internal/perf/usertiming.js index 6672a3f4dfdeb0..58e1aab161f326 100644 --- a/lib/internal/perf/usertiming.js +++ b/lib/internal/perf/usertiming.js @@ -129,7 +129,7 @@ function measure(name, startOrMeasureOptions, endMark) { const { start, duration, - detail + detail, } = calculateStartDuration(startOrMeasureOptions, endMark); return new PerformanceMeasure(name, start, duration, detail); } diff --git a/lib/internal/policy/manifest.js b/lib/internal/policy/manifest.js index c3ec82f596a509..e0ce88bf23dcdd 100644 --- a/lib/internal/policy/manifest.js +++ b/lib/internal/policy/manifest.js @@ -16,7 +16,7 @@ const { uncurryThis, } = primordials; const { - canBeRequiredByUsers + canBeRequiredByUsers, } = require('internal/bootstrap/loaders').NativeModule; const { ERR_MANIFEST_ASSERT_INTEGRITY, @@ -449,7 +449,7 @@ class Manifest { #createResolver = (resolve) => { return { resolve: (to, conditions) => resolve(`${to}`, conditions), - reaction: this.#reaction + reaction: this.#reaction, }; } @@ -498,7 +498,7 @@ class Manifest { for (let i = 0; i < integrityEntries.length; i++) { const { algorithm, - value: expected + value: expected, } = integrityEntries[i]; const hash = createHash(algorithm); HashUpdate(hash, content); diff --git a/lib/internal/policy/sri.js b/lib/internal/policy/sri.js index 6728ff4de22bd1..1c7972cf33d38b 100644 --- a/lib/internal/policy/sri.js +++ b/lib/internal/policy/sri.js @@ -15,7 +15,7 @@ const { } = primordials; const { - ERR_SRI_PARSE + ERR_SRI_PARSE, } = require('internal/errors').codes; const kWSP = '[\\x20\\x09]'; const kVCHAR = '[\\x21-\\x7E]'; @@ -55,7 +55,7 @@ const parse = (str) => { algorithm: match[2], value: BufferFrom(match[3], 'base64'), options: match[4] === undefined ? null : match[4], - }) + }), }); prevIndex += match[0].length; } diff --git a/lib/internal/process/execution.js b/lib/internal/process/execution.js index e2d9898012d2d7..ceddfa533d654e 100644 --- a/lib/internal/process/execution.js +++ b/lib/internal/process/execution.js @@ -20,7 +20,7 @@ const { clearAsyncIdStack, hasAsyncIdStack, afterHooksExist, - emitAfter + emitAfter, } = require('internal/async_hooks'); // shouldAbortOnUncaughtToggle is a typed array for faster @@ -85,7 +85,7 @@ function evalScript(name, body, breakFirstLine, print) { async importModuleDynamically(specifier) { const loader = await asyncESM.ESMLoader; return loader.import(specifier, baseUrl); - } + }, })); if (print) { const { log } = require('internal/console/global'); @@ -98,7 +98,7 @@ function evalScript(name, body, breakFirstLine, print) { const exceptionHandlerState = { captureFn: null, - reportFlag: false + reportFlag: false, }; function setUncaughtExceptionCaptureCallback(fn) { @@ -220,5 +220,5 @@ module.exports = { evalScript, onGlobalUncaughtException: createOnGlobalUncaughtException(), setUncaughtExceptionCaptureCallback, - hasUncaughtExceptionCaptureCallback + hasUncaughtExceptionCaptureCallback, }; diff --git a/lib/internal/process/per_thread.js b/lib/internal/process/per_thread.js index e85029735a2c42..b2f58476679d52 100644 --- a/lib/internal/process/per_thread.js +++ b/lib/internal/process/per_thread.js @@ -37,8 +37,8 @@ const { ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, - ERR_UNKNOWN_SIGNAL - } + ERR_UNKNOWN_SIGNAL, + }, } = require('internal/errors'); const format = require('internal/util/inspect').format; const { @@ -55,7 +55,7 @@ function assert(x, msg) { function getFastAPIs(binding) { const { - hrtime: _hrtime + hrtime: _hrtime, } = binding.getFastAPIs(); // The 3 entries filled in by the original process.hrtime contains @@ -104,7 +104,7 @@ function wrapProcessMethods(binding) { cpuUsage: _cpuUsage, memoryUsage: _memoryUsage, rss, - resourceUsage: _resourceUsage + resourceUsage: _resourceUsage, } = binding; function _rawDebug(...args) { @@ -147,14 +147,14 @@ function wrapProcessMethods(binding) { if (prevValue) { return { user: cpuValues[0] - prevValue.user, - system: cpuValues[1] - prevValue.system + system: cpuValues[1] - prevValue.system, }; } // If no previous value passed in, return current value. return { user: cpuValues[0], - system: cpuValues[1] + system: cpuValues[1], }; } @@ -174,7 +174,7 @@ function wrapProcessMethods(binding) { heapTotal: memValues[1], heapUsed: memValues[2], external: memValues[3], - arrayBuffers: memValues[4] + arrayBuffers: memValues[4], }; } @@ -241,7 +241,7 @@ function wrapProcessMethods(binding) { ipcReceived: resourceValues[12], signalsCount: resourceValues[13], voluntaryContextSwitches: resourceValues[14], - involuntaryContextSwitches: resourceValues[15] + involuntaryContextSwitches: resourceValues[15], }; } @@ -252,7 +252,7 @@ function wrapProcessMethods(binding) { resourceUsage, memoryUsage, kill, - exit + exit, }; } @@ -264,7 +264,7 @@ const trailingValuesRegex = /=.*$/; // from data in the config binding. function buildAllowedFlags() { const { - envSettings: { kAllowedInEnvironment } + envSettings: { kAllowedInEnvironment }, } = internalBinding('options'); const { options, aliases } = require('internal/options'); @@ -399,5 +399,5 @@ module.exports = { getFastAPIs, assert, buildAllowedFlags, - wrapProcessMethods + wrapProcessMethods, }; diff --git a/lib/internal/process/policy.js b/lib/internal/process/policy.js index ea283a449742fc..075c4c9299a428 100644 --- a/lib/internal/process/policy.js +++ b/lib/internal/process/policy.js @@ -57,5 +57,5 @@ module.exports = ObjectFreeze({ assertIntegrity(moduleURL, content) { this.manifest.assertIntegrity(moduleURL, content); - } + }, }); diff --git a/lib/internal/process/promises.js b/lib/internal/process/promises.js index a6c65b0be4d84d..9c0b99dfab32db 100644 --- a/lib/internal/process/promises.js +++ b/lib/internal/process/promises.js @@ -14,14 +14,14 @@ const { kPromiseRejectWithNoHandler, kPromiseHandlerAddedAfterReject, kPromiseResolveAfterResolved, - kPromiseRejectAfterResolved + kPromiseRejectAfterResolved, }, - setPromiseRejectCallback + setPromiseRejectCallback, } = internalBinding('task_queue'); const { noSideEffectsToString, - triggerUncaughtException + triggerUncaughtException, } = internalBinding('errors'); const { @@ -144,7 +144,7 @@ function unhandledRejection(promise, reason) { uid: ++lastPromiseId, warned: false, domain: process.domain, - emit + emit, }); // This causes the promise to be referenced at least for one tick. ArrayPrototypePush(pendingUnhandledRejections, promise); diff --git a/lib/internal/process/report.js b/lib/internal/process/report.js index f34b71abe57d46..8bf4bb0da416ae 100644 --- a/lib/internal/process/report.js +++ b/lib/internal/process/report.js @@ -1,7 +1,7 @@ 'use strict'; const { ERR_INVALID_ARG_TYPE, - ERR_SYNTHETIC + ERR_SYNTHETIC, } = require('internal/errors').codes; const { validateBoolean, @@ -91,7 +91,7 @@ const report = { validateBoolean(trigger, 'trigger'); nr.setReportOnUncaughtException(trigger); - } + }, }; function addSignalHandler(sig) { @@ -116,5 +116,5 @@ function signalHandler(sig) { module.exports = { addSignalHandler, - report + report, }; diff --git a/lib/internal/process/signal.js b/lib/internal/process/signal.js index 0631fe2b29ab01..548f19a65c7602 100644 --- a/lib/internal/process/signal.js +++ b/lib/internal/process/signal.js @@ -50,5 +50,5 @@ function stopListeningIfSignal(type) { module.exports = { startListeningIfSignal, - stopListeningIfSignal + stopListeningIfSignal, }; diff --git a/lib/internal/process/task_queues.js b/lib/internal/process/task_queues.js index 2a14b9dea68080..b3119963507378 100644 --- a/lib/internal/process/task_queues.js +++ b/lib/internal/process/task_queues.js @@ -12,14 +12,14 @@ const { // Used to run V8's micro task queue. runMicrotasks, setTickCallback, - enqueueMicrotask + enqueueMicrotask, } = internalBinding('task_queue'); const { setHasRejectionToWarn, hasRejectionToWarn, listenForRejections, - processPromiseRejections + processPromiseRejections, } = require('internal/process/promises'); const { @@ -31,7 +31,7 @@ const { emitBefore, emitAfter, emitDestroy, - symbols: { async_id_symbol, trigger_async_id_symbol } + symbols: { async_id_symbol, trigger_async_id_symbol }, } = require('internal/async_hooks'); const FixedQueue = require('internal/fixed_queue'); @@ -127,7 +127,7 @@ function nextTick(callback) { [async_id_symbol]: asyncId, [trigger_async_id_symbol]: triggerAsyncId, callback, - args + args, }; if (initHooksExist()) emitInit(asyncId, 'TickObject', triggerAsyncId, tickObject); @@ -167,8 +167,8 @@ module.exports = { setTickCallback(processTicksAndRejections); return { nextTick, - runNextTicks + runNextTicks, }; }, - queueMicrotask + queueMicrotask, }; diff --git a/lib/internal/process/worker_thread_only.js b/lib/internal/process/worker_thread_only.js index 9d2a43b441a584..2f5a10c9d63f19 100644 --- a/lib/internal/process/worker_thread_only.js +++ b/lib/internal/process/worker_thread_only.js @@ -4,7 +4,7 @@ // run in the worker thread. const { - codes: { ERR_WORKER_UNSUPPORTED_OPERATION } + codes: { ERR_WORKER_UNSUPPORTED_OPERATION }, } = require('internal/errors'); function unavailable(name) { @@ -17,5 +17,5 @@ function unavailable(name) { } module.exports = { - unavailable + unavailable, }; diff --git a/lib/internal/querystring.js b/lib/internal/querystring.js index 68f52c90c27237..46fdf564dbcc8e 100644 --- a/lib/internal/querystring.js +++ b/lib/internal/querystring.js @@ -115,5 +115,5 @@ function encodeStr(str, noEscapeTable, hexTable) { module.exports = { encodeStr, hexTable, - isHexTable + isHexTable, }; diff --git a/lib/internal/readline/utils.js b/lib/internal/readline/utils.js index 55b3e07b4c1782..43ba14daeddfb9 100644 --- a/lib/internal/readline/utils.js +++ b/lib/internal/readline/utils.js @@ -94,7 +94,7 @@ function* emitKeys(stream) { name: undefined, ctrl: false, meta: false, - shift: false + shift: false, }; if (ch === kEscape) { @@ -386,5 +386,5 @@ module.exports = { commonPrefix, emitKeys, kSubstringSearch, - CSI + CSI, }; diff --git a/lib/internal/repl.js b/lib/internal/repl.js index 5eeb2e349031b2..cf484add00f2ab 100644 --- a/lib/internal/repl.js +++ b/lib/internal/repl.js @@ -23,7 +23,7 @@ function createRepl(env, opts, cb) { ignoreUndefined: false, useGlobal: true, breakEvalOnSigint: true, - ...opts + ...opts, }; if (NumberParseInt(env.NODE_NO_READLINE)) { @@ -33,7 +33,7 @@ function createRepl(env, opts, cb) { if (env.NODE_REPL_MODE) { opts.replMode = { 'strict': REPL.REPL_MODE_STRICT, - 'sloppy': REPL.REPL_MODE_SLOPPY + 'sloppy': REPL.REPL_MODE_SLOPPY, }[env.NODE_REPL_MODE.toLowerCase().trim()]; } diff --git a/lib/internal/repl/await.js b/lib/internal/repl/await.js index 9d36c7147509b4..7a2af076f7de50 100644 --- a/lib/internal/repl/await.js +++ b/lib/internal/repl/await.js @@ -73,7 +73,7 @@ const visitorsWithoutAncestors = { } walk.base.VariableDeclaration(node, state, c); - } + }, }; const visitors = {}; @@ -118,7 +118,7 @@ function processTopLevelAwait(src) { wrappedArray[node.end - 1] += str; }, containsAwait: false, - containsReturn: false + containsReturn: false, }; walk.recursive(body, state, visitors); @@ -152,5 +152,5 @@ function processTopLevelAwait(src) { } module.exports = { - processTopLevelAwait + processTopLevelAwait, }; diff --git a/lib/internal/repl/utils.js b/lib/internal/repl/utils.js index aff7dafe16e95a..78dc5151dfe250 100644 --- a/lib/internal/repl/utils.js +++ b/lib/internal/repl/utils.js @@ -33,7 +33,7 @@ const staticClassFeatures = const { sendInspectorCommand } = require('internal/util/inspector'); const { - ERR_INSPECTOR_NOT_AVAILABLE + ERR_INSPECTOR_NOT_AVAILABLE, } = require('internal/errors').codes; const { @@ -60,7 +60,7 @@ let debug = require('internal/util/debuglog').debuglog('repl', (fn) => { const previewOptions = { colors: false, depth: 1, - showHidden: false + showHidden: false, }; const REPL_MODE_STRICT = Symbol('repl-strict'); @@ -348,7 +348,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { colors: false, depth: 1, compact: true, - breakLength: Infinity + breakLength: Infinity, }, previewOptions); session.post('Runtime.callFunctionOn', { functionDeclaration: @@ -357,7 +357,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { .getOwnPropertyDescriptor(globalThis, 'util') .get().inspect(v, ${inspectOptions})`, objectId: result.objectId, - arguments: [result] + arguments: [result], }, (error, preview) => { if (error) { callback(error); @@ -528,7 +528,7 @@ function setupReverseSearch(repl) { const alreadyMatched = new SafeSet(); const labels = { r: 'bck-i-search: ', - s: 'fwd-i-search: ' + s: 'fwd-i-search: ', }; let isInReverseSearch = false; let historyIndex = -1; @@ -757,5 +757,5 @@ module.exports = { isRecoverableError, kStandaloneREPL: Symbol('kStandaloneREPL'), setupPreview, - setupReverseSearch + setupReverseSearch, }; diff --git a/lib/internal/socket_list.js b/lib/internal/socket_list.js index e6b2a1d7c6a84d..9949a6cde47a23 100644 --- a/lib/internal/socket_list.js +++ b/lib/internal/socket_list.js @@ -39,14 +39,14 @@ class SocketListSend extends EventEmitter { close(callback) { this._request({ cmd: 'NODE_SOCKET_NOTIFY_CLOSE', - key: this.key + key: this.key, }, 'NODE_SOCKET_ALL_CLOSED', true, callback); } getConnections(callback) { this._request({ cmd: 'NODE_SOCKET_GET_COUNT', - key: this.key + key: this.key, }, 'NODE_SOCKET_COUNT', false, (err, msg) => { if (err) return callback(err); callback(null, msg.count); @@ -69,7 +69,7 @@ class SocketListReceive extends EventEmitter { self.child._send({ cmd: 'NODE_SOCKET_ALL_CLOSED', - key: self.key + key: self.key, }, undefined, true); } @@ -87,7 +87,7 @@ class SocketListReceive extends EventEmitter { this.child._send({ cmd: 'NODE_SOCKET_COUNT', key: this.key, - count: this.connections + count: this.connections, }); } }); diff --git a/lib/internal/socketaddress.js b/lib/internal/socketaddress.js index 9697a1e7380eac..059d6a281c19ad 100644 --- a/lib/internal/socketaddress.js +++ b/lib/internal/socketaddress.js @@ -104,7 +104,7 @@ class SocketAddress extends JSTransferable { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `SocketAddress ${inspect(this.toJSON(), opts)}`; diff --git a/lib/internal/source_map/prepare_stack_trace.js b/lib/internal/source_map/prepare_stack_trace.js index 6b8d4e566ff1b1..00b2eb98fada20 100644 --- a/lib/internal/source_map/prepare_stack_trace.js +++ b/lib/internal/source_map/prepare_stack_trace.js @@ -21,7 +21,7 @@ const { findSourceMap } = require('internal/source_map/source_map_cache'); const { kNoOverride, overrideStackTrace, - maybeOverridePrepareStackTrace + maybeOverridePrepareStackTrace, } = require('internal/errors'); const { fileURLToPath } = require('internal/url'); diff --git a/lib/internal/source_map/source_map.js b/lib/internal/source_map/source_map.js index f49de5d8c4deda..fa9afc6fb742b8 100644 --- a/lib/internal/source_map/source_map.js +++ b/lib/internal/source_map/source_map.js @@ -76,7 +76,7 @@ const { } = primordials; const { - ERR_INVALID_ARG_TYPE + ERR_INVALID_ARG_TYPE, } = require('internal/errors').codes; let base64Map; @@ -352,5 +352,5 @@ function compareSourceMapEntry(entry1, entry2) { } module.exports = { - SourceMap + SourceMap, }; diff --git a/lib/internal/source_map/source_map_cache.js b/lib/internal/source_map/source_map_cache.js index f0d911f78fad8b..be03b3d3fc03b1 100644 --- a/lib/internal/source_map/source_map_cache.js +++ b/lib/internal/source_map/source_map_cache.js @@ -45,10 +45,10 @@ function getSourceMapsEnabled() { if (sourceMapsEnabled) { const { enableSourceMaps, - setPrepareStackTraceCallback + setPrepareStackTraceCallback, } = internalBinding('errors'); const { - prepareStackTrace + prepareStackTrace, } = require('internal/source_map/prepare_stack_trace'); setPrepareStackTraceCallback(prepareStackTrace); enableSourceMaps(); @@ -80,7 +80,7 @@ function maybeCacheSourceMap(filename, content, cjsModuleInstance) { filename, lineLengths: lineLengths(content), data, - url + url, }); } else { // If there is no cjsModuleInstance assume we are in a @@ -88,7 +88,7 @@ function maybeCacheSourceMap(filename, content, cjsModuleInstance) { esmSourceMapCache.set(filename, { lineLengths: lineLengths(content), data, - url + url, }); } } @@ -207,7 +207,7 @@ function appendCJSCache(obj) { obj[ObjectGetValueSafe(value, 'filename')] = { lineLengths: ObjectGetValueSafe(value, 'lineLengths'), data: ObjectGetValueSafe(value, 'data'), - url: ObjectGetValueSafe(value, 'url') + url: ObjectGetValueSafe(value, 'url'), }; } } @@ -225,7 +225,7 @@ function findSourceMap(sourceURL) { const filename = ObjectGetValueSafe(value, 'filename'); if (sourceURL === filename) { sourceMap = { - data: ObjectGetValueSafe(value, 'data') + data: ObjectGetValueSafe(value, 'data'), }; } } diff --git a/lib/internal/stream_base_commons.js b/lib/internal/stream_base_commons.js index 5254fc1553dd77..7454c790529004 100644 --- a/lib/internal/stream_base_commons.js +++ b/lib/internal/stream_base_commons.js @@ -13,17 +13,17 @@ const { kArrayBufferOffset, kBytesWritten, kLastWriteWasAsync, - streamBaseState + streamBaseState, } = internalBinding('stream_wrap'); const { UV_EOF } = internalBinding('uv'); const { - errnoException + errnoException, } = require('internal/errors'); const { owner_symbol } = require('internal/async_hooks').symbols; const { kTimeout, setUnrefTimeout, - getTimerDuration + getTimerDuration, } = require('internal/timers'); const { isUint8Array } = require('internal/util/types'); const { clearTimeout } = require('timers'); @@ -284,5 +284,5 @@ module.exports = { setStreamTimeout, kBuffer, kBufferCb, - kBufferGen + kBufferGen, }; diff --git a/lib/internal/streams/buffer_list.js b/lib/internal/streams/buffer_list.js index 2dc803d6fa0425..27f15767a417cc 100644 --- a/lib/internal/streams/buffer_list.js +++ b/lib/internal/streams/buffer_list.js @@ -175,7 +175,7 @@ module.exports = class BufferList { // Only inspect one level. depth: 0, // It should not recurse. - customInspect: false + customInspect: false, }); } }; diff --git a/lib/internal/streams/destroy.js b/lib/internal/streams/destroy.js index a2892c67a0fcfa..24abcc04507b4d 100644 --- a/lib/internal/streams/destroy.js +++ b/lib/internal/streams/destroy.js @@ -376,5 +376,5 @@ module.exports = { destroyer, destroy, undestroy, - errorOrDestroy + errorOrDestroy, }; diff --git a/lib/internal/streams/duplex.js b/lib/internal/streams/duplex.js index 596d30a90a0418..b3d31f66ea6bad 100644 --- a/lib/internal/streams/duplex.js +++ b/lib/internal/streams/duplex.js @@ -105,6 +105,6 @@ ObjectDefineProperties(Duplex.prototype, { this._readableState.destroyed = value; this._writableState.destroyed = value; } - } - } + }, + }, }); diff --git a/lib/internal/streams/end-of-stream.js b/lib/internal/streams/end-of-stream.js index 318ab4c2e6a8b7..e8178eb255eff6 100644 --- a/lib/internal/streams/end-of-stream.js +++ b/lib/internal/streams/end-of-stream.js @@ -8,7 +8,7 @@ const { codes, } = require('internal/errors'); const { - ERR_STREAM_PREMATURE_CLOSE + ERR_STREAM_PREMATURE_CLOSE, } = codes; const { once } = require('internal/util'); const { diff --git a/lib/internal/streams/from.js b/lib/internal/streams/from.js index 906ddcf9af844b..0444de13a05263 100644 --- a/lib/internal/streams/from.js +++ b/lib/internal/streams/from.js @@ -9,7 +9,7 @@ const { Buffer } = require('buffer'); const { ERR_INVALID_ARG_TYPE, - ERR_STREAM_NULL_VALUES + ERR_STREAM_NULL_VALUES, } = require('internal/errors').codes; function from(Readable, iterable, opts) { @@ -21,7 +21,7 @@ function from(Readable, iterable, opts) { read() { this.push(iterable); this.push(null); - } + }, }); } diff --git a/lib/internal/streams/lazy_transform.js b/lib/internal/streams/lazy_transform.js index 555e6430e33588..4b56f58c53b996 100644 --- a/lib/internal/streams/lazy_transform.js +++ b/lib/internal/streams/lazy_transform.js @@ -12,7 +12,7 @@ const { const stream = require('stream'); const { - getDefaultEncoding + getDefaultEncoding, } = require('internal/crypto/util'); module.exports = LazyTransform; @@ -42,7 +42,7 @@ function makeSetter(name) { value: val, enumerable: true, configurable: true, - writable: true + writable: true, }); }; } @@ -52,12 +52,12 @@ ObjectDefineProperties(LazyTransform.prototype, { get: makeGetter('_readableState'), set: makeSetter('_readableState'), configurable: true, - enumerable: true + enumerable: true, }, _writableState: { get: makeGetter('_writableState'), set: makeSetter('_writableState'), configurable: true, - enumerable: true - } + enumerable: true, + }, }); diff --git a/lib/internal/streams/pipeline.js b/lib/internal/streams/pipeline.js index 441fcb471858bc..e64be41e1231ea 100644 --- a/lib/internal/streams/pipeline.js +++ b/lib/internal/streams/pipeline.js @@ -16,7 +16,7 @@ const { ERR_INVALID_ARG_TYPE, ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS, - ERR_STREAM_DESTROYED + ERR_STREAM_DESTROYED, } = require('internal/errors').codes; const { validateCallback } = require('internal/validators'); @@ -208,7 +208,7 @@ function pipeline(...streams) { // composed through `.pipe(stream)`. const pt = new PassThrough({ - objectMode: true + objectMode: true, }); // Handle Promises/A+ spec, `then` could be a getter that throws on diff --git a/lib/internal/streams/readable.js b/lib/internal/streams/readable.js index aa0f5f94886427..46c840afbdd9b6 100644 --- a/lib/internal/streams/readable.js +++ b/lib/internal/streams/readable.js @@ -32,7 +32,7 @@ const { Promise, SafeSet, SymbolAsyncIterator, - Symbol + Symbol, } = primordials; module.exports = Readable; @@ -53,14 +53,14 @@ const BufferList = require('internal/streams/buffer_list'); const destroyImpl = require('internal/streams/destroy'); const { getHighWaterMark, - getDefaultHighWaterMark + getDefaultHighWaterMark, } = require('internal/streams/state'); const { ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED, - ERR_STREAM_UNSHIFT_AFTER_END_EVENT + ERR_STREAM_UNSHIFT_AFTER_END_EVENT, } = require('internal/errors').codes; const kPaused = Symbol('kPaused'); @@ -1072,7 +1072,7 @@ Readable.prototype[SymbolAsyncIterator] = function() { destroy(err, callback) { destroyImpl.destroyer(src, err); callback(err); - } + }, }).wrap(src); } @@ -1161,21 +1161,21 @@ ObjectDefineProperties(Readable.prototype, { if (this._readableState) { this._readableState.readable = !!val; } - } + }, }, readableHighWaterMark: { enumerable: false, get: function() { return this._readableState.highWaterMark; - } + }, }, readableBuffer: { enumerable: false, get: function() { return this._readableState && this._readableState.buffer; - } + }, }, readableFlowing: { @@ -1187,28 +1187,28 @@ ObjectDefineProperties(Readable.prototype, { if (this._readableState) { this._readableState.flowing = state; } - } + }, }, readableLength: { enumerable: false, get() { return this._readableState.length; - } + }, }, readableObjectMode: { enumerable: false, get() { return this._readableState ? this._readableState.objectMode : false; - } + }, }, readableEncoding: { enumerable: false, get() { return this._readableState ? this._readableState.encoding : null; - } + }, }, destroyed: { @@ -1229,14 +1229,14 @@ ObjectDefineProperties(Readable.prototype, { // Backward compatibility, the user is explicitly // managing destroyed. this._readableState.destroyed = value; - } + }, }, readableEnded: { enumerable: false, get() { return this._readableState ? this._readableState.endEmitted : false; - } + }, }, }); @@ -1246,7 +1246,7 @@ ObjectDefineProperties(ReadableState.prototype, { pipesCount: { get() { return this.pipes.length; - } + }, }, // Legacy property for `paused`. @@ -1256,8 +1256,8 @@ ObjectDefineProperties(ReadableState.prototype, { }, set(value) { this[kPaused] = !!value; - } - } + }, + }, }); // Exposed for testing purposes only. diff --git a/lib/internal/streams/state.js b/lib/internal/streams/state.js index 83050a62f9cedc..7b05a1ab0b5a51 100644 --- a/lib/internal/streams/state.js +++ b/lib/internal/streams/state.js @@ -32,5 +32,5 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) { module.exports = { getHighWaterMark, - getDefaultHighWaterMark + getDefaultHighWaterMark, }; diff --git a/lib/internal/streams/transform.js b/lib/internal/streams/transform.js index 26e0b07c2956c8..ff3dbfaf428fe6 100644 --- a/lib/internal/streams/transform.js +++ b/lib/internal/streams/transform.js @@ -65,12 +65,12 @@ const { ObjectSetPrototypeOf, - Symbol + Symbol, } = primordials; module.exports = Transform; const { - ERR_METHOD_NOT_IMPLEMENTED + ERR_METHOD_NOT_IMPLEMENTED, } = require('internal/errors').codes; const Duplex = require('internal/streams/duplex'); ObjectSetPrototypeOf(Transform.prototype, Duplex.prototype); diff --git a/lib/internal/streams/writable.js b/lib/internal/streams/writable.js index 03f63b16bd04ff..78585347580558 100644 --- a/lib/internal/streams/writable.js +++ b/lib/internal/streams/writable.js @@ -51,7 +51,7 @@ const { const { getHighWaterMark, - getDefaultHighWaterMark + getDefaultHighWaterMark, } = require('internal/streams/state'); const { ERR_INVALID_ARG_TYPE, @@ -62,7 +62,7 @@ const { ERR_STREAM_ALREADY_FINISHED, ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END, - ERR_UNKNOWN_ENCODING + ERR_UNKNOWN_ENCODING, } = require('internal/errors').codes; const { errorOrDestroy } = destroyImpl; @@ -213,7 +213,7 @@ WritableState.prototype.getBuffer = function getBuffer() { ObjectDefineProperty(WritableState.prototype, 'bufferedRequestCount', { get() { return this.buffered.length - this.bufferedIndex; - } + }, }); function Writable(options) { @@ -775,7 +775,7 @@ ObjectDefineProperties(Writable.prototype, { if (this._writableState) { this._writableState.destroyed = value; } - } + }, }, writable: { @@ -793,31 +793,31 @@ ObjectDefineProperties(Writable.prototype, { if (this._writableState) { this._writableState.writable = !!val; } - } + }, }, writableFinished: { get() { return this._writableState ? this._writableState.finished : false; - } + }, }, writableObjectMode: { get() { return this._writableState ? this._writableState.objectMode : false; - } + }, }, writableBuffer: { get() { return this._writableState && this._writableState.getBuffer(); - } + }, }, writableEnded: { get() { return this._writableState ? this._writableState.ending : false; - } + }, }, writableNeedDrain: { @@ -825,26 +825,26 @@ ObjectDefineProperties(Writable.prototype, { const wState = this._writableState; if (!wState) return false; return !wState.destroyed && !wState.ending && wState.needDrain; - } + }, }, writableHighWaterMark: { get() { return this._writableState && this._writableState.highWaterMark; - } + }, }, writableCorked: { get() { return this._writableState ? this._writableState.corked : 0; - } + }, }, writableLength: { get() { return this._writableState && this._writableState.length; - } - } + }, + }, }); const destroy = destroyImpl.destroy; diff --git a/lib/internal/test/transfer.js b/lib/internal/test/transfer.js index b814c37fe6dc6d..635f3033e76642 100644 --- a/lib/internal/test/transfer.js +++ b/lib/internal/test/transfer.js @@ -30,7 +30,7 @@ class F extends E { [kClone]() { return { data: { b: this.b }, - deserializeInfo: 'internal/test/transfer:F' + deserializeInfo: 'internal/test/transfer:F', }; } diff --git a/lib/internal/timers.js b/lib/internal/timers.js index 9a07fe3348f65e..d61eca38366320 100644 --- a/lib/internal/timers.js +++ b/lib/internal/timers.js @@ -87,7 +87,7 @@ const { toggleTimerRef, getLibuvNow, immediateInfo, - toggleImmediateRef + toggleImmediateRef, } = internalBinding('timers'); const { @@ -109,7 +109,7 @@ const trigger_async_id_symbol = Symbol('triggerId'); const kHasPrimitive = Symbol('kHasPrimitive'); const { - ERR_OUT_OF_RANGE + ERR_OUT_OF_RANGE, } = require('internal/errors').codes; const { validateCallback, @@ -203,7 +203,7 @@ Timeout.prototype[inspect.custom] = function(_, options) { // Only inspect one level. depth: 0, // It should not recurse. - customInspect: false + customInspect: false, }); }; @@ -254,7 +254,7 @@ TimersList.prototype[inspect.custom] = function(_, options) { // Only inspect one level. depth: 0, // It should not recurse. - customInspect: false + customInspect: false, }); }; @@ -592,7 +592,7 @@ function getTimerCallbacks(runNextTicks) { return { processImmediate, - processTimers + processTimers, }; } @@ -653,7 +653,7 @@ module.exports = { immediateInfoFields: { kCount, kRefCount, - kHasOutstanding + kHasOutstanding, }, active, unrefActive, @@ -661,5 +661,5 @@ module.exports = { timerListMap, timerListQueue, decRefCount, - incRefCount + incRefCount, }; diff --git a/lib/internal/trace_events_async_hooks.js b/lib/internal/trace_events_async_hooks.js index 9796f6866d96c8..4d3f8fe8c12cbb 100644 --- a/lib/internal/trace_events_async_hooks.js +++ b/lib/internal/trace_events_async_hooks.js @@ -46,7 +46,7 @@ function createHook() { type, asyncId, { triggerAsyncId, - executionAsyncId: async_hooks.executionAsyncId() + executionAsyncId: async_hooks.executionAsyncId(), }); }, @@ -72,7 +72,7 @@ function createHook() { // Cleanup asyncId to type map typeMemory.delete(asyncId); - } + }, }); return { @@ -89,7 +89,7 @@ function createHook() { this[kEnabled] = false; hook.disable(); typeMemory.clear(); - } + }, }; } diff --git a/lib/internal/tty.js b/lib/internal/tty.js index 5a247c7928c346..128debbd5c127e 100644 --- a/lib/internal/tty.js +++ b/lib/internal/tty.js @@ -31,7 +31,7 @@ const { const { ERR_INVALID_ARG_TYPE, - ERR_OUT_OF_RANGE + ERR_OUT_OF_RANGE, } = require('internal/errors').codes; let OSRelease; @@ -66,7 +66,7 @@ const TERM_ENVS = { // https://github.com/da-x/rxvt-unicode/tree/v9.22-with-24bit-color 'rxvt-unicode-24bit': COLORS_16m, // https://gist.github.com/XVilka/8346728#gistcomment-2823421 - 'terminator': COLORS_16m + 'terminator': COLORS_16m, }; const TERM_ENVS_REG_EXP = [ @@ -233,5 +233,5 @@ function hasColors(count, env) { module.exports = { getColorDepth, - hasColors + hasColors, }; diff --git a/lib/internal/url.js b/lib/internal/url.js index 16a453c7845a30..30ef54255a6563 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -37,7 +37,7 @@ const { inspect } = require('internal/util/inspect'); const { encodeStr, hexTable, - isHexTable + isHexTable, } = require('internal/querystring'); const { getConstructorOf, removeColors } = require('internal/util'); @@ -51,7 +51,7 @@ const { ERR_INVALID_TUPLE, ERR_INVALID_URL, ERR_INVALID_URL_SCHEME, - ERR_MISSING_ARGS + ERR_MISSING_ARGS, } = require('internal/errors').codes; const { CHAR_AMPERSAND, @@ -61,7 +61,7 @@ const { CHAR_LOWERCASE_A, CHAR_LOWERCASE_Z, CHAR_PERCENT, - CHAR_PLUS + CHAR_PLUS, } = require('internal/constants'); const path = require('path'); @@ -98,7 +98,7 @@ const { kPathStart, kPort, kQuery, - kSchemeStart + kSchemeStart, } = internalBinding('url'); const context = Symbol('context'); @@ -673,7 +673,7 @@ class URL { unicode: false, search: true, auth: true, - ...options + ...options, }; const ctx = this[context]; // https://url.spec.whatwg.org/#url-serializing @@ -1122,7 +1122,7 @@ function defineIDLClass(proto, classStr, obj) { writable: false, enumerable: false, configurable: true, - value: classStr + value: classStr, }); // https://heycam.github.io/webidl/#es-operations @@ -1131,7 +1131,7 @@ function defineIDLClass(proto, classStr, obj) { writable: true, enumerable: true, configurable: true, - value: obj[key] + value: obj[key], }); } for (const key of ObjectGetOwnPropertySymbols(obj)) { @@ -1139,7 +1139,7 @@ function defineIDLClass(proto, classStr, obj) { writable: true, enumerable: false, configurable: true, - value: obj[key] + value: obj[key], }); } } @@ -1179,7 +1179,7 @@ function createSearchParamsIterator(target, kind) { iterator[context] = { target, kind, - index: 0 + index: 0, }; return iterator; } @@ -1197,14 +1197,14 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', { const { target, kind, - index + index, } = this[context]; const values = target[searchParams]; const len = values.length; if (index >= len) { return { value: undefined, - done: true + done: true, }; } @@ -1223,7 +1223,7 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', { return { value: result, - done: false + done: false, }; }, [inspect.custom](recurseTimes, ctx) { @@ -1240,7 +1240,7 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', { const { target, kind, - index + index, } = this[context]; const output = ArrayPrototypeReduce( ArrayPrototypeSlice(target[searchParams], index), @@ -1266,7 +1266,7 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', { outputStr = ` ${ArrayPrototypeJoin(outputStrs, ', ')}`; } return `${this[SymbolToStringTag]} {${outputStr} }`; - } + }, }); function domainToASCII(domain) { @@ -1299,7 +1299,7 @@ function urlToHttpOptions(url) { search: url.search, pathname: url.pathname, path: `${url.pathname || ''}${url.search || ''}`, - href: url.href + href: url.href, }; if (url.port !== '') { options.port = Number(url.port); @@ -1490,5 +1490,5 @@ module.exports = { urlToHttpOptions, formatSymbol: kFormat, searchParamsSymbol: searchParams, - encodeStr + encodeStr, }; diff --git a/lib/internal/util.js b/lib/internal/util.js index f77f1fc43368c4..02824212550e9c 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -31,7 +31,7 @@ const { codes: { ERR_INVALID_ARG_TYPE, ERR_NO_CRYPTO, - ERR_UNKNOWN_SIGNAL + ERR_UNKNOWN_SIGNAL, }, uvErrmapGet, overrideStackTrace, @@ -42,7 +42,7 @@ const { setHiddenValue, arrow_message_private_symbol: kArrowMessagePrivateSymbolIndex, decorated_private_symbol: kDecoratedPrivateSymbolIndex, - sleep: _sleep + sleep: _sleep, } = internalBinding('util'); const { isNativeError } = internalBinding('types'); @@ -240,7 +240,7 @@ function createClassWrapper(type) { // Mask the wrapper function name and length values ObjectDefineProperties(fn, { name: { value: type.name }, - length: { value: type.length } + length: { value: type.length }, }); ObjectSetPrototypeOf(fn, type); fn.prototype = type.prototype; @@ -309,7 +309,7 @@ function promisify(original) { throw new ERR_INVALID_ARG_TYPE('util.promisify.custom', 'Function', fn); } return ObjectDefineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true + value: fn, enumerable: false, writable: false, configurable: true, }); } @@ -339,7 +339,7 @@ function promisify(original) { ObjectSetPrototypeOf(fn, ObjectGetPrototypeOf(original)); ObjectDefineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true + value: fn, enumerable: false, writable: false, configurable: true, }); return ObjectDefineProperties( fn, @@ -474,5 +474,5 @@ module.exports = { // Used by the buffer module to capture an internal reference to the // default isEncoding implementation, just in case userland overrides it. kIsEncodingSymbol: Symbol('kIsEncodingSymbol'), - kVmBreakFirstLineSymbol: Symbol('kVmBreakFirstLineSymbol') + kVmBreakFirstLineSymbol: Symbol('kVmBreakFirstLineSymbol'), }; diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index 729012d8ccb944..31af52d8b255a6 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -49,8 +49,8 @@ const { getOwnNonIndexProperties, propertyFilter: { ONLY_ENUMERABLE, - SKIP_SYMBOLS - } + SKIP_SYMBOLS, + }, } = internalBinding('util'); const kStrict = true; @@ -329,7 +329,7 @@ function keyCheck(val1, val2, strict, memos, iterationType, aKeys) { memos = { val1: new SafeMap(), val2: new SafeMap(), - position: 0 + position: 0, }; } else { // We prevent up to two map.has(x) calls by directly retrieving the value @@ -590,5 +590,5 @@ function isDeepStrictEqual(val1, val2) { module.exports = { isDeepEqual, - isDeepStrictEqual + isDeepStrictEqual, }; diff --git a/lib/internal/util/debuglog.js b/lib/internal/util/debuglog.js index b1f82b957b162a..0e6016a8f5c0e7 100644 --- a/lib/internal/util/debuglog.js +++ b/lib/internal/util/debuglog.js @@ -106,12 +106,12 @@ function debuglog(set, cb) { return test(); }, configurable: true, - enumerable: true + enumerable: true, }); return logger; } module.exports = { debuglog, - initializeDebugEnv + initializeDebugEnv, }; diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 62746517729a2e..e08f465e36b230 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -90,22 +90,22 @@ const { getExternalValue, propertyFilter: { ALL_PROPERTIES, - ONLY_ENUMERABLE - } + ONLY_ENUMERABLE, + }, } = internalBinding('util'); const { customInspectSymbol, isError, join, - removeColors + removeColors, } = require('internal/util'); const { codes: { - ERR_INVALID_ARG_TYPE + ERR_INVALID_ARG_TYPE, }, - isStackOverflowError + isStackOverflowError, } = require('internal/errors'); const { @@ -167,7 +167,7 @@ const inspectDefaultOptions = ObjectSeal({ breakLength: 80, compact: 3, sorted: false, - getters: false + getters: false, }); const kObjectType = 0; @@ -242,7 +242,7 @@ function getUserOptions(ctx, isCrossContext) { compact: ctx.compact, sorted: ctx.sorted, getters: ctx.getters, - ...ctx.userOptions + ...ctx.userOptions, }; // Typically, the target value will be an instance of `Object`. If that is @@ -299,7 +299,7 @@ function inspect(value, opts) { breakLength: inspectDefaultOptions.breakLength, compact: inspectDefaultOptions.compact, sorted: inspectDefaultOptions.sorted, - getters: inspectDefaultOptions.getters + getters: inspectDefaultOptions.getters, }; if (arguments.length > 1) { // Legacy... @@ -346,7 +346,7 @@ ObjectDefineProperty(inspect, 'defaultOptions', { set(options) { validateObject(options, 'options'); return ObjectAssign(inspectDefaultOptions, options); - } + }, }); // Set Graphics Rendition https://en.wikipedia.org/wiki/ANSI_escape_code#graphics @@ -411,7 +411,7 @@ function defineColorAlias(target, alias) { this[target] = value; }, configurable: true, - enumerable: false + enumerable: false, }); } @@ -443,7 +443,7 @@ inspect.styles = ObjectAssign(ObjectCreate(null), { // "name": intentionally not styling // TODO(BridgeAR): Highlight regular expressions properly. regexp: 'red', - module: 'underline' + module: 'underline', }); function addQuotes(str, quotes) { @@ -584,7 +584,7 @@ function getConstructorName(obj, ctx, recurseTimes, protoProps) { return `${res} <${inspect(firstProto, { ...ctx, customInspect: false, - depth: -1 + depth: -1, })}>`; } @@ -1919,7 +1919,7 @@ function formatWithOptionsInternal(inspectOptions, args) { ...inspectOptions, compact: 3, colors: false, - depth: 0 + depth: 0, }); } break; @@ -1944,7 +1944,7 @@ function formatWithOptionsInternal(inspectOptions, args) { ...inspectOptions, showHidden: true, showProxy: true, - depth: 4 + depth: 4, }); break; case 105: // 'i' @@ -2122,5 +2122,5 @@ module.exports = { formatWithOptions, getStringWidth, inspectDefaultOptions, - stripVTControlCharacters + stripVTControlCharacters, }; diff --git a/lib/internal/util/inspector.js b/lib/internal/util/inspector.js index cf8651c33ad6d0..1f89ad4710b4ff 100644 --- a/lib/internal/util/inspector.js +++ b/lib/internal/util/inspector.js @@ -51,7 +51,7 @@ function wrapConsole(consoleFromNode, consoleFromVM) { consoleFromNode[key] ); ObjectDefineProperty(consoleFromNode[key], 'name', { - value: key + value: key, }); } else { // Add additional console APIs from the inspector @@ -71,5 +71,5 @@ module.exports = { }, set consoleFromVM(val) { consoleFromVM = val; - } + }, }; diff --git a/lib/internal/util/iterable_weak_map.js b/lib/internal/util/iterable_weak_map.js index 67e51ec8619be9..16694ffdb11de8 100644 --- a/lib/internal/util/iterable_weak_map.js +++ b/lib/internal/util/iterable_weak_map.js @@ -30,7 +30,7 @@ class IterableWeakMap { this.#refSet.add(ref); this.#finalizationGroup.register(key, { set: this.#refSet, - ref + ref, }, ref); } } diff --git a/lib/internal/util/types.js b/lib/internal/util/types.js index aca7dbc4b2f2b6..84944c5e5bcc25 100644 --- a/lib/internal/util/types.js +++ b/lib/internal/util/types.js @@ -68,7 +68,7 @@ module.exports = { isFloat32Array, isFloat64Array, isBigInt64Array, - isBigUint64Array + isBigUint64Array, }; let isCryptoKey; @@ -88,7 +88,7 @@ ObjectDefineProperties(module.exports, { } return isKeyObject(obj); - } + }, }, isCryptoKey: { configurable: false, @@ -103,6 +103,6 @@ ObjectDefineProperties(module.exports, { } return isCryptoKey(obj); - } - } + }, + }, }); diff --git a/lib/internal/v8_prof_polyfill.js b/lib/internal/v8_prof_polyfill.js index 21d9b932c10f4b..a12a0a93367097 100644 --- a/lib/internal/v8_prof_polyfill.js +++ b/lib/internal/v8_prof_polyfill.js @@ -65,7 +65,7 @@ const os = { out = macCppfiltNm(out); } return out; - } + }, }; const print = console.log; function read(fileName) { @@ -113,7 +113,7 @@ function readline() { if (bytes === 0) { process.emitWarning(`Profile file ${logFile} is broken`, { code: 'BROKEN_PROFILE_FILE', - detail: `${JSON.stringify(line)} at the file end is broken` + detail: `${JSON.stringify(line)} at the file end is broken`, }); return ''; } @@ -150,7 +150,7 @@ function macCppfiltNm(out) { let filtered; try { filtered = cp.spawnSync('c++filt', [ '-p', '-i' ], { - input: entries.join('\n') + input: entries.join('\n'), }).stdout.toString(); } catch { return out; diff --git a/lib/internal/validators.js b/lib/internal/validators.js index 6abe332fc5fdc0..dbc929cf6ce4e0 100644 --- a/lib/internal/validators.js +++ b/lib/internal/validators.js @@ -24,11 +24,11 @@ const { ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL, ERR_INVALID_CALLBACK, - } + }, } = require('internal/errors'); const { normalizeEncoding } = require('internal/util'); const { - isArrayBufferView + isArrayBufferView, } = require('internal/util/types'); const { signals } = internalBinding('constants').os; diff --git a/lib/internal/vm/module.js b/lib/internal/vm/module.js index 911b8f4426e586..d926483780af39 100644 --- a/lib/internal/vm/module.js +++ b/lib/internal/vm/module.js @@ -240,7 +240,7 @@ class Module { ObjectSetPrototypeOf(o, ObjectGetPrototypeOf(this)); ObjectDefineProperty(o, SymbolToStringTag, { value: constructor.name, - configurable: true + configurable: true, }); // Lazy to avoid circular dependency diff --git a/lib/internal/watchdog.js b/lib/internal/watchdog.js index 6a5b772111f4d6..9815f6e672390d 100644 --- a/lib/internal/watchdog.js +++ b/lib/internal/watchdog.js @@ -1,7 +1,7 @@ 'use strict'; const { - TraceSigintWatchdog + TraceSigintWatchdog, } = internalBinding('watchdog'); class SigintWatchdog extends TraceSigintWatchdog { @@ -55,5 +55,5 @@ class SigintWatchdog extends TraceSigintWatchdog { module.exports = { - SigintWatchdog + SigintWatchdog, }; diff --git a/lib/internal/worker.js b/lib/internal/worker.js index f2414ebeec4aae..48c8d185e52557 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -53,7 +53,7 @@ const { kStdioWantsMoreDataCallback, setupPortReferencing, ReadableWorkerStdio, - WritableWorkerStdio + WritableWorkerStdio, } = workerIo; const { deserializeError } = require('internal/error_serdes'); const { fileURLToPath, isURLInstance, pathToFileURL } = require('internal/url'); @@ -69,7 +69,7 @@ const { kMaxOldGenerationSizeMb, kCodeRangeSizeMb, kStackSizeMb, - kTotalResourceLimitCount + kTotalResourceLimitCount, } = internalBinding('worker'); const kHandle = Symbol('kHandle'); @@ -256,7 +256,7 @@ class Worker extends EventEmitter { manifestSrc: getOptionValue('--experimental-policy') ? require('internal/process/policy').src : null, - hasStdin: !!options.stdin + hasStdin: !!options.stdin, }, transferList); // Use this to cache the Worker's loopStart value once available. this[kLoopStartTime] = -1; @@ -460,7 +460,7 @@ function makeResourceLimits(float64arr) { maxYoungGenerationSizeMb: float64arr[kMaxYoungGenerationSizeMb], maxOldGenerationSizeMb: float64arr[kMaxOldGenerationSizeMb], codeRangeSizeMb: float64arr[kCodeRangeSizeMb], - stackSizeMb: float64arr[kStackSizeMb] + stackSizeMb: float64arr[kStackSizeMb], }; } diff --git a/lib/internal/worker/io.js b/lib/internal/worker/io.js index adacdd913c6693..5a0696fcc83344 100644 --- a/lib/internal/worker/io.js +++ b/lib/internal/worker/io.js @@ -21,7 +21,7 @@ const { const { handle_onclose: handleOnCloseSymbol, oninit: onInitSymbol, - no_message_symbol: noMessageSymbol + no_message_symbol: noMessageSymbol, } = internalBinding('symbols'); const { MessagePort, @@ -35,7 +35,7 @@ const { DOMException, } = internalBinding('messaging'); const { - getEnvMessagePort + getEnvMessagePort, } = internalBinding('worker'); const { Readable, Writable } = require('stream'); @@ -54,7 +54,7 @@ const { codes: { ERR_INVALID_ARG_TYPE, ERR_MISSING_ARGS, - } + }, } = require('internal/errors'); const kData = Symbol('kData'); @@ -81,7 +81,7 @@ const messageTypes = { ERROR_MESSAGE: 'errorMessage', STDIO_PAYLOAD: 'stdioPayload', STDIO_WANTS_MORE_DATA: 'stdioWantsMoreData', - LOAD_SCRIPT: 'loadScript' + LOAD_SCRIPT: 'loadScript', }; // We have to mess with the MessagePort prototype a bit, so that a) we can make @@ -129,19 +129,19 @@ class MessageEvent extends Event { ObjectDefineProperties(MessageEvent.prototype, { data: { - get() { return this[kData]; }, enumerable: true, configurable: true + get() { return this[kData]; }, enumerable: true, configurable: true, }, origin: { - get() { return this[kOrigin]; }, enumerable: true, configurable: true + get() { return this[kOrigin]; }, enumerable: true, configurable: true, }, lastEventId: { - get() { return this[kLastEventId]; }, enumerable: true, configurable: true + get() { return this[kLastEventId]; }, enumerable: true, configurable: true, }, source: { - get() { return this[kSource]; }, enumerable: true, configurable: true + get() { return this[kSource]; }, enumerable: true, configurable: true, }, ports: { - get() { return this[kPorts]; }, enumerable: true, configurable: true + get() { return this[kPorts]; }, enumerable: true, configurable: true, }, }); @@ -176,7 +176,7 @@ defineEventHandler(MessagePort.prototype, 'messageerror'); ObjectDefineProperty(MessagePort.prototype, onInitSymbol, { enumerable: true, writable: false, - value: oninit + value: oninit, }); class MessagePortCloseEvent extends Event { @@ -193,7 +193,7 @@ function onclose() { ObjectDefineProperty(MessagePort.prototype, handleOnCloseSymbol, { enumerable: false, writable: false, - value: onclose + value: onclose, }); MessagePort.prototype.close = function(cb) { @@ -217,10 +217,10 @@ ObjectDefineProperty(MessagePort.prototype, inspect.custom, { active: false, } : { active: true, - refed: ref + refed: ref, }, this); - } + }, }); function setupPortReferencing(port, eventEmitter, eventName) { @@ -286,7 +286,7 @@ class ReadableWorkerStdio extends Readable { this[kPort].postMessage({ type: messageTypes.STDIO_WANTS_MORE_DATA, - stream: this[kName] + stream: this[kName], }); } } @@ -315,7 +315,7 @@ class WritableWorkerStdio extends Writable { this[kPort].postMessage({ type: messageTypes.STDIO_PAYLOAD, stream: this[kName], - chunks: [ { chunk: null, encoding: '' } ] + chunks: [ { chunk: null, encoding: '' } ], }); cb(); } @@ -335,7 +335,7 @@ function createWorkerStdio() { return { stdin: new ReadableWorkerStdio(port, 'stdin'), stdout: new WritableWorkerStdio(port, 'stdout'), - stderr: new WritableWorkerStdio(port, 'stderr') + stderr: new WritableWorkerStdio(port, 'stderr'), }; } @@ -369,7 +369,7 @@ class BroadcastChannel extends EventTarget { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `BroadcastChannel ${inspect({ diff --git a/lib/internal/worker/js_transferable.js b/lib/internal/worker/js_transferable.js index 7bd6c8cafc32e2..0030c18a993230 100644 --- a/lib/internal/worker/js_transferable.js +++ b/lib/internal/worker/js_transferable.js @@ -12,11 +12,11 @@ const { messaging_deserialize_symbol, messaging_transfer_symbol, messaging_clone_symbol, - messaging_transfer_list_symbol + messaging_transfer_list_symbol, } = internalBinding('symbols'); const { JSTransferable, - setDeserializerCreateObjectFunction + setDeserializerCreateObjectFunction, } = internalBinding('messaging'); function setup() { diff --git a/lib/net.js b/lib/net.js index 4b55366f87dae0..2a7568036a8a29 100644 --- a/lib/net.js +++ b/lib/net.js @@ -44,13 +44,13 @@ const { isIPv4, isIPv6, normalizedArgsSymbol, - makeSyncWrite + makeSyncWrite, } = require('internal/net'); const assert = require('internal/assert'); const { UV_EADDRINUSE, UV_EINVAL, - UV_ENOTCONN + UV_ENOTCONN, } = internalBinding('uv'); const { Buffer } = require('buffer'); @@ -59,17 +59,17 @@ const { ShutdownWrap } = internalBinding('stream_wrap'); const { TCP, TCPConnectWrap, - constants: TCPConstants + constants: TCPConstants, } = internalBinding('tcp_wrap'); const { Pipe, PipeConnectWrap, - constants: PipeConstants + constants: PipeConstants, } = internalBinding('pipe_wrap'); const { newAsyncId, defaultTriggerAsyncIdScope, - symbols: { async_id_symbol, owner_symbol } + symbols: { async_id_symbol, owner_symbol }, } = require('internal/async_hooks'); const { writevGeneric, @@ -81,7 +81,7 @@ const { setStreamTimeout, kBuffer, kBufferCb, - kBufferGen + kBufferGen, } = require('internal/stream_base_commons'); const { codes: { @@ -97,7 +97,7 @@ const { }, errnoException, exceptionWithHostPort, - uvExceptionWithHostPort + uvExceptionWithHostPort, } = require('internal/errors'); const { isUint8Array } = require('internal/util/types'); const { @@ -105,12 +105,12 @@ const { validateInt32, validateNumber, validatePort, - validateString + validateString, } = require('internal/validators'); const kLastWriteQueueSize = Symbol('lastWriteQueueSize'); const { DTRACE_NET_SERVER_CONNECTION, - DTRACE_NET_STREAM_END + DTRACE_NET_STREAM_END, } = require('internal/dtrace'); // Lazy loaded to improve startup performance. @@ -337,7 +337,7 @@ function Socket(options) { // we need to let it do that by turning it into a writable, own // property. ObjectDefineProperty(this._handle, 'bytesWritten', { - value: 0, writable: true + value: 0, writable: true, }); } } @@ -515,14 +515,14 @@ Socket.prototype.address = function() { ObjectDefineProperty(Socket.prototype, '_connecting', { get: function() { return this.connecting; - } + }, }); ObjectDefineProperty(Socket.prototype, 'pending', { get() { return !this._handle || this.connecting; }, - configurable: true + configurable: true, }); @@ -538,7 +538,7 @@ ObjectDefineProperty(Socket.prototype, 'readyState', { return 'writeOnly'; } return 'closed'; - } + }, }); @@ -547,13 +547,13 @@ ObjectDefineProperty(Socket.prototype, 'bufferSize', { if (this._handle) { return this.writableLength; } - } + }, }); ObjectDefineProperty(Socket.prototype, kUpdateTimer, { get: function() { return this._unrefTimer; - } + }, }); @@ -693,7 +693,7 @@ function protoGetter(name, callback) { ObjectDefineProperty(Socket.prototype, name, { configurable: false, enumerable: true, - get: callback + get: callback, }); } @@ -1010,7 +1010,7 @@ function lookupAndConnect(self, options) { if (dns === undefined) dns = require('dns'); const dnsopts = { family: options.family, - hints: options.hints || 0 + hints: options.hints || 0, }; if (!isWindows && @@ -1500,7 +1500,7 @@ ObjectDefineProperty(Server.prototype, 'listening', { return !!this._handle; }, configurable: true, - enumerable: true + enumerable: true, }); Server.prototype.address = function() { @@ -1538,7 +1538,7 @@ function onconnection(err, clientHandle) { allowHalfOpen: self.allowHalfOpen, pauseOnCreate: self.pauseOnConnect, readable: true, - writable: true + writable: true, }); self._connections++; @@ -1666,12 +1666,12 @@ Server.prototype[EventEmitter.captureRejectionSymbol] = function( // want to runtime-deprecate it at some point. There's no hurry, though. ObjectDefineProperty(TCP.prototype, 'owner', { get() { return this[owner_symbol]; }, - set(v) { return this[owner_symbol] = v; } + set(v) { return this[owner_symbol] = v; }, }); ObjectDefineProperty(Socket.prototype, '_handle', { get() { return this[kHandle]; }, - set(v) { return this[kHandle] = v; } + set(v) { return this[kHandle] = v; }, }); Server.prototype._setupWorker = function(socketList) { diff --git a/lib/os.js b/lib/os.js index 4396fcefd533c4..5ad14a9cbfd640 100644 --- a/lib/os.js +++ b/lib/os.js @@ -38,9 +38,9 @@ const isWindows = process.platform === 'win32'; const { codes: { - ERR_SYSTEM_ERROR + ERR_SYSTEM_ERROR, }, - hideStackFrames + hideStackFrames, } = require('internal/errors'); const { validateInt32 } = require('internal/validators'); @@ -57,7 +57,7 @@ const { getUserInfo, getUptime, isBigEndian, - setPriority: _setPriority + setPriority: _setPriority, } = internalBinding('os'); function getCheckedFunction(fn) { @@ -144,8 +144,8 @@ function cpus() { nice: data[i++], sys: data[i++], idle: data[i++], - irq: data[i++] - } + irq: data[i++], + }, }); } return result; @@ -269,7 +269,7 @@ function networkInterfaces() { family: data[i + 3], mac: data[i + 4], internal: data[i + 5], - cidr: getCIDR(data[i + 1], data[i + 2], data[i + 3]) + cidr: getCIDR(data[i + 1], data[i + 2], data[i + 3]), }; const scopeid = data[i + 6]; if (scopeid !== -1) @@ -367,20 +367,20 @@ module.exports = { type: getOSType, userInfo, uptime: getUptime, - version: getOSVersion + version: getOSVersion, }; ObjectDefineProperties(module.exports, { constants: { configurable: false, enumerable: true, - value: constants + value: constants, }, EOL: { configurable: true, enumerable: true, writable: false, - value: isWindows ? '\r\n' : '\n' - } + value: isWindows ? '\r\n' : '\n', + }, }); diff --git a/lib/path.js b/lib/path.js index 21bed936cadf70..1d50496c49c181 100644 --- a/lib/path.js +++ b/lib/path.js @@ -1064,7 +1064,7 @@ const win32 = { sep: '\\', delimiter: ';', win32: null, - posix: null + posix: null, }; const posixCwd = (() => { @@ -1530,7 +1530,7 @@ const posix = { sep: '/', delimiter: ':', win32: null, - posix: null + posix: null, }; posix.win32 = win32.win32 = win32; diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index a92a040f2de839..f046c6da43ff74 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -30,7 +30,7 @@ const { } = require('internal/perf/usertiming'); const { - createHistogram + createHistogram, } = require('internal/histogram'); const eventLoopUtilization = require('internal/perf/event_loop_utilization'); @@ -51,7 +51,7 @@ class Performance extends EventTarget { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `Performance ${inspect({ @@ -66,7 +66,7 @@ function toJSON() { return { nodeTiming: this.nodeTiming, timeOrigin: this.timeOrigin, - eventLoopUtilization: this.eventLoopUtilization() + eventLoopUtilization: this.eventLoopUtilization(), }; } @@ -119,7 +119,7 @@ ObjectDefineProperties(Performance.prototype, { configurable: true, enumerable: true, value: toJSON, - } + }, }); module.exports = { @@ -134,5 +134,5 @@ module.exports = { ObjectDefineProperty(module.exports, 'constants', { configurable: false, enumerable: true, - value: constants + value: constants, }); diff --git a/lib/querystring.js b/lib/querystring.js index 5bcfa13a6a5b13..e4f9c0181748c0 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -41,7 +41,7 @@ const { Buffer } = require('buffer'); const { encodeStr, hexTable, - isHexTable + isHexTable, } = require('internal/querystring'); const QueryString = module.exports = { unescapeBuffer, @@ -55,7 +55,7 @@ const QueryString = module.exports = { encode: stringify, parse, - decode: parse + decode: parse, }; const unhexTable = new Int8Array([ diff --git a/lib/readline.js b/lib/readline.js index b40c8019746120..1d6ab6fdb9623e 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -75,7 +75,7 @@ const emitKeypressEvents = require('internal/readline/emitKeypressEvents'); const { AbortError, - codes + codes, } = require('internal/errors'); const { @@ -371,7 +371,7 @@ ObjectDefineProperty(Interface.prototype, 'columns', { if (this.output && this.output.columns) return this.output.columns; return Infinity; - } + }, }); /** @@ -1288,7 +1288,7 @@ Interface.prototype[SymbolAsyncIterator] = function() { this.off('close', closeListener); this.close(); cb(err); - } + }, }); const lineListener = (input) => { if (!readable.push(input)) { @@ -1318,5 +1318,5 @@ module.exports = { createInterface, cursorTo, emitKeypressEvents, - moveCursor + moveCursor, }; diff --git a/lib/repl.js b/lib/repl.js index 2e80d652669ec5..06bb13d85f779a 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -101,16 +101,16 @@ const { const { makeRequireFunction, - addBuiltinLibsToObject + addBuiltinLibsToObject, } = require('internal/modules/cjs/helpers'); const { isIdentifierStart, - isIdentifierChar + isIdentifierChar, } = require('internal/deps/acorn/acorn/dist/acorn'); const { decorateErrorStack, isError, - deprecate + deprecate, } = require('internal/util'); const { inspect } = require('internal/util/inspect'); const vm = require('vm'); @@ -118,7 +118,7 @@ const path = require('path'); const fs = require('fs'); const { Interface } = require('readline'); const { - commonPrefix + commonPrefix, } = require('internal/readline/utils'); const { Console } = require('console'); const CJSModule = require('internal/modules/cjs/loader').Module; @@ -165,12 +165,12 @@ const { getOwnNonIndexProperties, propertyFilter: { ALL_PROPERTIES, - SKIP_SYMBOLS - } + SKIP_SYMBOLS, + }, } = internalBinding('util'); const { startSigintWatchdog, - stopSigintWatchdog + stopSigintWatchdog, } = internalBinding('contextify'); const history = require('internal/repl/history'); @@ -293,7 +293,7 @@ function REPLServer(prompt, 'DEP0141') : (val) => this.input = val, enumerable: false, - configurable: true + configurable: true, }); ObjectDefineProperty(this, 'outputStream', { get: pendingDeprecation ? @@ -309,7 +309,7 @@ function REPLServer(prompt, 'DEP0141') : (val) => this.output = val, enumerable: false, - configurable: true + configurable: true, }); this.allowBlockingCompletions = !!options.allowBlockingCompletions; @@ -459,7 +459,7 @@ function REPLServer(prompt, displayErrors: true, importModuleDynamically: async (specifier) => { return asyncESM.ESMLoader.import(specifier, parentURL); - } + }, }); } catch (e) { debug('parse error %j', code, e); @@ -515,7 +515,7 @@ function REPLServer(prompt, try { const scriptOptions = { displayErrors: false, - breakOnSigint: self.breakEvalOnSigint + breakOnSigint: self.breakEvalOnSigint, }; if (self.useGlobal) { @@ -717,7 +717,7 @@ function REPLServer(prompt, completer: options.completer || completer, terminal: options.terminal, historySize: options.historySize, - prompt + prompt, }]); self.resetContext(); @@ -742,7 +742,7 @@ function REPLServer(prompt, return ObjectAssign(writer.options, options); }, enumerable: true, - configurable: true + configurable: true, }); } } @@ -916,7 +916,7 @@ function REPLServer(prompt, const { clearPreview, - showPreview + showPreview, } = setupPreview( this, kContextId, @@ -1040,7 +1040,7 @@ REPLServer.prototype.createContext = function() { ObjectDefineProperty(context, 'console', { configurable: true, writable: true, - value: _console + value: _console, }); } @@ -1050,12 +1050,12 @@ REPLServer.prototype.createContext = function() { ObjectDefineProperty(context, 'module', { configurable: true, writable: true, - value: replModule + value: replModule, }); ObjectDefineProperty(context, 'require', { configurable: true, writable: true, - value: makeRequireFunction(replModule) + value: makeRequireFunction(replModule), }); addBuiltinLibsToObject(context); @@ -1080,7 +1080,7 @@ REPLServer.prototype.resetContext = function() { this.underscoreAssigned = true; this.output.write('Expression assignment to _ now disabled.\n'); } - } + }, }); ObjectDefineProperty(this.context, '_error', { @@ -1093,7 +1093,7 @@ REPLServer.prototype.resetContext = function() { this.output.write( 'Expression assignment to _error now disabled.\n'); } - } + }, }); // Allow REPL extensions to extend the new context @@ -1159,7 +1159,7 @@ function getGlobalLexicalScopeNames(contextId) { return sendInspectorCommand((session) => { let names = []; session.post('Runtime.globalLexicalScopeNames', { - executionContextId: contextId + executionContextId: contextId, }, (error, result) => { if (!error) names = result.names; }); @@ -1573,7 +1573,7 @@ function _memory(cmd) { // scope will not work for this function. ArrayPrototypePush(self.lines.level, { line: self.lines.length - 1, - depth: depth + depth: depth, }); } else if (depth < 0) { // Going... up. @@ -1623,7 +1623,7 @@ function defineDefaultCommands(repl) { action: function() { this.clearBufferedCommand(); this.displayPrompt(); - } + }, }); let clearMessage; @@ -1641,14 +1641,14 @@ function defineDefaultCommands(repl) { this.resetContext(); } this.displayPrompt(); - } + }, }); repl.defineCommand('exit', { help: 'Exit the REPL', action: function() { this.close(); - } + }, }); repl.defineCommand('help', { @@ -1668,7 +1668,7 @@ function defineDefaultCommands(repl) { this.output.write('\nPress Ctrl+C to abort current expression, ' + 'Ctrl+D to exit the REPL\n'); this.displayPrompt(); - } + }, }); repl.defineCommand('save', { @@ -1681,7 +1681,7 @@ function defineDefaultCommands(repl) { this.output.write(`Failed to save: ${file}\n`); } this.displayPrompt(); - } + }, }); repl.defineCommand('load', { @@ -1704,7 +1704,7 @@ function defineDefaultCommands(repl) { this.output.write(`Failed to load: ${file}\n`); } this.displayPrompt(); - } + }, }); if (repl.terminal) { repl.defineCommand('editor', { @@ -1713,7 +1713,7 @@ function defineDefaultCommands(repl) { _turnOnEditorMode(this); this.output.write( '// Entering editor mode (Ctrl+D to finish, Ctrl+C to cancel)\n'); - } + }, }); } } @@ -1730,14 +1730,14 @@ module.exports = { REPLServer, REPL_MODE_SLOPPY, REPL_MODE_STRICT, - Recoverable + Recoverable, }; ObjectDefineProperty(module.exports, 'builtinModules', { get: () => _builtinLibs, set: (val) => _builtinLibs = val, enumerable: true, - configurable: true + configurable: true, }); ObjectDefineProperty(module.exports, '_builtinLibs', { @@ -1752,5 +1752,5 @@ ObjectDefineProperty(module.exports, '_builtinLibs', { 'DEP0142' ) : (val) => _builtinLibs = val, enumerable: false, - configurable: true + configurable: true, }); diff --git a/lib/stream.js b/lib/stream.js index 1697a2f2729b82..103d7f36faf71d 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -57,21 +57,21 @@ ObjectDefineProperty(Stream, 'promises', { enumerable: true, get() { return lazyLoadPromises(); - } + }, }); ObjectDefineProperty(pipeline, customPromisify, { enumerable: true, get() { return lazyLoadPromises().pipeline; - } + }, }); ObjectDefineProperty(eos, customPromisify, { enumerable: true, get() { return lazyLoadPromises().finished; - } + }, }); // Backwards-compat with node 0.4.x diff --git a/lib/string_decoder.js b/lib/string_decoder.js index 2891e0a1d1a43a..be21a4b1b6d439 100644 --- a/lib/string_decoder.js +++ b/lib/string_decoder.js @@ -38,12 +38,12 @@ const { kSize, decode, flush, - encodings + encodings, } = internalBinding('string_decoder'); const internalUtil = require('internal/util'); const { ERR_INVALID_ARG_TYPE, - ERR_UNKNOWN_ENCODING + ERR_UNKNOWN_ENCODING, } = require('internal/errors').codes; const isEncoding = Buffer[internalUtil.kIsEncodingSymbol]; @@ -108,14 +108,14 @@ ObjectDefineProperties(StringDecoder.prototype, { return TypedArrayPrototypeSubarray(this[kNativeDecoder], kIncompleteCharactersStart, kIncompleteCharactersEnd); - } + }, }, lastNeed: { configurable: true, enumerable: true, get() { return this[kNativeDecoder][kMissingBytes]; - } + }, }, lastTotal: { configurable: true, @@ -123,8 +123,8 @@ ObjectDefineProperties(StringDecoder.prototype, { get() { return this[kNativeDecoder][kBufferedBytes] + this[kNativeDecoder][kMissingBytes]; - } - } + }, + }, }); exports.StringDecoder = StringDecoder; diff --git a/lib/timers.js b/lib/timers.js index 485f577d29f2f0..de03cb5aba4d25 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -25,12 +25,12 @@ const { MathTrunc, ObjectCreate, ObjectDefineProperty, - SymbolToPrimitive + SymbolToPrimitive, } = primordials; const { immediateInfo, - toggleImmediateRef + toggleImmediateRef, } = internalBinding('timers'); const L = require('internal/linkedlist'); const { @@ -40,7 +40,7 @@ const { decRefCount, immediateInfoFields: { kCount, - kRefCount + kRefCount, }, kRefed, kHasPrimitive, @@ -50,11 +50,11 @@ const { immediateQueue, active, unrefActive, - insert + insert, } = require('internal/timers'); const { promisify: { custom: customPromisify }, - deprecate + deprecate, } = require('internal/util'); let debug = require('internal/util/debuglog').debuglog('timer', (fn) => { debug = fn; @@ -66,7 +66,7 @@ let timersPromises; const { destroyHooksExist, // The needed emit*() functions. - emitDestroy + emitDestroy, } = require('internal/async_hooks'); // This stores all the known timer async ids to allow users to clearTimeout and @@ -167,7 +167,7 @@ ObjectDefineProperty(setTimeout, customPromisify, { if (!timersPromises) timersPromises = require('timers/promises'); return timersPromises.setTimeout; - } + }, }); function clearTimeout(timer) { @@ -268,7 +268,7 @@ ObjectDefineProperty(setImmediate, customPromisify, { if (!timersPromises) timersPromises = require('timers/promises'); return timersPromises.setImmediate; - } + }, }); @@ -315,5 +315,5 @@ module.exports = { enroll: deprecate( enroll, 'timers.enroll() is deprecated. Please use setTimeout instead.', - 'DEP0095') + 'DEP0095'), }; diff --git a/lib/timers/promises.js b/lib/timers/promises.js index 1f245580f86ab5..ee4fa91f526998 100644 --- a/lib/timers/promises.js +++ b/lib/timers/promises.js @@ -10,12 +10,12 @@ const { const { Timeout, Immediate, - insert + insert, } = require('internal/timers'); const { AbortError, - codes: { ERR_INVALID_ARG_TYPE } + codes: { ERR_INVALID_ARG_TYPE }, } = require('internal/errors'); const { diff --git a/lib/tls.js b/lib/tls.js index 2282fd33008868..80843535b253a5 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -46,7 +46,7 @@ const { const { ERR_TLS_CERT_ALTNAME_INVALID, - ERR_OUT_OF_RANGE + ERR_OUT_OF_RANGE, } = require('internal/errors').codes; const internalUtil = require('internal/util'); internalUtil.assertCrypto(); @@ -319,7 +319,7 @@ class SecurePair extends EventEmitter { isServer, requestCert, rejectUnauthorized, - ...options + ...options, }); this.cleartext.once('secure', () => this.emit('secure')); } diff --git a/lib/trace_events.js b/lib/trace_events.js index 5211f8b0b1fc74..e585ded924be81 100644 --- a/lib/trace_events.js +++ b/lib/trace_events.js @@ -17,7 +17,7 @@ const kMaxTracingCount = 10; const { ERR_TRACE_EVENTS_CATEGORY_REQUIRED, ERR_TRACE_EVENTS_UNAVAILABLE, - ERR_INVALID_ARG_TYPE + ERR_INVALID_ARG_TYPE, } = require('internal/errors').codes; const { ownsProcessState } = require('internal/worker'); @@ -76,7 +76,7 @@ class Tracing { const obj = { enabled: this.enabled, - categories: this.categories + categories: this.categories, }; return `Tracing ${format(obj)}`; } @@ -98,5 +98,5 @@ function createTracing(options) { module.exports = { createTracing, - getEnabledCategories + getEnabledCategories, }; diff --git a/lib/tty.js b/lib/tty.js index e61a5c3ac3f905..01d59ba8d47334 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -33,7 +33,7 @@ const errors = require('internal/errors'); const { ERR_INVALID_FD, ERR_TTY_INIT_FAILED } = errors.codes; const { getColorDepth, - hasColors + hasColors, } = require('internal/tty'); // Lazy loaded for startup performance. @@ -61,7 +61,7 @@ function ReadStream(fd, options) { readable: true, writable: false, handle: tty, - ...options + ...options, }); this.isRaw = false; @@ -97,7 +97,7 @@ function WriteStream(fd) { net.Socket.call(this, { handle: tty, readable: false, - writable: true + writable: true, }); // Prevents interleaved or dropped stdout/stderr output for terminals. diff --git a/lib/util.js b/lib/util.js index bcb1c81933c0c0..2ab301a60315ad 100644 --- a/lib/util.js +++ b/lib/util.js @@ -48,16 +48,16 @@ const { codes: { ERR_FALSY_VALUE_REJECTION, ERR_INVALID_ARG_TYPE, - ERR_OUT_OF_RANGE + ERR_OUT_OF_RANGE, }, errnoException, exceptionWithHostPort, - hideStackFrames + hideStackFrames, } = require('internal/errors'); const { format, formatWithOptions, - inspect + inspect, } = require('internal/util/inspect'); const { debuglog } = require('internal/util/debuglog'); const { validateNumber } = require('internal/validators'); @@ -69,7 +69,7 @@ const { deprecate, getSystemErrorMap, getSystemErrorName: internalErrorName, - promisify + promisify, } = require('internal/util'); let internalDeepEqual; @@ -240,7 +240,7 @@ function inherits(ctor, superCtor) { ObjectDefineProperty(ctor, 'super_', { value: superCtor, writable: true, - configurable: true + configurable: true, }); ObjectSetPrototypeOf(ctor.prototype, superCtor.prototype); } @@ -371,5 +371,5 @@ module.exports = { promisify, TextDecoder, TextEncoder, - types + types, }; diff --git a/lib/v8.js b/lib/v8.js index e7a44331b8b350..80bb9c6207abc5 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -38,7 +38,7 @@ const { Buffer } = require('buffer'); const { validateString } = require('internal/validators'); const { Serializer, - Deserializer + Deserializer, } = internalBinding('serdes'); let profiler = {}; @@ -54,7 +54,7 @@ const { getValidatedPath } = require('internal/fs/utils'); const { toNamespacedPath } = require('path'); const { createHeapSnapshotStream, - triggerHeapSnapshot + triggerHeapSnapshot, } = internalBinding('heap_utils'); const { HeapSnapshotStream } = require('internal/heap_utils'); @@ -106,7 +106,7 @@ const { // Properties for heap code statistics buffer extraction. kCodeAndMetadataSizeIndex, kBytecodeAndMetadataSizeIndex, - kExternalScriptSourceSizeIndex + kExternalScriptSourceSizeIndex, } = binding; const kNumberOfHeapSpaces = kHeapSpaces.length; @@ -132,7 +132,7 @@ function getHeapStatistics() { 'peak_malloced_memory': buffer[kPeakMallocedMemoryIndex], 'does_zap_garbage': buffer[kDoesZapGarbageIndex], 'number_of_native_contexts': buffer[kNumberOfNativeContextsIndex], - 'number_of_detached_contexts': buffer[kNumberOfDetachedContextsIndex] + 'number_of_detached_contexts': buffer[kNumberOfDetachedContextsIndex], }; } @@ -147,7 +147,7 @@ function getHeapSpaceStatistics() { space_size: buffer[kSpaceSizeIndex], space_used_size: buffer[kSpaceUsedSizeIndex], space_available_size: buffer[kSpaceAvailableSizeIndex], - physical_space_size: buffer[kPhysicalSpaceSizeIndex] + physical_space_size: buffer[kPhysicalSpaceSizeIndex], }; } @@ -161,7 +161,7 @@ function getHeapCodeStatistics() { return { 'code_and_metadata_size': buffer[kCodeAndMetadataSizeIndex], 'bytecode_and_metadata_size': buffer[kBytecodeAndMetadataSizeIndex], - 'external_script_source_size': buffer[kExternalScriptSourceSizeIndex] + 'external_script_source_size': buffer[kExternalScriptSourceSizeIndex], }; } diff --git a/lib/vm.js b/lib/vm.js index c873842c434c30..58f835fe519049 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -175,7 +175,7 @@ function getRunInContextArgs(options = {}) { return { breakOnSigint, - args: [timeout, displayErrors, breakOnSigint, breakFirstLine] + args: [timeout, displayErrors, breakOnSigint, breakFirstLine], }; } @@ -226,7 +226,7 @@ function createContext(contextObject = {}, options = {}) { name = `VM Context ${defaultContextNameIndex++}`, origin, codeGeneration, - microtaskMode + microtaskMode, } = options; validateString(name, 'options.name'); @@ -283,7 +283,7 @@ function runInContext(code, contextifiedObject, options) { if (typeof options === 'string') { options = { filename: options, - [kParsingContext]: contextifiedObject + [kParsingContext]: contextifiedObject, }; } else { options = { ...options, [kParsingContext]: contextifiedObject }; diff --git a/lib/wasi.js b/lib/wasi.js index b3c14fc2f14840..f7dd050d20b023 100644 --- a/lib/wasi.js +++ b/lib/wasi.js @@ -11,7 +11,7 @@ const { const { ERR_INVALID_ARG_TYPE, - ERR_WASI_ALREADY_STARTED + ERR_WASI_ALREADY_STARTED, } = require('internal/errors').codes; const { emitExperimentalWarning } = require('internal/util'); const { isArrayBuffer } = require('internal/util/types'); diff --git a/lib/worker_threads.js b/lib/worker_threads.js index 9d702fa2883447..155cc11ecdaf43 100644 --- a/lib/worker_threads.js +++ b/lib/worker_threads.js @@ -7,7 +7,7 @@ const { setEnvironmentData, getEnvironmentData, threadId, - Worker + Worker, } = require('internal/worker'); const { diff --git a/lib/zlib.js b/lib/zlib.js index c0c7f601758224..bb9e5dc942dc27 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -52,21 +52,21 @@ const { ERR_OUT_OF_RANGE, ERR_ZLIB_INITIALIZATION_FAILED, }, - hideStackFrames + hideStackFrames, } = require('internal/errors'); const { Transform, finished } = require('stream'); const { - deprecate + deprecate, } = require('internal/util'); const { isArrayBufferView, - isAnyArrayBuffer + isAnyArrayBuffer, } = require('internal/util/types'); const binding = internalBinding('zlib'); const assert = require('internal/assert'); const { Buffer, - kMaxLength + kMaxLength, } = require('buffer'); const { owner_symbol } = require('internal/async_hooks').symbols; const { @@ -102,7 +102,7 @@ const codes = { Z_DATA_ERROR: constants.Z_DATA_ERROR, Z_MEM_ERROR: constants.Z_MEM_ERROR, Z_BUF_ERROR: constants.Z_BUF_ERROR, - Z_VERSION_ERROR: constants.Z_VERSION_ERROR + Z_VERSION_ERROR: constants.Z_VERSION_ERROR, }; for (const ckey of ObjectKeys(codes)) { @@ -316,7 +316,7 @@ ObjectDefineProperty(ZlibBase.prototype, '_closed', { enumerable: true, get() { return !this._handle; - } + }, }); // `bytesRead` made sense as a name when looking from the zlib engine's @@ -333,7 +333,7 @@ ObjectDefineProperty(ZlibBase.prototype, 'bytesRead', { set: deprecate(function(value) { this.bytesWritten = value; }, 'Setting zlib.bytesRead is deprecated. ' + - 'This feature will be removed in the future.', 'DEP0108') + 'This feature will be removed in the future.', 'DEP0108'), }); ZlibBase.prototype.reset = function() { @@ -627,7 +627,7 @@ function _close(engine) { const zlibDefaultOpts = { flush: Z_NO_FLUSH, finishFlush: Z_FINISH, - fullFlush: Z_FULL_FLUSH + fullFlush: Z_FULL_FLUSH, }; // Base class for all streams actually backed by zlib and using zlib-specific // parameters. @@ -815,7 +815,7 @@ const brotliInitParamsArray = new Uint32Array(kMaxBrotliParam + 1); const brotliDefaultOpts = { flush: BROTLI_OPERATION_PROCESS, finishFlush: BROTLI_OPERATION_FINISH, - fullFlush: BROTLI_OPERATION_FLUSH + fullFlush: BROTLI_OPERATION_FLUSH, }; function Brotli(opts, mode) { assert(mode === BROTLI_DECODE || mode === BROTLI_ENCODE); @@ -879,7 +879,7 @@ function createProperty(ctor) { enumerable: true, value: function(options) { return new ctor(options); - } + }, }; } @@ -887,7 +887,7 @@ function createProperty(ctor) { // want to runtime-deprecate it at some point. There's no hurry, though. ObjectDefineProperty(binding.Zlib.prototype, 'jsref', { get() { return this[owner_symbol]; }, - set(v) { return this[owner_symbol] = v; } + set(v) { return this[owner_symbol] = v; }, }); module.exports = { @@ -936,13 +936,13 @@ ObjectDefineProperties(module.exports, { constants: { configurable: false, enumerable: true, - value: constants + value: constants, }, codes: { enumerable: true, writable: false, - value: ObjectFreeze(codes) - } + value: ObjectFreeze(codes), + }, }); // These should be considered deprecated @@ -950,6 +950,6 @@ ObjectDefineProperties(module.exports, { for (const bkey of ObjectKeys(constants)) { if (StringPrototypeStartsWith(bkey, 'BROTLI')) continue; ObjectDefineProperty(module.exports, bkey, { - enumerable: false, value: constants[bkey], writable: false + enumerable: false, value: constants[bkey], writable: false, }); } diff --git a/test/addons/async-hooks-promise/test.js b/test/addons/async-hooks-promise/test.js index d38bf9bd978103..e7642f8915f1e9 100644 --- a/test/addons/async-hooks-promise/test.js +++ b/test/addons/async-hooks-promise/test.js @@ -35,7 +35,7 @@ const initOnlyHook = async_hooks.createHook({ lastAsyncId = asyncId; lastTriggerAsyncId = triggerAsyncId; lastResource = resource; - } + }, }).enable(); // Check that no PromiseWrap is created when only using an init hook. @@ -59,7 +59,7 @@ const hookWithDestroy = async_hooks.createHook({ destroy() { - } + }, }).enable(); // Check that the internal field returns the same PromiseWrap passed to init(). @@ -90,7 +90,7 @@ setImmediate(() => { before() {}, after() {}, - resolve() {} + resolve() {}, }).enable(); // Check that no PromiseWrap is created when there is no destroy hook. diff --git a/test/addons/async-resource/test.js b/test/addons/async-resource/test.js index c37d4df83d0103..86cbb38e1cf2df 100644 --- a/test/addons/async-resource/test.js +++ b/test/addons/async-resource/test.js @@ -38,7 +38,7 @@ async_hooks.createHook({ destroy(id) { if (bindingUids.includes(id)) destroy++; - } + }, }).enable(); for (const call of [binding.callViaFunction, @@ -53,7 +53,7 @@ for (const call of [binding.callViaFunction, assert.strictEqual(async_hooks.executionAsyncId(), uid); return 'baz'; }, - kObjectTag + kObjectTag, }; if (passedTriggerId === undefined) diff --git a/test/addons/callback-scope/test-async-hooks.js b/test/addons/callback-scope/test-async-hooks.js index 94b53efc53d78e..3c276ce00ff482 100644 --- a/test/addons/callback-scope/test-async-hooks.js +++ b/test/addons/callback-scope/test-async-hooks.js @@ -14,7 +14,7 @@ async_hooks.createHook({ after: common.mustCall((id) => { assert.strictEqual(id, 1000); insideHook = false; - }) + }), }).enable(); runInCallbackScope({}, 1000, 1000, () => { diff --git a/test/addons/non-node-context/test-make-buffer.js b/test/addons/non-node-context/test-make-buffer.js index d134f63b77283c..64b39d0a7ef5e0 100644 --- a/test/addons/non-node-context/test-make-buffer.js +++ b/test/addons/non-node-context/test-make-buffer.js @@ -3,7 +3,7 @@ const common = require('../../common'); const assert = require('assert'); const { - makeBufferInNewContext + makeBufferInNewContext, } = require(`./build/${common.buildType}/binding`); // Because the `Buffer` function and its protoype property only (currently) diff --git a/test/addons/openssl-client-cert-engine/test.js b/test/addons/openssl-client-cert-engine/test.js index e843e4bf433bff..648600c99cd852 100644 --- a/test/addons/openssl-client-cert-engine/test.js +++ b/test/addons/openssl-client-cert-engine/test.js @@ -26,7 +26,7 @@ const serverOptions = { cert: agentCert, ca: agentCa, requestCert: true, - rejectUnauthorized: true + rejectUnauthorized: true, }; const server = https.createServer(serverOptions, common.mustCall((req, res) => { @@ -40,7 +40,7 @@ const server = https.createServer(serverOptions, common.mustCall((req, res) => { path: '/test', clientCertEngine: engine, // `engine` will provide key+cert rejectUnauthorized: false, // Prevent failing on self-signed certificates - headers: {} + headers: {}, }; const req = https.request(clientOptions, common.mustCall((response) => { diff --git a/test/addons/openssl-key-engine/test.js b/test/addons/openssl-key-engine/test.js index 2cd7ddabc17095..58885e46728788 100644 --- a/test/addons/openssl-key-engine/test.js +++ b/test/addons/openssl-key-engine/test.js @@ -26,7 +26,7 @@ const serverOptions = { cert: agentCert, ca: agentCa, requestCert: true, - rejectUnauthorized: true + rejectUnauthorized: true, }; const server = https.createServer(serverOptions, common.mustCall((req, res) => { @@ -42,7 +42,7 @@ const server = https.createServer(serverOptions, common.mustCall((req, res) => { privateKeyIdentifier: 'dummykey', cert: agentCert, rejectUnauthorized: false, // Prevent failing on self-signed certificates - headers: {} + headers: {}, }; const req = https.request(clientOptions, common.mustCall((response) => { diff --git a/test/addons/repl-domain-abort/test.js b/test/addons/repl-domain-abort/test.js index f8e70ffce96e45..8d148432c31c21 100644 --- a/test/addons/repl-domain-abort/test.js +++ b/test/addons/repl-domain-abort/test.js @@ -63,7 +63,7 @@ const options = { input: dInput, output: dOutput, terminal: false, - ignoreUndefined: true + ignoreUndefined: true, }; // Run commands from fake REPL. 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 024ba28aba04e0..6aff044519567e 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 @@ -32,5 +32,5 @@ assert.throws(() => { message: `Cannot create a string longer than 0x${stringLengthHex} ` + 'characters', code: 'ERR_STRING_TOO_LONG', - name: 'Error' + name: 'Error', }); 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 20137636024987..7c8e2d92c6a4db 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 @@ -32,5 +32,5 @@ assert.throws(() => { message: `Cannot create a string longer than 0x${stringLengthHex} ` + 'characters', code: 'ERR_STRING_TOO_LONG', - name: 'Error' + name: 'Error', }); 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 1ad04dc652873a..176c095e22e2ee 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 @@ -33,7 +33,7 @@ assert.throws(() => { message: `Cannot create a string longer than 0x${stringLengthHex} ` + 'characters', code: 'ERR_STRING_TOO_LONG', - name: 'Error' + name: 'Error', }); // FIXME: Free the memory early to avoid OOM. 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 7e3132af09d172..a473e0e90fb220 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 @@ -32,5 +32,5 @@ assert.throws(() => { message: `Cannot create a string longer than 0x${stringLengthHex} ` + 'characters', code: 'ERR_STRING_TOO_LONG', - name: 'Error' + name: 'Error', }); 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 78e73e0dc8557b..25271fad94b689 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 @@ -35,7 +35,7 @@ assert.throws(() => { message: `Cannot create a string longer than 0x${stringLengthHex} ` + 'characters', code: 'ERR_STRING_TOO_LONG', - name: 'Error' + name: 'Error', })(e); return true; } @@ -48,5 +48,5 @@ assert.throws(() => { message: `Cannot create a string longer than 0x${stringLengthHex} ` + 'characters', code: 'ERR_STRING_TOO_LONG', - name: 'Error' + name: 'Error', }); 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 7206b90d5f28b6..b843be5a9ab7a5 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 @@ -33,5 +33,5 @@ assert.throws(() => { message: `Cannot create a string longer than 0x${stringLengthHex} ` + 'characters', code: 'ERR_STRING_TOO_LONG', - name: 'Error' + name: 'Error', }); diff --git a/test/addons/worker-addon/test.js b/test/addons/worker-addon/test.js index f9923638d48767..8a420b294d72f5 100644 --- a/test/addons/worker-addon/test.js +++ b/test/addons/worker-addon/test.js @@ -13,12 +13,12 @@ switch (process.argv[2]) { case 'worker-twice': case 'worker': const worker = new Worker(`require(${JSON.stringify(binding)});`, { - eval: true + eval: true, }); if (process.argv[2] === 'worker-twice') { worker.on('exit', common.mustCall(() => { new Worker(`require(${JSON.stringify(binding)});`, { - eval: true + eval: true, }); })); } @@ -51,7 +51,7 @@ for (const { test, expected } of [ 'ctor cleanup dtor ctor cleanup dtor ', ].concat(libcMayBeMusl ? [ 'ctor cleanup cleanup dtor ', - ] : []) + ] : []), }, ]) { console.log('spawning test', test); diff --git a/test/async-hooks/init-hooks.js b/test/async-hooks/init-hooks.js index 59ecc96b881a5a..597410c636cc6a 100644 --- a/test/async-hooks/init-hooks.js +++ b/test/async-hooks/init-hooks.js @@ -27,7 +27,7 @@ class ActivityCollector { ondestroy, onpromiseResolve, logid = null, - logtype = null + logtype = null, } = {}) { this._start = start; this._allowNoInit = allowNoInit; @@ -49,7 +49,7 @@ class ActivityCollector { before: this._before.bind(this), after: this._after.bind(this), destroy: this._destroy.bind(this), - promiseResolve: this._promiseResolve.bind(this) + promiseResolve: this._promiseResolve.bind(this), }); } @@ -184,7 +184,7 @@ class ActivityCollector { // In some cases (e.g. Timeout) the handle is a function, thus the usual // `typeof handle === 'object' && handle !== null` check can't be used. handleIsObject: handle instanceof Object, - handle + handle, }; this._stamp(activity, 'init'); this._activities.set(uid, activity); @@ -236,7 +236,7 @@ exports = module.exports = function initHooks({ onpromiseResolve, allowNoInit, logid, - logtype + logtype, } = {}) { return new ActivityCollector(process.hrtime(), { oninit, @@ -246,6 +246,6 @@ exports = module.exports = function initHooks({ onpromiseResolve, allowNoInit, logid, - logtype + logtype, }); }; diff --git a/test/async-hooks/test-async-await.js b/test/async-hooks/test-async-await.js index 19a22d3076b8c0..4fd698c8e98197 100644 --- a/test/async-hooks/test-async-await.js +++ b/test/async-hooks/test-async-await.js @@ -22,7 +22,7 @@ const hooks = initHooks({ onbefore, onafter, ondestroy: null, // Intentionally not tested, since it will be removed soon - onpromiseResolve + onpromiseResolve, }); hooks.enable(); diff --git a/test/async-hooks/test-async-exec-resource-http-32060.js b/test/async-hooks/test-async-exec-resource-http-32060.js index 0ff68aa1070e19..1423179d4215bd 100644 --- a/test/async-hooks/test-async-exec-resource-http-32060.js +++ b/test/async-hooks/test-async-exec-resource-http-32060.js @@ -12,7 +12,7 @@ const hooked = {}; createHook({ init(asyncId, type, triggerAsyncId, resource) { hooked[asyncId] = resource; - } + }, }).enable(); const server = http.createServer((req, res) => { diff --git a/test/async-hooks/test-async-exec-resource-http.js b/test/async-hooks/test-async-exec-resource-http.js index ecc654bea0ab79..844720250d4195 100644 --- a/test/async-hooks/test-async-exec-resource-http.js +++ b/test/async-hooks/test-async-exec-resource-http.js @@ -13,7 +13,7 @@ const hooked = {}; createHook({ init(asyncId, type, triggerAsyncId, resource) { hooked[asyncId] = resource; - } + }, }).enable(); const server = http.createServer((req, res) => { diff --git a/test/async-hooks/test-async-exec-resource-match.js b/test/async-hooks/test-async-exec-resource-match.js index f5ea2c2b13965a..6174768ba76877 100644 --- a/test/async-hooks/test-async-exec-resource-match.js +++ b/test/async-hooks/test-async-exec-resource-match.js @@ -6,7 +6,7 @@ const { readFile } = require('fs'); const { createHook, executionAsyncResource, - AsyncResource + AsyncResource, } = require('async_hooks'); // Ignore any asyncIds created before our hook is active. @@ -32,7 +32,7 @@ createHook({ if (asyncId >= firstSeenAsyncId) { afterHook(asyncId); } - } + }, }).enable(); const beforeHook = common.mustCallAtLeast( diff --git a/test/async-hooks/test-async-local-storage-http-agent.js b/test/async-hooks/test-async-local-storage-http-agent.js index 1de535aa709687..54c8a585a5ba1c 100644 --- a/test/async-hooks/test-async-local-storage-http-agent.js +++ b/test/async-hooks/test-async-local-storage-http-agent.js @@ -7,7 +7,7 @@ const http = require('http'); const asyncLocalStorage = new AsyncLocalStorage(); const agent = new http.Agent({ - maxSockets: 1 + maxSockets: 1, }); const N = 3; diff --git a/test/async-hooks/test-async-local-storage-run-resource.js b/test/async-hooks/test-async-local-storage-run-resource.js index 21bc70051bd718..2a7a38cda193f0 100644 --- a/test/async-hooks/test-async-local-storage-run-resource.js +++ b/test/async-hooks/test-async-local-storage-run-resource.js @@ -3,7 +3,7 @@ require('../common'); const assert = require('assert'); const { AsyncLocalStorage, - executionAsyncResource + executionAsyncResource, } = require('async_hooks'); const asyncLocalStorage = new AsyncLocalStorage(); diff --git a/test/async-hooks/test-async-local-storage-thenable.js b/test/async-hooks/test-async-local-storage-thenable.js index 1f947fa9345491..3dc6841ac9838e 100644 --- a/test/async-hooks/test-async-local-storage-thenable.js +++ b/test/async-hooks/test-async-local-storage-thenable.js @@ -17,7 +17,7 @@ const then = common.mustCall((cb) => { function thenable() { return { - then + then, }; } diff --git a/test/async-hooks/test-callback-error.js b/test/async-hooks/test-callback-error.js index e8e255a7cf96c9..ddf8e36d8c554f 100644 --- a/test/async-hooks/test-callback-error.js +++ b/test/async-hooks/test-callback-error.js @@ -9,14 +9,14 @@ const arg = process.argv[2]; switch (arg) { case 'test_init_callback': initHooks({ - oninit: common.mustCall(() => { throw new Error(arg); }) + oninit: common.mustCall(() => { throw new Error(arg); }), }).enable(); new async_hooks.AsyncResource(`${arg}_type`); return; case 'test_callback': initHooks({ - onbefore: common.mustCall(() => { throw new Error(arg); }) + onbefore: common.mustCall(() => { throw new Error(arg); }), }).enable(); const resource = new async_hooks.AsyncResource(`${arg}_type`); resource.runInAsyncScope(() => {}); @@ -24,7 +24,7 @@ switch (arg) { case 'test_callback_abort': initHooks({ - oninit: common.mustCall(() => { throw new Error(arg); }) + oninit: common.mustCall(() => { throw new Error(arg); }), }).enable(); new async_hooks.AsyncResource(`${arg}_type`); return; diff --git a/test/async-hooks/test-destroy-not-blocked.js b/test/async-hooks/test-destroy-not-blocked.js index aa467f30143806..061c097c971a3e 100644 --- a/test/async-hooks/test-destroy-not-blocked.js +++ b/test/async-hooks/test-destroy-not-blocked.js @@ -23,7 +23,7 @@ createHook({ if (activeId === id) { activeId = -1; } - } + }, }).enable(); function testNextTick() { diff --git a/test/async-hooks/test-disable-in-init.js b/test/async-hooks/test-disable-in-init.js index 17537c62f30885..f810dfca3b9605 100644 --- a/test/async-hooks/test-disable-in-init.js +++ b/test/async-hooks/test-disable-in-init.js @@ -13,11 +13,11 @@ async_hooks.createHook({ nestedCall = true; fs.access(__filename, common.mustCall()); } - }, 2) + }, 2), }).enable(); const nestedHook = async_hooks.createHook({ - init: common.mustCall(2) + init: common.mustCall(2), }).enable(); fs.access(__filename, common.mustCall()); diff --git a/test/async-hooks/test-embedder.api.async-resource-no-type.js b/test/async-hooks/test-embedder.api.async-resource-no-type.js index 2600325e1ed6be..e21c5458df8614 100644 --- a/test/async-hooks/test-embedder.api.async-resource-no-type.js +++ b/test/async-hooks/test-embedder.api.async-resource-no-type.js @@ -20,7 +20,7 @@ if (process.argv[2] === 'child') { [null, undefined, 1, Date, {}, []].forEach((i) => { assert.throws(() => new Foo(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); diff --git a/test/async-hooks/test-emit-after-on-destroyed.js b/test/async-hooks/test-emit-after-on-destroyed.js index b015dacddba506..2940cf6acc7398 100644 --- a/test/async-hooks/test-emit-after-on-destroyed.js +++ b/test/async-hooks/test-emit-after-on-destroyed.js @@ -10,7 +10,7 @@ const heartbeatMsg = /heartbeat: still alive/; const { newAsyncId, getDefaultTriggerAsyncId, - emitInit, emitBefore, emitAfter, emitDestroy + emitInit, emitBefore, emitAfter, emitDestroy, } = internal_async_hooks; const initHooks = require('./init-hooks'); diff --git a/test/async-hooks/test-emit-before-after.js b/test/async-hooks/test-emit-before-after.js index 2ad98b993efd5b..561004cac2f012 100644 --- a/test/async-hooks/test-emit-before-after.js +++ b/test/async-hooks/test-emit-before-after.js @@ -30,7 +30,7 @@ const checkOnce = (fn) => { initHooks({ onbefore: checkOnce(chkBefore), onafter: checkOnce(chkAfter), - allowNoInit: true + allowNoInit: true, }).enable(); async_hooks.emitInit(expectedId, expectedType, expectedTriggerId); diff --git a/test/async-hooks/test-emit-before-on-destroyed.js b/test/async-hooks/test-emit-before-on-destroyed.js index 36a50a050f9324..811160a4270252 100644 --- a/test/async-hooks/test-emit-before-on-destroyed.js +++ b/test/async-hooks/test-emit-before-on-destroyed.js @@ -10,7 +10,7 @@ const heartbeatMsg = /heartbeat: still alive/; const { newAsyncId, getDefaultTriggerAsyncId, - emitInit, emitBefore, emitAfter, emitDestroy + emitInit, emitBefore, emitAfter, emitDestroy, } = internal_async_hooks; const initHooks = require('./init-hooks'); diff --git a/test/async-hooks/test-emit-init.js b/test/async-hooks/test-emit-init.js index bc1cd49cba2824..8994943b472931 100644 --- a/test/async-hooks/test-emit-init.js +++ b/test/async-hooks/test-emit-init.js @@ -17,7 +17,7 @@ const hooks1 = initHooks({ assert.strictEqual(type, expectedType); assert.strictEqual(triggerAsyncId, expectedTriggerId); assert.strictEqual(resource.key, expectedResource.key); - }) + }), }); hooks1.enable(); @@ -33,7 +33,7 @@ initHooks({ assert.strictEqual(type, expectedType); assert.notStrictEqual(triggerAsyncId, expectedTriggerId); assert.strictEqual(resource.key, expectedResource.key); - }) + }), }).enable(); async_hooks.emitInit(expectedId, expectedType, null, expectedResource); diff --git a/test/async-hooks/test-enable-in-init.js b/test/async-hooks/test-enable-in-init.js index 7bc70994e1fa7d..e710657a340440 100644 --- a/test/async-hooks/test-enable-in-init.js +++ b/test/async-hooks/test-enable-in-init.js @@ -5,7 +5,7 @@ const async_hooks = require('async_hooks'); const fs = require('fs'); const nestedHook = async_hooks.createHook({ - init: common.mustNotCall() + init: common.mustNotCall(), }); let nestedCall = false; @@ -16,7 +16,7 @@ async_hooks.createHook({ nestedCall = true; fs.access(__filename, common.mustCall()); } - }, 2) + }, 2), }).enable(); fs.access(__filename, common.mustCall()); diff --git a/test/async-hooks/test-filehandle-no-reuse.js b/test/async-hooks/test-filehandle-no-reuse.js index 7cd3322c1906fd..34921471e48c77 100644 --- a/test/async-hooks/test-filehandle-no-reuse.js +++ b/test/async-hooks/test-filehandle-no-reuse.js @@ -17,7 +17,7 @@ const hooks = initHooks(); hooks.enable(); const { - HTTP2_HEADER_CONTENT_TYPE + HTTP2_HEADER_CONTENT_TYPE, } = http2.constants; // Use large fixture to get several file operations. @@ -27,7 +27,7 @@ const fd = fs.openSync(fname, 'r'); const server = http2.createServer(); server.on('stream', (stream) => { stream.respondWithFD(fd, { - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', }); }); server.on('close', common.mustCall(() => fs.closeSync(fd))); diff --git a/test/async-hooks/test-graph.http.js b/test/async-hooks/test-graph.http.js index 3e36646e54e2ee..f153e7d5574e66 100644 --- a/test/async-hooks/test-graph.http.js +++ b/test/async-hooks/test-graph.http.js @@ -19,7 +19,7 @@ server.listen(0, common.mustCall(() => { http.get({ host: '::1', family: 6, - port: server.address().port + port: server.address().port, }, common.mustCall()); })); diff --git a/test/async-hooks/test-graph.tls-write.js b/test/async-hooks/test-graph.tls-write.js index b493ac819dfbcd..61542ca1720dae 100644 --- a/test/async-hooks/test-graph.tls-write.js +++ b/test/async-hooks/test-graph.tls-write.js @@ -21,7 +21,7 @@ hooks.enable(); const server = tls .createServer({ cert: fixtures.readKey('rsa_cert.crt'), - key: fixtures.readKey('rsa_private.pem') + key: fixtures.readKey('rsa_private.pem'), }) .on('listening', common.mustCall(onlistening)) .on('secureConnection', common.mustCall(onsecureConnection)) diff --git a/test/async-hooks/test-http-agent-handle-reuse-parallel.js b/test/async-hooks/test-http-agent-handle-reuse-parallel.js index cd73b3ed2cb61c..c219686f67047d 100644 --- a/test/async-hooks/test-http-agent-handle-reuse-parallel.js +++ b/test/async-hooks/test-http-agent-handle-reuse-parallel.js @@ -21,7 +21,7 @@ let responses = 0; const agent = new http.Agent({ keepAlive: true, keepAliveMsecs: Infinity, - maxSockets: 1 + maxSockets: 1, }); const verifyRequest = (idx) => (res) => { @@ -58,13 +58,13 @@ const server = http.createServer(common.mustCall((req, res) => { // First request. const r1 = http.request({ - agent, port, method: 'POST' + agent, port, method: 'POST', }, common.mustCall(verifyRequest(0))); r1.end(payload); // Second request. Sent in parallel with the first one. const r2 = http.request({ - agent, port, method: 'POST' + agent, port, method: 'POST', }, common.mustCall(verifyRequest(1))); r2.end(payload); })); diff --git a/test/async-hooks/test-http-agent-handle-reuse-serial.js b/test/async-hooks/test-http-agent-handle-reuse-serial.js index bbc7183d6e72ca..b7805789fe9676 100644 --- a/test/async-hooks/test-http-agent-handle-reuse-serial.js +++ b/test/async-hooks/test-http-agent-handle-reuse-serial.js @@ -20,7 +20,7 @@ let asyncIdAtSecondReq; const agent = new http.Agent({ keepAlive: true, keepAliveMsecs: Infinity, - maxSockets: 1 + maxSockets: 1, }); const server = http.createServer(common.mustCall((req, res) => { @@ -38,7 +38,7 @@ const server = http.createServer(common.mustCall((req, res) => { // First request. This is useless except for adding a socket to the // agent’s pool for reuse. const r1 = http.request({ - agent, port, method: 'POST' + agent, port, method: 'POST', }, common.mustCall((res) => { // Remember which socket we used. const socket = res.socket; @@ -60,8 +60,8 @@ const server = http.createServer(common.mustCall((req, res) => { // response header has already been received. const r2 = http.request({ agent, port, method: 'POST', headers: { - 'Content-Length': payload.length - } + 'Content-Length': payload.length, + }, }, common.mustCall((res) => { asyncIdAtSecondReq = res.socket[async_id_symbol]; assert.ok(asyncIdAtSecondReq > 0, `${asyncIdAtSecondReq} > 0`); diff --git a/test/async-hooks/test-httpparser-reuse.js b/test/async-hooks/test-httpparser-reuse.js index 70248970df364c..8fbd48765dec12 100644 --- a/test/async-hooks/test-httpparser-reuse.js +++ b/test/async-hooks/test-httpparser-reuse.js @@ -40,7 +40,7 @@ createHook({ } else { destroyed.push(asyncId); } - } + }, }).enable(); const server = http.createServer((req, res) => { diff --git a/test/async-hooks/test-improper-order.js b/test/async-hooks/test-improper-order.js index a9d46917df59e0..409d79beb957f0 100644 --- a/test/async-hooks/test-improper-order.js +++ b/test/async-hooks/test-improper-order.js @@ -10,7 +10,7 @@ const heartbeatMsg = /heartbeat: still alive/; const { newAsyncId, getDefaultTriggerAsyncId, - emitInit, emitBefore, emitAfter + emitInit, emitBefore, emitAfter, } = internal_async_hooks; const initHooks = require('./init-hooks'); diff --git a/test/async-hooks/test-improper-unwind.js b/test/async-hooks/test-improper-unwind.js index a62512db974ac6..41e1223c41241b 100644 --- a/test/async-hooks/test-improper-unwind.js +++ b/test/async-hooks/test-improper-unwind.js @@ -10,7 +10,7 @@ const heartbeatMsg = /heartbeat: still alive/; const { newAsyncId, getDefaultTriggerAsyncId, - emitInit, emitBefore, emitAfter + emitInit, emitBefore, emitAfter, } = internal_async_hooks; const initHooks = require('./init-hooks'); diff --git a/test/async-hooks/test-late-hook-enable.js b/test/async-hooks/test-late-hook-enable.js index 82a80b24bb777c..e0dcfe22fdb851 100644 --- a/test/async-hooks/test-late-hook-enable.js +++ b/test/async-hooks/test-late-hook-enable.js @@ -37,7 +37,7 @@ const hook = async_hooks.createHook({ destroy: common.mustCall(() => { hook.disable(); nextTest(); - }, 3) + }, 3), }); nextTest(); diff --git a/test/async-hooks/test-nexttick-default-trigger.js b/test/async-hooks/test-nexttick-default-trigger.js index 7d6d98c9abc902..fa1ad2c561ce6f 100644 --- a/test/async-hooks/test-nexttick-default-trigger.js +++ b/test/async-hooks/test-nexttick-default-trigger.js @@ -23,6 +23,6 @@ process.on('exit', () => { const as = hooks.activitiesOfTypes('TickObject'); checkInvocations(as[0], { - init: 1, before: 1, after: 1, destroy: 1 + init: 1, before: 1, after: 1, destroy: 1, }, 'when process exits'); }); diff --git a/test/async-hooks/test-queue-microtask.js b/test/async-hooks/test-queue-microtask.js index 1e2029efe4ad0e..01200d45423929 100644 --- a/test/async-hooks/test-queue-microtask.js +++ b/test/async-hooks/test-queue-microtask.js @@ -20,6 +20,6 @@ process.on('exit', () => { const as = hooks.activitiesOfTypes('Microtask'); checkInvocations(as[0], { - init: 1, before: 1, after: 1, destroy: 1 + init: 1, before: 1, after: 1, destroy: 1, }, 'when process exits'); }); diff --git a/test/async-hooks/test-tlswrap.js b/test/async-hooks/test-tlswrap.js index 65a4087d1659c6..6a8996e00f2b71 100644 --- a/test/async-hooks/test-tlswrap.js +++ b/test/async-hooks/test-tlswrap.js @@ -25,7 +25,7 @@ tls.DEFAULT_MAX_VERSION = 'TLSv1.2'; const server = tls .createServer({ cert: fixtures.readKey('rsa_cert.crt'), - key: fixtures.readKey('rsa_private.pem') + key: fixtures.readKey('rsa_private.pem'), }) .on('listening', common.mustCall(onlistening)) .on('secureConnection', common.mustCall(onsecureConnection)) diff --git a/test/async-hooks/test-unhandled-rejection-context.js b/test/async-hooks/test-unhandled-rejection-context.js index b70d97f99fd441..8404cf71f0db6f 100644 --- a/test/async-hooks/test-unhandled-rejection-context.js +++ b/test/async-hooks/test-unhandled-rejection-context.js @@ -15,7 +15,7 @@ const hooks = initHooks({ if (type === 'PROMISE') { promiseAsyncIds.push(asyncId); } - } + }, }); hooks.enable(); diff --git a/test/async-hooks/test-zlib.zlib-binding.deflate.js b/test/async-hooks/test-zlib.zlib-binding.deflate.js index 16d9b3f3ebd7d5..b38bb17cb49552 100644 --- a/test/async-hooks/test-zlib.zlib-binding.deflate.js +++ b/test/async-hooks/test-zlib.zlib-binding.deflate.js @@ -29,7 +29,7 @@ const buffers = { writeResult: new Uint32Array(2), dictionary: new Uint8Array(0), inBuf: new Uint8Array([0x78]), - outBuf: new Uint8Array(1) + outBuf: new Uint8Array(1), }; handle.init( diff --git a/test/async-hooks/verify-graph.js b/test/async-hooks/verify-graph.js index 638edd03a4ab24..111fdd5bfc3ab1 100644 --- a/test/async-hooks/verify-graph.js +++ b/test/async-hooks/verify-graph.js @@ -20,7 +20,7 @@ function pruneTickObjects(activities) { const tickObject = { found: true, index: null, - data: null + data: null, }; if (!Array.isArray(activities)) @@ -42,7 +42,7 @@ function pruneTickObjects(activities) { tickObject.data = activities[tickObject.index]; const triggerId = { new: tickObject.data.triggerAsyncId, - old: tickObject.data.uid + old: tickObject.data.uid, }; activities.forEach(function repointTriggerId(x) { @@ -85,7 +85,7 @@ module.exports = function verifyGraph(hooks, graph) { errors.push({ id: node.id, expectedTid: node.triggerAsyncId, - actualTid: uidtoid[x.triggerAsyncId] + actualTid: uidtoid[x.triggerAsyncId], }); } diff --git a/test/common/README.md b/test/common/README.md index ea4d4e401be64e..3f9c3ff8a3490d 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -118,20 +118,20 @@ expectWarning('DeprecationWarning', [ expectWarning('DeprecationWarning', { DEP0XXX: 'Foobar is deprecated', - DEP0XX2: 'Baz is also deprecated' + DEP0XX2: 'Baz is also deprecated', }); expectWarning({ DeprecationWarning: { DEP0XXX: 'Foobar is deprecated', - DEP0XX1: 'Baz is also deprecated' + DEP0XX1: 'Baz is also deprecated', }, Warning: [ ['Multiple array entries are fine', 'SpecialWarningCode'], ['No code is also fine'], ], SingleEntry: ['This will also work', 'WarningCode'], - SingleString: 'Single string entries without code will also work' + SingleString: 'Single string entries without code will also work', }); ``` @@ -689,7 +689,7 @@ validateSnapshotNodes('TLSWRAP', [ { name: 'enc_out' }, { name: 'enc_in' }, { name: 'TLSWrap' }, - ] + ], }, ]); ``` diff --git a/test/common/benchmark.js b/test/common/benchmark.js index 56351c92505efa..3df8d2c9b48aa8 100644 --- a/test/common/benchmark.js +++ b/test/common/benchmark.js @@ -17,7 +17,7 @@ function runBenchmark(name, env) { const child = fork(runjs, argv, { env: mergedEnv, - stdio: ['inherit', 'pipe', 'inherit', 'ipc'] + stdio: ['inherit', 'pipe', 'inherit', 'ipc'], }); child.stdout.setEncoding('utf8'); diff --git a/test/common/cpu-prof.js b/test/common/cpu-prof.js index ae81eefd45c307..860e81fc1c6dcb 100644 --- a/test/common/cpu-prof.js +++ b/test/common/cpu-prof.js @@ -40,7 +40,7 @@ function verifyFrames(output, file, suffix) { const kCpuProfInterval = 50; const env = { ...process.env, - NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' + NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER', }; module.exports = { @@ -48,5 +48,5 @@ module.exports = { kCpuProfInterval, env, getFrames, - verifyFrames + verifyFrames, }; diff --git a/test/common/dns.js b/test/common/dns.js index 3574229db44117..47c4acdfea286e 100644 --- a/test/common/dns.js +++ b/test/common/dns.js @@ -14,11 +14,11 @@ const types = { MX: 15, TXT: 16, ANY: 255, - CAA: 257 + CAA: 257, }; const classes = { - IN: 1 + IN: 1, }; // Naïve DNS parser/serializer. @@ -35,7 +35,7 @@ function readDomainFromPacket(buffer, offset) { const { nread, domain } = readDomainFromPacket(buffer, offset + length); return { nread: 1 + length + nread, - domain: domain ? `${chunk}.${domain}` : chunk + domain: domain ? `${chunk}.${domain}` : chunk, }; } // Pointer to another part of the packet. @@ -44,7 +44,7 @@ function readDomainFromPacket(buffer, offset) { const pointeeOffset = buffer.readUInt16BE(offset) &~ 0xC000; return { nread: 2, - domain: readDomainFromPacket(buffer, pointeeOffset) + domain: readDomainFromPacket(buffer, pointeeOffset), }; } @@ -316,5 +316,5 @@ module.exports = { parseDNSPacket, errorLookupMock, mockedErrorCode, - mockedSysCall + mockedSysCall, }; diff --git a/test/common/heap.js b/test/common/heap.js index a6232177ba9fd3..d859b064e3a3f3 100644 --- a/test/common/heap.js +++ b/test/common/heap.js @@ -42,7 +42,7 @@ function createJSHeapSnapshot(stream = getHeapSnapshot()) { type, to: toNode, from: fromNode, - name: typeof name_or_index === 'string' ? name_or_index : null + name: typeof name_or_index === 'string' ? name_or_index : null, }; toNode.incomingEdges.push(edge); fromNode.outgoingEdges.push(edge); @@ -198,5 +198,5 @@ function validateSnapshotNodes(...args) { module.exports = { recordState, - validateSnapshotNodes + validateSnapshotNodes, }; diff --git a/test/common/hijackstdio.js b/test/common/hijackstdio.js index 6995f6665891d3..ad6f83eb4124f9 100644 --- a/test/common/hijackstdio.js +++ b/test/common/hijackstdio.js @@ -29,5 +29,5 @@ module.exports = { hijackStdout: hijackStdWritable.bind(null, 'stdout'), hijackStderr: hijackStdWritable.bind(null, 'stderr'), restoreStdout: restoreWritable.bind(null, 'stdout'), - restoreStderr: restoreWritable.bind(null, 'stderr') + restoreStderr: restoreWritable.bind(null, 'stderr'), }; diff --git a/test/common/http2.js b/test/common/http2.js index c4d430d1d93f98..22e770ecdf6375 100644 --- a/test/common/http2.js +++ b/test/common/http2.js @@ -145,5 +145,5 @@ module.exports = { PingFrame, kFakeRequestHeaders, kFakeResponseHeaders, - kClientMagic + kClientMagic, }; diff --git a/test/common/index.js b/test/common/index.js index 14d47cf0574048..53175b08268be8 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -40,7 +40,7 @@ const hasIntl = !!process.config.variables.v8_enable_i18n_support; const { atob, - btoa + btoa, } = require('buffer'); // Some tests assume a umask of 0o022 so set that up front. Tests that need a @@ -163,7 +163,7 @@ if (process.env.NODE_TEST_WITH_ASYNC_HOOKS) { } initHandles[id] = { resource, - stack: util.inspect(new Error()).substr(6) + stack: util.inspect(new Error()).substr(6), }; }, before() { }, @@ -379,7 +379,7 @@ function _mustCallInner(fn, criteria = 1, field) { [field]: criteria, actual: 0, stack: util.inspect(new Error()), - name: fn.name || '' + name: fn.name || '', }; // Add the exit listener only once to avoid listener leak warnings @@ -881,7 +881,7 @@ const common = { throw new Error('common.PORT cannot be used in a parallelized test'); } return +process.env.NODE_COMMON_PORT || 12346; - } + }, }; @@ -891,5 +891,5 @@ module.exports = new Proxy(common, { if (!validProperties.has(prop)) throw new Error(`Using invalid common property: '${prop}'`); return obj[prop]; - } + }, }); diff --git a/test/common/index.mjs b/test/common/index.mjs index 73049004759869..9e3beca215c323 100644 --- a/test/common/index.mjs +++ b/test/common/index.mjs @@ -47,7 +47,7 @@ const { getArrayBufferViews, getBufferSources, getTTYfd, - runWithInvalidFD + runWithInvalidFD, } = common; export { @@ -93,5 +93,5 @@ export { getBufferSources, getTTYfd, runWithInvalidFD, - createRequire + createRequire, }; diff --git a/test/common/inspector-helper.js b/test/common/inspector-helper.js index 9c98ce6252c0e3..430db1836f8327 100644 --- a/test/common/inspector-helper.js +++ b/test/common/inspector-helper.js @@ -423,8 +423,8 @@ class NodeInstance extends EventEmitter { 'Connection': 'Upgrade', 'Upgrade': 'websocket', 'Sec-WebSocket-Version': 13, - 'Sec-WebSocket-Key': 'key==' - } + 'Sec-WebSocket-Key': 'key==', + }, }); } @@ -519,5 +519,5 @@ function fires(promise, error, timeoutMs) { } module.exports = { - NodeInstance + NodeInstance, }; diff --git a/test/common/internet.js b/test/common/internet.js index accea74969e276..57c3893122d094 100644 --- a/test/common/internet.js +++ b/test/common/internet.js @@ -44,7 +44,7 @@ const addresses = { // An accessible IPv4 DNS server DNS4_SERVER: '8.8.8.8', // An accessible IPv4 DNS server - DNS6_SERVER: '2001:4860:4860::8888' + DNS6_SERVER: '2001:4860:4860::8888', }; for (const key of Object.keys(addresses)) { @@ -55,5 +55,5 @@ for (const key of Object.keys(addresses)) { } module.exports = { - addresses + addresses, }; diff --git a/test/common/measure-memory.js b/test/common/measure-memory.js index 67c8fb3b9d2d67..7c9cc5c8229b6d 100644 --- a/test/common/measure-memory.js +++ b/test/common/measure-memory.js @@ -53,5 +53,5 @@ module.exports = { assertSummaryShape, assertDetailedShape, assertSingleDetailedShape, - expectExperimentalWarning + expectExperimentalWarning, }; diff --git a/test/common/ongc.js b/test/common/ongc.js index d8e27beb8f0a13..d361c55b51fe30 100644 --- a/test/common/ongc.js +++ b/test/common/ongc.js @@ -21,7 +21,7 @@ function onGC(obj, gcListener) { this.gcListener.ongc(); onGcAsyncHook.disable(); } - } + }, }).enable(); onGcAsyncHook.gcListener = gcListener; diff --git a/test/common/require-as.js b/test/common/require-as.js index 7aba4fa6d825a2..4c932247493b82 100644 --- a/test/common/require-as.js +++ b/test/common/require-as.js @@ -18,7 +18,7 @@ const { Worker, isMainThread, workerData } = require('worker_threads'); if (isMainThread) { if (process.argv[2] === 'worker') { new Worker(__filename, { - workerData: process.argv[3] + workerData: process.argv[3], }); return; } diff --git a/test/common/shared-lib-util.js b/test/common/shared-lib-util.js index f40acd783ba0e7..3ecd38791cf481 100644 --- a/test/common/shared-lib-util.js +++ b/test/common/shared-lib-util.js @@ -46,5 +46,5 @@ function getBinaryPath() { module.exports = { addLibraryPath, getBinaryPath, - getSharedLibPath + getSharedLibPath, }; diff --git a/test/common/tls.js b/test/common/tls.js index 27414c79eda040..27e9034d7b1c1e 100644 --- a/test/common/tls.js +++ b/test/common/tls.js @@ -53,7 +53,7 @@ class TestTLSSocket extends net.Socket { createClientKeyExchange() { const encrypted_pre_primary_secret = crypto.publicEncrypt({ key: this.server_cert, - padding: crypto.constants.RSA_PKCS1_PADDING + padding: crypto.constants.RSA_PKCS1_PADDING, }, this.pre_primary_secret); const length = Buffer.alloc(2); length.writeUIntBE(encrypted_pre_primary_secret.length, 0, 2); diff --git a/test/common/tmpdir.js b/test/common/tmpdir.js index d911feb460a2f3..fa7669dad63261 100644 --- a/test/common/tmpdir.js +++ b/test/common/tmpdir.js @@ -58,5 +58,5 @@ function onexit() { module.exports = { path: tmpPath, - refresh + refresh, }; diff --git a/test/common/udppair.js b/test/common/udppair.js index a7e532a99778e9..1d76213dac3496 100644 --- a/test/common/udppair.js +++ b/test/common/udppair.js @@ -68,7 +68,7 @@ class FakeUDPWrap extends EventEmitter { address = '127.0.0.1', port = 1337, }, - flags = 0 + flags = 0, } = info; let familyInt; @@ -98,5 +98,5 @@ function makeUDPPair() { module.exports = { FakeUDPWrap, - makeUDPPair + makeUDPPair, }; diff --git a/test/common/wpt.js b/test/common/wpt.js index 74508f0c8d2a56..84f3bdbb384437 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -34,7 +34,7 @@ const harnessMock = { assert_array_equals: assert.deepStrictEqual, assert_unreached(desc) { assert.fail(`Reached unreachable code: ${desc}`); - } + }, }; class ResourceLoader { @@ -70,7 +70,7 @@ class ResourceLoader { return { ok: true, json() { return JSON.parse(data.toString()); }, - text() { return data.toString(); } + text() { return data.toString(); }, }; }); } @@ -352,14 +352,14 @@ class WPTRunner { for (const script of meta.script) { scriptsToRun.push({ filename: this.resource.toRealFilePath(relativePath, script), - code: this.resource.read(relativePath, script, false) + code: this.resource.read(relativePath, script, false), }); } } // The actual test scriptsToRun.push({ code: content, - filename: absolutePath + filename: absolutePath, }); const workerPath = path.join(__dirname, 'wpt/worker.js'); @@ -402,7 +402,7 @@ class WPTRunner { status: NODE_UNCAUGHT, name: 'evaluation in WPTRunner.runJsTests()', message: err.message, - stack: inspect(err) + stack: inspect(err), }, kUncaught ); @@ -555,7 +555,7 @@ class WPTRunner { this.addTestResult(filename, { expected, status: kFail, - reason: test.message || status + reason: test.message || status, }); } @@ -566,7 +566,7 @@ class WPTRunner { console.log(`[SKIPPED] ${joinedReasons}`); this.addTestResult(filename, { status: kSkip, - reason: joinedReasons + reason: joinedReasons, }); } @@ -617,5 +617,5 @@ class WPTRunner { module.exports = { harness: harnessMock, ResourceLoader, - WPTRunner + WPTRunner, }; diff --git a/test/common/wpt/worker.js b/test/common/wpt/worker.js index afaee075f7a32e..90bd24aadce9f2 100644 --- a/test/common/wpt/worker.js +++ b/test/common/wpt/worker.js @@ -10,7 +10,7 @@ const resource = new ResourceLoader(workerData.wptPath); global.self = global; global.GLOBAL = { - isWindow() { return false; } + isWindow() { return false; }, }; global.require = require; @@ -26,7 +26,7 @@ if (workerData.initScript) { } runInThisContext(workerData.harness.code, { - filename: workerData.harness.filename + filename: workerData.harness.filename, }); // eslint-disable-next-line no-undef diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js index dd651a66c1e94f..0b29f57f2a0201 100644 --- a/test/doctool/test-doctool-html.js +++ b/test/doctool/test-doctool-html.js @@ -32,8 +32,8 @@ const htmlStringify = require('rehype-stringify'); const testLinksMapper = { 'foo': { 'command line options': 'cli.html#cli-options', - 'web server': 'example.html' - } + 'web server': 'example.html', + }, }; function toHTML({ input, filename, nodeVersion, versions }) { @@ -65,7 +65,7 @@ const testData = [ 'id="foo_static_method_buffer_from_array"># ' + '' + 'Reference/Global_Objects/Array" class="type"><Array>', }, { file: fixtures.path('doc_with_yaml.md'), @@ -98,7 +98,7 @@ const testData = [ '

Something#

' + ' ' + - '

Describe Something in more detail here.

' + '

Describe Something in more detail here.

', }, { file: fixtures.path('sample_document.md'), @@ -124,7 +124,7 @@ const testData = [ '\'Hello, World!\':

' + '

See also#

Check' + - 'out alsothis guide

' + 'out alsothis guide

', }, { file: fixtures.path('document_with_special_heading.md'), diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js index 70e6aa50f0c568..54d260813bc287 100644 --- a/test/doctool/test-doctool-json.js +++ b/test/doctool/test-doctool-json.js @@ -50,12 +50,12 @@ const testData = [ desc: '
    \n
  1. fish
  2. \n
  3. fish
  4. \n
\n' + '
    \n
  • Red fish
  • \n
  • Blue fish
  • \n
', type: 'module', - displayName: 'Seussian Rhymes' + displayName: 'Seussian Rhymes', }], type: 'module', - displayName: 'Sample Markdown' - }] - } + displayName: 'Sample Markdown', + }], + }, }, { file: fixtures.path('order_of_end_tags_5873.md'), @@ -77,18 +77,18 @@ const testData = [ params: [{ textRaw: '`array` {Array}', name: 'array', - type: 'Array' - }] + type: 'Array', + }], }, - ] + ], }], type: 'module', - displayName: 'Subsection' + displayName: 'Subsection', }], type: 'module', - displayName: 'Title' - }] - } + displayName: 'Title', + }], + }, }, { file: fixtures.path('doc_with_yaml.md'), @@ -105,12 +105,12 @@ const testData = [ name: 'foobar', meta: { added: ['v1.0.0'], - changes: [] + changes: [], }, desc: '

Describe Foobar in more detail ' + 'here.

', type: 'module', - displayName: 'Foobar' + displayName: 'Foobar', }, { textRaw: 'Foobar II', @@ -122,12 +122,12 @@ const testData = [ 'pr-url': 'https://github.com/nodejs/node/pull/3276', 'description': 'The `error` parameter can now be ' + 'an arrow function.' }, - ] + ], }, desc: '

Describe Foobar II in more detail ' + 'here. fg(1)

', type: 'module', - displayName: 'Foobar II' + displayName: 'Foobar II', }, { textRaw: 'Deprecated thingy', @@ -135,12 +135,12 @@ const testData = [ meta: { added: ['v1.0.0'], deprecated: ['v2.0.0'], - changes: [] + changes: [], }, desc: '

Describe Deprecated thingy in more ' + 'detail here. fg(1p)

', type: 'module', - displayName: 'Deprecated thingy' + displayName: 'Deprecated thingy', }, { textRaw: 'Something', @@ -148,14 +148,14 @@ const testData = [ desc: '\n

' + 'Describe Something in more detail here.

', type: 'module', - displayName: 'Something' + displayName: 'Something', }, ], type: 'module', - displayName: 'Sample Markdown with YAML info' + displayName: 'Sample Markdown with YAML info', }, - ] - } + ], + }, }, { file: fixtures.path('doc_with_backticks_in_headings.md'), @@ -169,7 +169,7 @@ const testData = [ properties: [ { name: 'fullName', - textRaw: '`Fqhqwhgads.fullName`' + textRaw: '`Fqhqwhgads.fullName`', }, ], classMethods: [ @@ -177,18 +177,18 @@ const testData = [ name: 'again', signatures: [ { - params: [] + params: [], }, ], textRaw: 'Static method: `Fhqwhgads.again()`', - type: 'classMethod' + type: 'classMethod', }, ], classes: [ { textRaw: 'Class: `ComeOn`', type: 'class', - name: 'ComeOn' + name: 'ComeOn', }, ], ctors: [ @@ -196,11 +196,11 @@ const testData = [ name: 'Fhqwhgads', signatures: [ { - params: [] + params: [], }, ], textRaw: 'Constructor: `new Fhqwhgads()`', - type: 'ctor' + type: 'ctor', }, ], methods: [ @@ -208,7 +208,7 @@ const testData = [ textRaw: '`everybody.to(limit)`', type: 'method', name: 'to', - signatures: [{ params: [] }] + signatures: [{ params: [] }], }, ], events: [ @@ -216,14 +216,14 @@ const testData = [ textRaw: "Event: `'FHQWHfest'`", type: 'event', name: 'FHQWHfest', - params: [] + params: [], }, ], type: 'module', - displayName: 'Fhqwhgads' + displayName: 'Fhqwhgads', }, - ] - } + ], + }, }, ]; diff --git a/test/es-module/test-esm-cjs-named-error.mjs b/test/es-module/test-esm-cjs-named-error.mjs index 4ef75a22f92674..3c9fac4bd52f5c 100644 --- a/test/es-module/test-esm-cjs-named-error.mjs +++ b/test/es-module/test-esm-cjs-named-error.mjs @@ -27,21 +27,21 @@ rejects(async () => { await import(`${fixtureBase}/single-quote.mjs`); }, { name: 'SyntaxError', - message: expectedRelative + message: expectedRelative, }, 'should support relative specifiers with single quotes'); rejects(async () => { await import(`${fixtureBase}/double-quote.mjs`); }, { name: 'SyntaxError', - message: expectedRelative + message: expectedRelative, }, 'should support relative specifiers with double quotes'); rejects(async () => { await import(`${fixtureBase}/renamed-import.mjs`); }, { name: 'SyntaxError', - message: expectedRenamed + message: expectedRenamed, }, 'should correctly format named imports with renames'); rejects(async () => { @@ -55,21 +55,21 @@ rejects(async () => { await import(`${fixtureBase}/json-hack.mjs`); }, { name: 'SyntaxError', - message: expectedPackageHack + message: expectedPackageHack, }, 'should respect recursive package.json for module type'); rejects(async () => { await import(`${fixtureBase}/bare-import-single.mjs`); }, { name: 'SyntaxError', - message: expectedBare + message: expectedBare, }, 'should support bare specifiers with single quotes'); rejects(async () => { await import(`${fixtureBase}/bare-import-double.mjs`); }, { name: 'SyntaxError', - message: expectedBare + message: expectedBare, }, 'should support bare specifiers with double quotes'); rejects(async () => { diff --git a/test/es-module/test-esm-data-urls.js b/test/es-module/test-esm-data-urls.js index ba8bd4c95746c0..83c3f4dd7d12eb 100644 --- a/test/es-module/test-esm-data-urls.js +++ b/test/es-module/test-esm-data-urls.js @@ -75,7 +75,7 @@ function createBase64URL(mime, body) { return import('data:application/json;foo="test,",0'); }, { name: 'SyntaxError', - message: /Unexpected end of JSON input/ + message: /Unexpected end of JSON input/, }); } { diff --git a/test/es-module/test-esm-dns-promises.mjs b/test/es-module/test-esm-dns-promises.mjs index 149682db02d042..1256bb75a2b83c 100644 --- a/test/es-module/test-esm-dns-promises.mjs +++ b/test/es-module/test-esm-dns-promises.mjs @@ -10,5 +10,5 @@ assert.throws(() => { }, { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: `The argument 'address' is invalid. Received '${invalidAddress}'` + message: `The argument 'address' is invalid. Received '${invalidAddress}'`, }); diff --git a/test/es-module/test-esm-dynamic-import.js b/test/es-module/test-esm-dynamic-import.js index 3df2191e3ba06b..a2c1b2a835b978 100644 --- a/test/es-module/test-esm-dynamic-import.js +++ b/test/es-module/test-esm-dynamic-import.js @@ -19,7 +19,7 @@ function expectOkNamespace(result) { .then(common.mustCall((ns) => { const expected = { default: true }; Object.defineProperty(expected, Symbol.toStringTag, { - value: 'Module' + value: 'Module', }); Object.setPrototypeOf(expected, Object.getPrototypeOf(ns)); assert.deepStrictEqual(ns, expected); diff --git a/test/es-module/test-esm-import-meta.mjs b/test/es-module/test-esm-import-meta.mjs index 0151177b21c302..12377eab3f2c92 100644 --- a/test/es-module/test-esm-import-meta.mjs +++ b/test/es-module/test-esm-import-meta.mjs @@ -12,7 +12,7 @@ for (const descriptor of Object.values(descriptors)) { assert.deepStrictEqual(descriptor, { enumerable: true, writable: true, - configurable: true + configurable: true, }); } diff --git a/test/es-module/test-esm-loader-invalid-format.mjs b/test/es-module/test-esm-loader-invalid-format.mjs index 64237f7af243af..5a16381e58897f 100644 --- a/test/es-module/test-esm-loader-invalid-format.mjs +++ b/test/es-module/test-esm-loader-invalid-format.mjs @@ -5,6 +5,6 @@ import assert from 'assert'; import('../fixtures/es-modules/test-esm-ok.mjs') .then(assert.fail, expectsError({ code: 'ERR_UNKNOWN_MODULE_FORMAT', - message: /Unknown module format: esm/ + message: /Unknown module format: esm/, })) .then(mustCall()); diff --git a/test/es-module/test-esm-loader-invalid-url.mjs b/test/es-module/test-esm-loader-invalid-url.mjs index 7dce946da2c3c3..0cdc5daa8d948e 100644 --- a/test/es-module/test-esm-loader-invalid-url.mjs +++ b/test/es-module/test-esm-loader-invalid-url.mjs @@ -6,7 +6,7 @@ import('../fixtures/es-modules/test-esm-ok.mjs') .then(assert.fail, (error) => { expectsError({ code: 'ERR_INVALID_URL', - message: 'Invalid URL' + message: 'Invalid URL', })(error); assert.strictEqual(error.input, '../fixtures/es-modules/test-esm-ok.mjs'); diff --git a/test/es-module/test-esm-loader-modulemap.js b/test/es-module/test-esm-loader-modulemap.js index 2d74cd385be52b..360efd1b1fab96 100644 --- a/test/es-module/test-esm-loader-modulemap.js +++ b/test/es-module/test-esm-loader-modulemap.js @@ -26,7 +26,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "url" argument must be of type string. Received type number' + - ' (1)' + ' (1)', } ); @@ -36,7 +36,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "url" argument must be of type string. Received type number' + - ' (1)' + ' (1)', } ); @@ -46,7 +46,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "job" argument must be an instance of ModuleJob. ' + - "Received type string ('notamodulejob')" + "Received type string ('notamodulejob')", } ); @@ -56,6 +56,6 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "url" argument must be of type string. Received type number' + - ' (1)' + ' (1)', } ); diff --git a/test/es-module/test-esm-loader-search.js b/test/es-module/test-esm-loader-search.js index 3c451409b356db..5f25edadb7cbb1 100644 --- a/test/es-module/test-esm-loader-search.js +++ b/test/es-module/test-esm-loader-search.js @@ -7,7 +7,7 @@ require('../common'); const assert = require('assert'); const { - defaultResolve: resolve + defaultResolve: resolve, } = require('internal/modules/esm/resolve'); assert.throws( @@ -15,6 +15,6 @@ assert.throws( { code: 'ERR_MODULE_NOT_FOUND', name: 'Error', - message: /Cannot find package 'target'/ + message: /Cannot find package 'target'/, } ); diff --git a/test/es-module/test-esm-symlink-type.js b/test/es-module/test-esm-symlink-type.js index 2537881f46c0e2..76f03d4f46d457 100644 --- a/test/es-module/test-esm-symlink-type.js +++ b/test/es-module/test-esm-symlink-type.js @@ -16,12 +16,12 @@ const symlinks = [ source: 'extensionless-symlink-to-mjs-file', target: fixtures.path('es-modules/mjs-file.mjs'), prints: '.mjs file', - errorsWithPreserveSymlinksMain: false + errorsWithPreserveSymlinksMain: false, }, { source: 'extensionless-symlink-to-cjs-file', target: fixtures.path('es-modules/cjs-file.cjs'), prints: '.cjs file', - errorsWithPreserveSymlinksMain: false + errorsWithPreserveSymlinksMain: false, }, { source: 'extensionless-symlink-to-file-in-module-scope', target: fixtures.path('es-modules/package-type-module/index.js'), @@ -29,17 +29,17 @@ const symlinks = [ // The package scope of the symlinks' sources is commonjs, and this // symlink's target is a .js file in a module scope, so when the scope // is evaluated based on the source (commonjs) this esm file should error - errorsWithPreserveSymlinksMain: true + errorsWithPreserveSymlinksMain: true, }, { source: 'extensionless-symlink-to-file-in-explicit-commonjs-scope', target: fixtures.path('es-modules/package-type-commonjs/index.js'), prints: 'package-type-commonjs', - errorsWithPreserveSymlinksMain: false + errorsWithPreserveSymlinksMain: false, }, { source: 'extensionless-symlink-to-file-in-implicit-commonjs-scope', target: fixtures.path('es-modules/package-without-type/index.js'), prints: 'package-without-type', - errorsWithPreserveSymlinksMain: false + errorsWithPreserveSymlinksMain: false, }, ]; @@ -53,7 +53,7 @@ symlinks.forEach((symlink) => { ]; flags.forEach((nodeOptions) => { const opts = { - env: Object.assign({}, process.env, { NODE_OPTIONS: nodeOptions }) + env: Object.assign({}, process.env, { NODE_OPTIONS: nodeOptions }), }; exec(process.execPath, [mainPath], opts, common.mustCall( (err, stdout) => { diff --git a/test/internet/test-dgram-broadcast-multi-process.js b/test/internet/test-dgram-broadcast-multi-process.js index 717b4dc01ea027..fd30763addaf59 100644 --- a/test/internet/test-dgram-broadcast-multi-process.js +++ b/test/internet/test-dgram-broadcast-multi-process.js @@ -166,7 +166,7 @@ if (process.argv[2] !== 'child') { const sendSocket = dgram.createSocket({ type: 'udp4', - reuseAddr: true + reuseAddr: true, }); // Bind the address explicitly for sending @@ -217,7 +217,7 @@ if (process.argv[2] === 'child') { const receivedMessages = []; const listenSocket = dgram.createSocket({ type: 'udp4', - reuseAddr: true + reuseAddr: true, }); listenSocket.on('message', (buf, rinfo) => { diff --git a/test/internet/test-dgram-multicast-multi-process.js b/test/internet/test-dgram-multicast-multi-process.js index e19f8dc05b747a..cd7e903eab3cc2 100644 --- a/test/internet/test-dgram-multicast-multi-process.js +++ b/test/internet/test-dgram-multicast-multi-process.js @@ -195,7 +195,7 @@ if (process.argv[2] === 'child') { const receivedMessages = []; const listenSocket = dgram.createSocket({ type: 'udp4', - reuseAddr: true + reuseAddr: true, }); listenSocket.on('listening', function() { diff --git a/test/internet/test-dgram-multicast-set-interface-lo.js b/test/internet/test-dgram-multicast-set-interface-lo.js index 11c3d47cff0637..8d0276667d089d 100644 --- a/test/internet/test-dgram-multicast-set-interface-lo.js +++ b/test/internet/test-dgram-multicast-set-interface-lo.js @@ -25,7 +25,7 @@ const networkInterfaces = require('os').networkInterfaces(); const fork = require('child_process').fork; const MULTICASTS = { IPv4: ['224.0.0.115', '224.0.0.116', '224.0.0.117'], - IPv6: ['ff02::1:115', 'ff02::1:116', 'ff02::1:117'] + IPv6: ['ff02::1:115', 'ff02::1:116', 'ff02::1:117'], }; const LOOPBACK = { IPv4: '127.0.0.1', IPv6: '::1' }; const ANY = { IPv4: '0.0.0.0', IPv6: '::' }; @@ -201,7 +201,7 @@ if (process.argv[2] !== 'child') { const sendSocket = dgram.createSocket({ type: UDP[FAM], - reuseAddr: true + reuseAddr: true, }); // Don't bind the address explicitly when sending and start with @@ -256,7 +256,7 @@ if (process.argv[2] === 'child') { console.error(`pid ${process.pid} iface ${IFACE} MULTICAST ${MULTICAST}`); const listenSocket = dgram.createSocket({ type: UDP[FAM], - reuseAddr: true + reuseAddr: true, }); listenSocket.on('message', (buf, rinfo) => { diff --git a/test/internet/test-dgram-multicast-ssm-multi-process.js b/test/internet/test-dgram-multicast-ssm-multi-process.js index 5653559e243c7a..447aeddee9714c 100644 --- a/test/internet/test-dgram-multicast-ssm-multi-process.js +++ b/test/internet/test-dgram-multicast-ssm-multi-process.js @@ -189,7 +189,7 @@ if (process.argv[2] === 'child') { const receivedMessages = []; const listenSocket = dgram.createSocket({ type: 'udp4', - reuseAddr: true + reuseAddr: true, }); listenSocket.on('listening', function() { diff --git a/test/internet/test-dgram-multicast-ssmv6-multi-process.js b/test/internet/test-dgram-multicast-ssmv6-multi-process.js index e139d93a971a28..db3fd9269993a9 100644 --- a/test/internet/test-dgram-multicast-ssmv6-multi-process.js +++ b/test/internet/test-dgram-multicast-ssmv6-multi-process.js @@ -189,7 +189,7 @@ if (process.argv[2] === 'child') { const receivedMessages = []; const listenSocket = dgram.createSocket({ type: 'udp6', - reuseAddr: true + reuseAddr: true, }); listenSocket.on('listening', function() { diff --git a/test/internet/test-dns-any.js b/test/internet/test-dns-any.js index e721d0f99dcfd7..afebfb7308386a 100644 --- a/test/internet/test-dns-any.js +++ b/test/internet/test-dns-any.js @@ -78,7 +78,7 @@ const checkers = { assert.strictEqual(typeof r.priority, 'number'); assert.strictEqual(typeof r.weight, 'number'); assert.strictEqual(r.type, 'SRV'); - } + }, }; function TEST(f) { diff --git a/test/internet/test-dns-ipv4.js b/test/internet/test-dns-ipv4.js index a84f7e644fc9cf..01e55b17bad39d 100644 --- a/test/internet/test-dns-ipv4.js +++ b/test/internet/test-dns-ipv4.js @@ -125,7 +125,7 @@ TEST(async function test_lookup_ipv4_explicit_object(done) { validateResult(await dnsPromises.lookup(addresses.INET4_HOST, { family: 4 })); const req = dns.lookup(addresses.INET4_HOST, { - family: 4 + family: 4, }, common.mustSucceed((ip, family) => { validateResult({ address: ip, family }); done(); @@ -141,11 +141,11 @@ TEST(async function test_lookup_ipv4_hint_addrconfig(done) { } validateResult(await dnsPromises.lookup(addresses.INET4_HOST, { - hints: dns.ADDRCONFIG + hints: dns.ADDRCONFIG, })); const req = dns.lookup(addresses.INET4_HOST, { - hints: dns.ADDRCONFIG + hints: dns.ADDRCONFIG, }, common.mustSucceed((ip, family) => { validateResult({ address: ip, family }); done(); @@ -201,7 +201,7 @@ TEST(async function test_lookup_all_ipv4(done) { validateResult(await dnsPromises.lookup(addresses.INET4_HOST, { all: true, - family: 4 + family: 4, })); const req = dns.lookup( diff --git a/test/internet/test-dns-ipv6.js b/test/internet/test-dns-ipv6.js index 6f499b68947322..b797051aa7cebb 100644 --- a/test/internet/test-dns-ipv6.js +++ b/test/internet/test-dns-ipv6.js @@ -122,7 +122,7 @@ TEST(async function test_lookup_ipv6_explicit_object(done) { validateResult(await dnsPromises.lookup(addresses.INET6_HOST, { family: 6 })); const req = dns.lookup(addresses.INET6_HOST, { - family: 6 + family: 6, }, common.mustSucceed((ip, family) => { validateResult({ address: ip, family }); done(); @@ -134,7 +134,7 @@ TEST(async function test_lookup_ipv6_explicit_object(done) { TEST(function test_lookup_ipv6_hint(done) { const req = dns.lookup(addresses.INET6_HOST, { family: 6, - hints: dns.V4MAPPED + hints: dns.V4MAPPED, }, common.mustCall((err, ip, family) => { if (err) { // FreeBSD does not support V4MAPPED @@ -191,7 +191,7 @@ TEST(async function test_lookup_all_ipv6(done) { validateResult(await dnsPromises.lookup(addresses.INET6_HOST, { all: true, - family: 6 + family: 6, })); const req = dns.lookup( diff --git a/test/internet/test-dns-lookup.js b/test/internet/test-dns-lookup.js index 6939698d392317..81b9e6bbc6b35e 100644 --- a/test/internet/test-dns-lookup.js +++ b/test/internet/test-dns-lookup.js @@ -11,11 +11,11 @@ assert.rejects( dnsPromises.lookup(addresses.NOT_FOUND, { hints: 0, family: 0, - all: false + all: false, }), { code: 'ENOTFOUND', - message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}` + message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`, } ); @@ -23,18 +23,18 @@ assert.rejects( dnsPromises.lookup(addresses.NOT_FOUND, { hints: 0, family: 0, - all: true + all: true, }), { code: 'ENOTFOUND', - message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}` + message: `getaddrinfo ENOTFOUND ${addresses.NOT_FOUND}`, } ); dns.lookup(addresses.NOT_FOUND, { hints: 0, family: 0, - all: true + all: true, }, common.mustCall((error) => { assert.strictEqual(error.code, 'ENOTFOUND'); assert.strictEqual( diff --git a/test/internet/test-dns-promises-resolve.js b/test/internet/test-dns-promises-resolve.js index d9607a44f60e31..3f64e0b9dfcfab 100644 --- a/test/internet/test-dns-promises-resolve.js +++ b/test/internet/test-dns-promises-resolve.js @@ -12,7 +12,7 @@ const dnsPromises = require('dns').promises; { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: `The argument 'rrtype' is invalid. Received '${rrtype}'` + message: `The argument 'rrtype' is invalid. Received '${rrtype}'`, } ); } @@ -26,7 +26,7 @@ const dnsPromises = require('dns').promises; code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "rrtype" argument must be of type string. ' + - `Received type ${typeof rrtype} (${rrtype})` + `Received type ${typeof rrtype} (${rrtype})`, } ); } diff --git a/test/internet/test-dns.js b/test/internet/test-dns.js index 363dc92446a5ef..a87de278f03911 100644 --- a/test/internet/test-dns.js +++ b/test/internet/test-dns.js @@ -97,11 +97,11 @@ TEST(async function test_resolve4_ttl(done) { } validateResult(await dnsPromises.resolve4(addresses.INET4_HOST, { - ttl: true + ttl: true, })); const req = dns.resolve4(addresses.INET4_HOST, { - ttl: true + ttl: true, }, function(err, result) { assert.ifError(err); validateResult(result); @@ -125,11 +125,11 @@ TEST(async function test_resolve6_ttl(done) { } validateResult(await dnsPromises.resolve6(addresses.INET6_HOST, { - ttl: true + ttl: true, })); const req = dns.resolve6(addresses.INET6_HOST, { - ttl: true + ttl: true, }, function(err, result) { assert.ifError(err); validateResult(result); @@ -621,7 +621,7 @@ TEST(async function test_lookup_all_mixed(done) { validateResult(await dnsPromises.lookup(addresses.INET_HOST, { all: true })); const req = dns.lookup(addresses.INET_HOST, { - all: true + all: true, }, function(err, ips) { assert.ifError(err); validateResult(ips); @@ -654,7 +654,7 @@ TEST(function test_reverse_failure(done) { .then(common.mustNotCall()) .catch(common.expectsError({ code: 'ENOTFOUND', - hostname: '203.0.113.0' + hostname: '203.0.113.0', })); // 203.0.113.0/24 are addresses reserved for (RFC) documentation use only @@ -676,7 +676,7 @@ TEST(function test_lookup_failure(done) { .then(common.mustNotCall()) .catch(common.expectsError({ code: 'ENOTFOUND', - hostname: addresses.NOT_FOUND + hostname: addresses.NOT_FOUND, })); const req = dns.lookup(addresses.NOT_FOUND, (err) => { diff --git a/test/internet/test-http-dns-fail.js b/test/internet/test-http-dns-fail.js index 00875a976335e6..5aacd53f8a42c3 100644 --- a/test/internet/test-http-dns-fail.js +++ b/test/internet/test-http-dns-fail.js @@ -35,7 +35,7 @@ function httpreq(count) { host: 'not-a-real-domain-name.nobody-would-register-this-as-a-tld', port: 80, path: '/', - method: 'GET' + method: 'GET', }, common.mustNotCall()); req.on('error', common.mustCall((e) => { diff --git a/test/internet/test-tls-add-ca-cert.js b/test/internet/test-tls-add-ca-cert.js index c3780acd50671a..2515758ec86c1a 100644 --- a/test/internet/test-tls-add-ca-cert.js +++ b/test/internet/test-tls-add-ca-cert.js @@ -24,7 +24,7 @@ const caCert = loadPEM('ca1-cert'); const opts = { host: 'www.nodejs.org', port: 443, - rejectUnauthorized: true + rejectUnauthorized: true, }; // Success relies on the compiled in well-known root CAs diff --git a/test/internet/test-trace-events-dns.js b/test/internet/test-trace-events-dns.js index 529665f907b0c9..64efd541fd9d2c 100644 --- a/test/internet/test-trace-events-dns.js +++ b/test/internet/test-trace-events-dns.js @@ -37,7 +37,7 @@ const tests = { 'resolveSrv': 'dns.resolveSrv("example.com", (err, res) => {});', 'resolvePtr': 'dns.resolvePtr("example.com", (err, res) => {});', 'resolveNaptr': 'dns.resolveNaptr("example.com", (err, res) => {});', - 'resolveSoa': 'dns.resolveSoa("example.com", (err, res) => {});' + 'resolveSoa': 'dns.resolveSoa("example.com", (err, res) => {});', }; for (const tr in tests) { diff --git a/test/js-native-api/test_bigint/test.js b/test/js-native-api/test_bigint/test.js index 509c263c733a53..75fccc8512717b 100644 --- a/test/js-native-api/test_bigint/test.js +++ b/test/js-native-api/test_bigint/test.js @@ -48,5 +48,5 @@ assert.throws(() => CreateTooBigBigInt(), { // Test that we correctly forward exceptions from the engine. assert.throws(() => MakeBigIntWordsThrow(), { name: 'RangeError', - message: 'Maximum BigInt size exceeded' + message: 'Maximum BigInt size exceeded', }); diff --git a/test/js-native-api/test_constructor/test.js b/test/js-native-api/test_constructor/test.js index c5be4c93bf81e9..6fb33d935489b5 100644 --- a/test/js-native-api/test_constructor/test.js +++ b/test/js-native-api/test_constructor/test.js @@ -58,5 +58,5 @@ assert.deepStrictEqual(TestConstructor.TestDefineClass(), { cbIsNull: 'Invalid argument', cbDataIsNull: 'napi_ok', propertiesIsNull: 'Invalid argument', - resultIsNull: 'Invalid argument' + resultIsNull: 'Invalid argument', }); diff --git a/test/js-native-api/test_conversions/test.js b/test/js-native-api/test_conversions/test.js index 2fd6ace593840e..b994cfac6ec827 100644 --- a/test/js-native-api/test_conversions/test.js +++ b/test/js-native-api/test_conversions/test.js @@ -143,28 +143,28 @@ assert.deepStrictEqual(test.testNull.getValueBool(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', resultIsNull: 'Invalid argument', - inputTypeCheck: 'A boolean was expected' + inputTypeCheck: 'A boolean was expected', }); assert.deepStrictEqual(test.testNull.getValueInt32(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', resultIsNull: 'Invalid argument', - inputTypeCheck: 'A number was expected' + inputTypeCheck: 'A number was expected', }); assert.deepStrictEqual(test.testNull.getValueUint32(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', resultIsNull: 'Invalid argument', - inputTypeCheck: 'A number was expected' + inputTypeCheck: 'A number was expected', }); assert.deepStrictEqual(test.testNull.getValueInt64(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', resultIsNull: 'Invalid argument', - inputTypeCheck: 'A number was expected' + inputTypeCheck: 'A number was expected', }); @@ -172,47 +172,47 @@ assert.deepStrictEqual(test.testNull.getValueDouble(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', resultIsNull: 'Invalid argument', - inputTypeCheck: 'A number was expected' + inputTypeCheck: 'A number was expected', }); assert.deepStrictEqual(test.testNull.coerceToBool(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', resultIsNull: 'Invalid argument', - inputTypeCheck: 'napi_ok' + inputTypeCheck: 'napi_ok', }); assert.deepStrictEqual(test.testNull.coerceToObject(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', resultIsNull: 'Invalid argument', - inputTypeCheck: 'napi_ok' + inputTypeCheck: 'napi_ok', }); assert.deepStrictEqual(test.testNull.coerceToString(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', resultIsNull: 'Invalid argument', - inputTypeCheck: 'napi_ok' + inputTypeCheck: 'napi_ok', }); assert.deepStrictEqual(test.testNull.getValueStringUtf8(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', wrongTypeIn: 'A string was expected', - bufAndOutLengthIsNull: 'Invalid argument' + bufAndOutLengthIsNull: 'Invalid argument', }); assert.deepStrictEqual(test.testNull.getValueStringLatin1(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', wrongTypeIn: 'A string was expected', - bufAndOutLengthIsNull: 'Invalid argument' + bufAndOutLengthIsNull: 'Invalid argument', }); assert.deepStrictEqual(test.testNull.getValueStringUtf16(), { envIsNull: 'Invalid argument', valueIsNull: 'Invalid argument', wrongTypeIn: 'A string was expected', - bufAndOutLengthIsNull: 'Invalid argument' + bufAndOutLengthIsNull: 'Invalid argument', }); diff --git a/test/js-native-api/test_error/test.js b/test/js-native-api/test_error/test.js index 2dc6904c75a732..e4d08b70f4451c 100644 --- a/test/js-native-api/test_error/test.js +++ b/test/js-native-api/test_error/test.js @@ -73,21 +73,21 @@ assert.throws( () => test_error.throwErrorCode(), { code: 'ERR_TEST_CODE', - message: 'Error [error]' + message: 'Error [error]', }); assert.throws( () => test_error.throwRangeErrorCode(), { code: 'ERR_TEST_CODE', - message: 'RangeError [range error]' + message: 'RangeError [range error]', }); assert.throws( () => test_error.throwTypeErrorCode(), { code: 'ERR_TEST_CODE', - message: 'TypeError [type error]' + message: 'TypeError [type error]', }); let error = test_error.createError(); diff --git a/test/js-native-api/test_function/test.js b/test/js-native-api/test_function/test.js index 988f128404e429..e828801d369322 100644 --- a/test/js-native-api/test_function/test.js +++ b/test/js-native-api/test_function/test.js @@ -40,5 +40,5 @@ assert.deepStrictEqual(test_function.TestCreateFunctionParameters(), { envIsNull: 'Invalid argument', nameIsNull: 'napi_ok', cbIsNull: 'Invalid argument', - resultIsNull: 'Invalid argument' + resultIsNull: 'Invalid argument', }); diff --git a/test/js-native-api/test_general/testEnvCleanup.js b/test/js-native-api/test_general/testEnvCleanup.js index 99b47a3e62560f..4aa707d3de03ea 100644 --- a/test/js-native-api/test_general/testEnvCleanup.js +++ b/test/js-native-api/test_general/testEnvCleanup.js @@ -11,7 +11,7 @@ if (process.argv[2] === 'child') { 'simple wrap': 0, 'wrap, removeWrap': 1, 'first wrap': 2, - 'second wrap': 3 + 'second wrap': 3, }; // We attach the three objects we will test to `module.exports` to ensure they @@ -39,7 +39,7 @@ if (process.argv[2] === 'child') { const { spawnSync } = require('child_process'); const child = spawnSync(process.execPath, [__filename, 'child'], { - stdio: [ process.stdin, 'pipe', process.stderr ] + stdio: [ process.stdin, 'pipe', process.stderr ], }); // Grab the child's output and construct an object whose keys are the rows of @@ -49,7 +49,7 @@ if (process.argv[2] === 'child') { child.stdout.toString().split(/\r\n|\r|\n/g).reduce((obj, item) => Object.assign(obj, item ? { [item]: true } : {}), {}), { 'finalize at env cleanup for simple wrap': true, - 'finalize at env cleanup for second wrap': true + 'finalize at env cleanup for second wrap': true, }); // Ensure that the child exited successfully. diff --git a/test/js-native-api/test_general/testInstanceOf.js b/test/js-native-api/test_general/testInstanceOf.js index d50ce7a27c3efa..43f8ab158a453c 100644 --- a/test/js-native-api/test_general/testInstanceOf.js +++ b/test/js-native-api/test_general/testInstanceOf.js @@ -69,7 +69,7 @@ if (typeof Symbol !== 'undefined' && 'hasInstance' in Symbol && Object.defineProperty(MyClass, Symbol.hasInstance, { value: function(candidate) { return 'mark' in candidate; - } + }, }); function MySubClass() {} diff --git a/test/js-native-api/test_object/test.js b/test/js-native-api/test_object/test.js index 807c920bd46b54..b4fcfff9c23522 100644 --- a/test/js-native-api/test_object/test.js +++ b/test/js-native-api/test_object/test.js @@ -12,8 +12,8 @@ const object = { 1, 94, 'str', 12.321, { test: 'obj in arr' }, ], newObject: { - test: 'obj in obj' - } + test: 'obj in obj', + }, }; assert.strictEqual(test_object.Get(object, 'hello'), 'world'); @@ -91,7 +91,7 @@ assert.strictEqual(newObject.test_string, 'test string'); const cube = { x: 10, y: 10, - z: 10 + z: 10, }; assert.deepStrictEqual(test_object.Inflate(cube), { x: 11, y: 11, z: 11 }); @@ -107,7 +107,7 @@ assert.strictEqual(newObject.test_string, 'test string'); const sym4 = Symbol('4'); const object2 = { [sym1]: '@@iterator', - [sym2]: sym3 + [sym2]: sym3, }; assert(test_object.Has(object2, sym1)); @@ -227,7 +227,7 @@ assert.strictEqual(newObject.test_string, 'test string'); // and includes indices and converts them to strings. const object = Object.create({ - inherited: 1 + inherited: 1, }); const fooSymbol = Symbol('foo'); @@ -238,7 +238,7 @@ assert.strictEqual(newObject.test_string, 'test string'); value: 4, enumerable: false, writable: true, - configurable: true + configurable: true, }); object[5] = 5; @@ -255,7 +255,7 @@ assert.deepStrictEqual(test_object.TestSetProperty(), { envIsNull: 'Invalid argument', objectIsNull: 'Invalid argument', keyIsNull: 'Invalid argument', - valueIsNull: 'Invalid argument' + valueIsNull: 'Invalid argument', }); // Verify that passing NULL to napi_has_property() results in the correct @@ -264,7 +264,7 @@ assert.deepStrictEqual(test_object.TestHasProperty(), { envIsNull: 'Invalid argument', objectIsNull: 'Invalid argument', keyIsNull: 'Invalid argument', - resultIsNull: 'Invalid argument' + resultIsNull: 'Invalid argument', }); // Verify that passing NULL to napi_get_property() results in the correct @@ -273,7 +273,7 @@ assert.deepStrictEqual(test_object.TestGetProperty(), { envIsNull: 'Invalid argument', objectIsNull: 'Invalid argument', keyIsNull: 'Invalid argument', - resultIsNull: 'Invalid argument' + resultIsNull: 'Invalid argument', }); { diff --git a/test/js-native-api/test_object/test_null.js b/test/js-native-api/test_object/test_null.js index c94aa0fc84f19d..fb998c5a636a0b 100644 --- a/test/js-native-api/test_object/test_null.js +++ b/test/js-native-api/test_object/test_null.js @@ -9,7 +9,7 @@ const expectedForProperty = { envIsNull: 'Invalid argument', objectIsNull: 'Invalid argument', keyIsNull: 'Invalid argument', - valueIsNull: 'Invalid argument' + valueIsNull: 'Invalid argument', }; assert.deepStrictEqual(testNull.setProperty(), expectedForProperty); assert.deepStrictEqual(testNull.getProperty(), expectedForProperty); @@ -27,7 +27,7 @@ assert.deepStrictEqual(testNull.hasNamedProperty(), expectedForProperty); const expectedForElement = { envIsNull: 'Invalid argument', objectIsNull: 'Invalid argument', - valueIsNull: 'Invalid argument' + valueIsNull: 'Invalid argument', }; assert.deepStrictEqual(testNull.setElement(), expectedForElement); assert.deepStrictEqual(testNull.getElement(), expectedForElement); diff --git a/test/known_issues/test-http-path-contains-unicode.js b/test/known_issues/test-http-path-contains-unicode.js index d899fab07c43bb..dbc3eb97ce70c4 100644 --- a/test/known_issues/test-http-path-contains-unicode.js +++ b/test/known_issues/test-http-path-contains-unicode.js @@ -27,7 +27,7 @@ server.listen(0, () => { http.request({ port: server.address().port, path: expected, - method: 'GET' + method: 'GET', }, common.mustCall(function(res) { res.resume(); })).on('error', function(e) { diff --git a/test/known_issues/test-repl-require-context.js b/test/known_issues/test-repl-require-context.js index 2b8737b8671669..193a65eab2dc86 100644 --- a/test/known_issues/test-repl-require-context.js +++ b/test/known_issues/test-repl-require-context.js @@ -11,7 +11,7 @@ const fixture = path('is-object.js'); const r = repl.start({ input: inputStream, output: outputStream, - useGlobal: false + useGlobal: false, }); let output = ''; diff --git a/test/known_issues/test-vm-ownkeys.js b/test/known_issues/test-vm-ownkeys.js index f245b0f7b52a37..9d1bae72b50c28 100644 --- a/test/known_issues/test-vm-ownkeys.js +++ b/test/known_issues/test-vm-ownkeys.js @@ -8,7 +8,7 @@ const sym1 = Symbol('1'); const sym2 = Symbol('2'); const sandbox = { a: true, - [sym1]: true + [sym1]: true, }; Object.defineProperty(sandbox, 'b', { value: true }); Object.defineProperty(sandbox, sym2, { value: true }); diff --git a/test/known_issues/test-vm-ownpropertynames.js b/test/known_issues/test-vm-ownpropertynames.js index d1c03186ab19ee..41f6822ee1a47f 100644 --- a/test/known_issues/test-vm-ownpropertynames.js +++ b/test/known_issues/test-vm-ownpropertynames.js @@ -8,7 +8,7 @@ const sym1 = Symbol('1'); const sym2 = Symbol('2'); const sandbox = { a: true, - [sym1]: true + [sym1]: true, }; Object.defineProperty(sandbox, 'b', { value: true }); Object.defineProperty(sandbox, sym2, { value: true }); diff --git a/test/known_issues/test-vm-ownpropertysymbols.js b/test/known_issues/test-vm-ownpropertysymbols.js index 2f501627907164..676133cc9ecaea 100644 --- a/test/known_issues/test-vm-ownpropertysymbols.js +++ b/test/known_issues/test-vm-ownpropertysymbols.js @@ -8,7 +8,7 @@ const sym1 = Symbol('1'); const sym2 = Symbol('2'); const sandbox = { a: true, - [sym1]: true + [sym1]: true, }; Object.defineProperty(sandbox, 'b', { value: true }); Object.defineProperty(sandbox, sym2, { value: true }); diff --git a/test/known_issues/test-vm-timeout-escape-nexttick.js b/test/known_issues/test-vm-timeout-escape-nexttick.js index c6967cd742f9f3..1fab10f577fee9 100644 --- a/test/known_issues/test-vm-timeout-escape-nexttick.js +++ b/test/known_issues/test-vm-timeout-escape-nexttick.js @@ -36,11 +36,11 @@ for (let i = 0; i < 4; i++) { { hrtime, nextTick, - loop + loop, }, { timeout: common.platformTimeout(10) } ); }, { - code: 'ERR_SCRIPT_EXECUTION_TIMEOUT' + code: 'ERR_SCRIPT_EXECUTION_TIMEOUT', }); } diff --git a/test/known_issues/test-vm-timeout-escape-queuemicrotask.js b/test/known_issues/test-vm-timeout-escape-queuemicrotask.js index c8333bd044702b..6088e19e3e15c5 100644 --- a/test/known_issues/test-vm-timeout-escape-queuemicrotask.js +++ b/test/known_issues/test-vm-timeout-escape-queuemicrotask.js @@ -33,11 +33,11 @@ assert.throws(() => { { hrtime, queueMicrotask, - loop + loop, }, { timeout, microtaskMode: 'afterScriptRun' } ); }, { code: 'ERR_SCRIPT_EXECUTION_TIMEOUT', - message: `Script execution timed out after ${timeout}ms` + message: `Script execution timed out after ${timeout}ms`, }); diff --git a/test/message/async_error_eval_cjs.js b/test/message/async_error_eval_cjs.js index 820507beda9937..d76cabeab116d7 100644 --- a/test/message/async_error_eval_cjs.js +++ b/test/message/async_error_eval_cjs.js @@ -29,7 +29,7 @@ main(); '-e', main, ], { - env: { ...process.env } + env: { ...process.env }, }); if (child.status !== 0) { diff --git a/test/message/async_error_eval_esm.js b/test/message/async_error_eval_esm.js index dfab2b8a8264e9..efacef779b1712 100644 --- a/test/message/async_error_eval_esm.js +++ b/test/message/async_error_eval_esm.js @@ -31,7 +31,7 @@ main(); '-e', main, ], { - env: { ...process.env } + env: { ...process.env }, }); if (child.status !== 0) { diff --git a/test/message/console_low_stack_space.js b/test/message/console_low_stack_space.js index 4834ffd9cd0b36..8954b777d464f6 100644 --- a/test/message/console_low_stack_space.js +++ b/test/message/console_low_stack_space.js @@ -4,7 +4,7 @@ const consoleDescriptor = Object.getOwnPropertyDescriptor(global, 'console'); Object.defineProperty(global, 'console', { configurable: true, writable: true, - value: {} + value: {}, }); require('../common'); diff --git a/test/message/esm_display_syntax_error_import.mjs b/test/message/esm_display_syntax_error_import.mjs index 2173cb2b2e3a71..566cf0fccec232 100644 --- a/test/message/esm_display_syntax_error_import.mjs +++ b/test/message/esm_display_syntax_error_import.mjs @@ -2,5 +2,5 @@ import '../common/index.mjs'; import { foo, - notfound + notfound, } from '../fixtures/es-module-loaders/module-named-exports.mjs'; diff --git a/test/message/esm_loader_not_found_cjs_hint_bare.js b/test/message/esm_loader_not_found_cjs_hint_bare.js index 437fa2d3d430a1..b3b4ee8c94a3d2 100644 --- a/test/message/esm_loader_not_found_cjs_hint_bare.js +++ b/test/message/esm_loader_not_found_cjs_hint_bare.js @@ -12,6 +12,6 @@ spawn( ], { cwd: fixturesDir, - stdio: 'inherit' + stdio: 'inherit', } ); diff --git a/test/message/vm_dont_display_runtime_error.js b/test/message/vm_dont_display_runtime_error.js index 72568a21c7c339..83c4f6091ce098 100644 --- a/test/message/vm_dont_display_runtime_error.js +++ b/test/message/vm_dont_display_runtime_error.js @@ -28,7 +28,7 @@ console.error('beginning'); try { vm.runInThisContext('throw new Error("boo!")', { filename: 'test.vm', - displayErrors: false + displayErrors: false, }); } catch {} @@ -36,7 +36,7 @@ console.error('middle'); vm.runInThisContext('throw new Error("boo!")', { filename: 'test.vm', - displayErrors: false + displayErrors: false, }); console.error('end'); diff --git a/test/message/vm_dont_display_syntax_error.js b/test/message/vm_dont_display_syntax_error.js index 7e588c5095741a..215132351b7f91 100644 --- a/test/message/vm_dont_display_syntax_error.js +++ b/test/message/vm_dont_display_syntax_error.js @@ -28,7 +28,7 @@ console.error('beginning'); try { vm.runInThisContext('var 5;', { filename: 'test.vm', - displayErrors: false + displayErrors: false, }); } catch {} @@ -36,7 +36,7 @@ console.error('middle'); vm.runInThisContext('var 5;', { filename: 'test.vm', - displayErrors: false + displayErrors: false, }); console.error('end'); diff --git a/test/node-api/test_async/test-async-hooks.js b/test/node-api/test_async/test-async-hooks.js index e7879c5ad2b686..956d210f3f0832 100644 --- a/test/node-api/test_async/test-async-hooks.js +++ b/test/node-api/test_async/test-async-hooks.js @@ -29,7 +29,7 @@ async_hooks.createHook({ if (testId === id) { events.push({ type: 'destroy', id }); } - } + }, }).enable(); const resource = { foo: 'foo' }; diff --git a/test/node-api/test_callback_scope/test-async-hooks.js b/test/node-api/test_callback_scope/test-async-hooks.js index 22074428883d6b..2ae8da5ea2f31f 100644 --- a/test/node-api/test_callback_scope/test-async-hooks.js +++ b/test/node-api/test_callback_scope/test-async-hooks.js @@ -31,7 +31,7 @@ async_hooks.createHook({ after: common.mustCall((id) => { assert.strictEqual(id, expectedId); insideHook = false; - }) + }), }).enable(); runInCallbackScope(expectedResource, expectedResourceType, () => { diff --git a/test/node-api/test_policy/test_policy.js b/test/node-api/test_policy/test_policy.js index b69dbded585891..d6cb12b56cb683 100644 --- a/test/node-api/test_policy/test_policy.js +++ b/test/node-api/test_policy/test_policy.js @@ -57,9 +57,9 @@ function test(shouldFail, resources) { test(false, [{ url: depURL, - integrity: `sha256-${hash('sha256', depBody)}` + integrity: `sha256-${hash('sha256', depBody)}`, }]); test(true, [{ url: depURL, - integrity: `sha256akjsalkjdlaskjdk-${hash('sha256', depBody)}` + integrity: `sha256akjsalkjdlaskjdk-${hash('sha256', depBody)}`, }]); diff --git a/test/node-api/test_threadsafe_function/test.js b/test/node-api/test_threadsafe_function/test.js index ff8a7d80849079..8cb033419bf41a 100644 --- a/test/node-api/test_threadsafe_function/test.js +++ b/test/node-api/test_threadsafe_function/test.js @@ -63,7 +63,7 @@ function testUnref(queueSize) { return new Promise((resolve, reject) => { let output = ''; const child = fork(__filename, ['child', queueSize], { - stdio: [process.stdin, 'pipe', process.stderr, 'ipc'] + stdio: [process.stdin, 'pipe', process.stderr, 'ipc'], }); child.on('close', (code) => { if (code === 0) { @@ -99,7 +99,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { .then(() => testWithJSMarshaller({ threadStarter: 'StartThread', maxQueueSize: binding.MAX_QUEUE_SIZE, - quitAfter: binding.ARRAY_LENGTH + quitAfter: binding.ARRAY_LENGTH, })) .then((result) => assert.deepStrictEqual(result, expectedArray)) @@ -110,7 +110,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { .then(() => testWithJSMarshaller({ threadStarter: 'StartThreadNoJsFunc', maxQueueSize: binding.MAX_QUEUE_SIZE, - quitAfter: binding.ARRAY_LENGTH + quitAfter: binding.ARRAY_LENGTH, })) .then((result) => assert.deepStrictEqual(result, expectedArray)) @@ -119,7 +119,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { .then(() => testWithJSMarshaller({ threadStarter: 'StartThread', maxQueueSize: 0, - quitAfter: binding.ARRAY_LENGTH + quitAfter: binding.ARRAY_LENGTH, })) .then((result) => assert.deepStrictEqual(result, expectedArray)) @@ -128,7 +128,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { .then(() => testWithJSMarshaller({ threadStarter: 'StartThreadNonblocking', maxQueueSize: binding.MAX_QUEUE_SIZE, - quitAfter: binding.ARRAY_LENGTH + quitAfter: binding.ARRAY_LENGTH, })) .then((result) => assert.deepStrictEqual(result, expectedArray)) @@ -137,7 +137,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { .then(() => testWithJSMarshaller({ threadStarter: 'StartThread', maxQueueSize: binding.MAX_QUEUE_SIZE, - quitAfter: 1 + quitAfter: 1, })) .then((result) => assert.deepStrictEqual(result, expectedArray)) @@ -146,7 +146,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { .then(() => testWithJSMarshaller({ threadStarter: 'StartThread', maxQueueSize: 0, - quitAfter: 1 + quitAfter: 1, })) .then((result) => assert.deepStrictEqual(result, expectedArray)) @@ -155,7 +155,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { .then(() => testWithJSMarshaller({ threadStarter: 'StartThreadNonblocking', maxQueueSize: binding.MAX_QUEUE_SIZE, - quitAfter: 1 + quitAfter: 1, })) .then((result) => assert.deepStrictEqual(result, expectedArray)) @@ -166,7 +166,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { threadStarter: 'StartThread', quitAfter: 1, maxQueueSize: binding.MAX_QUEUE_SIZE, - launchSecondary: true + launchSecondary: true, })) .then((result) => assert.deepStrictEqual(result, expectedArray)) @@ -177,7 +177,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { threadStarter: 'StartThreadNonblocking', quitAfter: 1, maxQueueSize: binding.MAX_QUEUE_SIZE, - launchSecondary: true + launchSecondary: true, })) .then((result) => assert.deepStrictEqual(result, expectedArray)) @@ -187,7 +187,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { threadStarter: 'StartThread', quitAfter: 1, maxQueueSize: binding.MAX_QUEUE_SIZE, - abort: true + abort: true, })) .then((result) => assert.strictEqual(result.indexOf(0), -1)) @@ -197,7 +197,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { threadStarter: 'StartThread', quitAfter: 1, maxQueueSize: 0, - abort: true + abort: true, })) .then((result) => assert.strictEqual(result.indexOf(0), -1)) @@ -207,7 +207,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { threadStarter: 'StartThreadNonblocking', quitAfter: 1, maxQueueSize: binding.MAX_QUEUE_SIZE, - abort: true + abort: true, })) .then((result) => assert.strictEqual(result.indexOf(0), -1)) @@ -216,7 +216,7 @@ new Promise(function testWithoutJSMarshaller(resolve) { .then(() => testWithJSMarshaller({ threadStarter: 'StartThreadNonblocking', maxQueueSize: binding.ARRAY_LENGTH >>> 1, - quitAfter: binding.ARRAY_LENGTH + quitAfter: binding.ARRAY_LENGTH, })) .then((result) => assert.deepStrictEqual(result, expectedArray)) diff --git a/test/parallel/test-assert-async.js b/test/parallel/test-assert-async.js index dd98c0a23339ec..b3dee018d55cac 100644 --- a/test/parallel/test-assert-async.js +++ b/test/parallel/test-assert-async.js @@ -36,7 +36,7 @@ const invalidThenableFunc = () => { const errObj = { code: 'ERR_ASSERTION', name: 'AssertionError', - message: 'Failed' + message: 'Failed', }; // `assert.rejects` accepts a function or a promise @@ -48,7 +48,7 @@ const invalidThenableFunc = () => { then: (fulfill, reject) => { reject({ code: 'FAIL' }); }, - catch: () => {} + catch: () => {}, }; promises.push(assert.rejects(validRejectingThenable, { code: 'FAIL' })); @@ -57,13 +57,13 @@ const invalidThenableFunc = () => { promises.push(assert.rejects( assert.rejects(invalidThenable, {}), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) ); promises.push(assert.rejects( assert.rejects(invalidThenableFunc, {}), { - code: 'ERR_INVALID_RETURN_VALUE' + code: 'ERR_INVALID_RETURN_VALUE', }) ); @@ -104,7 +104,7 @@ const invalidThenableFunc = () => { name: 'TypeError', code: 'ERR_INVALID_RETURN_VALUE', message: 'Expected instance of Promise to be returned ' + - 'from the "promiseFn" function but got type undefined.' + 'from the "promiseFn" function but got type undefined.', })); promise = assert.rejects(Promise.resolve(), common.mustNotCall()); @@ -126,7 +126,7 @@ promises.push(assert.rejects( { code: 'ERR_INVALID_ARG_TYPE', message: 'The "promiseFn" argument must be of type function or an ' + - "instance of Promise. Received type string ('fail')" + "instance of Promise. Received type string ('fail')", } )); @@ -164,7 +164,7 @@ promises.push(assert.rejects( message: 'Expected instance of Promise to be returned ' + 'from the "promiseFn" function but got instance of Map.', code: 'ERR_INVALID_RETURN_VALUE', - name: 'TypeError' + name: 'TypeError', })); promises.push(assert.doesNotReject(async () => {})); promises.push(assert.doesNotReject(Promise.resolve())); @@ -175,19 +175,19 @@ promises.push(assert.rejects( then: (fulfill, reject) => { fulfill(); }, - catch: () => {} + catch: () => {}, }; promises.push(assert.doesNotReject(validFulfillingThenable)); promises.push(assert.rejects( assert.doesNotReject(invalidThenable), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) ); promises.push(assert.rejects( assert.doesNotReject(invalidThenableFunc), { - code: 'ERR_INVALID_RETURN_VALUE' + code: 'ERR_INVALID_RETURN_VALUE', }) ); @@ -226,7 +226,7 @@ promises.push(assert.rejects( { code: 'ERR_INVALID_ARG_TYPE', message: 'The "promiseFn" argument must be of type ' + - 'function or an instance of Promise. Received type number (123)' + 'function or an instance of Promise. Received type number (123)', } )); /* eslint-enable no-restricted-syntax */ diff --git a/test/parallel/test-assert-builtins-not-read-from-filesystem.js b/test/parallel/test-assert-builtins-not-read-from-filesystem.js index 7a713a2ea432c1..622d160b04a60e 100644 --- a/test/parallel/test-assert-builtins-not-read-from-filesystem.js +++ b/test/parallel/test-assert-builtins-not-read-from-filesystem.js @@ -42,7 +42,7 @@ if (process.argv[2] !== 'child') { assert.throws( () => e.emit('hello', false), { - message: 'false == true' + message: 'false == true', } ); } diff --git a/test/parallel/test-assert-checktag.js b/test/parallel/test-assert-checktag.js index c0b80adffcaa1a..3cd23d5a3f68bf 100644 --- a/test/parallel/test-assert-checktag.js +++ b/test/parallel/test-assert-checktag.js @@ -27,14 +27,14 @@ if (process.stdout.isTTY) () => assert.deepStrictEqual(date, fake), { message: 'Expected values to be strictly deep-equal:\n' + - '+ actual - expected\n\n+ 2016-01-01T00:00:00.000Z\n- Date {}' + '+ actual - expected\n\n+ 2016-01-01T00:00:00.000Z\n- Date {}', } ); assert.throws( () => assert.deepStrictEqual(fake, date), { message: 'Expected values to be strictly deep-equal:\n' + - '+ actual - expected\n\n+ Date {}\n- 2016-01-01T00:00:00.000Z' + '+ actual - expected\n\n+ Date {}\n- 2016-01-01T00:00:00.000Z', } ); } diff --git a/test/parallel/test-assert-deep.js b/test/parallel/test-assert-deep.js index c74ca48d26cb74..41b5caa4517f8d 100644 --- a/test/parallel/test-assert-deep.js +++ b/test/parallel/test-assert-deep.js @@ -25,14 +25,14 @@ function re(literals, ...values) { maxArrayLength: Infinity, breakLength: Infinity, sorted: true, - getters: true + getters: true, }); // Need to escape special characters. result += `${str}${literals[i + 1]}`; } return { code: 'ERR_ASSERTION', - message: result + message: result, }; } @@ -52,7 +52,7 @@ assert.throws( code: 'ERR_ASSERTION', message: `${defaultMsgStartFull} ... Lines skipped\n\n` + '+ Uint8Array(4) [\n' + - '- Buffer(4) [Uint8Array] [\n 120,\n...\n 122,\n 10\n ]' + '- Buffer(4) [Uint8Array] [\n 120,\n...\n 122,\n 10\n ]', } ); assert.deepEqual(arr, buf); @@ -72,7 +72,7 @@ assert.deepEqual(arr, buf); ' 122,\n' + ' 10,\n' + '+ prop: 1\n' + - ' ]' + ' ]', } ); assert.notDeepEqual(buf2, buf); @@ -92,7 +92,7 @@ assert.deepEqual(arr, buf); ' 122,\n' + ' 10,\n' + '- prop: 5\n' + - ' ]' + ' ]', } ); assert.notDeepEqual(arr, arr2); @@ -116,7 +116,7 @@ assert.throws( code: 'ERR_ASSERTION', message: `${defaultMsgStartFull}\n\n` + '+ 2016-01-01T00:00:00.000Z\n- MyDate 2016-01-01T00:00:00.000Z' + - " {\n- '0': '1'\n- }" + " {\n- '0': '1'\n- }", } ); assert.throws( @@ -125,7 +125,7 @@ assert.throws( code: 'ERR_ASSERTION', message: `${defaultMsgStartFull}\n\n` + '+ MyDate 2016-01-01T00:00:00.000Z {\n' + - "+ '0': '1'\n+ }\n- 2016-01-01T00:00:00.000Z" + "+ '0': '1'\n+ }\n- 2016-01-01T00:00:00.000Z", } ); @@ -145,7 +145,7 @@ assert.throws( { code: 'ERR_ASSERTION', message: `${defaultMsgStartFull}\n\n` + - "+ /test/\n- MyRegExp /test/ {\n- '0': '1'\n- }" + "+ /test/\n- MyRegExp /test/ {\n- '0': '1'\n- }", } ); @@ -524,7 +524,7 @@ assertNotDeepOrStrict( { code: 'ERR_ASSERTION', message: `${defaultMsgStartFull}\n\n` + - " Map(1) {\n+ 1 => 1\n- 1 => '1'\n }" + " Map(1) {\n+ 1 => 1\n- 1 => '1'\n }", } ); } @@ -667,14 +667,14 @@ assertDeepAndStrictEqual(-0, -0); assert.throws( () => assert.notDeepEqual(1, true), { - message: /1\n\nshould not loosely deep-equal\n\ntrue/ + message: /1\n\nshould not loosely deep-equal\n\ntrue/, } ); assert.throws( () => assert.notDeepEqual(1, 1), { - message: /Expected "actual" not to be loosely deep-equal to:\n\n1/ + message: /Expected "actual" not to be loosely deep-equal to:\n\n1/, } ); @@ -741,7 +741,7 @@ assertDeepAndStrictEqual(a1, a2); // Having an identical prototype property. const nbRoot = { - toString() { return `${this.first} ${this.last}`; } + toString() { return `${this.first} ${this.last}`; }, }; function nameBuilder(first, last) { @@ -807,7 +807,7 @@ assert.throws( { name: 'AssertionError', message: 'Expected "actual" not to be strictly deep-equal to:\n\n' + - util.inspect(new Date(2000, 3, 14)) + util.inspect(new Date(2000, 3, 14)), } ); @@ -818,35 +818,35 @@ assert.throws( { code: 'ERR_ASSERTION', name: 'AssertionError', - message: `${defaultMsgStartFull}\n\n+ /ab/\n- /a/` + message: `${defaultMsgStartFull}\n\n+ /ab/\n- /a/`, }); assert.throws( () => assert.deepStrictEqual(/a/g, /a/), { code: 'ERR_ASSERTION', name: 'AssertionError', - message: `${defaultMsgStartFull}\n\n+ /a/g\n- /a/` + message: `${defaultMsgStartFull}\n\n+ /a/g\n- /a/`, }); assert.throws( () => assert.deepStrictEqual(/a/i, /a/), { code: 'ERR_ASSERTION', name: 'AssertionError', - message: `${defaultMsgStartFull}\n\n+ /a/i\n- /a/` + message: `${defaultMsgStartFull}\n\n+ /a/i\n- /a/`, }); assert.throws( () => assert.deepStrictEqual(/a/m, /a/), { code: 'ERR_ASSERTION', name: 'AssertionError', - message: `${defaultMsgStartFull}\n\n+ /a/m\n- /a/` + message: `${defaultMsgStartFull}\n\n+ /a/m\n- /a/`, }); assert.throws( () => assert.deepStrictEqual(/aa/igm, /aa/im), { code: 'ERR_ASSERTION', name: 'AssertionError', - message: `${defaultMsgStartFull}\n\n+ /aa/gim\n- /aa/im\n ^` + message: `${defaultMsgStartFull}\n\n+ /aa/gim\n- /aa/im\n ^`, }); { @@ -872,7 +872,7 @@ assert.throws(() => assert.deepStrictEqual([4], ['4']), { code: 'ERR_ASSERTION', name: 'AssertionError', - message: `${defaultMsgStartFull}\n\n [\n+ 4\n- '4'\n ]` + message: `${defaultMsgStartFull}\n\n [\n+ 4\n- '4'\n ]`, }); assert.throws( () => assert.deepStrictEqual({ a: 4 }, { a: 4, b: true }), @@ -880,7 +880,7 @@ assert.throws( code: 'ERR_ASSERTION', name: 'AssertionError', message: `${defaultMsgStartFull}\n\n ` + - '{\n a: 4,\n- b: true\n }' + '{\n a: 4,\n- b: true\n }', }); assert.throws( () => assert.deepStrictEqual(['a'], { 0: 'a' }), @@ -888,7 +888,7 @@ assert.throws( code: 'ERR_ASSERTION', name: 'AssertionError', message: `${defaultMsgStartFull}\n\n` + - "+ [\n+ 'a'\n+ ]\n- {\n- '0': 'a'\n- }" + "+ [\n+ 'a'\n+ ]\n- {\n- '0': 'a'\n- }", }); /* eslint-enable */ @@ -950,7 +950,7 @@ assertDeepAndStrictEqual(obj1, obj2); " ' }',\n" + "+ operator: 'deepStrictEqual'\n" + "- operator: 'throws'\n" + - ' }' + ' }', } ); } @@ -969,13 +969,13 @@ assertDeepAndStrictEqual(obj1, obj2); util.inspect.defaultOptions = tmp; const invalidTrap = new Proxy([1, 2, 3], { - ownKeys() { return []; } + ownKeys() { return []; }, }); assert.throws( () => assert.deepStrictEqual(invalidTrap, [1, 2, 3]), { name: 'TypeError', - message: "'ownKeys' on proxy: trap result did not include 'length'" + message: "'ownKeys' on proxy: trap result did not include 'length'", } ); } @@ -996,7 +996,7 @@ assertDeepAndStrictEqual(obj1, obj2); { code: 'ERR_ASSERTION', name: 'AssertionError', - message: /\.\.\./g + message: /\.\.\./g, } ); } @@ -1025,7 +1025,7 @@ assert.throws( ' 1,\n' + ' 2,\n' + '+ 3\n' + - ' ]' + ' ]', } ); @@ -1035,7 +1035,7 @@ assert.throws( const a = new Date('2000'); const b = new Date('2000'); Object.defineProperty(a, 'getTime', { - value: () => 5 + value: () => 5, }); assertDeepAndStrictEqual(a, b); } @@ -1060,14 +1060,14 @@ assert.throws( const a = { 0: 1, 1: 1, - 2: 'broken' + 2: 'broken', }; Object.setPrototypeOf(a, Object.getPrototypeOf([])); Object.defineProperty(a, Symbol.toStringTag, { value: 'Array', }); Object.defineProperty(a, 'length', { - value: 2 + value: 2, }); assertNotDeepOrStrict(a, [1, 1]); } @@ -1100,10 +1100,10 @@ assert.throws( const a = new Number(5); const b = new Number(5); Object.defineProperty(a, 'valueOf', { - value: () => { throw new Error('failed'); } + value: () => { throw new Error('failed'); }, }); Object.defineProperty(b, 'valueOf', { - value: () => { throw new Error('failed'); } + value: () => { throw new Error('failed'); }, }); assertDeepAndStrictEqual(a, b); } @@ -1111,17 +1111,17 @@ assert.throws( // Check getters. { const a = { - get a() { return 5; } + get a() { return 5; }, }; const b = { - get a() { return 6; } + get a() { return 6; }, }; assert.throws( () => assert.deepStrictEqual(a, b), { code: 'ERR_ASSERTION', name: 'AssertionError', - message: /a: \[Getter: 5]\n- a: \[Getter: 6]\n / + message: /a: \[Getter: 5]\n- a: \[Getter: 6]\n /, } ); @@ -1137,14 +1137,14 @@ assert.throws( Object.getOwnPropertyDescriptors(a) ); Object.defineProperty(b, Symbol.toStringTag, { - value: 'Uint8Array' + value: 'Uint8Array', }); assertNotDeepOrStrict(a, b); a = new Uint8Array(10); b = new Int8Array(10); Object.defineProperty(b, Symbol.toStringTag, { - value: 'Uint8Array' + value: 'Uint8Array', }); Object.setPrototypeOf(b, Uint8Array.prototype); assertNotDeepOrStrict(a, b); @@ -1154,7 +1154,7 @@ assert.throws( Object.setPrototypeOf(b, Array.prototype); Object.defineProperty(b, 'length', { value: 3, enumerable: false }); Object.defineProperty(b, Symbol.toStringTag, { - value: 'Array' + value: 'Array', }); assertNotDeepOrStrict(a, b); @@ -1164,7 +1164,7 @@ assert.throws( Object.getOwnPropertyDescriptors(a) ); Object.defineProperty(b, Symbol.toStringTag, { - value: 'Date' + value: 'Date', }); assertNotDeepOrStrict(a, b); @@ -1174,7 +1174,7 @@ assert.throws( Object.getOwnPropertyDescriptors(a) ); Object.defineProperty(b, Symbol.toStringTag, { - value: 'RegExp' + value: 'RegExp', }); assertNotDeepOrStrict(a, b); @@ -1182,14 +1182,14 @@ assert.throws( b = /abc/; Object.setPrototypeOf(b, Array.prototype); Object.defineProperty(b, Symbol.toStringTag, { - value: 'Array' + value: 'Array', }); assertNotDeepOrStrict(a, b); a = Object.create(null); b = new RangeError('abc'); Object.defineProperty(a, Symbol.toStringTag, { - value: 'Error' + value: 'Error', }); Object.setPrototypeOf(b, null); assertNotDeepOrStrict(a, b, assert.AssertionError); diff --git a/test/parallel/test-assert-fail-deprecation.js b/test/parallel/test-assert-fail-deprecation.js index 5f51d27e3cfc0f..e9bebc125d4218 100644 --- a/test/parallel/test-assert-fail-deprecation.js +++ b/test/parallel/test-assert-fail-deprecation.js @@ -20,7 +20,7 @@ assert.throws(() => { operator: '!=', actual: 'first', expected: 'second', - generatedMessage: true + generatedMessage: true, }); // Three args @@ -33,7 +33,7 @@ assert.throws(() => { operator: 'fail', actual: 'ignored', expected: 'ignored', - generatedMessage: false + generatedMessage: false, }); // Three args with custom Error @@ -41,7 +41,7 @@ assert.throws(() => { assert.fail(typeof 1, 'object', new TypeError('another custom message')); }, { name: 'TypeError', - message: 'another custom message' + message: 'another custom message', }); // No third arg (but a fourth arg) @@ -53,7 +53,7 @@ assert.throws(() => { message: '\'first\' operator \'second\'', operator: 'operator', actual: 'first', - expected: 'second' + expected: 'second', }); // The stackFrameFunction should exclude the foo frame diff --git a/test/parallel/test-assert-fail.js b/test/parallel/test-assert-fail.js index e2003f2ce91da8..c3467dbdccc411 100644 --- a/test/parallel/test-assert-fail.js +++ b/test/parallel/test-assert-fail.js @@ -14,7 +14,7 @@ assert.throws( actual: undefined, expected: undefined, generatedMessage: true, - stack: /Failed/ + stack: /Failed/, } ); @@ -28,7 +28,7 @@ assert.throws(() => { operator: 'fail', actual: undefined, expected: undefined, - generatedMessage: false + generatedMessage: false, }); // One arg = Error @@ -36,5 +36,5 @@ assert.throws(() => { assert.fail(new TypeError('custom message')); }, { name: 'TypeError', - message: 'custom message' + message: 'custom message', }); diff --git a/test/parallel/test-assert-first-line.js b/test/parallel/test-assert-first-line.js index f9d4a8b06cbea0..955fbb45bed138 100644 --- a/test/parallel/test-assert-first-line.js +++ b/test/parallel/test-assert-first-line.js @@ -10,7 +10,7 @@ assert.throws( () => require(path('assert-first-line')), { name: 'AssertionError', - message: "The expression evaluated to a falsy value:\n\n ässört.ok('')\n" + message: "The expression evaluated to a falsy value:\n\n ässört.ok('')\n", } ); @@ -18,6 +18,6 @@ assert.throws( () => require(path('assert-long-line')), { name: 'AssertionError', - message: "The expression evaluated to a falsy value:\n\n assert.ok('')\n" + message: "The expression evaluated to a falsy value:\n\n assert.ok('')\n", } ); diff --git a/test/parallel/test-assert-if-error.js b/test/parallel/test-assert-if-error.js index 76539bb69b44f0..8332346d8f1976 100644 --- a/test/parallel/test-assert-if-error.js +++ b/test/parallel/test-assert-if-error.js @@ -42,28 +42,28 @@ const stack = err.stack; assert.throws( () => assert.ifError(new TypeError()), { - message: 'ifError got unwanted exception: TypeError' + message: 'ifError got unwanted exception: TypeError', } ); assert.throws( () => assert.ifError({ stack: false }), { - message: 'ifError got unwanted exception: { stack: false }' + message: 'ifError got unwanted exception: { stack: false }', } ); assert.throws( () => assert.ifError({ constructor: null, message: '' }), { - message: 'ifError got unwanted exception: ' + message: 'ifError got unwanted exception: ', } ); assert.throws( () => { assert.ifError(false); }, { - message: 'ifError got unwanted exception: false' + message: 'ifError got unwanted exception: false', } ); diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 80a55094b73ecf..9a0e27000f498f 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -87,7 +87,7 @@ assert.throws( () => a.notStrictEqual(2, 2), { message: 'Expected "actual" to be strictly unequal to: 2', - name: 'AssertionError' + name: 'AssertionError', } ); @@ -96,7 +96,7 @@ assert.throws( { message: 'Expected "actual" to be strictly unequal to:\n\n' + `'${'a '.repeat(30)}'`, - name: 'AssertionError' + name: 'AssertionError', } ); @@ -104,7 +104,7 @@ assert.throws( () => a.notEqual(1, 1), { message: '1 != 1', - operator: '!=' + operator: '!=', } ); @@ -134,7 +134,7 @@ assert.throws( name: 'AssertionError', operator: 'throws', message: 'The error is expected to be an instance of "AssertionError". ' + - 'Received "TypeError"\n\nError message:\n\n[object Object]' + 'Received "TypeError"\n\nError message:\n\n[object Object]', } ); @@ -170,7 +170,7 @@ assert.throws( code: 'ERR_ASSERTION', operator: 'doesNotThrow', message: 'Got unwanted exception: user message\n' + - 'Actual message: "[object Object]"' + 'Actual message: "[object Object]"', } ); @@ -178,7 +178,7 @@ assert.throws( () => a.doesNotThrow(() => thrower(Error)), { code: 'ERR_ASSERTION', - message: 'Got unwanted exception.\nActual message: "[object Object]"' + message: 'Got unwanted exception.\nActual message: "[object Object]"', } ); @@ -189,7 +189,7 @@ assert.throws( code: 'ERR_ASSERTION', operator: 'doesNotThrow', message: 'Got unwanted exception: user message\n' + - 'Actual message: "[object Object]"' + 'Actual message: "[object Object]"', } ); @@ -228,7 +228,7 @@ assert.throws( code: 'ERR_ASSERTION', operator: 'throws', actual: symbol, - expected: /abc/ + expected: /abc/, }); } @@ -274,7 +274,7 @@ a.throws(() => thrower(TypeError), (err) => { message: 'Missing expected exception.', operator: 'throws', actual: undefined, - expected: undefined + expected: undefined, }); assert.throws( @@ -283,7 +283,7 @@ a.throws(() => thrower(TypeError), (err) => { code: 'ERR_ASSERTION', message: 'Missing expected exception (TypeError).', actual: undefined, - expected: TypeError + expected: TypeError, }); assert.throws( @@ -292,7 +292,7 @@ a.throws(() => thrower(TypeError), (err) => { code: 'ERR_ASSERTION', message: 'Missing expected exception: fhqwhgads', actual: undefined, - expected: undefined + expected: undefined, }); assert.throws( @@ -301,7 +301,7 @@ a.throws(() => thrower(TypeError), (err) => { code: 'ERR_ASSERTION', message: 'Missing expected exception (TypeError): fhqwhgads', actual: undefined, - expected: TypeError + expected: TypeError, }); let threw = false; @@ -324,7 +324,7 @@ function testAssertionMessage(actual, expected, msg) { { generatedMessage: true, message: msg || strictEqualMessageStart + - `+ actual - expected\n\n+ ${expected}\n- ''` + `+ actual - expected\n\n+ ${expected}\n- ''`, } ); } @@ -365,7 +365,7 @@ assert.throws( () => assert.strictEqual(1, 2), { message: `${strictEqualMessageStart}\n1 !== 2\n`, - generatedMessage: true + generatedMessage: true, } ); @@ -373,7 +373,7 @@ assert.throws( () => assert.strictEqual(1, 2, 'oh no'), { message: 'oh no', - generatedMessage: false + generatedMessage: false, } ); @@ -415,7 +415,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "fn" argument must be of type function.' + - common.invalidArgTypeHelper(fn) + common.invalidArgTypeHelper(fn), } ); }; @@ -485,7 +485,7 @@ assert.throws(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), }); }); } @@ -497,7 +497,7 @@ assert.throws( name: 'AssertionError', message: 'Expected "actual" to be reference-equal to "expected":\n' + '+ actual - expected\n\n' + - '+ [Error: foo]\n- [Error: foobar]' + '+ [Error: foo]\n- [Error: foobar]', } ); @@ -528,14 +528,14 @@ a.throws( { message: 'No value argument passed to `assert.ok()`', name: 'AssertionError', - generatedMessage: true + generatedMessage: true, } ); assert.throws( () => a(), { message: 'No value argument passed to `assert.ok()`', - name: 'AssertionError' + name: 'AssertionError', } ); @@ -552,7 +552,7 @@ a.throws( code: 'ERR_ASSERTION', constructor: assert.AssertionError, message: 'The expression evaluated to a falsy value:\n\n ' + - "assert.ok(\n typeof 123 === 'string'\n )\n" + "assert.ok(\n typeof 123 === 'string'\n )\n", } ); Error.stackTraceLimit = tmpLimit; @@ -695,7 +695,7 @@ a.throws( '- {\n' + '- [Symbol(nodejs.util.inspect.custom)]: [Function (anonymous)],\n' + "- loop: 'forever'\n" + - '- }' + '- }', }); // notDeepEqual tests @@ -703,7 +703,7 @@ a.throws( () => assert.notDeepEqual([1], [1]), { message: 'Expected "actual" not to be strictly deep-equal to:\n\n' + - '[\n 1\n]\n' + '[\n 1\n]\n', } ); @@ -723,7 +723,7 @@ assert.throws( constructor: assert.AssertionError, generatedMessage: true, message: 'The expression evaluated to a falsy value:\n\n ' + - 'assert.ok(null)\n' + 'assert.ok(null)\n', } ); assert.throws( @@ -733,7 +733,7 @@ assert.throws( constructor: assert.AssertionError, generatedMessage: true, message: 'The expression evaluated to a falsy value:\n\n ' + - "assert(typeof 123n === 'string')\n" + "assert(typeof 123n === 'string')\n", } ); @@ -743,7 +743,7 @@ assert.throws( code: 'ERR_ASSERTION', constructor: assert.AssertionError, generatedMessage: false, - message: 'Symbol(foo)' + message: 'Symbol(foo)', } ); @@ -763,7 +763,7 @@ assert.throws( code: 'ERR_ASSERTION', constructor: assert.AssertionError, message: 'The expression evaluated to a falsy value:\n\n ' + - "assert(\n (Buffer.from('test') instanceof Error)\n )\n" + "assert(\n (Buffer.from('test') instanceof Error)\n )\n", } ); assert.throws( @@ -772,7 +772,7 @@ assert.throws( code: 'ERR_ASSERTION', constructor: assert.AssertionError, message: 'The expression evaluated to a falsy value:\n\n ' + - "assert(\n (Buffer.from('test') instanceof Error)\n )\n" + "assert(\n (Buffer.from('test') instanceof Error)\n )\n", } ); fs.close = tmp; @@ -798,7 +798,7 @@ assert.throws( ' ===\n' + ' 123 instanceof\n' + ' Buffer\n' + - ' )\n' + ' )\n', } ); @@ -822,7 +822,7 @@ assert.throws( ' ===\n' + ' 123 instanceof\n' + ' Buffer\n' + - ' )\n' + ' )\n', } ); @@ -841,7 +841,7 @@ Buffer ' () => \'string\')() ===\n' + ' 123 instanceof\n' + ' Buffer\n' + - ' )\n' + ' )\n', } ); /* eslint-enable indent */ @@ -854,7 +854,7 @@ assert.throws( code: 'ERR_ASSERTION', constructor: assert.AssertionError, message: 'The expression evaluated to a falsy value:\n\n ' + - 'assert(null, undefined)\n' + 'assert(null, undefined)\n', } ); @@ -867,7 +867,7 @@ assert.throws( code: 'ERR_ASSERTION', constructor: assert.AssertionError, message: 'The expression evaluated to a falsy value:\n\n ' + - 'ok(null, undefined)\n' + 'ok(null, undefined)\n', } ); @@ -878,7 +878,7 @@ assert.throws( code: 'ERR_ASSERTION', constructor: assert.AssertionError, message: 'The expression evaluated to a falsy value:\n\n ' + - 'assert[\'ok\']["apply"](null, [0])\n' + 'assert[\'ok\']["apply"](null, [0])\n', } ); @@ -890,7 +890,7 @@ assert.throws( { code: 'ERR_ASSERTION', constructor: assert.AssertionError, - message: 'The expression evaluated to a falsy value:\n\n fn(value)\n' + message: 'The expression evaluated to a falsy value:\n\n fn(value)\n', } ); @@ -901,7 +901,7 @@ assert.throws( constructor: assert.AssertionError, message: 'The expression evaluated to a falsy value:\n\n ' + 'assert.ok.call(null, 0)\n', - generatedMessage: true + generatedMessage: true, } ); @@ -911,7 +911,7 @@ assert.throws( code: 'ERR_ASSERTION', constructor: assert.AssertionError, message: 'test', - generatedMessage: false + generatedMessage: false, } ); @@ -921,14 +921,15 @@ assert.throws( { code: 'ERR_ASSERTION', constructor: assert.AssertionError, - message: 'The expression evaluated to a falsy value:\n\n assert(1 === 2)\n' + message: 'The expression evaluated to a falsy value:' + + '\n\n assert(1 === 2)\n', } ); assert.throws( () => eval('console.log("FOO");\nassert.ok(1 === 2);'), { code: 'ERR_ASSERTION', - message: 'false == true' + message: 'false == true', } ); @@ -939,7 +940,7 @@ assert.throws( name: 'TypeError', message: 'The "error" argument must be of type function or ' + 'an instance of Error, RegExp, or Object. Received type string ' + - "('Error message')" + "('Error message')", } ); @@ -954,7 +955,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', message: 'The "error" argument must be of type function or ' + 'an instance of Error, RegExp, or Object.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), } ); }); @@ -965,7 +966,7 @@ assert.throws( assert.ok((() => Boolean('' === false))()); }, { message: 'The expression evaluated to a falsy value:\n\n' + - " assert.ok((() => Boolean('\\u0001' === false))())\n" + " assert.ok((() => Boolean('\\u0001' === false))())\n", }); const errFn = () => { @@ -975,7 +976,7 @@ assert.throws( }; const errObj = { name: 'TypeError', - message: 'Wrong value' + message: 'Wrong value', }; assert.throws(errFn, errObj); @@ -996,7 +997,7 @@ assert.throws( '- foo: undefined,\n' + " message: 'Wrong value',\n" + " name: 'TypeError'\n" + - ' }' + ' }', } ); @@ -1014,7 +1015,7 @@ assert.throws( '- foo: undefined,\n' + " message: 'Wrong value',\n" + " name: 'TypeError'\n" + - ' }' + ' }', } ); @@ -1023,7 +1024,7 @@ assert.throws( { constructor: assert.AssertionError, code: 'ERR_ASSERTION', - message: 'foobar' + message: 'foobar', } ); @@ -1033,7 +1034,7 @@ assert.throws( name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "expected" argument must be of type function or an ' + - 'instance of RegExp. Received an instance of Object' + 'instance of RegExp. Received an instance of Object', } ); @@ -1048,7 +1049,7 @@ assert.throws( " message: 'e',\n" + "+ name: 'TypeError'\n" + "- name: 'Error'\n" + - ' }' + ' }', } ); assert.throws( @@ -1062,7 +1063,7 @@ assert.throws( "+ message: 'foo',\n" + "- message: '',\n" + " name: 'Error'\n" + - ' }' + ' }', } ); @@ -1074,7 +1075,7 @@ assert.throws( { name: 'AssertionError', code: 'ERR_ASSERTION', - message: 'Got unwanted exception.\nActual message: "undefined"' + message: 'Got unwanted exception.\nActual message: "undefined"', } ); } @@ -1083,7 +1084,7 @@ assert.throws( () => assert.throws(() => { throw new Error(); }, {}), { message: "The argument 'error' may not be an empty object. Received {}", - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', } ); @@ -1096,7 +1097,7 @@ assert.throws( { code: 'ERR_AMBIGUOUS_ARGUMENT', message: 'The "error/message" argument is ambiguous. ' + - 'The error "foo" is identical to the message.' + 'The error "foo" is identical to the message.', } ); @@ -1108,7 +1109,7 @@ assert.throws( { code: 'ERR_AMBIGUOUS_ARGUMENT', message: 'The "error/message" argument is ambiguous. ' + - 'The error message "foo" is identical to the message.' + 'The error message "foo" is identical to the message.', } ); /* eslint-enable no-restricted-syntax */ @@ -1120,7 +1121,7 @@ assert.throws(() => { throw null; }, 'foo'); assert.throws( () => assert.strictEqual([], []), { - message: 'Values have same structure but are not reference-equal:\n\n[]\n' + message: 'Values have same structure but are not reference-equal:\n\n[]\n', } ); @@ -1131,7 +1132,7 @@ assert.throws( { message: 'Expected "actual" to be reference-equal to "expected":\n' + '+ actual - expected\n\n' + - "+ [Arguments] {\n- {\n '0': 'a'\n }" + "+ [Arguments] {\n- {\n '0': 'a'\n }", } ); } @@ -1140,7 +1141,7 @@ assert.throws( () => { throw new TypeError('foobar'); }, { message: /foo/, - name: /^TypeError$/ + name: /^TypeError$/, } ); @@ -1149,7 +1150,7 @@ assert.throws( () => { throw new TypeError('foobar'); }, { message: /fooa/, - name: /^TypeError$/ + name: /^TypeError$/, } ), { @@ -1158,7 +1159,7 @@ assert.throws( "+ message: 'foobar',\n" + '- message: /fooa/,\n' + " name: 'TypeError'\n" + - ' }' + ' }', } ); @@ -1179,7 +1180,7 @@ assert.throws( '+ null\n' + '- {\n' + "- message: 'foo'\n" + - '- }' + '- }', } ); @@ -1195,7 +1196,7 @@ assert.throws( actual, message, operator: 'throws', - generatedMessage: false + generatedMessage: false, } ); } @@ -1210,7 +1211,7 @@ assert.throws( '+ actual - expected\n\n' + "+ 'test test'\n" + "- 'test foobar'\n" + - ' ^' + ' ^', } ); @@ -1223,7 +1224,7 @@ assert.throws( { code: 'ERR_ASSERTION', name: 'AssertionError', - message: 'Expected "actual" not to be reference-equal to "expected": {}' + message: 'Expected "actual" not to be reference-equal to "expected": {}', } ); @@ -1236,7 +1237,7 @@ assert.throws( code: 'ERR_ASSERTION', name: 'AssertionError', message: 'Expected "actual" not to be reference-equal to "expected":\n\n' + - '{\n a: true\n}\n' + '{\n a: true\n}\n', } ); @@ -1307,12 +1308,12 @@ assert.throws( const err = new assert.AssertionError({ actual: 'foo', operator: 'strictEqual', - stackStartFunction: hidden + stackStartFunction: hidden, }); const err2 = new assert.AssertionError({ actual: 'foo', operator: 'strictEqual', - stackStartFn: hidden + stackStartFn: hidden, }); assert(!err.stack.includes('hidden')); assert(!err2.stack.includes('hidden')); @@ -1323,7 +1324,7 @@ assert.throws( () => assert.throws(() => { throw Symbol('foo'); }, RangeError), { message: 'The error is expected to be an instance of "RangeError". ' + - 'Received "Symbol(foo)"' + 'Received "Symbol(foo)"', } ); @@ -1332,7 +1333,7 @@ assert.throws( () => assert.throws(() => { throw [1, 2]; }, RangeError), { message: 'The error is expected to be an instance of "RangeError". ' + - 'Received "[Array]"' + 'Received "[Array]"', } ); @@ -1364,7 +1365,7 @@ assert.throws( { message: 'The error is expected to be an instance of "RangeError". ' + 'Received an error with identical name but a different ' + - 'prototype.\n\nError message:\n\nfoobar' + 'prototype.\n\nError message:\n\nfoobar', } ); @@ -1375,7 +1376,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', message: 'The "regexp" argument must be an instance of RegExp. ' + - "Received type string ('string')" + "Received type string ('string')", } ); assert.throws( @@ -1386,7 +1387,7 @@ assert.throws( operator: 'match', message: 'The input did not match the regular expression /abc/. ' + "Input:\n\n'string'\n", - generatedMessage: true + generatedMessage: true, } ); assert.throws( @@ -1396,7 +1397,7 @@ assert.throws( expected: /abc/, operator: 'match', message: 'foobar', - generatedMessage: false + generatedMessage: false, } ); const errorMessage = new RangeError('foobar'); @@ -1412,7 +1413,7 @@ assert.throws( operator: 'match', message: 'The "string" argument must be of type string. ' + 'Received type object ({ abc: 123 })', - generatedMessage: true + generatedMessage: true, } ); assert.match('I will pass', /pass$/); @@ -1425,7 +1426,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', message: 'The "regexp" argument must be an instance of RegExp. ' + - "Received type string ('string')" + "Received type string ('string')", } ); assert.throws( @@ -1436,7 +1437,7 @@ assert.throws( operator: 'doesNotMatch', message: 'The input was expected to not match the regular expression ' + "/string/. Input:\n\n'string'\n", - generatedMessage: true + generatedMessage: true, } ); assert.throws( @@ -1446,7 +1447,7 @@ assert.throws( expected: /string/, operator: 'doesNotMatch', message: 'foobar', - generatedMessage: false + generatedMessage: false, } ); const errorMessage = new RangeError('foobar'); @@ -1462,7 +1463,7 @@ assert.throws( operator: 'doesNotMatch', message: 'The "string" argument must be of type string. ' + 'Received type object ({ abc: 123 })', - generatedMessage: true + generatedMessage: true, } ); assert.doesNotMatch('I will pass', /different$/); diff --git a/test/parallel/test-async-hooks-async-await.js b/test/parallel/test-async-hooks-async-await.js index 791adab75c8621..1eebbd7f49f78d 100644 --- a/test/parallel/test-async-hooks-async-await.js +++ b/test/parallel/test-async-hooks-async-await.js @@ -10,7 +10,7 @@ const asyncIds = []; async_hooks.createHook({ init: (asyncId, type, triggerAsyncId) => { asyncIds.push([triggerAsyncId, asyncId]); - } + }, }).enable(); async function main() { diff --git a/test/parallel/test-async-hooks-asyncresource-constructor.js b/test/parallel/test-async-hooks-asyncresource-constructor.js index 8b504aa7a79e09..50e21f6f2432e3 100644 --- a/test/parallel/test-async-hooks-asyncresource-constructor.js +++ b/test/parallel/test-async-hooks-asyncresource-constructor.js @@ -9,7 +9,7 @@ const { AsyncResource } = async_hooks; // Setup init hook such parameters are validated async_hooks.createHook({ - init() {} + init() {}, }).enable(); assert.throws(() => { diff --git a/test/parallel/test-async-hooks-close-during-destroy.js b/test/parallel/test-async-hooks-close-during-destroy.js index 6e485d2d1110f2..93d9171daa280a 100644 --- a/test/parallel/test-async-hooks-close-during-destroy.js +++ b/test/parallel/test-async-hooks-close-during-destroy.js @@ -27,7 +27,7 @@ async_hooks.createHook({ assert.fail('More than 2 destroy() invocations'); break; } - }, 2) + }, 2), }).enable(); const res1 = new async_hooks.AsyncResource('foobar'); diff --git a/test/parallel/test-async-hooks-destroy-on-gc.js b/test/parallel/test-async-hooks-destroy-on-gc.js index fe6325e189734b..4963d6c31a61a1 100644 --- a/test/parallel/test-async-hooks-destroy-on-gc.js +++ b/test/parallel/test-async-hooks-destroy-on-gc.js @@ -12,7 +12,7 @@ const destroyedIds = new Set(); async_hooks.createHook({ destroy: common.mustCallAtLeast((asyncId) => { destroyedIds.add(asyncId); - }, 1) + }, 1), }).enable(); let asyncId = null; diff --git a/test/parallel/test-async-hooks-disable-during-promise.js b/test/parallel/test-async-hooks-disable-during-promise.js index 6b9b53bd30f0f5..b1159194d36886 100644 --- a/test/parallel/test-async-hooks-disable-during-promise.js +++ b/test/parallel/test-async-hooks-disable-during-promise.js @@ -8,7 +8,7 @@ if (!common.isMainThread) const hook = async_hooks.createHook({ init: common.mustCall(2), before: common.mustCall(1), - after: common.mustNotCall() + after: common.mustNotCall(), }).enable(); Promise.resolve(1).then(common.mustCall(() => { diff --git a/test/parallel/test-async-hooks-disable-gc-tracking.js b/test/parallel/test-async-hooks-disable-gc-tracking.js index 84c5043aad3335..3491a8e93743a1 100644 --- a/test/parallel/test-async-hooks-disable-gc-tracking.js +++ b/test/parallel/test-async-hooks-disable-gc-tracking.js @@ -8,7 +8,7 @@ const common = require('../common'); const async_hooks = require('async_hooks'); const hook = async_hooks.createHook({ - destroy: common.mustCallAtLeast(1) // only 1 immediate is destroyed + destroy: common.mustCallAtLeast(1), // only 1 immediate is destroyed }).enable(); new async_hooks.AsyncResource('foobar', { requireManualDestroy: true }); diff --git a/test/parallel/test-async-hooks-enable-before-promise-resolve.js b/test/parallel/test-async-hooks-enable-before-promise-resolve.js index c96c9e5dd96655..0886f20cb76c3c 100644 --- a/test/parallel/test-async-hooks-enable-before-promise-resolve.js +++ b/test/parallel/test-async-hooks-enable-before-promise-resolve.js @@ -12,7 +12,7 @@ const promise = new Promise((resolve) => { setTimeout(() => { initialAsyncId = async_hooks.executionAsyncId(); async_hooks.createHook({ - after: common.mustCall(() => {}, 2) + after: common.mustCall(() => {}, 2), }).enable(); resolve(); }, 0); diff --git a/test/parallel/test-async-hooks-enable-disable.js b/test/parallel/test-async-hooks-enable-disable.js index b685c7123454dd..f795fb6f0afd9e 100644 --- a/test/parallel/test-async-hooks-enable-disable.js +++ b/test/parallel/test-async-hooks-enable-disable.js @@ -7,7 +7,7 @@ const hook = async_hooks.createHook({ init: common.mustCall(() => {}, 1), before: common.mustNotCall(), after: common.mustNotCall(), - destroy: common.mustNotCall() + destroy: common.mustNotCall(), }); assert.strictEqual(hook.enable(), hook); diff --git a/test/parallel/test-async-hooks-enable-during-promise.js b/test/parallel/test-async-hooks-enable-during-promise.js index ce3253b01c1279..2dfa2402ca431e 100644 --- a/test/parallel/test-async-hooks-enable-during-promise.js +++ b/test/parallel/test-async-hooks-enable-during-promise.js @@ -6,7 +6,7 @@ Promise.resolve(1).then(common.mustCall(() => { async_hooks.createHook({ init: common.mustCall(), before: common.mustCallAtLeast(), - after: common.mustCallAtLeast(2) + after: common.mustCallAtLeast(2), }).enable(); process.nextTick(common.mustCall()); diff --git a/test/parallel/test-async-hooks-enable-recursive.js b/test/parallel/test-async-hooks-enable-recursive.js index 74caebbad225ba..08aea634e3caac 100644 --- a/test/parallel/test-async-hooks-enable-recursive.js +++ b/test/parallel/test-async-hooks-enable-recursive.js @@ -5,13 +5,13 @@ const async_hooks = require('async_hooks'); const fs = require('fs'); const nestedHook = async_hooks.createHook({ - init: common.mustCall() + init: common.mustCall(), }); async_hooks.createHook({ init: common.mustCall(() => { nestedHook.enable(); - }, 2) + }, 2), }).enable(); fs.access(__filename, common.mustCall(() => { diff --git a/test/parallel/test-async-hooks-execution-async-resource-await.js b/test/parallel/test-async-hooks-execution-async-resource-await.js index 8dc04c83d73103..9c68e2364e755f 100644 --- a/test/parallel/test-async-hooks-execution-async-resource-await.js +++ b/test/parallel/test-async-hooks-execution-async-resource-await.js @@ -16,7 +16,7 @@ createHook({ init(asyncId, type, triggerAsyncId, resource) { const cr = executionAsyncResource(); resource[sym] = cr[sym]; - } + }, }).enable(); async function handler(req, res) { diff --git a/test/parallel/test-async-hooks-execution-async-resource.js b/test/parallel/test-async-hooks-execution-async-resource.js index b3a9f76ef4ec3f..bd610157903c0c 100644 --- a/test/parallel/test-async-hooks-execution-async-resource.js +++ b/test/parallel/test-async-hooks-execution-async-resource.js @@ -14,7 +14,7 @@ createHook({ init(asyncId, type, triggerAsyncId, resource) { const cr = executionAsyncResource(); resource[sym] = cr[sym]; - } + }, }).enable(); const server = createServer(function(req, res) { diff --git a/test/parallel/test-async-hooks-fatal-error.js b/test/parallel/test-async-hooks-fatal-error.js index 40c2edf329df6e..742ba1c6d250be 100644 --- a/test/parallel/test-async-hooks-fatal-error.js +++ b/test/parallel/test-async-hooks-fatal-error.js @@ -21,7 +21,7 @@ function child(type, valueType) { } // eslint-disable-next-line no-throw-literal throw null; - } + }, }).enable(); // Trigger `promiseResolve`. diff --git a/test/parallel/test-async-hooks-http-agent-destroy.js b/test/parallel/test-async-hooks-http-agent-destroy.js index 637f2c511410e7..e14bdd4d1a13d2 100644 --- a/test/parallel/test-async-hooks-http-agent-destroy.js +++ b/test/parallel/test-async-hooks-http-agent-destroy.js @@ -16,14 +16,14 @@ const destroyedIds = new Set(); async_hooks.createHook({ destroy: common.mustCallAtLeast((asyncId) => { destroyedIds.add(asyncId); - }, 1) + }, 1), }).enable(); // Make sure a single socket is transparently reused for 2 requests. const agent = new http.Agent({ keepAlive: true, keepAliveMsecs: Infinity, - maxSockets: 1 + maxSockets: 1, }); const server = http.createServer(common.mustCall((req, res) => { @@ -41,7 +41,7 @@ const server = http.createServer(common.mustCall((req, res) => { // First request. This is useless except for adding a socket to the // agent’s pool for reuse. const r1 = http.request({ - agent, port, method: 'POST' + agent, port, method: 'POST', }, common.mustCall((res) => { // Remember which socket we used. const socket = res.socket; @@ -59,7 +59,7 @@ const server = http.createServer(common.mustCall((req, res) => { // second request: const r2 = http.request({ - agent, port, method: 'POST' + agent, port, method: 'POST', }, common.mustCall((res) => { assert.ok(destroyedIds.has(asyncIdAtFirstRequest)); diff --git a/test/parallel/test-async-hooks-http-agent.js b/test/parallel/test-async-hooks-http-agent.js index a55858947337b2..a2239bb085e451 100644 --- a/test/parallel/test-async-hooks-http-agent.js +++ b/test/parallel/test-async-hooks-http-agent.js @@ -13,7 +13,7 @@ const http = require('http'); const agent = new http.Agent({ keepAlive: true, keepAliveMsecs: Infinity, - maxSockets: 1 + maxSockets: 1, }); const server = http.createServer(common.mustCall((req, res) => { @@ -31,7 +31,7 @@ const server = http.createServer(common.mustCall((req, res) => { // First request. This is useless except for adding a socket to the // agent’s pool for reuse. const r1 = http.request({ - agent, port, method: 'POST' + agent, port, method: 'POST', }, common.mustCall((res) => { // Remember which socket we used. const socket = res.socket; @@ -53,8 +53,8 @@ const server = http.createServer(common.mustCall((req, res) => { // response header has already been received. const r2 = http.request({ agent, port, method: 'POST', headers: { - 'Content-Length': payload.length - } + 'Content-Length': payload.length, + }, }, common.mustCall((res) => { const asyncId = res.socket[async_id_symbol]; assert.ok(asyncId > 0, `${asyncId} > 0`); diff --git a/test/parallel/test-async-hooks-http-parser-destroy.js b/test/parallel/test-async-hooks-http-parser-destroy.js index 6cbc2043b09583..b1e3778d91aa3d 100644 --- a/test/parallel/test-async-hooks-http-parser-destroy.js +++ b/test/parallel/test-async-hooks-http-parser-destroy.js @@ -41,7 +41,7 @@ async_hooks.createHook({ if (destroyedIdsIncomingMessage.length === N && server.listening) { server.close(); } - } + }, }).enable(); const server = http.createServer((req, res) => { @@ -61,7 +61,7 @@ server.listen(0, () => { (function makeRequest() { http.get({ port: server.address().port, - agent: keepAliveAgent + agent: keepAliveAgent, }, (res) => { res.resume(); }); diff --git a/test/parallel/test-async-hooks-prevent-double-destroy.js b/test/parallel/test-async-hooks-prevent-double-destroy.js index 689dc399f9d2f2..821766079b1450 100644 --- a/test/parallel/test-async-hooks-prevent-double-destroy.js +++ b/test/parallel/test-async-hooks-prevent-double-destroy.js @@ -8,7 +8,7 @@ const common = require('../common'); const async_hooks = require('async_hooks'); const hook = async_hooks.createHook({ - destroy: common.mustCallAtLeast(2) // 1 immediate + manual destroy + destroy: common.mustCallAtLeast(2), // 1 immediate + manual destroy }).enable(); { diff --git a/test/parallel/test-async-hooks-promise-enable-disable.js b/test/parallel/test-async-hooks-promise-enable-disable.js index 47a259166ee182..42e9d5b52a2153 100644 --- a/test/parallel/test-async-hooks-promise-enable-disable.js +++ b/test/parallel/test-async-hooks-promise-enable-disable.js @@ -25,7 +25,7 @@ const mustCallInit = common.mustCall(function init(id, type, tid, resource) { }, EXPECTED_INITS); const hook = async_hooks.createHook({ - init: mustCallInit + init: mustCallInit, // Enable then disable to test whether disable() actually works. }).enable().disable().disable(); diff --git a/test/parallel/test-async-hooks-promise-triggerid.js b/test/parallel/test-async-hooks-promise-triggerid.js index b860d60999e1ef..bc004197d82fb8 100644 --- a/test/parallel/test-async-hooks-promise-triggerid.js +++ b/test/parallel/test-async-hooks-promise-triggerid.js @@ -23,7 +23,7 @@ async_hooks.createHook({ }), after: common.mustCall((id) => { assert.strictEqual(id, promiseAsyncIds[1]); - }) + }), }).enable(); Promise.resolve(42).then(common.mustCall(() => { diff --git a/test/parallel/test-async-hooks-promise.js b/test/parallel/test-async-hooks-promise.js index 9db510e329ffad..5b7b21d85e9e24 100644 --- a/test/parallel/test-async-hooks-promise.js +++ b/test/parallel/test-async-hooks-promise.js @@ -17,7 +17,7 @@ async_hooks.createHook({ promiseResolve: common.mustCall((id) => { assert.strictEqual(initCalls[resolveCalls.length].id, id); resolveCalls.push(id); - }, 2) + }, 2), }).enable(); const a = Promise.resolve(42); diff --git a/test/parallel/test-async-hooks-top-level-clearimmediate.js b/test/parallel/test-async-hooks-top-level-clearimmediate.js index cc5fcf48eb50b3..955233631dcf6c 100644 --- a/test/parallel/test-async-hooks-top-level-clearimmediate.js +++ b/test/parallel/test-async-hooks-top-level-clearimmediate.js @@ -22,7 +22,7 @@ async_hooks.createHook({ after: common.mustNotCall(), destroy: common.mustCall((id) => { assert.strictEqual(seenId, id); - }) + }), }).enable(); const immediate = setImmediate(common.mustNotCall()); diff --git a/test/parallel/test-async-wrap-constructor.js b/test/parallel/test-async-wrap-constructor.js index e89bc49df02333..f3f1033f182b40 100644 --- a/test/parallel/test-async-wrap-constructor.js +++ b/test/parallel/test-async-wrap-constructor.js @@ -14,7 +14,7 @@ const async_hooks = require('async_hooks'); }, { code: 'ERR_ASYNC_CALLBACK', name: 'TypeError', - message: `hook.${field} must be a function` + message: `hook.${field} must be a function`, }); }); }); diff --git a/test/parallel/test-async-wrap-promise-after-enabled.js b/test/parallel/test-async-wrap-promise-after-enabled.js index 0d58cbd653868b..c0a2a7a465d514 100644 --- a/test/parallel/test-async-wrap-promise-after-enabled.js +++ b/test/parallel/test-async-wrap-promise-after-enabled.js @@ -27,7 +27,7 @@ const hooks = async_hooks.createHook({ assert.ok(id > 1); seenEvents.push('after'); hooks.disable(); - }) + }), }); setImmediate(() => { diff --git a/test/parallel/test-async-wrap-tlssocket-asyncreset.js b/test/parallel/test-async-wrap-tlssocket-asyncreset.js index e0dd8be2904429..ab5348546c5c39 100644 --- a/test/parallel/test-async-wrap-tlssocket-asyncreset.js +++ b/test/parallel/test-async-wrap-tlssocket-asyncreset.js @@ -12,7 +12,7 @@ const https = require('https'); const serverOptions = { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), - ca: fixtures.readKey('ca1-cert.pem') + ca: fixtures.readKey('ca1-cert.pem'), }; const server = https.createServer( @@ -29,9 +29,9 @@ server.listen( const clientOptions = { agent: new https.Agent({ keepAlive: true, - rejectUnauthorized: false + rejectUnauthorized: false, }), - port: port + port: port, }; const req = https.get( diff --git a/test/parallel/test-asyncresource-bind.js b/test/parallel/test-asyncresource-bind.js index a9f613d9302edf..375061ba1931d8 100644 --- a/test/parallel/test-asyncresource-bind.js +++ b/test/parallel/test-asyncresource-bind.js @@ -17,7 +17,7 @@ const asyncResource = new AsyncResource('test'); [1, false, '', {}, []].forEach((i) => { assert.throws(() => asyncResource.bind(i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); diff --git a/test/parallel/test-blob.js b/test/parallel/test-blob.js index 6c880e9dea1c84..1f61271212fd8d 100644 --- a/test/parallel/test-blob.js +++ b/test/parallel/test-blob.js @@ -12,15 +12,15 @@ const { inspect } = require('util'); } assert.throws(() => new Blob(false), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => new Blob('hello'), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => new Blob({}), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); { @@ -181,7 +181,7 @@ assert.throws(() => new Blob({}), { configurable: true, enumerable: false, value: 'Blob', - writable: false + writable: false, }); } diff --git a/test/parallel/test-blocklist.js b/test/parallel/test-blocklist.js index c72d9e30b5f2da..4d42c2212e8db2 100644 --- a/test/parallel/test-blocklist.js +++ b/test/parallel/test-blocklist.js @@ -14,37 +14,37 @@ const util = require('util'); [1, [], {}, null, 1n, undefined, null].forEach((i) => { assert.throws(() => blockList.addAddress(i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); [1, [], {}, null, 1n, null].forEach((i) => { assert.throws(() => blockList.addAddress('1.1.1.1', i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); assert.throws(() => blockList.addAddress('1.1.1.1', 'foo'), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); [1, [], {}, null, 1n, undefined, null].forEach((i) => { assert.throws(() => blockList.addRange(i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => blockList.addRange('1.1.1.1', i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); [1, [], {}, null, 1n, null].forEach((i) => { assert.throws(() => blockList.addRange('1.1.1.1', '1.1.1.2', i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); assert.throws(() => blockList.addRange('1.1.1.1', '1.1.1.2', 'foo'), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); } @@ -73,7 +73,7 @@ const util = require('util'); const sa1 = new SocketAddress({ address: '1.1.1.1' }); const sa2 = new SocketAddress({ address: '8592:757c:efae:4e45:fb5d:d62a:0d00:8e17', - family: 'ipv6' + family: 'ipv6', }); const sa3 = new SocketAddress({ address: '1.1.1.2' }); diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index 1368136abe8f22..86943fd2c181b5 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -82,7 +82,7 @@ Buffer(0); const outOfRangeError = { code: 'ERR_OUT_OF_RANGE', - name: 'RangeError' + name: 'RangeError', }; // Try to write a 0-length string beyond the end of b @@ -1019,7 +1019,7 @@ assert.throws( { code: 'ERR_UNKNOWN_ENCODING', name: 'TypeError', - message: 'Unknown encoding: buffer' + message: 'Unknown encoding: buffer', } ); @@ -1065,18 +1065,18 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "target" argument must be an instance of Buffer or ' + - 'Uint8Array. Received undefined' + 'Uint8Array. Received undefined', }); assert.throws(() => Buffer.from(), { name: 'TypeError', message: 'The first argument must be of type string or an instance of ' + - 'Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined' + 'Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined', }); assert.throws(() => Buffer.from(null), { name: 'TypeError', message: 'The first argument must be of type string or an instance of ' + - 'Buffer, ArrayBuffer, or Array or an Array-like Object. Received null' + 'Buffer, ArrayBuffer, or Array or an Array-like Object. Received null', }); // Test prototype getters don't throw @@ -1105,7 +1105,7 @@ assert.strictEqual(SlowBuffer.prototype.offset, undefined); const errMsg = common.expectsError({ code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: '"offset" is outside of buffer bounds' + message: '"offset" is outside of buffer bounds', }); assert.throws(() => Buffer.from(new ArrayBuffer(0), -1 >>> 0), errMsg); } @@ -1148,26 +1148,26 @@ assert.throws(() => { Buffer.alloc(0x1000, 'This is not correctly encoded', 'hex'); }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => { Buffer.alloc(0x1000, 'c', 'hex'); }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => { Buffer.alloc(1, Buffer.alloc(0)); }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => { Buffer.alloc(40, 'x', 20); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); diff --git a/test/parallel/test-buffer-arraybuffer.js b/test/parallel/test-buffer-arraybuffer.js index bb22b879932571..cfd522222dee6a 100644 --- a/test/parallel/test-buffer-arraybuffer.js +++ b/test/parallel/test-buffer-arraybuffer.js @@ -45,7 +45,7 @@ assert.throws(function() { name: 'TypeError', message: 'The first argument must be of type string or an instance of ' + 'Buffer, ArrayBuffer, or Array or an Array-like Object. Received ' + - 'an instance of AB' + 'an instance of AB', }); // Test the byteOffset and length arguments @@ -67,12 +67,12 @@ assert.throws(function() { assert.throws(() => Buffer.from(ab.buffer, 6), { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: '"offset" is outside of buffer bounds' + message: '"offset" is outside of buffer bounds', }); assert.throws(() => Buffer.from(ab.buffer, 3, 6), { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: '"length" is outside of buffer bounds' + message: '"length" is outside of buffer bounds', }); } @@ -95,12 +95,12 @@ assert.throws(function() { assert.throws(() => Buffer(ab.buffer, 6), { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: '"offset" is outside of buffer bounds' + message: '"offset" is outside of buffer bounds', }); assert.throws(() => Buffer(ab.buffer, 3, 6), { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: '"length" is outside of buffer bounds' + message: '"length" is outside of buffer bounds', }); } @@ -122,7 +122,7 @@ assert.throws(function() { }, { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: '"offset" is outside of buffer bounds' + message: '"offset" is outside of buffer bounds', }); } @@ -144,7 +144,7 @@ assert.throws(function() { }, { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: '"length" is outside of buffer bounds' + message: '"length" is outside of buffer bounds', }); } diff --git a/test/parallel/test-buffer-bigint64.js b/test/parallel/test-buffer-bigint64.js index a160d35b4a551a..301fea8af3ae6b 100644 --- a/test/parallel/test-buffer-bigint64.js +++ b/test/parallel/test-buffer-bigint64.js @@ -40,7 +40,7 @@ const buf = Buffer.allocUnsafe(8); }, { code: 'ERR_OUT_OF_RANGE', message: 'The value of "value" is out of range. It must be ' + - '>= 0n and < 2n ** 64n. Received 18_446_744_073_709_551_616n' + '>= 0n and < 2n ** 64n. Received 18_446_744_073_709_551_616n', }); // Should throw a TypeError upon invalid input diff --git a/test/parallel/test-buffer-bytelength.js b/test/parallel/test-buffer-bytelength.js index 33cbb3268440a1..7e82fec11f942f 100644 --- a/test/parallel/test-buffer-bytelength.js +++ b/test/parallel/test-buffer-bytelength.js @@ -18,7 +18,7 @@ const vm = require('vm'); name: 'TypeError', message: 'The "string" argument must be of type string or an instance ' + 'of Buffer or ArrayBuffer.' + - common.invalidArgTypeHelper(args[0]) + common.invalidArgTypeHelper(args[0]), } ); }); diff --git a/test/parallel/test-buffer-compare-offset.js b/test/parallel/test-buffer-compare-offset.js index 9f6f7335473e65..d9d03c2b117bee 100644 --- a/test/parallel/test-buffer-compare-offset.js +++ b/test/parallel/test-buffer-compare-offset.js @@ -90,5 +90,5 @@ assert.throws(() => a.compare(), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "target" argument must be an instance of ' + - 'Buffer or Uint8Array. Received undefined' + 'Buffer or Uint8Array. Received undefined', }); diff --git a/test/parallel/test-buffer-compare.js b/test/parallel/test-buffer-compare.js index 4a1e1acccb9a58..e6195d9ea154ff 100644 --- a/test/parallel/test-buffer-compare.js +++ b/test/parallel/test-buffer-compare.js @@ -31,17 +31,17 @@ assert.strictEqual(Buffer.compare(Buffer.alloc(1), Buffer.alloc(0)), 1); assert.throws(() => Buffer.compare(Buffer.alloc(1), 'abc'), { code: 'ERR_INVALID_ARG_TYPE', message: 'The "buf2" argument must be an instance of Buffer or Uint8Array. ' + - "Received type string ('abc')" + "Received type string ('abc')", }); assert.throws(() => Buffer.compare('abc', Buffer.alloc(1)), { code: 'ERR_INVALID_ARG_TYPE', message: 'The "buf1" argument must be an instance of Buffer or Uint8Array. ' + - "Received type string ('abc')" + "Received type string ('abc')", }); assert.throws(() => Buffer.alloc(1).compare('abc'), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "target" argument must be an instance of ' + - "Buffer or Uint8Array. Received type string ('abc')" + "Buffer or Uint8Array. Received type string ('abc')", }); diff --git a/test/parallel/test-buffer-concat.js b/test/parallel/test-buffer-concat.js index 2e7541fb58b063..c83a59a9ee5f27 100644 --- a/test/parallel/test-buffer-concat.js +++ b/test/parallel/test-buffer-concat.js @@ -50,7 +50,7 @@ assert.strictEqual(flatLongLen.toString(), check); }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "list" argument must be an instance of Array.' + - `${common.invalidArgTypeHelper(value)}` + `${common.invalidArgTypeHelper(value)}`, }); }); @@ -60,7 +60,7 @@ assert.strictEqual(flatLongLen.toString(), check); }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "list[0]" argument must be an instance of Buffer ' + - `or Uint8Array.${common.invalidArgTypeHelper(value[0])}` + `or Uint8Array.${common.invalidArgTypeHelper(value[0])}`, }); }); @@ -69,7 +69,7 @@ assert.throws(() => { }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "list[1]" argument must be an instance of Buffer ' + - 'or Uint8Array. Received type number (3)' + 'or Uint8Array. Received type number (3)', }); // eslint-disable-next-line node-core/crypto-check diff --git a/test/parallel/test-buffer-constructor-outside-node-modules.js b/test/parallel/test-buffer-constructor-outside-node-modules.js index 71362599827dc4..76b6536af737e7 100644 --- a/test/parallel/test-buffer-constructor-outside-node-modules.js +++ b/test/parallel/test-buffer-constructor-outside-node-modules.js @@ -19,11 +19,11 @@ process.addListener('warning', common.mustCall((warning) => { })); vm.runInNewContext('new Buffer(10)', { Buffer }, { - filename: '/a/node_modules/b' + filename: '/a/node_modules/b', }); common.expectWarning('DeprecationWarning', bufferWarning, 'DEP0005'); vm.runInNewContext('new Buffer(10)', { Buffer }, { - filename: '/this_should_emit_a_warning' + filename: '/this_should_emit_a_warning', }); diff --git a/test/parallel/test-buffer-copy.js b/test/parallel/test-buffer-copy.js index d6f734614471e5..ba44543996dfc9 100644 --- a/test/parallel/test-buffer-copy.js +++ b/test/parallel/test-buffer-copy.js @@ -114,7 +114,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "sourceStart" is out of range. ' + - 'It must be >= 0. Received -1' + 'It must be >= 0. Received -1', } ); @@ -135,7 +135,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "sourceEnd" is out of range. ' + - 'It must be >= 0. Received -1' + 'It must be >= 0. Received -1', } ); diff --git a/test/parallel/test-buffer-equals.js b/test/parallel/test-buffer-equals.js index b6993246f81019..3feb1c1236a959 100644 --- a/test/parallel/test-buffer-equals.js +++ b/test/parallel/test-buffer-equals.js @@ -20,6 +20,6 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "otherBuffer" argument must be an instance of ' + - "Buffer or Uint8Array. Received type string ('abc')" + "Buffer or Uint8Array. Received type string ('abc')", } ); diff --git a/test/parallel/test-buffer-fill.js b/test/parallel/test-buffer-fill.js index 00e65c82e91849..3477f931508abf 100644 --- a/test/parallel/test-buffer-fill.js +++ b/test/parallel/test-buffer-fill.js @@ -118,7 +118,7 @@ assert.throws(() => { buf.fill('yKJh', 'hex'); }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => { @@ -127,7 +127,7 @@ assert.throws(() => { buf.fill('\u0222', 'hex'); }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', }); // BASE64 @@ -199,7 +199,7 @@ assert.throws( { code: 'ERR_UNKNOWN_ENCODING', name: 'TypeError', - message: 'Unknown encoding: node rocks!' + message: 'Unknown encoding: node rocks!', } ); @@ -212,7 +212,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', message: 'The "encoding" argument must be of type ' + - `string.${common.invalidArgTypeHelper(args[3])}` + `string.${common.invalidArgTypeHelper(args[3])}`, } ); }); @@ -222,7 +222,7 @@ assert.throws( { code: 'ERR_UNKNOWN_ENCODING', name: 'TypeError', - message: 'Unknown encoding: foo' + message: 'Unknown encoding: foo', } ); @@ -355,13 +355,13 @@ assert.throws( const end = { [Symbol.toPrimitive]() { return 1; - } + }, }; Buffer.alloc(1).fill(Buffer.alloc(1), 0, end); }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "end" argument must be of type number. Received an ' + - 'instance of Object' + 'instance of Object', }); } @@ -377,13 +377,13 @@ assert.throws(() => { const buf = Buffer.from('w00t'); Object.defineProperty(buf, 'length', { value: 1337, - enumerable: true + enumerable: true, }); buf.fill(''); }, { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: 'Attempt to access memory outside buffer bounds' + message: 'Attempt to access memory outside buffer bounds', }); assert.deepStrictEqual( @@ -427,5 +427,5 @@ assert.throws(() => { buf.fill('This is not correctly encoded', 'hex'); }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', }); diff --git a/test/parallel/test-buffer-from.js b/test/parallel/test-buffer-from.js index b513f4080a2054..59ca280cdb8519 100644 --- a/test/parallel/test-buffer-from.js +++ b/test/parallel/test-buffer-from.js @@ -54,7 +54,7 @@ deepStrictEqual( name: 'TypeError', message: 'The first argument must be of type string or an instance of ' + 'Buffer, ArrayBuffer, or Array or an Array-like Object.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), }; throws(() => Buffer.from(input), errObj); throws(() => Buffer.from(input, 'hex'), errObj); diff --git a/test/parallel/test-buffer-includes.js b/test/parallel/test-buffer-includes.js index 57b3a33aaa487f..31c77b15fb9ef6 100644 --- a/test/parallel/test-buffer-includes.js +++ b/test/parallel/test-buffer-includes.js @@ -284,7 +284,7 @@ for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) { name: 'TypeError', message: 'The "value" argument must be one of type number or string ' + 'or an instance of Buffer or Uint8Array.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), } ); }); diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index 82d359ca213f2c..690c8e548b0433 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -359,7 +359,7 @@ assert.strictEqual(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1); name: 'TypeError', message: 'The "value" argument must be one of type number or string ' + 'or an instance of Buffer or Uint8Array.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), } ); }); @@ -618,6 +618,6 @@ assert.strictEqual(reallyLong.lastIndexOf(pattern), 0); name: 'TypeError', message: 'The "buffer" argument must be an instance of Buffer, ' + 'TypedArray, or DataView. ' + - 'Received an instance of lastIndexOf' + 'Received an instance of lastIndexOf', }); } diff --git a/test/parallel/test-buffer-new.js b/test/parallel/test-buffer-new.js index 0f8fa485f29990..9610c2f75d913b 100644 --- a/test/parallel/test-buffer-new.js +++ b/test/parallel/test-buffer-new.js @@ -7,5 +7,5 @@ assert.throws(() => new Buffer(42, 'utf8'), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "string" argument must be of type string. Received type ' + - 'number (42)' + 'number (42)', }); diff --git a/test/parallel/test-buffer-no-negative-allocation.js b/test/parallel/test-buffer-no-negative-allocation.js index 3d0d1919381f4c..1e0f89369f9ed2 100644 --- a/test/parallel/test-buffer-no-negative-allocation.js +++ b/test/parallel/test-buffer-no-negative-allocation.js @@ -7,7 +7,7 @@ const { SlowBuffer } = require('buffer'); const msg = { code: 'ERR_INVALID_ARG_VALUE', name: 'RangeError', - message: /^The argument 'size' is invalid\. Received [^"]*$/ + message: /^The argument 'size' is invalid\. Received [^"]*$/, }; // Test that negative Buffer length inputs throw errors. diff --git a/test/parallel/test-buffer-over-max-length.js b/test/parallel/test-buffer-over-max-length.js index c263633d941cdd..6d2f3279a0ced7 100644 --- a/test/parallel/test-buffer-over-max-length.js +++ b/test/parallel/test-buffer-over-max-length.js @@ -10,7 +10,7 @@ const kMaxLength = buffer.kMaxLength; const bufferMaxSizeMsg = { code: 'ERR_INVALID_ARG_VALUE', name: 'RangeError', - message: /^The argument 'size' is invalid\. Received [^"]*$/ + message: /^The argument 'size' is invalid\. Received [^"]*$/, }; assert.throws(() => Buffer((-1 >>> 0) + 2), bufferMaxSizeMsg); diff --git a/test/parallel/test-buffer-read.js b/test/parallel/test-buffer-read.js index 8c266163f44e43..a9001e6765e90b 100644 --- a/test/parallel/test-buffer-read.js +++ b/test/parallel/test-buffer-read.js @@ -54,13 +54,13 @@ read(buf, 'readUIntLE', [2, 2], 0xea48); // Error name and message const OOR_ERROR = { - name: 'RangeError' + name: 'RangeError', }; const OOB_ERROR = { name: 'RangeError', - message: 'Attempt to access memory outside buffer bounds' + message: 'Attempt to access memory outside buffer bounds', }; // Attempt to overflow buffers, similar to previous bug in array buffers diff --git a/test/parallel/test-buffer-readdouble.js b/test/parallel/test-buffer-readdouble.js index 4a86ebe4ce382f..37751aaf2d7a02 100644 --- a/test/parallel/test-buffer-readdouble.js +++ b/test/parallel/test-buffer-readdouble.js @@ -118,7 +118,7 @@ assert.strictEqual(buffer.readDoubleLE(0), -Infinity); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be >= 0 and <= 0. Received ${offset}` + `It must be >= 0 and <= 0. Received ${offset}`, }); }); @@ -127,7 +127,7 @@ assert.strictEqual(buffer.readDoubleLE(0), -Infinity); { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: 'Attempt to access memory outside buffer bounds' + message: 'Attempt to access memory outside buffer bounds', }); [NaN, 1.01].forEach((offset) => { @@ -137,7 +137,7 @@ assert.strictEqual(buffer.readDoubleLE(0), -Infinity); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); diff --git a/test/parallel/test-buffer-readfloat.js b/test/parallel/test-buffer-readfloat.js index c709956e025c70..0f377dae5496aa 100644 --- a/test/parallel/test-buffer-readfloat.js +++ b/test/parallel/test-buffer-readfloat.js @@ -81,7 +81,7 @@ assert.strictEqual(buffer.readFloatLE(0), -Infinity); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be >= 0 and <= 0. Received ${offset}` + `It must be >= 0 and <= 0. Received ${offset}`, }); }); @@ -90,7 +90,7 @@ assert.strictEqual(buffer.readFloatLE(0), -Infinity); { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: 'Attempt to access memory outside buffer bounds' + message: 'Attempt to access memory outside buffer bounds', }); [NaN, 1.01].forEach((offset) => { @@ -100,7 +100,7 @@ assert.strictEqual(buffer.readFloatLE(0), -Infinity); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); diff --git a/test/parallel/test-buffer-readint.js b/test/parallel/test-buffer-readint.js index 8758652b28a4a4..0b83adbe63c04d 100644 --- a/test/parallel/test-buffer-readint.js +++ b/test/parallel/test-buffer-readint.js @@ -18,7 +18,7 @@ const assert = require('assert'); () => buffer[`read${fn}`](o), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -27,7 +27,7 @@ const assert = require('assert'); () => buffer[`read${fn}`](offset), { code: 'ERR_OUT_OF_RANGE', - name: 'RangeError' + name: 'RangeError', }); }); @@ -38,7 +38,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); @@ -143,7 +143,7 @@ const assert = require('assert'); { code: 'ERR_OUT_OF_RANGE', message: 'The value of "byteLength" is out of range. ' + - `It must be >= 1 and <= 6. Received ${byteLength}` + `It must be >= 1 and <= 6. Received ${byteLength}`, }); }); @@ -154,7 +154,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "byteLength" is out of range. ' + - `It must be an integer. Received ${byteLength}` + `It must be an integer. Received ${byteLength}`, }); }); }); @@ -167,7 +167,7 @@ const assert = require('assert'); () => buffer[fn](o, i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -178,7 +178,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be >= 0 and <= ${8 - i}. Received ${offset}` + `It must be >= 0 and <= ${8 - i}. Received ${offset}`, }); }); @@ -189,7 +189,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); diff --git a/test/parallel/test-buffer-readuint.js b/test/parallel/test-buffer-readuint.js index 31e32bc3df14db..c34eb0224ce026 100644 --- a/test/parallel/test-buffer-readuint.js +++ b/test/parallel/test-buffer-readuint.js @@ -18,7 +18,7 @@ const assert = require('assert'); () => buffer[`read${fn}`](o), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -27,7 +27,7 @@ const assert = require('assert'); () => buffer[`read${fn}`](offset), { code: 'ERR_OUT_OF_RANGE', - name: 'RangeError' + name: 'RangeError', }); }); @@ -38,7 +38,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); @@ -111,7 +111,7 @@ const assert = require('assert'); { code: 'ERR_OUT_OF_RANGE', message: 'The value of "byteLength" is out of range. ' + - `It must be >= 1 and <= 6. Received ${byteLength}` + `It must be >= 1 and <= 6. Received ${byteLength}`, }); }); @@ -122,7 +122,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "byteLength" is out of range. ' + - `It must be an integer. Received ${byteLength}` + `It must be an integer. Received ${byteLength}`, }); }); }); @@ -135,7 +135,7 @@ const assert = require('assert'); () => buffer[fn](o, i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -146,7 +146,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be >= 0 and <= ${8 - i}. Received ${offset}` + `It must be >= 0 and <= ${8 - i}. Received ${offset}`, }); }); @@ -157,7 +157,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js index 70c7846beec68a..d74f80b3d9bd41 100644 --- a/test/parallel/test-buffer-slow.js +++ b/test/parallel/test-buffer-slow.js @@ -54,7 +54,7 @@ assert.throws(() => SlowBuffer(true), bufferInvalidTypeMsg); const bufferMaxSizeMsg = { code: 'ERR_INVALID_ARG_VALUE', name: 'RangeError', - message: /^The argument 'size' is invalid\. Received [^"]*$/ + message: /^The argument 'size' is invalid\. Received [^"]*$/, }; assert.throws(() => SlowBuffer(NaN), bufferMaxSizeMsg); assert.throws(() => SlowBuffer(Infinity), bufferMaxSizeMsg); diff --git a/test/parallel/test-buffer-tostring-range.js b/test/parallel/test-buffer-tostring-range.js index f4adf64c8d9129..5930f094c93ff3 100644 --- a/test/parallel/test-buffer-tostring-range.js +++ b/test/parallel/test-buffer-tostring-range.js @@ -89,12 +89,12 @@ assert.throws(() => { }, { code: 'ERR_UNKNOWN_ENCODING', name: 'TypeError', - message: 'Unknown encoding: 0' + message: 'Unknown encoding: 0', }); assert.throws(() => { rangeBuffer.toString(null, 1, 2); }, { code: 'ERR_UNKNOWN_ENCODING', name: 'TypeError', - message: 'Unknown encoding: null' + message: 'Unknown encoding: null', }); diff --git a/test/parallel/test-buffer-tostring-rangeerror.js b/test/parallel/test-buffer-tostring-rangeerror.js index 4416effb422ac4..4de9e72ebb9786 100644 --- a/test/parallel/test-buffer-tostring-rangeerror.js +++ b/test/parallel/test-buffer-tostring-rangeerror.js @@ -12,7 +12,7 @@ const len = 1422561062959; const message = { code: 'ERR_INVALID_ARG_VALUE', name: 'RangeError', - message: /^The argument 'size' is invalid\. Received [^"]*$/ + message: /^The argument 'size' is invalid\. Received [^"]*$/, }; assert.throws(() => Buffer(len).toString('utf8'), message); assert.throws(() => SlowBuffer(len).toString('utf8'), message); diff --git a/test/parallel/test-buffer-tostring.js b/test/parallel/test-buffer-tostring.js index 4219649fa37eb3..b67311a0cadeb6 100644 --- a/test/parallel/test-buffer-tostring.js +++ b/test/parallel/test-buffer-tostring.js @@ -30,7 +30,7 @@ for (let i = 1; i < 10; i++) { const error = common.expectsError({ code: 'ERR_UNKNOWN_ENCODING', name: 'TypeError', - message: `Unknown encoding: ${encoding}` + message: `Unknown encoding: ${encoding}`, }); assert.ok(!Buffer.isEncoding(encoding)); assert.throws(() => Buffer.from('foo').toString(encoding), error); diff --git a/test/parallel/test-buffer-write.js b/test/parallel/test-buffer-write.js index 128327c47e5d6f..6319ecf7d434a1 100644 --- a/test/parallel/test-buffer-write.js +++ b/test/parallel/test-buffer-write.js @@ -10,7 +10,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be >= 0 && <= 9. Received ${offset}` + `It must be >= 0 && <= 9. Received ${offset}`, } ); }); @@ -68,7 +68,7 @@ for (let i = 1; i < 10; i++) { const error = common.expectsError({ code: 'ERR_UNKNOWN_ENCODING', name: 'TypeError', - message: `Unknown encoding: ${encoding}` + message: `Unknown encoding: ${encoding}`, }); assert.ok(!Buffer.isEncoding(encoding)); diff --git a/test/parallel/test-buffer-writedouble.js b/test/parallel/test-buffer-writedouble.js index 5026c8187430b3..b7b2fe010babbd 100644 --- a/test/parallel/test-buffer-writedouble.js +++ b/test/parallel/test-buffer-writedouble.js @@ -99,7 +99,7 @@ assert.ok(Number.isNaN(buffer.readDoubleLE(8))); { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: 'Attempt to access memory outside buffer bounds' + message: 'Attempt to access memory outside buffer bounds', }); ['', '0', null, {}, [], () => {}, true, false].forEach((off) => { @@ -115,7 +115,7 @@ assert.ok(Number.isNaN(buffer.readDoubleLE(8))); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be >= 0 and <= 8. Received ${offset}` + `It must be >= 0 and <= 8. Received ${offset}`, }); }); @@ -126,7 +126,7 @@ assert.ok(Number.isNaN(buffer.readDoubleLE(8))); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); diff --git a/test/parallel/test-buffer-writefloat.js b/test/parallel/test-buffer-writefloat.js index 8676a819fc776d..570d094e9226d5 100644 --- a/test/parallel/test-buffer-writefloat.js +++ b/test/parallel/test-buffer-writefloat.js @@ -81,7 +81,7 @@ assert.ok(Number.isNaN(buffer.readFloatLE(4))); { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError', - message: 'Attempt to access memory outside buffer bounds' + message: 'Attempt to access memory outside buffer bounds', }); ['', '0', null, {}, [], () => {}, true, false].forEach((off) => { @@ -98,7 +98,7 @@ assert.ok(Number.isNaN(buffer.readFloatLE(4))); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be >= 0 and <= 4. Received ${offset}` + `It must be >= 0 and <= 4. Received ${offset}`, } ); }); @@ -110,7 +110,7 @@ assert.ok(Number.isNaN(buffer.readFloatLE(4))); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); diff --git a/test/parallel/test-buffer-writeint.js b/test/parallel/test-buffer-writeint.js index e4b916b1cff27f..b223dbab1dae95 100644 --- a/test/parallel/test-buffer-writeint.js +++ b/test/parallel/test-buffer-writeint.js @@ -8,7 +8,7 @@ const errorOutOfBounds = { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: new RegExp('^The value of "value" is out of range\\. ' + - 'It must be >= -\\d+ and <= \\d+\\. Received .+$') + 'It must be >= -\\d+ and <= \\d+\\. Received .+$'), }; // Test 8 bit @@ -195,7 +195,7 @@ const errorOutOfBounds = { { code: 'ERR_OUT_OF_RANGE', message: 'The value of "byteLength" is out of range. ' + - `It must be >= 1 and <= 6. Received ${byteLength}` + `It must be >= 1 and <= 6. Received ${byteLength}`, } ); }); @@ -207,7 +207,7 @@ const errorOutOfBounds = { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "byteLength" is out of range. ' + - `It must be an integer. Received ${byteLength}` + `It must be an integer. Received ${byteLength}`, }); }); }); @@ -231,7 +231,7 @@ const errorOutOfBounds = { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "value" is out of range. ' + - `It must be ${range}. Received ${received}` + `It must be ${range}. Received ${received}`, }); }); @@ -240,7 +240,7 @@ const errorOutOfBounds = { () => data[fn](min, o, i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -251,7 +251,7 @@ const errorOutOfBounds = { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be >= 0 and <= ${8 - i}. Received ${offset}` + `It must be >= 0 and <= ${8 - i}. Received ${offset}`, }); }); @@ -262,7 +262,7 @@ const errorOutOfBounds = { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); diff --git a/test/parallel/test-buffer-writeuint.js b/test/parallel/test-buffer-writeuint.js index efacdb7ab48c3b..98a15a52f82d45 100644 --- a/test/parallel/test-buffer-writeuint.js +++ b/test/parallel/test-buffer-writeuint.js @@ -90,7 +90,7 @@ const assert = require('assert'); { code: 'ERR_OUT_OF_RANGE', message: 'The value of "value" is out of range. ' + - `It must be >= 0 and <= 65535. Received ${value}` + `It must be >= 0 and <= 65535. Received ${value}`, } ); }); @@ -150,7 +150,7 @@ const assert = require('assert'); { code: 'ERR_OUT_OF_RANGE', message: 'The value of "byteLength" is out of range. ' + - `It must be >= 1 and <= 6. Received ${byteLength}` + `It must be >= 1 and <= 6. Received ${byteLength}`, } ); }); @@ -162,7 +162,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "byteLength" is out of range. ' + - `It must be an integer. Received ${byteLength}` + `It must be an integer. Received ${byteLength}`, }); }); }); @@ -180,7 +180,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "value" is out of range. ' + - `It must be >= 0 and <${range}. Received ${received}` + `It must be >= 0 and <${range}. Received ${received}`, }); ['', '0', null, {}, [], () => {}, true, false].forEach((o) => { @@ -188,7 +188,7 @@ const assert = require('assert'); () => data[fn](23, o, i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -199,7 +199,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be >= 0 and <= ${8 - i}. Received ${offset}` + `It must be >= 0 and <= ${8 - i}. Received ${offset}`, }); }); @@ -210,7 +210,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); diff --git a/test/parallel/test-child-process-advanced-serialization.js b/test/parallel/test-child-process-advanced-serialization.js index 71a0c44a042d31..e3babb3f117635 100644 --- a/test/parallel/test-child-process-advanced-serialization.js +++ b/test/parallel/test-child-process-advanced-serialization.js @@ -13,7 +13,7 @@ if (process.argv[2] !== 'child') { code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.serialization' " + "must be one of: undefined, 'json', 'advanced'. " + - `Received ${inspect(value)}` + `Received ${inspect(value)}`, }); } @@ -21,7 +21,7 @@ if (process.argv[2] !== 'child') { const cp = child_process.spawn(process.execPath, [__filename, 'child'], { stdio: ['ipc', 'inherit', 'inherit'], - serialization: 'advanced' + serialization: 'advanced', }); const circular = {}; diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index 0bd8dd85b0bd84..e16ea84a097c4b 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -16,7 +16,7 @@ assert.strictEqual(typeof ChildProcess, 'function'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object.' + - `${common.invalidArgTypeHelper(options)}` + `${common.invalidArgTypeHelper(options)}`, }); }); } @@ -32,7 +32,7 @@ assert.strictEqual(typeof ChildProcess, 'function'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.file" property must be of type string.' + - `${common.invalidArgTypeHelper(file)}` + `${common.invalidArgTypeHelper(file)}`, }); }); } @@ -48,7 +48,7 @@ assert.strictEqual(typeof ChildProcess, 'function'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.envPairs" property must be an instance of Array.' + - common.invalidArgTypeHelper(envPairs) + common.invalidArgTypeHelper(envPairs), }); }); } @@ -64,7 +64,7 @@ assert.strictEqual(typeof ChildProcess, 'function'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.args" property must be an instance of Array.' + - common.invalidArgTypeHelper(args) + common.invalidArgTypeHelper(args), }); }); } @@ -75,7 +75,7 @@ child.spawn({ file: process.execPath, args: ['--interactive'], cwd: process.cwd(), - stdio: 'pipe' + stdio: 'pipe', }); assert.strictEqual(child.hasOwnProperty('pid'), true); diff --git a/test/parallel/test-child-process-disconnect.js b/test/parallel/test-child-process-disconnect.js index fb8a2dd0ea2213..65db37252dc00c 100644 --- a/test/parallel/test-child-process-disconnect.js +++ b/test/parallel/test-child-process-disconnect.js @@ -96,7 +96,7 @@ if (process.argv[2] === 'child') { assert.throws( child.disconnect.bind(child), { - code: 'ERR_IPC_DISCONNECTED' + code: 'ERR_IPC_DISCONNECTED', }); return; } diff --git a/test/parallel/test-child-process-env.js b/test/parallel/test-child-process-env.js index f9815ff0154f7d..0e718e87e5dd9d 100644 --- a/test/parallel/test-child-process-env.js +++ b/test/parallel/test-child-process-env.js @@ -41,7 +41,7 @@ const env = { 'DUPLICATE': 'uppercase', }; Object.setPrototypeOf(env, { - 'FOO': 'BAR' + 'FOO': 'BAR', }); let child; diff --git a/test/parallel/test-child-process-exec-abortcontroller-promisified.js b/test/parallel/test-child-process-exec-abortcontroller-promisified.js index a19b797ba6671d..c326289f799abc 100644 --- a/test/parallel/test-child-process-exec-abortcontroller-promisified.js +++ b/test/parallel/test-child-process-exec-abortcontroller-promisified.js @@ -7,7 +7,7 @@ const { promisify } = require('util'); const execPromisifed = promisify(exec); const invalidArgTypeError = { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }; const waitCommand = common.isLinux ? diff --git a/test/parallel/test-child-process-exec-timeout.js b/test/parallel/test-child-process-exec-timeout.js index 64648d62bb3284..082a682491a6fd 100644 --- a/test/parallel/test-child-process-exec-timeout.js +++ b/test/parallel/test-child-process-exec-timeout.js @@ -40,7 +40,7 @@ cp.exec(cmd, { timeout: 1 }, common.mustCall((err, stdout, stderr) => { // Test with a different kill signal. cp.exec(cmd, { timeout: 1, - killSignal: 'SIGKILL' + killSignal: 'SIGKILL', }, common.mustCall((err, stdout, stderr) => { assert.strictEqual(err.killed, true); assert.strictEqual(err.code, null); diff --git a/test/parallel/test-child-process-execFile-promisified-abortController.js b/test/parallel/test-child-process-execFile-promisified-abortController.js index 38c177eb33389c..420802eded016c 100644 --- a/test/parallel/test-child-process-execFile-promisified-abortController.js +++ b/test/parallel/test-child-process-execFile-promisified-abortController.js @@ -10,7 +10,7 @@ const echoFixture = fixtures.path('echo.js'); const promisified = promisify(execFile); const invalidArgTypeError = { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }; { diff --git a/test/parallel/test-child-process-fork-abort-signal.js b/test/parallel/test-child-process-fork-abort-signal.js index 9982444c429552..a4681adf583134 100644 --- a/test/parallel/test-child-process-fork-abort-signal.js +++ b/test/parallel/test-child-process-fork-abort-signal.js @@ -10,7 +10,7 @@ const { fork } = require('child_process'); const ac = new AbortController(); const { signal } = ac; const cp = fork(fixtures.path('child-process-stay-alive-forever.js'), { - signal + signal, }); cp.on('exit', mustCall((code, killSignal) => { strictEqual(code, null); @@ -25,7 +25,7 @@ const { fork } = require('child_process'); // Test passing an already aborted signal to a forked child_process const signal = AbortSignal.abort(); const cp = fork(fixtures.path('child-process-stay-alive-forever.js'), { - signal + signal, }); cp.on('exit', mustCall((code, killSignal) => { strictEqual(code, null); @@ -57,7 +57,7 @@ const { fork } = require('child_process'); const ac = new AbortController(); const { signal } = ac; const cp = fork(fixtures.path('child-process-stay-alive-forever.js'), { - signal + signal, }); cp.on('exit', mustCall(() => { ac.abort(); diff --git a/test/parallel/test-child-process-fork-args.js b/test/parallel/test-child-process-fork-args.js index 68863ffb14b747..8b3d2ace6ca20a 100644 --- a/test/parallel/test-child-process-fork-args.js +++ b/test/parallel/test-child-process-fork-args.js @@ -25,7 +25,7 @@ const expectedEnv = { foo: 'bar' }; assert.throws(() => fork(modulePath), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "modulePath" argument must be of type string/ + message: /^The "modulePath" argument must be of type string/, }); }); @@ -55,7 +55,7 @@ const expectedEnv = { foo: 'bar' }; }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -64,7 +64,7 @@ const expectedEnv = { foo: 'bar' }; argsLists.forEach((args) => { const cp = fork(fixtures.path('child-process-echo-options.js'), args, { - env: { ...process.env, ...expectedEnv } + env: { ...process.env, ...expectedEnv }, }); cp.on( @@ -98,7 +98,7 @@ const expectedEnv = { foo: 'bar' }; }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-child-process-fork-no-shell.js b/test/parallel/test-child-process-fork-no-shell.js index 81ceab61fd203f..5f87e2eab597ae 100644 --- a/test/parallel/test-child-process-fork-no-shell.js +++ b/test/parallel/test-child-process-fork-no-shell.js @@ -8,7 +8,7 @@ const expected = common.isWindows ? '%foo%' : '$foo'; if (process.argv[2] === undefined) { const child = cp.fork(__filename, [expected], { shell: true, - env: { ...process.env, foo: 'bar' } + env: { ...process.env, foo: 'bar' }, }); child.on('exit', common.mustCall((code, signal) => { diff --git a/test/parallel/test-child-process-fork-stdio.js b/test/parallel/test-child-process-fork-stdio.js index e76ef27797f0f5..076fe09864cb6d 100644 --- a/test/parallel/test-child-process-fork-stdio.js +++ b/test/parallel/test-child-process-fork-stdio.js @@ -27,7 +27,7 @@ if (process.argv[2] === 'child') { let stderr = ''; const buf = Buffer.from('data to send via pipe'); const child = cp.fork(__filename, ['child'], { - stdio: [0, 'ignore', 'pipe', 'ipc', 'pipe'] + stdio: [0, 'ignore', 'pipe', 'ipc', 'pipe'], }); assert.strictEqual(child.stdout, null); diff --git a/test/parallel/test-child-process-fork.js b/test/parallel/test-child-process-fork.js index a357f4fbc192ef..f943d9f32ac166 100644 --- a/test/parallel/test-child-process-fork.js +++ b/test/parallel/test-child-process-fork.js @@ -42,19 +42,19 @@ n.on('message', (m) => { assert.throws(() => n.send(undefined), { name: 'TypeError', message: 'The "message" argument must be specified', - code: 'ERR_MISSING_ARGS' + code: 'ERR_MISSING_ARGS', }); assert.throws(() => n.send(), { name: 'TypeError', message: 'The "message" argument must be specified', - code: 'ERR_MISSING_ARGS' + code: 'ERR_MISSING_ARGS', }); assert.throws(() => n.send(Symbol()), { name: 'TypeError', message: 'The "message" argument must be one of type string,' + ' object, number, or boolean. Received type symbol (Symbol())', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); n.send({ hello: 'world' }); diff --git a/test/parallel/test-child-process-recv-handle.js b/test/parallel/test-child-process-recv-handle.js index b67bc206ac6f7c..42031cfd90cc04 100644 --- a/test/parallel/test-child-process-recv-handle.js +++ b/test/parallel/test-child-process-recv-handle.js @@ -39,7 +39,7 @@ function primary() { const proc = spawn(process.execPath, [ '--expose-internals', __filename, 'worker', ], { - stdio: ['pipe', 'pipe', 'pipe', 'ipc'] + stdio: ['pipe', 'pipe', 'pipe', 'ipc'], }); let handle = null; proc.on('exit', () => { diff --git a/test/parallel/test-child-process-send-after-close.js b/test/parallel/test-child-process-send-after-close.js index 62128b7b1b9876..1ecdc293aa63c0 100644 --- a/test/parallel/test-child-process-send-after-close.js +++ b/test/parallel/test-child-process-send-after-close.js @@ -14,7 +14,7 @@ child.on('close', common.mustCall((code, signal) => { const testError = common.expectsError({ name: 'Error', message: 'Channel closed', - code: 'ERR_IPC_CHANNEL_CLOSED' + code: 'ERR_IPC_CHANNEL_CLOSED', }, 2); child.on('error', testError); diff --git a/test/parallel/test-child-process-server-close.js b/test/parallel/test-child-process-server-close.js index 832cf970178afa..a8cb56a5c7b828 100644 --- a/test/parallel/test-child-process-server-close.js +++ b/test/parallel/test-child-process-server-close.js @@ -26,7 +26,7 @@ if (process.argv[2] !== 'child') { // Child const server = net.createServer((conn) => { spawn(process.execPath, ['-v'], { - stdio: ['ignore', conn, 'ignore'] + stdio: ['ignore', conn, 'ignore'], }).on('close', common.mustCall(() => { conn.end(); })); diff --git a/test/parallel/test-child-process-set-blocking.js b/test/parallel/test-child-process-set-blocking.js index e2620cd84c8506..fabd860d2a0fc6 100644 --- a/test/parallel/test-child-process-set-blocking.js +++ b/test/parallel/test-child-process-set-blocking.js @@ -28,7 +28,7 @@ const SIZE = 100000; const python = process.env.PYTHON || 'python'; const cp = ch.spawn(python, ['-c', `print(${SIZE} * "C")`], { - stdio: 'inherit' + stdio: 'inherit', }); cp.on('exit', common.mustCall(function(code) { diff --git a/test/parallel/test-child-process-spawn-shell.js b/test/parallel/test-child-process-spawn-shell.js index 9b8de0507130d6..69f07b6bd2d57f 100644 --- a/test/parallel/test-child-process-spawn-shell.js +++ b/test/parallel/test-child-process-spawn-shell.js @@ -20,7 +20,7 @@ doesNotExist.on('exit', common.mustCall((code, signal) => { // Verify that passing arguments works const echo = cp.spawn('echo', ['foo'], { encoding: 'utf8', - shell: true + shell: true, }); let echoOutput = ''; @@ -37,7 +37,7 @@ echo.on('close', common.mustCall((code, signal) => { const cmd = 'echo bar | cat'; const command = cp.spawn(cmd, { encoding: 'utf8', - shell: true + shell: true, }); let commandOutput = ''; @@ -52,7 +52,7 @@ command.on('close', common.mustCall((code, signal) => { const env = cp.spawn(`"${process.execPath}" -pe process.env.BAZ`, { env: { ...process.env, BAZ: 'buzz' }, encoding: 'utf8', - shell: true + shell: true, }); let envOutput = ''; diff --git a/test/parallel/test-child-process-spawn-typeerror.js b/test/parallel/test-child-process-spawn-typeerror.js index 25d1bafe4513cc..323963ad13efb2 100644 --- a/test/parallel/test-child-process-spawn-typeerror.js +++ b/test/parallel/test-child-process-spawn-typeerror.js @@ -31,12 +31,12 @@ const empty = fixtures.path('empty.js'); const invalidArgValueError = { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', }; const invalidArgTypeError = { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }; assert.throws(function() { diff --git a/test/parallel/test-child-process-spawnsync-env.js b/test/parallel/test-child-process-spawnsync-env.js index c8e11b5067c7d1..407350790b7466 100644 --- a/test/parallel/test-child-process-spawnsync-env.js +++ b/test/parallel/test-child-process-spawnsync-env.js @@ -29,7 +29,7 @@ if (process.argv[2] === 'child') { } else { const expected = 'bar'; const child = cp.spawnSync(process.execPath, [__filename, 'child'], { - env: Object.assign(process.env, { foo: expected }) + env: Object.assign(process.env, { foo: expected }), }); assert.strictEqual(child.stdout.toString().trim(), expected); diff --git a/test/parallel/test-child-process-spawnsync-input.js b/test/parallel/test-child-process-spawnsync-input.js index 62ae476ae17caa..86be0701e04b23 100644 --- a/test/parallel/test-child-process-spawnsync-input.js +++ b/test/parallel/test-child-process-spawnsync-input.js @@ -60,7 +60,7 @@ if (process.argv.includes('spawnchild')) { break; case '2': ret = spawnSync(process.execPath, args, { - stdio: ['inherit', 'inherit', 'inherit'] + stdio: ['inherit', 'inherit', 'inherit'], }); checkSpawnSyncRet(ret); break; @@ -73,7 +73,7 @@ verifyBufOutput(spawnSync(process.execPath, [__filename, 'spawnchild', 1])); verifyBufOutput(spawnSync(process.execPath, [__filename, 'spawnchild', 2])); let options = { - input: 1234 + input: 1234, }; assert.throws( @@ -81,7 +81,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' }); options = { - input: 'hello world' + input: 'hello world', }; ret = spawnSync('cat', [], options); @@ -91,7 +91,7 @@ assert.strictEqual(ret.stdout.toString('utf8'), options.input); assert.strictEqual(ret.stderr.toString('utf8'), ''); options = { - input: Buffer.from('hello world') + input: Buffer.from('hello world'), }; ret = spawnSync('cat', [], options); @@ -105,7 +105,7 @@ assert.deepStrictEqual(ret.stderr, Buffer.from('')); const msgBuf = Buffer.from('hello world'.repeat(8)); for (const arrayBufferView of common.getArrayBufferViews(msgBuf)) { options = { - input: arrayBufferView + input: arrayBufferView, }; ret = spawnSync('cat', [], options); diff --git a/test/parallel/test-child-process-spawnsync-shell.js b/test/parallel/test-child-process-spawnsync-shell.js index 0dd50cedd123b2..9d8e8a5c76a49e 100644 --- a/test/parallel/test-child-process-spawnsync-shell.js +++ b/test/parallel/test-child-process-spawnsync-shell.js @@ -38,7 +38,7 @@ assert.strictEqual(command.stdout.toString().trim(), 'bar'); // Verify that the environment is properly inherited const env = cp.spawnSync(`"${process.execPath}" -pe process.env.BAZ`, { env: { ...process.env, BAZ: 'buzz' }, - shell: true + shell: true, }); assert.strictEqual(env.stdout.toString().trim(), 'buzz'); diff --git a/test/parallel/test-child-process-stdin-ipc.js b/test/parallel/test-child-process-stdin-ipc.js index 945960b99b72cc..bfd901ca58faec 100644 --- a/test/parallel/test-child-process-stdin-ipc.js +++ b/test/parallel/test-child-process-stdin-ipc.js @@ -32,7 +32,7 @@ if (process.argv[2] === 'child') { } const proc = spawn(process.execPath, [__filename, 'child'], { - stdio: ['ipc', 'inherit', 'inherit'] + stdio: ['ipc', 'inherit', 'inherit'], }); proc.on('exit', common.mustCall(function(code) { diff --git a/test/parallel/test-child-process-stdio-overlapped.js b/test/parallel/test-child-process-stdio-overlapped.js index 70a6454ff8fc9a..167619e9bb374d 100644 --- a/test/parallel/test-child-process-stdio-overlapped.js +++ b/test/parallel/test-child-process-stdio-overlapped.js @@ -34,7 +34,7 @@ const exe = 'overlapped-checker' + exeExtension; const exePath = path.join(path.dirname(process.execPath), exe); const child = child_process.spawn(exePath, [], { - stdio: ['overlapped', 'pipe', 'pipe'] + stdio: ['overlapped', 'pipe', 'pipe'], }); child.stdin.setEncoding('utf8'); diff --git a/test/parallel/test-child-process-stdout-ipc.js b/test/parallel/test-child-process-stdout-ipc.js index c916be95b73fc0..0fca7b9940febb 100644 --- a/test/parallel/test-child-process-stdout-ipc.js +++ b/test/parallel/test-child-process-stdout-ipc.js @@ -10,7 +10,7 @@ if (process.argv[2] === 'child') { } const proc = spawn(process.execPath, [__filename, 'child'], { - stdio: ['inherit', 'ipc', 'inherit'] + stdio: ['inherit', 'ipc', 'inherit'], }); proc.on('exit', common.mustCall(function(code) { diff --git a/test/parallel/test-child-process-validate-stdio.js b/test/parallel/test-child-process-validate-stdio.js index 6775455fd6538c..8e23e2832811d1 100644 --- a/test/parallel/test-child-process-validate-stdio.js +++ b/test/parallel/test-child-process-validate-stdio.js @@ -53,7 +53,7 @@ if (common.isMainThread) { { type: 'fd', fd: 2 }, ], ipc: undefined, - ipcFd: undefined + ipcFd: undefined, }); } else { common.printSkipMessage( diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 8fb15d3ba505c1..c06985e974b146 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -134,7 +134,7 @@ function workerTest(opts, command, wantsError, test) { execArgv: [], eval: true, stdout: true, - stderr: true + stderr: true, }); worker.on('error', (err) => { workerError = err; diff --git a/test/parallel/test-cli-options-precedence.js b/test/parallel/test-cli-options-precedence.js index 32804d187fccc3..73566514470005 100644 --- a/test/parallel/test-cli-options-precedence.js +++ b/test/parallel/test-cli-options-precedence.js @@ -9,7 +9,7 @@ assert.strictEqual(spawnSync(process.execPath, [ '--max-http-header-size=5678', '-p', 'http.maxHeaderSize', ], { - encoding: 'utf8' + encoding: 'utf8', }).stdout.trim(), '5678'); // The command line takes precedence over NODE_OPTIONS: @@ -18,5 +18,5 @@ assert.strictEqual(spawnSync(process.execPath, [ '-p', 'http.maxHeaderSize', ], { encoding: 'utf8', - env: { ...process.env, NODE_OPTIONS: '--max-http-header-size=1234' } + env: { ...process.env, NODE_OPTIONS: '--max-http-header-size=1234' }, }).stdout.trim(), '5678'); diff --git a/test/parallel/test-cluster-basic.js b/test/parallel/test-cluster-basic.js index 79d8640cf4f65c..5b4c188c45a1fa 100644 --- a/test/parallel/test-cluster-basic.js +++ b/test/parallel/test-cluster-basic.js @@ -46,34 +46,34 @@ if (cluster.isWorker) { fork: false, online: false, listening: false, - exit: false + exit: false, }, equal: { fork: false, online: false, listening: false, - exit: false - } + exit: false, + }, }, worker: { events: { online: false, listening: false, - exit: false + exit: false, }, equal: { online: false, listening: false, - exit: false + exit: false, }, states: { none: false, online: false, listening: false, - dead: false - } - } + dead: false, + }, + }, }; const stateNames = Object.keys(checks.worker.states); diff --git a/test/parallel/test-cluster-dgram-ipv6only.js b/test/parallel/test-cluster-dgram-ipv6only.js index a6283f94d4bffc..331d9ca6e43865 100644 --- a/test/parallel/test-cluster-dgram-ipv6only.js +++ b/test/parallel/test-cluster-dgram-ipv6only.js @@ -25,7 +25,7 @@ if (cluster.isPrimary) { const socket1 = dgram.createSocket({ type: 'udp6', - ipv6Only: true + ipv6Only: true, }); const socket2 = dgram.createSocket({ type: 'udp4', diff --git a/test/parallel/test-cluster-fork-env.js b/test/parallel/test-cluster-fork-env.js index 90b456b19668cd..a69e44317010d1 100644 --- a/test/parallel/test-cluster-fork-env.js +++ b/test/parallel/test-cluster-fork-env.js @@ -32,7 +32,7 @@ const cluster = require('cluster'); if (cluster.isWorker) { const result = cluster.worker.send({ prop: process.env.cluster_test_prop, - overwrite: process.env.cluster_test_overwrite + overwrite: process.env.cluster_test_overwrite, }); assert.strictEqual(result, true); @@ -40,7 +40,7 @@ if (cluster.isWorker) { const checks = { using: false, - overwrite: false + overwrite: false, }; // To check that the cluster extend on the process.env we will overwrite a @@ -50,7 +50,7 @@ if (cluster.isWorker) { // Fork worker const worker = cluster.fork({ 'cluster_test_prop': 'custom', - 'cluster_test_overwrite': 'new' + 'cluster_test_overwrite': 'new', }); // Checks worker env diff --git a/test/parallel/test-cluster-fork-stdio.js b/test/parallel/test-cluster-fork-stdio.js index 263c2ba8024f25..81c46f07158e13 100644 --- a/test/parallel/test-cluster-fork-stdio.js +++ b/test/parallel/test-cluster-fork-stdio.js @@ -8,7 +8,7 @@ if (cluster.isPrimary) { const buf = Buffer.from('foobar'); cluster.setupPrimary({ - stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe'] + stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe'], }); const worker = cluster.fork(); diff --git a/test/parallel/test-cluster-fork-windowsHide.js b/test/parallel/test-cluster-fork-windowsHide.js index 9ba809d71a318f..f9720d7ebc43ca 100644 --- a/test/parallel/test-cluster-fork-windowsHide.js +++ b/test/parallel/test-cluster-fork-windowsHide.js @@ -28,7 +28,7 @@ if (!process.argv[2]) { workerExit: common.mustCall((msg) => { assert.strictEqual(msg.code, 0); assert.strictEqual(msg.signal, null); - }) + }), }; primary.on('message', (msg) => { @@ -45,7 +45,7 @@ if (!process.argv[2]) { } else if (cluster.isPrimary) { cluster.setupPrimary({ silent: true, - windowsHide: true + windowsHide: true, }); const worker = cluster.fork(); diff --git a/test/parallel/test-cluster-invalid-message.js b/test/parallel/test-cluster-invalid-message.js index a42f5284dba134..c2a2a258c14975 100644 --- a/test/parallel/test-cluster-invalid-message.js +++ b/test/parallel/test-cluster-invalid-message.js @@ -14,7 +14,7 @@ if (cluster.isPrimary) { worker.on('online', () => { worker.send({ cmd: 'NODE_CLUSTER', - ack: -1 + ack: -1, }, () => { worker.disconnect(); }); diff --git a/test/parallel/test-cluster-message.js b/test/parallel/test-cluster-message.js index 45854c77a5a347..69313d48a4838a 100644 --- a/test/parallel/test-cluster-message.js +++ b/test/parallel/test-cluster-message.js @@ -43,7 +43,7 @@ if (cluster.isWorker) { // Tell primary using TCP socket that a message is received. socket.write(JSON.stringify({ code: 'received message', - echo: message + echo: message, })); } @@ -66,16 +66,16 @@ if (cluster.isWorker) { const checks = { global: { 'receive': false, - 'correct': false + 'correct': false, }, primary: { 'receive': false, - 'correct': false + 'correct': false, }, worker: { 'receive': false, - 'correct': false - } + 'correct': false, + }, }; diff --git a/test/parallel/test-cluster-primary-error.js b/test/parallel/test-cluster-primary-error.js index f48682da4eab16..b0523832caf3ee 100644 --- a/test/parallel/test-cluster-primary-error.js +++ b/test/parallel/test-cluster-primary-error.js @@ -37,7 +37,7 @@ if (cluster.isWorker) { // Send PID process.send({ cmd: 'worker', - workerPID: worker.process.pid + workerPID: worker.process.pid, }); // Stop listening when done diff --git a/test/parallel/test-cluster-primary-kill.js b/test/parallel/test-cluster-primary-kill.js index 08c78096039f3f..685656976e3a90 100644 --- a/test/parallel/test-cluster-primary-kill.js +++ b/test/parallel/test-cluster-primary-kill.js @@ -36,7 +36,7 @@ if (cluster.isWorker) { // send PID info to testcase process process.send({ - pid: worker.process.pid + pid: worker.process.pid, }); // Terminate the cluster process diff --git a/test/parallel/test-cluster-send-deadlock.js b/test/parallel/test-cluster-send-deadlock.js index 8ddc40c2529441..ee38f8c89d88f7 100644 --- a/test/parallel/test-cluster-send-deadlock.js +++ b/test/parallel/test-cluster-send-deadlock.js @@ -49,11 +49,11 @@ if (cluster.isPrimary) { assert(msg.port); const client1 = net.connect({ host: 'localhost', - port: msg.port + port: msg.port, }, () => { const client2 = net.connect({ host: 'localhost', - port: msg.port + port: msg.port, }, () => { client1.on('close', onclose); client2.on('close', onclose); diff --git a/test/parallel/test-cluster-send-handle-twice.js b/test/parallel/test-cluster-send-handle-twice.js index c413f6f82bffca..0a9c5b3956aadb 100644 --- a/test/parallel/test-cluster-send-handle-twice.js +++ b/test/parallel/test-cluster-send-handle-twice.js @@ -28,7 +28,7 @@ const cluster = require('cluster'); const net = require('net'); const workers = { - toStart: 1 + toStart: 1, }; if (cluster.isPrimary) { @@ -48,7 +48,7 @@ if (cluster.isPrimary) { server.listen(0, function() { const client = net.connect({ host: 'localhost', - port: server.address().port + port: server.address().port, }); client.on('close', common.mustCall(() => { cluster.worker.disconnect(); })); client.on('connect', () => { client.end(); }); diff --git a/test/parallel/test-cluster-setup-primary.js b/test/parallel/test-cluster-setup-primary.js index efba017fd76fae..6e818cf1e01848 100644 --- a/test/parallel/test-cluster-setup-primary.js +++ b/test/parallel/test-cluster-setup-primary.js @@ -34,7 +34,7 @@ if (cluster.isWorker) { const checks = { args: false, setupEvent: false, - settingsObject: false + settingsObject: false, }; const totalWorkers = 2; @@ -43,7 +43,7 @@ if (cluster.isWorker) { // Setup primary cluster.setupPrimary({ args: ['custom argument'], - silent: true + silent: true, }); cluster.once('setup', function() { diff --git a/test/parallel/test-cluster-worker-constructor.js b/test/parallel/test-cluster-worker-constructor.js index c116e622e5d0fa..9e2967b2304900 100644 --- a/test/parallel/test-cluster-worker-constructor.js +++ b/test/parallel/test-cluster-worker-constructor.js @@ -37,7 +37,7 @@ assert.strictEqual(worker.process, undefined); worker = new cluster.Worker({ id: 3, state: 'online', - process: process + process: process, }); assert.strictEqual(worker.exitedAfterDisconnect, undefined); assert.strictEqual(worker.state, 'online'); diff --git a/test/parallel/test-cluster-worker-disconnect.js b/test/parallel/test-cluster-worker-disconnect.js index b28c0fbd8f5d9e..8d8b2ca1d2802c 100644 --- a/test/parallel/test-cluster-worker-disconnect.js +++ b/test/parallel/test-cluster-worker-disconnect.js @@ -40,7 +40,7 @@ if (cluster.isWorker) { cluster: { emitDisconnect: false, emitExit: false, - callback: false + callback: false, }, worker: { emitDisconnect: false, @@ -48,8 +48,8 @@ if (cluster.isWorker) { emitExit: false, state: false, voluntaryMode: false, - died: false - } + died: false, + }, }; // start worker diff --git a/test/parallel/test-cluster-worker-exit.js b/test/parallel/test-cluster-worker-exit.js index 09e2a83701ac77..0ae83819773eaa 100644 --- a/test/parallel/test-cluster-worker-exit.js +++ b/test/parallel/test-cluster-worker-exit.js @@ -57,13 +57,13 @@ if (cluster.isWorker) { ], worker_died: [true, 'the worker is still running'], worker_exitCode: [EXIT_CODE, 'the worker exited w/ incorrect exitCode'], - worker_signalCode: [null, 'the worker exited w/ incorrect signalCode'] + worker_signalCode: [null, 'the worker exited w/ incorrect signalCode'], }; const results = { cluster_emitDisconnect: 0, cluster_emitExit: 0, worker_emitDisconnect: 0, - worker_emitExit: 0 + worker_emitExit: 0, }; diff --git a/test/parallel/test-cluster-worker-kill.js b/test/parallel/test-cluster-worker-kill.js index 9fcb924149704e..560222b92e1a6d 100644 --- a/test/parallel/test-cluster-worker-kill.js +++ b/test/parallel/test-cluster-worker-kill.js @@ -54,13 +54,13 @@ if (cluster.isWorker) { worker_died: [true, 'the worker is still running'], worker_exitCode: [null, 'the worker exited w/ incorrect exitCode'], worker_signalCode: [KILL_SIGNAL, - 'the worker exited w/ incorrect signalCode'] + 'the worker exited w/ incorrect signalCode'], }; const results = { cluster_emitDisconnect: 0, cluster_emitExit: 0, worker_emitDisconnect: 0, - worker_emitExit: 0 + worker_emitExit: 0, }; diff --git a/test/parallel/test-code-cache.js b/test/parallel/test-code-cache.js index 1b151e269dcfaf..049f302191608e 100644 --- a/test/parallel/test-code-cache.js +++ b/test/parallel/test-code-cache.js @@ -8,11 +8,11 @@ const { isMainThread } = require('../common'); const assert = require('assert'); const { - internalBinding + internalBinding, } = require('internal/test/binding'); const { getCacheUsage, - moduleCategories: { canBeRequired, cannotBeRequired } + moduleCategories: { canBeRequired, cannotBeRequired }, } = internalBinding('native_module'); for (const key of canBeRequired) { @@ -23,7 +23,7 @@ for (const key of canBeRequired) { const { compiledWithoutCache, compiledWithCache, - compiledInSnapshot + compiledInSnapshot, } = getCacheUsage(); function extractModules(list) { diff --git a/test/parallel/test-common.js b/test/parallel/test-common.js index 24c4f8462eb767..13c9d59c625153 100644 --- a/test/parallel/test-common.js +++ b/test/parallel/test-common.js @@ -42,7 +42,7 @@ const { join } = require('path'); { const p = fixtures.path('leakedGlobal.js'); execFile(process.execPath, [p], { - env: { ...process.env, NODE_TEST_KNOWN_GLOBALS: 0 } + env: { ...process.env, NODE_TEST_KNOWN_GLOBALS: 0 }, }, common.mustCall((err, stdout, stderr) => { assert.strictEqual(err, null); assert.strictEqual(stderr.trim(), ''); @@ -67,7 +67,7 @@ assert.throws( () => { assert.fail('fhqwhgads'); }, { code: 'ERR_ASSERTION', - message: /^fhqwhgads$/ + message: /^fhqwhgads$/, }); const fnOnce = common.mustCall(() => {}); diff --git a/test/parallel/test-console-async-write-error.js b/test/parallel/test-console-async-write-error.js index be76c89832f611..8971dfed32189f 100644 --- a/test/parallel/test-console-async-write-error.js +++ b/test/parallel/test-console-async-write-error.js @@ -7,7 +7,7 @@ for (const method of ['dir', 'log', 'warn']) { const out = new Writable({ write: common.mustCall((chunk, enc, callback) => { process.nextTick(callback, new Error('foobar')); - }) + }), }); const c = new Console(out, out, true); diff --git a/test/parallel/test-console-group.js b/test/parallel/test-console-group.js index 9b7e836a436add..8bbc81057c9366 100644 --- a/test/parallel/test-console-group.js +++ b/test/parallel/test-console-group.js @@ -4,7 +4,7 @@ const { hijackStdout, hijackStderr, restoreStdout, - restoreStderr + restoreStderr, } = require('../common/hijackstdio'); const assert = require('assert'); @@ -202,7 +202,7 @@ function teardown() { }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-console-instance.js b/test/parallel/test-console-instance.js index bf22314e22e031..199f9e283a2e4a 100644 --- a/test/parallel/test-console-instance.js +++ b/test/parallel/test-console-instance.js @@ -48,7 +48,7 @@ assert.throws( { code: 'ERR_CONSOLE_WRITABLE_STREAM', name: 'TypeError', - message: /stdout/ + message: /stdout/, } ); @@ -62,7 +62,7 @@ assert.throws( { code: 'ERR_CONSOLE_WRITABLE_STREAM', name: 'TypeError', - message: /stderr/ + message: /stderr/, } ); @@ -136,13 +136,13 @@ out.write = err.write = (d) => {}; new Console({ stdout: out, stderr: err, - inspectOptions + inspectOptions, }); }, { message: 'The "options.inspectOptions" property must be of type object.' + common.invalidArgTypeHelper(inspectOptions), - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); }); diff --git a/test/parallel/test-console-log-stdio-broken-dest.js b/test/parallel/test-console-log-stdio-broken-dest.js index d29e8ee5173be7..2767c65297367f 100644 --- a/test/parallel/test-console-log-stdio-broken-dest.js +++ b/test/parallel/test-console-log-stdio-broken-dest.js @@ -11,7 +11,7 @@ const stream = new Writable({ }, writev(chunks, cb) { setTimeout(cb, 10, new Error('kaboom')); - } + }, }); const myConsole = new Console(stream, stream); diff --git a/test/parallel/test-console-log-throw-primitive.js b/test/parallel/test-console-log-throw-primitive.js index a1a9ca25726ab9..8bf3924529844e 100644 --- a/test/parallel/test-console-log-throw-primitive.js +++ b/test/parallel/test-console-log-throw-primitive.js @@ -6,7 +6,7 @@ const { Console } = require('console'); const stream = new Writable({ write() { throw null; // eslint-disable-line no-throw-literal - } + }, }); const console = new Console({ stdout: stream }); diff --git a/test/parallel/test-console-methods.js b/test/parallel/test-console-methods.js index d338cc1f807f2c..96ff6275422afc 100644 --- a/test/parallel/test-console-methods.js +++ b/test/parallel/test-console-methods.js @@ -37,7 +37,7 @@ const alternateNames = { info: 'log', dirxml: 'log', error: 'warn', - groupCollapsed: 'group' + groupCollapsed: 'group', }; function assertEqualName(method) { diff --git a/test/parallel/test-console-sync-write-error.js b/test/parallel/test-console-sync-write-error.js index bf916ff5b84e8d..a728b627c0b19c 100644 --- a/test/parallel/test-console-sync-write-error.js +++ b/test/parallel/test-console-sync-write-error.js @@ -8,7 +8,7 @@ for (const method of ['dir', 'log', 'warn']) { const out = new Writable({ write: common.mustCall((chunk, enc, callback) => { callback(new Error('foobar')); - }) + }), }); const c = new Console(out, out, true); @@ -19,7 +19,7 @@ for (const method of ['dir', 'log', 'warn']) { const out = new Writable({ write: common.mustCall((chunk, enc, callback) => { throw new Error('foobar'); - }) + }), }); const c = new Console(out, out, true); @@ -30,7 +30,7 @@ for (const method of ['dir', 'log', 'warn']) { const out = new Writable({ write: common.mustCall((chunk, enc, callback) => { setImmediate(() => callback(new Error('foobar'))); - }) + }), }); const c = new Console(out, out, true); diff --git a/test/parallel/test-console-tty-colors.js b/test/parallel/test-console-tty-colors.js index 0eb51c72898f7c..d8ecf36e7f8501 100644 --- a/test/parallel/test-console-tty-colors.js +++ b/test/parallel/test-console-tty-colors.js @@ -19,11 +19,11 @@ function check(isTTY, colorMode, expectedColorMode, inspectOptions) { assert.strictEqual(chunk.trim(), util.inspect(items[i++], { colors: expectedColorMode, - ...inspectOptions + ...inspectOptions, })); cb(); }, items.length), - decodeStrings: false + decodeStrings: false, }); stream.isTTY = isTTY; @@ -33,7 +33,7 @@ function check(isTTY, colorMode, expectedColorMode, inspectOptions) { stdout: stream, ignoreErrors: false, colorMode, - inspectOptions + inspectOptions, }); for (const item of items) { testConsole.log(item); @@ -53,7 +53,7 @@ check(false, false, false); // Check invalid options. { const stream = new Writable({ - write: common.mustNotCall() + write: common.mustNotCall(), }); [0, 'true', null, {}, [], () => {}].forEach((colorMode) => { @@ -63,12 +63,12 @@ check(false, false, false); new Console({ stdout: stream, ignoreErrors: false, - colorMode: colorMode + colorMode: colorMode, }); }, { message: `The argument 'colorMode' is invalid. Received ${received}`, - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', } ); }); @@ -81,14 +81,14 @@ check(false, false, false); ignoreErrors: false, colorMode: colorMode, inspectOptions: { - colors: false - } + colors: false, + }, }); }, { message: 'Option "options.inspectOptions.color" cannot be used in ' + 'combination with option "colorMode"', - code: 'ERR_INCOMPATIBLE_OPTION_PAIR' + code: 'ERR_INCOMPATIBLE_OPTION_PAIR', } ); }); diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index ee2c7c82a6f8e0..4bbc129d4b2abe 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -28,7 +28,7 @@ const { hijackStdout, hijackStderr, restoreStdout, - restoreStderr + restoreStderr, } = require('../common/hijackstdio'); assert.ok(process.stdout.writable); diff --git a/test/parallel/test-crypto-aes-wrap.js b/test/parallel/test-crypto-aes-wrap.js index 6fe35258f7d6b2..e68145aad9d984 100644 --- a/test/parallel/test-crypto-aes-wrap.js +++ b/test/parallel/test-crypto-aes-wrap.js @@ -11,37 +11,37 @@ const test = [ algorithm: 'aes128-wrap', key: 'b26f309fbe57e9b3bb6ae5ef31d54450', iv: '3fd838af4093d749', - text: '12345678123456781234567812345678' + text: '12345678123456781234567812345678', }, { algorithm: 'id-aes128-wrap-pad', key: 'b26f309fbe57e9b3bb6ae5ef31d54450', iv: '3fd838af', - text: '12345678123456781234567812345678123' + text: '12345678123456781234567812345678123', }, { algorithm: 'aes192-wrap', key: '40978085d68091f7dfca0d7dfc7a5ee76d2cc7f2f345a304', iv: '3fd838af4093d749', - text: '12345678123456781234567812345678' + text: '12345678123456781234567812345678', }, { algorithm: 'id-aes192-wrap-pad', key: '40978085d68091f7dfca0d7dfc7a5ee76d2cc7f2f345a304', iv: '3fd838af', - text: '12345678123456781234567812345678123' + text: '12345678123456781234567812345678123', }, { algorithm: 'aes256-wrap', key: '29c9eab5ed5ad44134a1437fe2e673b4d88a5b7c72e68454fea08721392b7323', iv: '3fd838af4093d749', - text: '12345678123456781234567812345678' + text: '12345678123456781234567812345678', }, { algorithm: 'id-aes256-wrap-pad', key: '29c9eab5ed5ad44134a1437fe2e673b4d88a5b7c72e68454fea08721392b7323', iv: '3fd838af', - text: '12345678123456781234567812345678123' + text: '12345678123456781234567812345678123', }, ]; diff --git a/test/parallel/test-crypto-async-sign-verify.js b/test/parallel/test-crypto-async-sign-verify.js index 2e6c9e0bc539f4..f7a4854de8151f 100644 --- a/test/parallel/test-crypto-async-sign-verify.js +++ b/test/parallel/test-crypto-async-sign-verify.js @@ -26,13 +26,13 @@ function test( key: privateKey.export({ format: 'der', type: 'pkcs8' }), format: 'der', type: 'pkcs8', - ...options + ...options, }; const publicDer = { key: publicKey.export({ format: 'der', type: 'spki' }), format: 'der', type: 'spki', - ...options + ...options, }; if (options) { @@ -78,14 +78,14 @@ test('rsa_public.pem', 'rsa_private.pem', 'sha256', false, test('rsa_public.pem', 'rsa_private.pem', 'sha256', false, { padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN + saltLength: crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN, }); // RSA w/ PSS_PADDING and PSS_SALTLEN_DIGEST test('rsa_public.pem', 'rsa_private.pem', 'sha256', false, { padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST + saltLength: crypto.constants.RSA_PSS_SALTLEN_DIGEST, }); // ED25519 diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js index 21c5af6cfe3e5e..2ac66848c0d8cd 100644 --- a/test/parallel/test-crypto-authenticated.js +++ b/test/parallel/test-crypto-authenticated.js @@ -44,7 +44,7 @@ const errMessages = { state: / state/, FIPS: /not supported in FIPS mode/, length: /Invalid initialization vector/, - authTagLength: /Invalid authentication tag/ + authTagLength: /Invalid authentication tag/, }; const ciphers = crypto.getCiphers(); @@ -80,7 +80,7 @@ const expectedDeprecationWarnings = [ common.expectWarning({ Warning: expectedWarnings, - DeprecationWarning: expectedDeprecationWarnings + DeprecationWarning: expectedDeprecationWarnings, }); for (const test of TEST_CASES) { @@ -107,7 +107,7 @@ for (const test of TEST_CASES) { let aadOptions; if (isCCM) { aadOptions = { - plaintextLength: Buffer.from(test.plain, inputEncoding).length + plaintextLength: Buffer.from(test.plain, inputEncoding).length, }; } @@ -246,7 +246,7 @@ for (const test of TEST_CASES) { decrypt.setAuthTag(Buffer.from('1'.repeat(length))); }, { name: 'TypeError', - message: /Invalid authentication tag length/ + message: /Invalid authentication tag length/, }); assert.throws(() => { @@ -254,11 +254,11 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6Szih', { - authTagLength: length + authTagLength: length, }); }, { name: 'TypeError', - message: /Invalid authentication tag length/ + message: /Invalid authentication tag length/, }); assert.throws(() => { @@ -266,11 +266,11 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6Szih', { - authTagLength: length + authTagLength: length, }); }, { name: 'TypeError', - message: /Invalid authentication tag length/ + message: /Invalid authentication tag length/, }); } } @@ -282,7 +282,7 @@ for (const test of TEST_CASES) { const cipher = crypto.createCipheriv('aes-256-gcm', 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6Szih', { - authTagLength + authTagLength, }); cipher.setAAD(Buffer.from('abcd')); cipher.update('01234567', 'hex'); @@ -297,7 +297,7 @@ for (const test of TEST_CASES) { const decipher = crypto.createDecipheriv('aes-256-gcm', 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6Szih', { - authTagLength: 8 + authTagLength: 8, }); assert.throws(() => { @@ -305,7 +305,7 @@ for (const test of TEST_CASES) { decipher.setAuthTag(Buffer.from('1'.repeat(12))); }, { name: 'TypeError', - message: /Invalid authentication tag length/ + message: /Invalid authentication tag length/, }); // The Decipher object should be left intact. @@ -326,13 +326,13 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6S', { - authTagLength + authTagLength, }); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.authTagLength' is invalid. " + - `Received ${inspect(authTagLength)}` + `Received ${inspect(authTagLength)}`, }); assert.throws(() => { @@ -340,13 +340,13 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6S', { - authTagLength + authTagLength, }); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.authTagLength' is invalid. " + - `Received ${inspect(authTagLength)}` + `Received ${inspect(authTagLength)}`, }); if (!common.hasFipsCrypto) { @@ -356,7 +356,7 @@ for (const test of TEST_CASES) { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.authTagLength' is invalid. " + - `Received ${inspect(authTagLength)}` + `Received ${inspect(authTagLength)}`, }); assert.throws(() => { @@ -365,7 +365,7 @@ for (const test of TEST_CASES) { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.authTagLength' is invalid. " + - `Received ${inspect(authTagLength)}` + `Received ${inspect(authTagLength)}`, }); } } @@ -378,7 +378,7 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6S', { - authTagLength + authTagLength, }); }, errMessages.authTagLength); @@ -388,7 +388,7 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6S', { - authTagLength + authTagLength, }); }, errMessages.authTagLength); @@ -412,7 +412,7 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6S'); }, { - message: `authTagLength required for aes-256-${mode}` + message: `authTagLength required for aes-256-${mode}`, }); // CCM decryption and create(De|C)ipher are unsupported in FIPS mode. @@ -422,19 +422,19 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6S'); }, { - message: `authTagLength required for aes-256-${mode}` + message: `authTagLength required for aes-256-${mode}`, }); assert.throws(() => { crypto.createCipher(`aes-256-${mode}`, 'very bad password'); }, { - message: `authTagLength required for aes-256-${mode}` + message: `authTagLength required for aes-256-${mode}`, }); assert.throws(() => { crypto.createDecipher(`aes-256-${mode}`, 'very bad password'); }, { - message: `authTagLength required for aes-256-${mode}` + message: `authTagLength required for aes-256-${mode}`, }); } } @@ -446,7 +446,7 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6S', { - authTagLength: 10 + authTagLength: 10, }); for (const plaintextLength of [-1, true, false, NaN, 5.5]) { @@ -456,7 +456,7 @@ for (const test of TEST_CASES) { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.plaintextLength' is invalid. " + - `Received ${inspect(plaintextLength)}` + `Received ${inspect(plaintextLength)}`, }); } } @@ -469,12 +469,12 @@ for (const test of TEST_CASES) { const cipher = () => crypto.createCipheriv('aes-256-ccm', key, '0'.repeat(ivLength), { - authTagLength: 10 + authTagLength: 10, }); assert.throws(() => { cipher().setAAD(Buffer.alloc(0), { - plaintextLength: maxMessageSize + 1 + plaintextLength: maxMessageSize + 1, }); }, /Invalid message length$/); @@ -485,7 +485,7 @@ for (const test of TEST_CASES) { const c = cipher(); c.setAAD(Buffer.alloc(0), { - plaintextLength: maxMessageSize + plaintextLength: maxMessageSize, }); c.update(msg.slice(1)); } @@ -499,7 +499,7 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6S', { - authTagLength: 10 + authTagLength: 10, }); cipher.setAAD(Buffer.from('0123456789', 'hex')); }, /options\.plaintextLength required for CCM mode with AAD/); @@ -510,7 +510,7 @@ for (const test of TEST_CASES) { 'FxLKsqdmv0E9xrQhp0b1ZgI0K7JFZJM8', 'qkuZpJWCewa6S', { - authTagLength: 10 + authTagLength: 10, }); cipher.setAAD(Buffer.from('0123456789', 'hex')); }, /options\.plaintextLength required for CCM mode with AAD/); @@ -524,13 +524,13 @@ for (const test of TEST_CASES) { const iv = Buffer.from('7305220bca40d4c90e1791e9', 'hex'); const ct = Buffer.from('8beba09d4d4d861f957d51c0794f4abf8030848e', 'hex'); const decrypt = crypto.createDecipheriv('aes-128-ccm', key, iv, { - authTagLength: 10 + authTagLength: 10, }); // Normally, we would do this: // decrypt.setAuthTag(Buffer.from('0d9bcd142a94caf3d1dd', 'hex')); assert.throws(() => { decrypt.setAAD(Buffer.from('63616c76696e', 'hex'), { - plaintextLength: ct.length + plaintextLength: ct.length, }); decrypt.update(ct); decrypt.final(); @@ -569,14 +569,14 @@ for (const test of TEST_CASES) { for (const mode of ['gcm', 'ocb']) { for (const authTagLength of mode === 'gcm' ? [undefined, 8] : [8]) { const cipher = crypto.createCipheriv(`aes-128-${mode}`, key, iv, { - authTagLength + authTagLength, }); const ciphertext = Buffer.concat([cipher.update(plain), cipher.final()]); const authTag = cipher.getAuthTag(); for (const authTagBeforeUpdate of [true, false]) { const decipher = crypto.createDecipheriv(`aes-128-${mode}`, key, iv, { - authTagLength + authTagLength, }); if (authTagBeforeUpdate) { decipher.setAuthTag(authTag); @@ -681,9 +681,9 @@ for (const test of TEST_CASES) { assert.throws(() => { cipher.final(); }, common.hasOpenSSL3 ? { - code: 'ERR_OSSL_TAG_NOT_SET' + code: 'ERR_OSSL_TAG_NOT_SET', } : { - message: /Unsupported state/ + message: /Unsupported state/, }); } } diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index 3bbca5b0da395b..55fe0581a64823 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -87,8 +87,8 @@ assert.throws(function() { sha512: '87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b305' + '45e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f170' + - '2e696c203a126854' - } + '2e696c203a126854', + }, }, { key: Buffer.from('4a656665', 'hex'), // 'Jefe' @@ -105,8 +105,8 @@ assert.throws(function() { sha512: '164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7' + 'ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b' + - '636e070a38bce737' - } + '636e070a38bce737', + }, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'), @@ -124,8 +124,8 @@ assert.throws(function() { sha512: 'fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33' + 'b2279d39bf3e848279a722c806b485a47e67c807b946a337bee89426' + - '74278859e13292fb' - } + '74278859e13292fb', + }, }, { key: Buffer.from('0102030405060708090a0b0c0d0e0f10111213141516171819', @@ -144,8 +144,8 @@ assert.throws(function() { sha512: 'b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050' + '361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2d' + - 'e2adebeb10a298dd' - } + 'e2adebeb10a298dd', + }, }, { key: Buffer.from('0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c', 'hex'), @@ -155,9 +155,9 @@ assert.throws(function() { sha224: '0e2aea68a90c8d37c988bcdb9fca6fa8', sha256: 'a3b6167473100ee06e0c796c2955552b', sha384: '3abf34c3503b2a23a46efc619baef897', - sha512: '415fad6271580a531d4179bc891d87a6' + sha512: '415fad6271580a531d4179bc891d87a6', }, - truncate: true + truncate: true, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -181,8 +181,8 @@ assert.throws(function() { sha512: '80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b0137' + '83f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec' + - '8b915a985d786598' - } + '8b915a985d786598', + }, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -212,8 +212,8 @@ assert.throws(function() { sha512: 'e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d' + '20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de04460' + - '65c97440fa8c6a58' - } + '65c97440fa8c6a58', + }, }, ]; @@ -239,19 +239,19 @@ assert.throws(function() { { key: Buffer.from('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b', 'hex'), data: 'Hi There', - hmac: '9294727a3638bb1c13f48ef8158bfc9d' + hmac: '9294727a3638bb1c13f48ef8158bfc9d', }, { key: 'Jefe', data: 'what do ya want for nothing?', - hmac: '750c783e6ab0b503eaa86e310a5db738' + hmac: '750c783e6ab0b503eaa86e310a5db738', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'), data: Buffer.from('ddddddddddddddddddddddddddddddddddddddddddddddddd' + 'ddddddddddddddddddddddddddddddddddddddddddddddddddd', 'hex'), - hmac: '56be34521d144c88dbb8c733f0e8b3f6' + hmac: '56be34521d144c88dbb8c733f0e8b3f6', }, { key: Buffer.from('0102030405060708090a0b0c0d0e0f10111213141516171819', @@ -260,12 +260,12 @@ assert.throws(function() { 'dcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd' + 'cdcdcdcdcd', 'hex'), - hmac: '697eaf0aca3a3aea3a75164746ffaa79' + hmac: '697eaf0aca3a3aea3a75164746ffaa79', }, { key: Buffer.from('0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c', 'hex'), data: 'Test With Truncation', - hmac: '56461ef2342edc00f9bab995690efd4c' + hmac: '56461ef2342edc00f9bab995690efd4c', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -274,7 +274,7 @@ assert.throws(function() { 'aaaaaaaaaaaaaaaaaaaaaa', 'hex'), data: 'Test Using Larger Than Block-Size Key - Hash Key First', - hmac: '6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd' + hmac: '6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -285,19 +285,19 @@ assert.throws(function() { data: 'Test Using Larger Than Block-Size Key and Larger Than One ' + 'Block-Size Data', - hmac: '6f630fad67cda0ee1fb1f562db3aa53e' + hmac: '6f630fad67cda0ee1fb1f562db3aa53e', }, ]; const rfc2202_sha1 = [ { key: Buffer.from('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b', 'hex'), data: 'Hi There', - hmac: 'b617318655057264e28bc0b6fb378c8ef146be00' + hmac: 'b617318655057264e28bc0b6fb378c8ef146be00', }, { key: 'Jefe', data: 'what do ya want for nothing?', - hmac: 'effcdf6ae5eb2fa2d27416d5f184df9c259a7c79' + hmac: 'effcdf6ae5eb2fa2d27416d5f184df9c259a7c79', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'), @@ -305,7 +305,7 @@ assert.throws(function() { 'ddddddddddddddddddddddddddddddddddddddddddddd' + 'dddddddddd', 'hex'), - hmac: '125d7342b9ac11cd91a39af48aa17b4f63f175d3' + hmac: '125d7342b9ac11cd91a39af48aa17b4f63f175d3', }, { key: Buffer.from('0102030405060708090a0b0c0d0e0f10111213141516171819', @@ -314,12 +314,12 @@ assert.throws(function() { 'dcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd' + 'cdcdcdcdcd', 'hex'), - hmac: '4c9007f4026250c6bc8414f9bf50c86c2d7235da' + hmac: '4c9007f4026250c6bc8414f9bf50c86c2d7235da', }, { key: Buffer.from('0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c', 'hex'), data: 'Test With Truncation', - hmac: '4c1a03424b55e07fe7f27be1d58bb9324a9a5a04' + hmac: '4c1a03424b55e07fe7f27be1d58bb9324a9a5a04', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -328,7 +328,7 @@ assert.throws(function() { 'aaaaaaaaaaaaaaaaaaaaaa', 'hex'), data: 'Test Using Larger Than Block-Size Key - Hash Key First', - hmac: 'aa4ae5e15272d00e95705637ce8a3b55ed402112' + hmac: 'aa4ae5e15272d00e95705637ce8a3b55ed402112', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -339,7 +339,7 @@ assert.throws(function() { data: 'Test Using Larger Than Block-Size Key and Larger Than One ' + 'Block-Size Data', - hmac: 'e8e99d0f45237d786d6bbaa7965c7808bbff1a91' + hmac: 'e8e99d0f45237d786d6bbaa7965c7808bbff1a91', }, ]; @@ -576,7 +576,7 @@ assert.throws( () => crypto.createHash('sha1').update({ foo: 'bar' }), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); diff --git a/test/parallel/test-crypto-certificate.js b/test/parallel/test-crypto-certificate.js index 4a5f1f149fe6c7..3d14da9b606327 100644 --- a/test/parallel/test-crypto-certificate.js +++ b/test/parallel/test-crypto-certificate.js @@ -77,15 +77,15 @@ function checkMethods(certificate) { if (!skip) { assert.throws( () => Certificate.verifySpkac(buf), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws( () => Certificate.exportChallenge(buf), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws( () => Certificate.exportPublicKey(buf), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); } } diff --git a/test/parallel/test-crypto-cipher-decipher.js b/test/parallel/test-crypto-cipher-decipher.js index 35514afbea9256..44cdf02c32357e 100644 --- a/test/parallel/test-crypto-cipher-decipher.js +++ b/test/parallel/test-crypto-cipher-decipher.js @@ -16,7 +16,7 @@ common.expectWarning({ ], DeprecationWarning: [ ['crypto.createCipher is deprecated.', 'DEP0106'], - ] + ], }); function testCipher1(key) { @@ -91,14 +91,14 @@ testCipher2(Buffer.from('0123456789abcdef')); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "cipher" argument must be of type string. ' + - 'Received null' + 'Received null', }); assert.throws( () => crypto.createCipher('aes-256-cbc', null), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); assert.throws( @@ -128,7 +128,7 @@ testCipher2(Buffer.from('0123456789abcdef')); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "cipher" argument must be of type string. ' + - 'Received null' + 'Received null', }); assert.throws( @@ -243,7 +243,7 @@ testCipher2(Buffer.from('0123456789abcdef')); { code: 'ERR_CRYPTO_INVALID_STATE', name: 'Error', - message: 'Invalid state for operation getAuthTag' + message: 'Invalid state for operation getAuthTag', } ); @@ -261,7 +261,7 @@ testCipher2(Buffer.from('0123456789abcdef')); { code: 'ERR_CRYPTO_INVALID_STATE', name: 'Error', - message: 'Invalid state for operation setAAD' + message: 'Invalid state for operation setAAD', }); assert.throws( @@ -269,7 +269,7 @@ testCipher2(Buffer.from('0123456789abcdef')); { code: 'ERR_CRYPTO_INVALID_STATE', name: 'Error', - message: 'Invalid state for operation setAuthTag' + message: 'Invalid state for operation setAuthTag', }); assert.throws( @@ -277,7 +277,7 @@ testCipher2(Buffer.from('0123456789abcdef')); { code: 'ERR_CRYPTO_INVALID_STATE', name: 'Error', - message: 'Invalid state for operation setAutoPadding' + message: 'Invalid state for operation setAutoPadding', } ); } diff --git a/test/parallel/test-crypto-cipheriv-decipheriv.js b/test/parallel/test-crypto-cipheriv-decipheriv.js index 87f3641fb188bd..49466439cd8ffe 100644 --- a/test/parallel/test-crypto-cipheriv-decipheriv.js +++ b/test/parallel/test-crypto-cipheriv-decipheriv.js @@ -93,7 +93,7 @@ function testCipher3(key, iv) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "cipher" argument must be of type string. ' + - 'Received null' + 'Received null', }); assert.throws( @@ -126,7 +126,7 @@ function testCipher3(key, iv) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "cipher" argument must be of type string. ' + - 'Received null' + 'Received null', }); assert.throws( @@ -207,7 +207,7 @@ for (let n = minIvLength; n < maxIvLength; n += 1) { { name: 'Error', code: 'ERR_CRYPTO_UNKNOWN_CIPHER', - message: 'Unknown cipher' + message: 'Unknown cipher', }); // Passing a key with an invalid length should throw. diff --git a/test/parallel/test-crypto-des3-wrap.js b/test/parallel/test-crypto-des3-wrap.js index 75c8cd574fd662..7943984c830ca1 100644 --- a/test/parallel/test-crypto-des3-wrap.js +++ b/test/parallel/test-crypto-des3-wrap.js @@ -13,7 +13,7 @@ const test = { iv: Buffer.alloc(0), plaintext: '32|RmVZZkFUVmpRRkp0TmJaUm56ZU9qcnJkaXNNWVNpTTU*|iXmckfRWZBG' + 'WWELweCBsThSsfUHLeRe0KCsK8ooHgxie0zOINpXxfZi/oNG7uq9JWFVCk70gfzQH8ZU' + - 'JjAfaFg**' + 'JjAfaFg**', }; const cipher = crypto.createCipheriv('des3-wrap', test.key, test.iv); diff --git a/test/parallel/test-crypto-dh-stateless.js b/test/parallel/test-crypto-dh-stateless.js index 658bd38fff655a..9ef0959c1d5a78 100644 --- a/test/parallel/test-crypto-dh-stateless.js +++ b/test/parallel/test-crypto-dh-stateless.js @@ -12,13 +12,13 @@ const crypto = require('crypto'); assert.throws(() => crypto.diffieHellman(), { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', - message: 'The "options" argument must be of type object. Received undefined' + message: 'The "options" argument must be of type object. Received undefined', }); assert.throws(() => crypto.diffieHellman(null), { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', - message: 'The "options" argument must be of type object. Received null' + message: 'The "options" argument must be of type object. Received null', }); assert.throws(() => crypto.diffieHellman([]), { @@ -34,11 +34,11 @@ function test({ publicKey: alicePublicKey, privateKey: alicePrivateKey }, expectedValue) { const buf1 = crypto.diffieHellman({ privateKey: alicePrivateKey, - publicKey: bobPublicKey + publicKey: bobPublicKey, }); const buf2 = crypto.diffieHellman({ privateKey: bobPrivateKey, - publicKey: alicePublicKey + publicKey: alicePublicKey, }); assert.deepStrictEqual(buf1, buf2); @@ -58,7 +58,7 @@ const alicePrivateKey = crypto.createPrivateKey({ 'iIt9FmvFaaOVe2DupqSr6xzbf/zyON+WF5B5HNVOWXswgpgdUsCyygs98hKy/Xje\n' + 'TGzJUoWInW39t0YgMXenJrkS0m6wol8Rhxx81AGgELNV7EHZqg==\n' + '-----END PRIVATE KEY-----', - format: 'pem' + format: 'pem', }); const alicePublicKey = crypto.createPublicKey({ key: '-----BEGIN PUBLIC KEY-----\n' + @@ -72,7 +72,7 @@ const alicePublicKey = crypto.createPublicKey({ 'rDEz8mjIlnvbWpKB9+uYmbjfVoc3leFvUBqfG2In2m23Md1swsPxr3n7g68H66JX\n' + 'iBJKZLQMqNdbY14G9rdKmhhTJrQjC+i7Q/wI8JPhOFzHIGA=\n' + '-----END PUBLIC KEY-----', - format: 'pem' + format: 'pem', }); const bobPrivateKey = crypto.createPrivateKey({ @@ -87,7 +87,7 @@ const bobPrivateKey = crypto.createPrivateKey({ 'GagGtIy3dV5f4FA0B/2C97jQ1pO16ah8gSLQRKsNpTCw2rqsZusE0rK6RaYAef7H\n' + 'y/0tmLIsHxLIn+WK9CANqMbCWoP4I178BQaqhiOBkNyNZ0ndqA==\n' + '-----END PRIVATE KEY-----', - format: 'pem' + format: 'pem', }); const bobPublicKey = crypto.createPublicKey({ @@ -102,19 +102,19 @@ const bobPublicKey = crypto.createPublicKey({ 'QFKfjzNaJRNMFFd4f2Dn8MSB4yu1xpA1T2i0JSk24vS2H55jx24xhUYtfhT2LJgK\n' + 'JvnaODey/xtY4Kql10ZKf43Lw6gdQC3G8opC9OxVxt9oNR7Z\n' + '-----END PUBLIC KEY-----', - format: 'pem' + format: 'pem', }); assert.throws(() => crypto.diffieHellman({ privateKey: alicePrivateKey }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', - message: "The property 'options.publicKey' is invalid. Received undefined" + message: "The property 'options.publicKey' is invalid. Received undefined", }); assert.throws(() => crypto.diffieHellman({ publicKey: alicePublicKey }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', - message: "The property 'options.privateKey' is invalid. Received undefined" + message: "The property 'options.privateKey' is invalid. Received undefined", }); const privateKey = Buffer.from( @@ -170,10 +170,10 @@ for (const [params1, params2] of list) { crypto.generateKeyPairSync('dh', params2)); }, common.hasOpenSSL3 ? { name: 'Error', - code: 'ERR_OSSL_DH_INVALID_PUBLIC_KEY' + code: 'ERR_OSSL_DH_INVALID_PUBLIC_KEY', } : { name: 'Error', - code: 'ERR_OSSL_EVP_DIFFERENT_PARAMETERS' + code: 'ERR_OSSL_EVP_DIFFERENT_PARAMETERS', }); } { @@ -188,7 +188,7 @@ for (const [params1, params2] of list) { 'JaiCW3ax9+qk31f2jTNKrQznmKgopVKXF0FEJC6H79W/8Y0U14gsI9sHpovKhfou\n' + 'RQD0QogW7ejSwMG8hCYibfrvMm0b5PHlwimISyEKh7VtDQ1frYN/Wr9ZbiV+FePJ\n' + '2j6RUKYNj1Pv+B4zdMgiLLjILAs8WUfbHciU21KSJh1izVQaUQ==\n' + - '-----END PRIVATE KEY-----' + '-----END PRIVATE KEY-----', }); const publicKey = crypto.createPublicKey({ key: '-----BEGIN PUBLIC KEY-----\n' + @@ -202,7 +202,7 @@ for (const [params1, params2] of list) { 'taGX4mP3247golVx2DS4viDYs7UtaMdx03dWaP6y5StNUZQlgCIUzL7MYpC16V5y\n' + 'KkFrE+Kp/Z77gEjivaG6YuxVj4GPLxJYbNFVTel42oSVeKuq\n' + '-----END PUBLIC KEY-----', - format: 'pem' + format: 'pem', }); // This key combination will result in an unusually short secret, and should @@ -229,10 +229,10 @@ assert.throws(() => { crypto.generateKeyPairSync('ec', { namedCurve: not256k1 })); }, common.hasOpenSSL3 ? { name: 'Error', - code: 'ERR_OSSL_MISMATCHING_SHARED_PARAMETERS' + code: 'ERR_OSSL_MISMATCHING_SHARED_PARAMETERS', } : { name: 'Error', - code: 'ERR_OSSL_EVP_DIFFERENT_PARAMETERS' + code: 'ERR_OSSL_EVP_DIFFERENT_PARAMETERS', }); // Test ECDH-ES. @@ -249,5 +249,5 @@ assert.throws(() => { }, { name: 'Error', code: 'ERR_CRYPTO_INCOMPATIBLE_KEY', - message: 'Incompatible key types for Diffie-Hellman: x448 and x25519' + message: 'Incompatible key types for Diffie-Hellman: x448 and x25519', }); diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js index cae9301517c37c..59ebd72c228513 100644 --- a/test/parallel/test-crypto-dh.js +++ b/test/parallel/test-crypto-dh.js @@ -158,7 +158,7 @@ if (common.hasOpenSSL3) { message: 'error:1C80006B:Provider routines::wrong final block length', code: 'ERR_OSSL_WRONG_FINAL_BLOCK_LENGTH', library: 'Provider routines', - reason: 'wrong final block length' + reason: 'wrong final block length', }; } else { wrongBlockLength = { @@ -166,7 +166,7 @@ if (common.hasOpenSSL3) { ' routines:EVP_DecryptFinal_ex:wrong final block length', code: 'ERR_OSSL_EVP_WRONG_FINAL_BLOCK_LENGTH', library: 'digital envelope routines', - reason: 'wrong final block length' + reason: 'wrong final block length', }; } @@ -312,7 +312,7 @@ if (availableCurves.has('prime256v1') && availableCurves.has('secp256k1')) { { code: 'ERR_CRYPTO_ECDH_INVALID_FORMAT', name: 'TypeError', - message: 'Invalid ECDH format: 10' + message: 'Invalid ECDH format: 10', }); // ECDH should check that point is on curve @@ -324,7 +324,7 @@ if (availableCurves.has('prime256v1') && availableCurves.has('secp256k1')) { { code: 'ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY', name: 'Error', - message: 'Public key is not valid for specified curve' + message: 'Public key is not valid for specified curve', }); // ECDH should allow .setPrivateKey()/.setPublicKey() @@ -437,7 +437,7 @@ if (availableCurves.has('prime256v1') && availableHashes.has('sha256')) { { code: 'ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY', name: 'Error', - message: 'Public key is not valid for specified curve' + message: 'Public key is not valid for specified curve', }); // Check that signing operations are not impacted by the above error. const ecPrivateKey = @@ -456,7 +456,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "curve" argument must be of type string. ' + - 'Received undefined' + 'Received undefined', }); assert.throws( @@ -466,7 +466,7 @@ assert.throws( { name: 'Error', code: 'ERR_CRYPTO_UNKNOWN_DH_GROUP', - message: 'Unknown DH group' + message: 'Unknown DH group', }, 'crypto.getDiffieHellman(\'unknown-group\') ' + 'failed to throw the expected error.' @@ -492,7 +492,7 @@ assert.throws( assert.throws( () => crypto.createDiffieHellman('', true), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); [true, Symbol(), {}, () => {}, []].forEach((generator) => assert.throws( diff --git a/test/parallel/test-crypto-ecdh-convert-key.js b/test/parallel/test-crypto-ecdh-convert-key.js index f4d5a651ed6b88..31712c414c3cea 100644 --- a/test/parallel/test-crypto-ecdh-convert-key.js +++ b/test/parallel/test-crypto-ecdh-convert-key.js @@ -37,7 +37,7 @@ assert.throws( () => ECDH.convertKey(cafebabePubPtComp, 'badcurve'), { name: 'TypeError', - message: 'Invalid EC curve name' + message: 'Invalid EC curve name', }); if (getCurves().includes('secp256k1')) { @@ -47,7 +47,7 @@ if (getCurves().includes('secp256k1')) { { code: 'ERR_CRYPTO_ECDH_INVALID_FORMAT', name: 'TypeError', - message: 'Invalid ECDH format: 10' + message: 'Invalid ECDH format: 10', }); // Point formats. diff --git a/test/parallel/test-crypto-engine.js b/test/parallel/test-crypto-engine.js index 8b33285b454eef..c3fa4515c2df96 100644 --- a/test/parallel/test-crypto-engine.js +++ b/test/parallel/test-crypto-engine.js @@ -14,7 +14,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "id" argument must be of type string. Received type boolean' + - ' (true)' + ' (true)', }); assert.throws( @@ -23,7 +23,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "flags" argument must be of type number. Received type' + - " string ('notANumber')" + " string ('notANumber')", }); assert.throws( @@ -31,7 +31,7 @@ assert.throws( { code: 'ERR_CRYPTO_ENGINE_UNKNOWN', name: 'Error', - message: `Engine "${invalidEngineName}" was not found` + message: `Engine "${invalidEngineName}" was not found`, }); assert.throws( @@ -39,5 +39,5 @@ assert.throws( { code: 'ERR_CRYPTO_ENGINE_UNKNOWN', name: 'Error', - message: `Engine "${invalidEngineName}" was not found` + message: `Engine "${invalidEngineName}" was not found`, }); diff --git a/test/parallel/test-crypto-fips.js b/test/parallel/test-crypto-fips.js index b6e70b62be68b9..b433d407fcfd0c 100644 --- a/test/parallel/test-crypto-fips.js +++ b/test/parallel/test-crypto-fips.js @@ -31,7 +31,7 @@ function testHelper(stream, args, expectedOutput, cmd, env) { const fullArgs = args.concat(['-e', `console.log(${cmd})`]); const child = spawnSync(process.execPath, fullArgs, { cwd: path.dirname(process.execPath), - env: env + env: env, }); console.error( diff --git a/test/parallel/test-crypto-getcipherinfo.js b/test/parallel/test-crypto-getcipherinfo.js index 98d2a52eceac4b..9b6f3953802cfd 100644 --- a/test/parallel/test-crypto-getcipherinfo.js +++ b/test/parallel/test-crypto-getcipherinfo.js @@ -6,7 +6,7 @@ if (!common.hasCrypto) const { getCiphers, - getCipherInfo + getCipherInfo, } = require('crypto'); const assert = require('assert'); @@ -33,25 +33,25 @@ assert.strictEqual(info.mode, 'cbc'); [null, undefined, [], {}].forEach((arg) => { assert.throws(() => getCipherInfo(arg), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); [null, '', 1, true].forEach((options) => { assert.throws( () => getCipherInfo('aes-192-cbc', options), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); [null, '', {}, [], true].forEach((len) => { assert.throws( () => getCipherInfo('aes-192-cbc', { keyLength: len }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws( () => getCipherInfo('aes-192-cbc', { ivLength: len }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); diff --git a/test/parallel/test-crypto-hash.js b/test/parallel/test-crypto-hash.js index af2146982c7a3b..91737d09a97d4c 100644 --- a/test/parallel/test-crypto-hash.js +++ b/test/parallel/test-crypto-hash.js @@ -119,7 +119,7 @@ assert.throws( }), { name: 'Error', - message: 'boom' + message: 'boom', }); // Issue https://github.com/nodejs/node/issues/25487: error message for invalid @@ -149,14 +149,14 @@ assert.throws( () => h3.digest(), { code: 'ERR_CRYPTO_HASH_FINALIZED', - name: 'Error' + name: 'Error', }); assert.throws( () => h3.update('foo'), { code: 'ERR_CRYPTO_HASH_FINALIZED', - name: 'Error' + name: 'Error', }); assert.strictEqual( @@ -169,7 +169,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "algorithm" argument must be of type string. ' + - 'Received undefined' + 'Received undefined', } ); @@ -230,7 +230,7 @@ assert.throws( 'badfd6dfaac359a5efbb7bcc4b59d538' + 'df9a04302e10c8bc1cbf1a0b3a5120ea'); const superLongHash = crypto.createHash('shake256', { - outputLength: 1024 * 1024 + outputLength: 1024 * 1024, }).update('The message is shorter than the hash!') .digest('hex'); assert.strictEqual(superLongHash.length, 2 * 1024 * 1024); @@ -247,7 +247,7 @@ assert.throws( assert.throws(() => { crypto.createHash('sha256', { outputLength: 28 }); }, { - code: 'ERR_OSSL_EVP_NOT_XOF_OR_INVALID_LENGTH' + code: 'ERR_OSSL_EVP_NOT_XOF_OR_INVALID_LENGTH', }); for (const outputLength of [null, {}, 'foo', false]) { diff --git a/test/parallel/test-crypto-hkdf.js b/test/parallel/test-crypto-hkdf.js index ee9f56c87c430d..ce880251003e26 100644 --- a/test/parallel/test-crypto-hkdf.js +++ b/test/parallel/test-crypto-hkdf.js @@ -11,105 +11,105 @@ const { createSecretKey, hkdf, hkdfSync, - getHashes + getHashes, } = require('crypto'); { [1, {}, [], false, Infinity].forEach((i) => { assert.throws(() => hkdf(i, 'a'), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "digest" argument must be of type string/ + message: /^The "digest" argument must be of type string/, }); assert.throws(() => hkdfSync(i, 'a'), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "digest" argument must be of type string/ + message: /^The "digest" argument must be of type string/, }); }); [1, {}, [], false, Infinity].forEach((i) => { assert.throws(() => hkdf('sha256', i), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "key" argument must be / + message: /^The "key" argument must be /, }); assert.throws(() => hkdfSync('sha256', i), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "key" argument must be / + message: /^The "key" argument must be /, }); }); [1, {}, [], false, Infinity].forEach((i) => { assert.throws(() => hkdf('sha256', 'secret', i), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "salt" argument must be / + message: /^The "salt" argument must be /, }); assert.throws(() => hkdfSync('sha256', 'secret', i), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "salt" argument must be / + message: /^The "salt" argument must be /, }); }); [1, {}, [], false, Infinity].forEach((i) => { assert.throws(() => hkdf('sha256', 'secret', 'salt', i), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "info" argument must be / + message: /^The "info" argument must be /, }); assert.throws(() => hkdfSync('sha256', 'secret', 'salt', i), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "info" argument must be / + message: /^The "info" argument must be /, }); }); ['test', {}, [], false].forEach((i) => { assert.throws(() => hkdf('sha256', 'secret', 'salt', 'info', i), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "length" argument must be of type number/ + message: /^The "length" argument must be of type number/, }); assert.throws(() => hkdfSync('sha256', 'secret', 'salt', 'info', i), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "length" argument must be of type number/ + message: /^The "length" argument must be of type number/, }); }); assert.throws(() => hkdf('sha256', 'secret', 'salt', 'info', -1), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => hkdfSync('sha256', 'secret', 'salt', 'info', -1), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => hkdf('sha256', 'secret', 'salt', 'info', kMaxLength + 1), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => hkdfSync('sha256', 'secret', 'salt', 'info', kMaxLength + 1), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => hkdfSync('unknown', 'a', '', '', 10), { - code: 'ERR_CRYPTO_INVALID_DIGEST' + code: 'ERR_CRYPTO_INVALID_DIGEST', }); assert.throws(() => hkdf('unknown', 'a', '', '', 10, common.mustNotCall()), { - code: 'ERR_CRYPTO_INVALID_DIGEST' + code: 'ERR_CRYPTO_INVALID_DIGEST', }); assert.throws(() => hkdf('unknown', 'a', '', Buffer.alloc(1025), 10, common.mustNotCall()), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => hkdfSync('unknown', 'a', '', Buffer.alloc(1025), 10), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws( () => hkdf('sha512', 'a', '', '', 64 * 255 + 1, common.mustNotCall()), { - code: 'ERR_CRYPTO_INVALID_KEYLEN' + code: 'ERR_CRYPTO_INVALID_KEYLEN', }); assert.throws( () => hkdfSync('sha512', 'a', '', '', 64 * 255 + 1), { - code: 'ERR_CRYPTO_INVALID_KEYLEN' + code: 'ERR_CRYPTO_INVALID_KEYLEN', }); } diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js index cfaa041c0622d9..fc1bb5c5df4818 100644 --- a/test/parallel/test-crypto-hmac.js +++ b/test/parallel/test-crypto-hmac.js @@ -18,7 +18,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: 'The "hmac" argument must be of type string. Received null' + message: 'The "hmac" argument must be of type string. Received null', }); // This used to segfault. See: https://github.com/nodejs/node/issues/9819 @@ -28,7 +28,7 @@ assert.throws( }), { name: 'Error', - message: 'boom' + message: 'boom', }); assert.throws( @@ -76,8 +76,8 @@ const wikipedia = [ sha1: 'de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9', sha256: 'f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc' + - '2d1a3cd8' - } + '2d1a3cd8', + }, }, { key: 'key', data: '', @@ -86,8 +86,8 @@ const wikipedia = [ sha1: 'f42bb0eeb018ebbd4597ae7213711ec60760843f', sha256: '5d5d139563c95b5967b9bd9a8c9b233a9dedb45072794cd232dc1b74' + - '832607d0' - } + '832607d0', + }, }, { key: '', data: 'The quick brown fox jumps over the lazy dog', @@ -96,8 +96,8 @@ const wikipedia = [ sha1: '2ba7f707ad5f187c412de3106583c3111d668de8', sha256: 'fb011e6154a19b9a4c767373c305275a5a69e8b68b0b4c9200c383dc' + - 'ed19a416' - } + 'ed19a416', + }, }, { key: '', data: '', @@ -106,8 +106,8 @@ const wikipedia = [ sha1: 'fbdb1d1b18aa6c08324b7d64b71fb76370690e1d', sha256: 'b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c71214' + - '4292c5ad' - } + '4292c5ad', + }, }, ]; @@ -132,8 +132,8 @@ const rfc4231 = [ sha512: '87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b305' + '45e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f170' + - '2e696c203a126854' - } + '2e696c203a126854', + }, }, { key: Buffer.from('4a656665', 'hex'), // 'Jefe' @@ -150,8 +150,8 @@ const rfc4231 = [ sha512: '164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7' + 'ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b' + - '636e070a38bce737' - } + '636e070a38bce737', + }, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'), @@ -169,8 +169,8 @@ const rfc4231 = [ sha512: 'fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33' + 'b2279d39bf3e848279a722c806b485a47e67c807b946a337bee89426' + - '74278859e13292fb' - } + '74278859e13292fb', + }, }, { key: Buffer.from('0102030405060708090a0b0c0d0e0f10111213141516171819', @@ -189,8 +189,8 @@ const rfc4231 = [ sha512: 'b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050' + '361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2d' + - 'e2adebeb10a298dd' - } + 'e2adebeb10a298dd', + }, }, { @@ -201,9 +201,9 @@ const rfc4231 = [ sha224: '0e2aea68a90c8d37c988bcdb9fca6fa8', sha256: 'a3b6167473100ee06e0c796c2955552b', sha384: '3abf34c3503b2a23a46efc619baef897', - sha512: '415fad6271580a531d4179bc891d87a6' + sha512: '415fad6271580a531d4179bc891d87a6', }, - truncate: true + truncate: true, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -227,8 +227,8 @@ const rfc4231 = [ sha512: '80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b0137' + '83f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec' + - '8b915a985d786598' - } + '8b915a985d786598', + }, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -258,8 +258,8 @@ const rfc4231 = [ sha512: 'e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d' + '20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de04460' + - '65c97440fa8c6a58' - } + '65c97440fa8c6a58', + }, }, ]; @@ -295,19 +295,19 @@ const rfc2202_md5 = [ { key: Buffer.from('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b', 'hex'), data: 'Hi There', - hmac: '9294727a3638bb1c13f48ef8158bfc9d' + hmac: '9294727a3638bb1c13f48ef8158bfc9d', }, { key: 'Jefe', data: 'what do ya want for nothing?', - hmac: '750c783e6ab0b503eaa86e310a5db738' + hmac: '750c783e6ab0b503eaa86e310a5db738', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'), data: Buffer.from('ddddddddddddddddddddddddddddddddddddddddddddddddd' + 'ddddddddddddddddddddddddddddddddddddddddddddddddddd', 'hex'), - hmac: '56be34521d144c88dbb8c733f0e8b3f6' + hmac: '56be34521d144c88dbb8c733f0e8b3f6', }, { key: Buffer.from('0102030405060708090a0b0c0d0e0f10111213141516171819', @@ -316,12 +316,12 @@ const rfc2202_md5 = [ 'dcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd' + 'cdcdcdcdcd', 'hex'), - hmac: '697eaf0aca3a3aea3a75164746ffaa79' + hmac: '697eaf0aca3a3aea3a75164746ffaa79', }, { key: Buffer.from('0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c', 'hex'), data: 'Test With Truncation', - hmac: '56461ef2342edc00f9bab995690efd4c' + hmac: '56461ef2342edc00f9bab995690efd4c', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -330,7 +330,7 @@ const rfc2202_md5 = [ 'aaaaaaaaaaaaaaaaaaaaaa', 'hex'), data: 'Test Using Larger Than Block-Size Key - Hash Key First', - hmac: '6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd' + hmac: '6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -341,7 +341,7 @@ const rfc2202_md5 = [ data: 'Test Using Larger Than Block-Size Key and Larger Than One ' + 'Block-Size Data', - hmac: '6f630fad67cda0ee1fb1f562db3aa53e' + hmac: '6f630fad67cda0ee1fb1f562db3aa53e', }, ]; @@ -352,12 +352,12 @@ const rfc2202_sha1 = [ { key: Buffer.from('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b', 'hex'), data: 'Hi There', - hmac: 'b617318655057264e28bc0b6fb378c8ef146be00' + hmac: 'b617318655057264e28bc0b6fb378c8ef146be00', }, { key: 'Jefe', data: 'what do ya want for nothing?', - hmac: 'effcdf6ae5eb2fa2d27416d5f184df9c259a7c79' + hmac: 'effcdf6ae5eb2fa2d27416d5f184df9c259a7c79', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'), @@ -365,7 +365,7 @@ const rfc2202_sha1 = [ 'ddddddddddddddddddddddddddddddddddddddddddddd' + 'dddddddddd', 'hex'), - hmac: '125d7342b9ac11cd91a39af48aa17b4f63f175d3' + hmac: '125d7342b9ac11cd91a39af48aa17b4f63f175d3', }, { key: Buffer.from('0102030405060708090a0b0c0d0e0f10111213141516171819', @@ -374,12 +374,12 @@ const rfc2202_sha1 = [ 'dcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd' + 'cdcdcdcdcd', 'hex'), - hmac: '4c9007f4026250c6bc8414f9bf50c86c2d7235da' + hmac: '4c9007f4026250c6bc8414f9bf50c86c2d7235da', }, { key: Buffer.from('0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c', 'hex'), data: 'Test With Truncation', - hmac: '4c1a03424b55e07fe7f27be1d58bb9324a9a5a04' + hmac: '4c1a03424b55e07fe7f27be1d58bb9324a9a5a04', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -388,7 +388,7 @@ const rfc2202_sha1 = [ 'aaaaaaaaaaaaaaaaaaaaaa', 'hex'), data: 'Test Using Larger Than Block-Size Key - Hash Key First', - hmac: 'aa4ae5e15272d00e95705637ce8a3b55ed402112' + hmac: 'aa4ae5e15272d00e95705637ce8a3b55ed402112', }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -399,7 +399,7 @@ const rfc2202_sha1 = [ data: 'Test Using Larger Than Block-Size Key and Larger Than One ' + 'Block-Size Data', - hmac: 'e8e99d0f45237d786d6bbaa7965c7808bbff1a91' + hmac: 'e8e99d0f45237d786d6bbaa7965c7808bbff1a91', }, ]; diff --git a/test/parallel/test-crypto-key-objects-messageport.js b/test/parallel/test-crypto-key-objects-messageport.js index f38e20da420aae..b7b8956c120639 100644 --- a/test/parallel/test-crypto-key-objects-messageport.js +++ b/test/parallel/test-crypto-key-objects-messageport.js @@ -10,7 +10,7 @@ const { MessageChannel, Worker, moveMessagePortToContext, - parentPort + parentPort, } = require('worker_threads'); function keyToString(key) { @@ -36,7 +36,7 @@ process.env.HAS_STARTED_WORKER = 1; // The main thread generates keys and passes them to worker threads. const secretKey = createSecretKey(randomBytes(32)); const { publicKey, privateKey } = generateKeyPairSync('rsa', { - modulusLength: 1024 + modulusLength: 1024, }); // Get immutable representations of all keys. diff --git a/test/parallel/test-crypto-key-objects.js b/test/parallel/test-crypto-key-objects.js index 3159b0da3f2901..793cbe96bbfe87 100644 --- a/test/parallel/test-crypto-key-objects.js +++ b/test/parallel/test-crypto-key-objects.js @@ -45,7 +45,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', name: 'RangeError', code: 'ERR_OUT_OF_RANGE', message: 'The value of "key.byteLength" is out of range. ' + - 'It must be > 0. Received 0' + 'It must be > 0. Received 0', }); } @@ -56,7 +56,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', assert.throws(() => new KeyObject(TYPE), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', - message: `The argument 'type' is invalid. Received '${TYPE}'` + message: `The argument 'type' is invalid. Received '${TYPE}'`, }); } @@ -67,7 +67,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', code: 'ERR_INVALID_ARG_TYPE', message: 'The "handle" argument must be of type object. Received type ' + - "string ('')" + "string ('')", }); } @@ -77,7 +77,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', code: 'ERR_INVALID_ARG_TYPE', message: 'The "key" argument must be an instance of CryptoKey. Received type ' + - "string ('invalid_key')" + "string ('invalid_key')", }); } @@ -113,7 +113,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', assert.throws(() => createPublicKey(publicKey), { name: 'TypeError', code: 'ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE', - message: 'Invalid key object type public, expected private.' + message: 'Invalid key object type public, expected private.', }); // Constructing a private key from a public key should be impossible, even @@ -197,10 +197,10 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', type: 'pkcs8', format: 'pem', passphrase: '123', - cipher: 'aes-128-cbc' + cipher: 'aes-128-cbc', }), format: 'pem', - passphrase: '123' + passphrase: '123', }); assert.strictEqual(decryptedKey.type, 'public'); assert.strictEqual(decryptedKey.asymmetricKeyType, 'rsa'); @@ -210,7 +210,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', assert.throws(() => publicKey.export(opt), { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', - message: /^The "options" argument must be of type object/ + message: /^The "options" argument must be of type object/, }); } @@ -234,17 +234,17 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', privateKey.export({ format: 'jwk', passphrase: 'secret' }); }, { message: 'The selected key encoding jwk does not support encryption.', - code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS' + code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS', }); const publicDER = publicKey.export({ format: 'der', - type: 'pkcs1' + type: 'pkcs1', }); const privateDER = privateKey.export({ format: 'der', - type: 'pkcs1' + type: 'pkcs1', }); assert(Buffer.isBuffer(publicDER)); @@ -322,7 +322,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', createPrivateKey({ key: Buffer.alloc(0), format: 'der', type: 'spki' }); }, { code: 'ERR_INVALID_ARG_VALUE', - message: "The property 'options.type' is invalid. Received 'spki'" + message: "The property 'options.type' is invalid. Received 'spki'", }); // Unlike SPKI, PKCS#1 is a valid encoding for private keys (and public keys), @@ -330,15 +330,15 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', assert.throws(() => { const key = createPublicKey(publicPem).export({ format: 'der', - type: 'pkcs1' + type: 'pkcs1', }); createPrivateKey({ key, format: 'der', type: 'pkcs1' }); }, common.hasOpenSSL3 ? { message: /error:1E08010C:DECODER routines::unsupported/, - library: 'DECODER routines' + library: 'DECODER routines', } : { message: /asn1 encoding/, - library: 'asn1 encoding routines' + library: 'asn1 encoding routines', }); } @@ -350,7 +350,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', crv: 'Ed25519', x: 'K1wIouqnuiA04b3WrMa-xKIKIpfHetNZRv3h9fBf768', d: 'wVK6M3SMhQh3NK-7GRrSV-BVWQx1FO5pW8hhQeu_NdA', - kty: 'OKP' + kty: 'OKP', } }, { private: fixtures.readKey('ed448_private.pem', 'ascii'), public: fixtures.readKey('ed448_public.pem', 'ascii'), @@ -361,7 +361,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', 'Dgc2V5ZUA', d: '060Ke71sN0GpIc01nnGgMDkp0sFNQ09woVo4AM1ffax1-mjnakK0-p-S7-Xf859QewX' + 'jcR9mxppY', - kty: 'OKP' + kty: 'OKP', } }, { private: fixtures.readKey('x25519_private.pem', 'ascii'), public: fixtures.readKey('x25519_public.pem', 'ascii'), @@ -370,7 +370,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', crv: 'X25519', x: 'aSb8Q-RndwfNnPeOYGYPDUN3uhAPnMLzXyfi-mqfhig', d: 'mL_IWm55RrALUGRfJYzw40gEYWMvtRkesP9mj8o8Omc', - kty: 'OKP' + kty: 'OKP', } }, { private: fixtures.readKey('x448_private.pem', 'ascii'), public: fixtures.readKey('x448_public.pem', 'ascii'), @@ -381,7 +381,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', 'vSKsDFPA', d: 'tMNtrO_q8dlY6Y4NDeSTxNQ5CACkHiPvmukidPnNIuX_EkcryLEXt_7i6j6YZMKsrWy' + 'S0jlSYJk', - kty: 'OKP' + kty: 'OKP', } }, ].forEach((info) => { const keyType = info.keyType; @@ -435,7 +435,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', d: 'DxBsPQPIgMuMyQbxzbb9toew6Ev6e9O6ZhpxLNgmAEo', kty: 'EC', x: 'X0mMYR_uleZSIPjNztIkAS3_ud5LhNpbiIFp6fNf2Gs', - y: 'UbJuPy2Xi0lW7UYTBxPK3yGgDu9EAKYIecjkHX5s2lI' + y: 'UbJuPy2Xi0lW7UYTBxPK3yGgDu9EAKYIecjkHX5s2lI', } }, { private: fixtures.readKey('ec_secp256k1_private.pem', 'ascii'), public: fixtures.readKey('ec_secp256k1_public.pem', 'ascii'), @@ -446,7 +446,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', d: 'c34ocwTwpFa9NZZh3l88qXyrkoYSxvC0FEsU5v1v4IM', kty: 'EC', x: 'cOzhFSpWxhalCbWNdP2H_yUkdC81C9T2deDpfxK7owA', - y: '-A3DAZTk9IPppN-f03JydgHaFvL1fAHaoXf4SX4NXyo' + y: '-A3DAZTk9IPppN-f03JydgHaFvL1fAHaoXf4SX4NXyo', } }, { private: fixtures.readKey('ec_p384_private.pem', 'ascii'), public: fixtures.readKey('ec_p384_public.pem', 'ascii'), @@ -457,7 +457,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', d: 'dwfuHuAtTlMRn7ZBCBm_0grpc1D_4hPeNAgevgelljuC0--k_LDFosDgBlLLmZsi', kty: 'EC', x: 'hON3nzGJgv-08fdHpQxgRJFZzlK-GZDGa5f3KnvM31cvvjJmsj4UeOgIdy3rDAjV', - y: 'fidHhtecNCGCfLqmrLjDena1NSzWzWH1u_oUdMKGo5XSabxzD7-8JZxjpc8sR9cl' + y: 'fidHhtecNCGCfLqmrLjDena1NSzWzWH1u_oUdMKGo5XSabxzD7-8JZxjpc8sR9cl', } }, { private: fixtures.readKey('ec_p521_private.pem', 'ascii'), public: fixtures.readKey('ec_p521_public.pem', 'ascii'), @@ -471,7 +471,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', x: 'AaLFgjwZtznM3N7qsfb86awVXe6c6djUYOob1FN-kllekv0KEXV0bwcDjPGQz5f6MxL' + 'CbhMeHRavUS6P10rsTtBn', y: 'Ad3flexBeAfXceNzRBH128kFbOWD6W41NjwKRqqIF26vmgW_8COldGKZjFkOSEASxPB' + - 'cvA2iFJRUyQ3whC00j0Np' + 'cvA2iFJRUyQ3whC00j0Np', } }, ].forEach((info) => { const { keyType, namedCurve } = info; @@ -527,7 +527,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', } : { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', - message: 'Passphrase required for encrypted key' + message: 'Passphrase required for encrypted key', }); // Reading an encrypted key with a passphrase that exceeds OpenSSL's buffer @@ -535,10 +535,10 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', assert.throws(() => createPrivateKey({ key: privateDsa, format: 'pem', - passphrase: Buffer.alloc(1025, 'a') + passphrase: Buffer.alloc(1025, 'a'), }), common.hasOpenSSL3 ? { name: 'Error' } : { code: 'ERR_OSSL_PEM_BAD_PASSWORD_READ', - name: 'Error' + name: 'Error', }); // The buffer has a size of 1024 bytes, so this passphrase should be permitted @@ -546,11 +546,11 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', assert.throws(() => createPrivateKey({ key: privateDsa, format: 'pem', - passphrase: Buffer.alloc(1024, 'a') + passphrase: Buffer.alloc(1024, 'a'), }), { message: common.hasOpenSSL3 ? 'error:07880109:common libcrypto routines::interrupted or cancelled' : - /bad decrypt/ + /bad decrypt/, }); const publicKey = createPublicKey(publicDsa); @@ -564,7 +564,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', const privateKey = createPrivateKey({ key: privateDsa, format: 'pem', - passphrase: 'secret' + passphrase: 'secret', }); assert.strictEqual(privateKey.type, 'private'); assert.strictEqual(privateKey.asymmetricKeyType, 'dsa'); @@ -623,7 +623,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', assert.throws(() => { publicKey.export({ format: 'pem', type: 'pkcs1' }); }, { - code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS' + code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS', }); } @@ -725,12 +725,12 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', const privateKey = createPrivateKey(privatePem); assert.throws(() => { privateKey.export({ - format: 'pem', type: 'pkcs8', passphrase: 'super-secret' + format: 'pem', type: 'pkcs8', passphrase: 'super-secret', }); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', - message: "The property 'options.cipher' is invalid. Received undefined" + message: "The property 'options.cipher' is invalid. Received undefined", }); } @@ -767,13 +767,13 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem', () => publicKey.export({ format: 'jwk' }), { code: 'ERR_CRYPTO_JWK_UNSUPPORTED_CURVE', - message: `Unsupported JWK EC curve: ${namedCurve}.` + message: `Unsupported JWK EC curve: ${namedCurve}.`, }); assert.throws( () => privateKey.export({ format: 'jwk' }), { code: 'ERR_CRYPTO_JWK_UNSUPPORTED_CURVE', - message: `Unsupported JWK EC curve: ${namedCurve}.` + message: `Unsupported JWK EC curve: ${namedCurve}.`, }); } diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js index 4612fc4a1ac40a..fab6573fe2719b 100644 --- a/test/parallel/test-crypto-keygen.js +++ b/test/parallel/test-crypto-keygen.js @@ -19,7 +19,7 @@ const { publicEncrypt, privateDecrypt, sign, - verify + verify, } = require('crypto'); const { inspect, promisify } = require('util'); @@ -96,12 +96,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 512, publicKeyEncoding: { type: 'pkcs1', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', - format: 'pem' - } + format: 'pem', + }, }); assert.strictEqual(Object.keys(ret).length, 2); @@ -123,7 +123,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); // publicExpononent const { publicKey, privateKey } = generateKeyPairSync('rsa', { publicExponent: 3, - modulusLength: 512 + modulusLength: 512, }); assert.strictEqual(typeof publicKey, 'object'); @@ -131,7 +131,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.strictEqual(publicKey.asymmetricKeyType, 'rsa'); assert.deepStrictEqual(publicKey.asymmetricKeyDetails, { modulusLength: 512, - publicExponent: 3n + publicExponent: 3n, }); assert.strictEqual(typeof privateKey, 'object'); @@ -139,14 +139,14 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.strictEqual(privateKey.asymmetricKeyType, 'rsa'); assert.deepStrictEqual(privateKey.asymmetricKeyDetails, { modulusLength: 512, - publicExponent: 3n + publicExponent: 3n, }); } { // Test sync key generation with key objects. const { publicKey, privateKey } = generateKeyPairSync('rsa', { - modulusLength: 512 + modulusLength: 512, }); assert.strictEqual(typeof publicKey, 'object'); @@ -154,7 +154,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.strictEqual(publicKey.asymmetricKeyType, 'rsa'); assert.deepStrictEqual(publicKey.asymmetricKeyDetails, { modulusLength: 512, - publicExponent: 65537n + publicExponent: 65537n, }); assert.strictEqual(typeof privateKey, 'object'); @@ -162,14 +162,14 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.strictEqual(privateKey.asymmetricKeyType, 'rsa'); assert.deepStrictEqual(privateKey.asymmetricKeyDetails, { modulusLength: 512, - publicExponent: 65537n + publicExponent: 65537n, }); } { const publicKeyEncoding = { type: 'pkcs1', - format: 'der' + format: 'der', }; // Test async RSA key generation. @@ -179,8 +179,8 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); publicKeyEncoding, privateKeyEncoding: { type: 'pkcs1', - format: 'pem' - } + format: 'pem', + }, }, common.mustSucceed((publicKeyDER, privateKey) => { assert(Buffer.isBuffer(publicKeyDER)); assertApproximateSize(publicKeyDER, 74); @@ -203,8 +203,8 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); type: 'pkcs1', format: 'pem', cipher: 'aes-256-cbc', - passphrase: 'secret' - } + passphrase: 'secret', + }, }, common.mustSucceed((publicKeyDER, privateKey) => { assert(Buffer.isBuffer(publicKeyDER)); assertApproximateSize(publicKeyDER, 74); @@ -217,11 +217,11 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); const expectedError = common.hasOpenSSL3 ? { name: 'Error', message: 'error:07880109:common libcrypto routines::interrupted or ' + - 'cancelled' + 'cancelled', } : { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', - message: 'Passphrase required for encrypted key' + message: 'Passphrase required for encrypted key', }; assert.throws(() => testSignVerify(publicKey, privateKey), expectedError); @@ -239,8 +239,8 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); type: 'pkcs8', format: 'der', cipher: 'aes-256-cbc', - passphrase: 'secret' - } + passphrase: 'secret', + }, }, common.mustSucceed((publicKeyDER, privateKeyDER) => { assert(Buffer.isBuffer(publicKeyDER)); assertApproximateSize(publicKeyDER, 74); @@ -253,12 +253,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); testSignVerify(publicKey, { key: privateKeyDER, format: 'der', - type: 'pkcs8' + type: 'pkcs8', }); }, { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', - message: 'Passphrase required for encrypted key' + message: 'Passphrase required for encrypted key', }); // Signing should work with the correct password. @@ -267,7 +267,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); key: privateKeyDER, format: 'der', type: 'pkcs8', - passphrase: 'secret' + passphrase: 'secret', }; testEncryptDecrypt(publicKey, privateKey); testSignVerify(publicKey, privateKey); @@ -280,8 +280,8 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); publicKeyEncoding, privateKeyEncoding: { type: 'pkcs8', - format: 'der' - } + format: 'der', + }, }, common.mustSucceed((publicKeyDER, privateKeyDER) => { assert(Buffer.isBuffer(publicKeyDER)); assertApproximateSize(publicKeyDER, 74); @@ -293,7 +293,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); key: privateKeyDER, format: 'der', type: 'pkcs8', - passphrase: 'secret' + passphrase: 'secret', }; testEncryptDecrypt(publicKey, privateKey); testSignVerify(publicKey, privateKey); @@ -306,20 +306,20 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 512, saltLength: 16, hash: 'sha256', - mgf1Hash: 'sha256' + mgf1Hash: 'sha256', }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(publicKey.type, 'public'); assert.strictEqual(publicKey.asymmetricKeyType, 'rsa-pss'); assert.deepStrictEqual(publicKey.asymmetricKeyDetails, { modulusLength: 512, - publicExponent: 65537n + publicExponent: 65537n, }); assert.strictEqual(privateKey.type, 'private'); assert.strictEqual(privateKey.asymmetricKeyType, 'rsa-pss'); assert.deepStrictEqual(privateKey.asymmetricKeyDetails, { modulusLength: 512, - publicExponent: 65537n + publicExponent: 65537n, }); // Unlike RSA, RSA-PSS does not allow encryption. @@ -331,10 +331,10 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.throws(() => { testSignVerify({ key: publicKey, - padding: constants.RSA_PKCS1_PADDING + padding: constants.RSA_PKCS1_PADDING, }, { key: privateKey, - padding: constants.RSA_PKCS1_PADDING + padding: constants.RSA_PKCS1_PADDING, }); }, /illegal or unsupported padding mode/); @@ -346,7 +346,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); { const privateKeyEncoding = { type: 'pkcs8', - format: 'der' + format: 'der', }; // Test async DSA key generation. @@ -355,13 +355,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); divisorLength: 256, publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { cipher: 'aes-128-cbc', passphrase: 'secret', - ...privateKeyEncoding - } + ...privateKeyEncoding, + }, }, common.mustSucceed((publicKey, privateKeyDER) => { assert.strictEqual(typeof publicKey, 'string'); assert(spkiExp.test(publicKey)); @@ -375,19 +375,19 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.throws(() => { return testSignVerify(publicKey, { key: privateKeyDER, - ...privateKeyEncoding + ...privateKeyEncoding, }); }, { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', - message: 'Passphrase required for encrypted key' + message: 'Passphrase required for encrypted key', }); // Signing should work with the correct password. testSignVerify(publicKey, { key: privateKeyDER, ...privateKeyEncoding, - passphrase: 'secret' + passphrase: 'secret', }); })); } @@ -395,20 +395,20 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); // Test async DSA key object generation. generateKeyPair('dsa', { modulusLength: common.hasOpenSSL3 ? 2048 : 512, - divisorLength: 256 + divisorLength: 256, }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(publicKey.type, 'public'); assert.strictEqual(publicKey.asymmetricKeyType, 'dsa'); assert.deepStrictEqual(publicKey.asymmetricKeyDetails, { modulusLength: common.hasOpenSSL3 ? 2048 : 512, - divisorLength: 256 + divisorLength: 256, }); assert.strictEqual(privateKey.type, 'private'); assert.strictEqual(privateKey.asymmetricKeyType, 'dsa'); assert.deepStrictEqual(privateKey.asymmetricKeyDetails, { modulusLength: common.hasOpenSSL3 ? 2048 : 512, - divisorLength: 256 + divisorLength: 256, }); })); } @@ -421,12 +421,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); paramEncoding: 'named', publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'sec1', - format: 'pem' - } + format: 'pem', + }, }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(typeof publicKey, 'string'); assert(spkiExp.test(publicKey)); @@ -443,12 +443,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); paramEncoding: 'explicit', publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'sec1', - format: 'pem' - } + format: 'pem', + }, }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(typeof publicKey, 'string'); assert(spkiExp.test(publicKey)); @@ -464,14 +464,14 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); paramEncoding: 'named', publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'sec1', format: 'pem', cipher: 'aes-128-cbc', - passphrase: 'secret' - } + passphrase: 'secret', + }, }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(typeof publicKey, 'string'); assert(spkiExp.test(publicKey)); @@ -482,11 +482,11 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.throws(() => testSignVerify(publicKey, privateKey), common.hasOpenSSL3 ? { message: 'error:07880109:common libcrypto ' + - 'routines::interrupted or cancelled' + 'routines::interrupted or cancelled', } : { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', - message: 'Passphrase required for encrypted key' + message: 'Passphrase required for encrypted key', }); testSignVerify(publicKey, { key: privateKey, passphrase: 'secret' }); @@ -498,14 +498,14 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); paramEncoding: 'explicit', publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'sec1', format: 'pem', cipher: 'aes-128-cbc', - passphrase: 'secret' - } + passphrase: 'secret', + }, }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(typeof publicKey, 'string'); assert(spkiExp.test(publicKey)); @@ -516,11 +516,11 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.throws(() => testSignVerify(publicKey, privateKey), common.hasOpenSSL3 ? { message: 'error:07880109:common libcrypto ' + - 'routines::interrupted or cancelled' + 'routines::interrupted or cancelled', } : { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', - message: 'Passphrase required for encrypted key' + message: 'Passphrase required for encrypted key', }); testSignVerify(publicKey, { key: privateKey, passphrase: 'secret' }); @@ -535,14 +535,14 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); paramEncoding: 'named', publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: 'aes-128-cbc', - passphrase: 'top secret' - } + passphrase: 'top secret', + }, }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(typeof publicKey, 'string'); assert(spkiExp.test(publicKey)); @@ -553,16 +553,16 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.throws(() => testSignVerify(publicKey, privateKey), common.hasOpenSSL3 ? { message: 'error:07880109:common libcrypto ' + - 'routines::interrupted or cancelled' + 'routines::interrupted or cancelled', } : { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', - message: 'Passphrase required for encrypted key' + message: 'Passphrase required for encrypted key', }); testSignVerify(publicKey, { key: privateKey, - passphrase: 'top secret' + passphrase: 'top secret', }); })); @@ -573,14 +573,14 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); paramEncoding: 'explicit', publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: 'aes-128-cbc', - passphrase: 'top secret' - } + passphrase: 'top secret', + }, }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(typeof publicKey, 'string'); assert(spkiExp.test(publicKey)); @@ -591,16 +591,16 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.throws(() => testSignVerify(publicKey, privateKey), common.hasOpenSSL3 ? { message: 'error:07880109:common libcrypto ' + - 'routines::interrupted or cancelled' + 'routines::interrupted or cancelled', } : { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', - message: 'Passphrase required for encrypted key' + message: 'Passphrase required for encrypted key', }); testSignVerify(publicKey, { key: privateKey, - passphrase: 'top secret' + passphrase: 'top secret', }); })); } @@ -612,19 +612,19 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); paramEncoding: 'otherEncoding', publicKeyEncoding: { type: 'spki', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: 'aes-128-cbc', - passphrase: 'top secret' - } + passphrase: 'top secret', + }, }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.paramEncoding' is invalid. " + - "Received 'otherEncoding'" + "Received 'otherEncoding'", }); } @@ -635,12 +635,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 512, publicKeyEncoding: { type: 'pkcs1', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs1', - format: 'pem' - } + format: 'pem', + }, }).then(common.mustCall((keys) => { const { publicKey, privateKey } = keys; assert.strictEqual(typeof publicKey, 'string'); @@ -663,14 +663,15 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "type" argument must be of type string.' + - common.invalidArgTypeHelper(type) + common.invalidArgTypeHelper(type), }); } assert.throws(() => generateKeyPairSync('rsa2', {}), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', - message: "The argument 'type' must be a supported key type. Received 'rsa2'" + message: "The argument 'type' must be a supported key type." + + " Received 'rsa2'", }); } @@ -680,7 +681,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "options" argument must be of type object. ' + - 'Received undefined' + 'Received undefined', }); // Even if no options are required, it should be impossible to pass anything @@ -689,7 +690,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "options" argument must be of type object. ' + - 'Received type number (0)' + 'Received type number (0)', }); } @@ -699,8 +700,8 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 1024, privateKeyEncoding: { type: 'pkcs1', - format: 'pem' - } + format: 'pem', + }, }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(typeof publicKey, 'object'); assert.strictEqual(publicKey.type, 'public'); @@ -718,8 +719,8 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 1024, publicKeyEncoding: { type: 'pkcs1', - format: 'pem' - } + format: 'pem', + }, }, common.mustSucceed((publicKey, privateKey) => { // The public key should still be a string. assert.strictEqual(typeof publicKey, 'string'); @@ -741,13 +742,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); publicKeyEncoding: enc, privateKeyEncoding: { type: 'pkcs1', - format: 'pem' - } + format: 'pem', + }, }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.publicKeyEncoding' is invalid. " + - `Received ${inspect(enc)}` + `Received ${inspect(enc)}`, }); } @@ -757,17 +758,17 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 4096, publicKeyEncoding: { type, - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs1', - format: 'pem' - } + format: 'pem', + }, }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.publicKeyEncoding.type' is invalid. " + - `Received ${inspect(type)}` + `Received ${inspect(type)}`, }); } @@ -777,17 +778,17 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 4096, publicKeyEncoding: { type: 'pkcs1', - format + format, }, privateKeyEncoding: { type: 'pkcs1', - format: 'pem' - } + format: 'pem', + }, }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.publicKeyEncoding.format' is invalid. " + - `Received ${inspect(format)}` + `Received ${inspect(format)}`, }); } @@ -797,14 +798,14 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 4096, publicKeyEncoding: { type: 'pkcs1', - format: 'pem' + format: 'pem', }, - privateKeyEncoding: enc + privateKeyEncoding: enc, }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.privateKeyEncoding' is invalid. " + - `Received ${inspect(enc)}` + `Received ${inspect(enc)}`, }); } @@ -814,17 +815,17 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 4096, publicKeyEncoding: { type: 'pkcs1', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type, - format: 'pem' - } + format: 'pem', + }, }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.privateKeyEncoding.type' is invalid. " + - `Received ${inspect(type)}` + `Received ${inspect(type)}`, }); } @@ -834,17 +835,17 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 4096, publicKeyEncoding: { type: 'pkcs1', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs1', - format - } + format, + }, }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.privateKeyEncoding.format' is invalid. " + - `Received ${inspect(format)}` + `Received ${inspect(format)}`, }); } @@ -854,18 +855,18 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 4096, publicKeyEncoding: { type: 'pkcs1', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs1', format: 'pem', - cipher - } + cipher, + }, }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.privateKeyEncoding.cipher' is invalid. " + - `Received ${inspect(cipher)}` + `Received ${inspect(cipher)}`, }); } @@ -874,18 +875,18 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 4096, publicKeyEncoding: { type: 'pkcs1', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: 'foo', - passphrase: 'secret' - } + passphrase: 'secret', + }, }), { name: 'Error', code: 'ERR_CRYPTO_UNKNOWN_CIPHER', - message: 'Unknown cipher' + message: 'Unknown cipher', }); // Cipher, but no valid passphrase. @@ -894,19 +895,19 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 4096, publicKeyEncoding: { type: 'pkcs1', - format: 'pem' + format: 'pem', }, privateKeyEncoding: { type: 'pkcs8', format: 'pem', cipher: 'aes-128-cbc', - passphrase - } + passphrase, + }, }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.privateKeyEncoding.passphrase' " + - `is invalid. Received ${inspect(passphrase)}` + `is invalid. Received ${inspect(passphrase)}`, }); } @@ -915,10 +916,10 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.throws(() => generateKeyPair('rsa', { modulusLength: 512, publicKeyEncoding: { type: 'pkcs1', format: 'pem' }, - privateKeyEncoding: { type: 'pkcs1', format: 'pem' } + privateKeyEncoding: { type: 'pkcs1', format: 'pem' }, }, cb), { name: 'TypeError', - code: 'ERR_INVALID_CALLBACK' + code: 'ERR_INVALID_CALLBACK', }); } } @@ -928,12 +929,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); // Test invalid modulus lengths. for (const modulusLength of [undefined, null, 'a', true, {}, [], 512.1, -1]) { assert.throws(() => generateKeyPair('rsa', { - modulusLength + modulusLength, }, common.mustNotCall()), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.modulusLength' is invalid. " + - `Received ${inspect(modulusLength)}` + `Received ${inspect(modulusLength)}`, }); } @@ -941,12 +942,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); for (const publicExponent of ['a', true, {}, [], 3.5, -1]) { assert.throws(() => generateKeyPair('rsa', { modulusLength: 4096, - publicExponent + publicExponent, }, common.mustNotCall()), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.publicExponent' is invalid. " + - `Received ${inspect(publicExponent)}` + `Received ${inspect(publicExponent)}`, }); } } @@ -956,12 +957,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); // Test invalid modulus lengths. for (const modulusLength of [undefined, null, 'a', true, {}, [], 4096.1]) { assert.throws(() => generateKeyPair('dsa', { - modulusLength + modulusLength, }, common.mustNotCall()), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.modulusLength' is invalid. " + - `Received ${inspect(modulusLength)}` + `Received ${inspect(modulusLength)}`, }); } @@ -969,12 +970,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); for (const divisorLength of ['a', true, {}, [], 4096.1, 2147483648, -1]) { assert.throws(() => generateKeyPair('dsa', { modulusLength: 2048, - divisorLength + divisorLength, }, common.mustNotCall()), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.divisorLength' is invalid. " + - `Received ${inspect(divisorLength)}` + `Received ${inspect(divisorLength)}`, }); } } @@ -986,11 +987,11 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); generateKeyPairSync('ec', { namedCurve: 'abcdef', publicKeyEncoding: { type: 'spki', format: 'pem' }, - privateKeyEncoding: { type: 'sec1', format: 'pem' } + privateKeyEncoding: { type: 'sec1', format: 'pem' }, }); }, { name: 'TypeError', - message: 'Invalid EC curve name' + message: 'Invalid EC curve name', }); // Test error type when curve is not a string @@ -999,13 +1000,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); generateKeyPairSync('ec', { namedCurve, publicKeyEncoding: { type: 'spki', format: 'pem' }, - privateKeyEncoding: { type: 'sec1', format: 'pem' } + privateKeyEncoding: { type: 'sec1', format: 'pem' }, }); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.namedCurve' is invalid. " + - `Received ${inspect(namedCurve)}` + `Received ${inspect(namedCurve)}`, }); } @@ -1014,10 +1015,10 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); namedCurve: 'P-256', }, common.mustSucceed((publicKey, privateKey) => { assert.deepStrictEqual(publicKey.asymmetricKeyDetails, { - namedCurve: 'prime256v1' + namedCurve: 'prime256v1', }); assert.deepStrictEqual(privateKey.asymmetricKeyDetails, { - namedCurve: 'prime256v1' + namedCurve: 'prime256v1', }); })); @@ -1025,10 +1026,10 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); namedCurve: 'secp256k1', }, common.mustSucceed((publicKey, privateKey) => { assert.deepStrictEqual(publicKey.asymmetricKeyDetails, { - namedCurve: 'secp256k1' + namedCurve: 'secp256k1', }); assert.deepStrictEqual(privateKey.asymmetricKeyDetails, { - namedCurve: 'secp256k1' + namedCurve: 'secp256k1', }); })); } @@ -1053,7 +1054,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); // Test classic Diffie-Hellman key generation. { generateKeyPair('dh', { - primeLength: 1024 + primeLength: 1024, }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(publicKey.type, 'public'); assert.strictEqual(publicKey.asymmetricKeyType, 'dh'); @@ -1067,7 +1068,8 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', - message: 'The "options" argument must be of type object. Received undefined' + message: 'The "options" argument must be of type object.' + + ' Received undefined', }); assert.throws(() => { @@ -1076,22 +1078,22 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); name: 'TypeError', code: 'ERR_MISSING_OPTION', message: 'At least one of the group, prime, or primeLength options is ' + - 'required' + 'required', }); assert.throws(() => { generateKeyPair('dh', { - group: 'modp0' + group: 'modp0', }, common.mustNotCall()); }, { name: 'Error', code: 'ERR_CRYPTO_UNKNOWN_DH_GROUP', - message: 'Unknown DH group' + message: 'Unknown DH group', }); assert.throws(() => { generateKeyPair('dh', { - primeLength: 2147483648 + primeLength: 2147483648, }, common.mustNotCall()); }, { name: 'TypeError', @@ -1102,7 +1104,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.throws(() => { generateKeyPair('dh', { - primeLength: -1 + primeLength: -1, }, common.mustNotCall()); }, { name: 'TypeError', @@ -1140,7 +1142,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); group: 'modp5', prime: Buffer.alloc(0), primeLength: 1024, - generator: 2 + generator: 2, }; const incompatible = [ ['group', 'prime'], @@ -1152,13 +1154,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.throws(() => { generateKeyPairSync('dh', { [opt1]: allOpts[opt1], - [opt2]: allOpts[opt2] + [opt2]: allOpts[opt2], }); }, { name: 'TypeError', code: 'ERR_INCOMPATIBLE_OPTION_PAIR', message: `Option "${opt1}" cannot be used in combination with option ` + - `"${opt2}"` + `"${opt2}"`, }); } } @@ -1171,13 +1173,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); generateKeyPairSync('rsa', { modulusLength: 4096, publicKeyEncoding: { type, format: 'pem' }, - privateKeyEncoding: { type: 'pkcs8', format: 'pem' } + privateKeyEncoding: { type: 'pkcs8', format: 'pem' }, }); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.publicKeyEncoding.type' is invalid. " + - `Received ${inspect(type)}` + `Received ${inspect(type)}`, }); } @@ -1186,13 +1188,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); assert.throws(() => { generateKeyPairSync('rsa-pss', { modulusLength: 4096, - hash: hashValue + hash: hashValue, }); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.hash' is invalid. " + - `Received ${inspect(hashValue)}` + `Received ${inspect(hashValue)}`, }); } @@ -1202,13 +1204,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 512, saltLength: 2147483648, hash: 'sha256', - mgf1Hash: 'sha256' + mgf1Hash: 'sha256', }, common.mustNotCall()); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.saltLength' is invalid. " + - 'Received 2147483648' + 'Received 2147483648', }); assert.throws(() => { @@ -1216,13 +1218,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 512, saltLength: -1, hash: 'sha256', - mgf1Hash: 'sha256' + mgf1Hash: 'sha256', }, common.mustNotCall()); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.saltLength' is invalid. " + - 'Received -1' + 'Received -1', }); // Invalid private key type. @@ -1231,13 +1233,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); generateKeyPairSync('rsa', { modulusLength: 4096, publicKeyEncoding: { type: 'spki', format: 'pem' }, - privateKeyEncoding: { type, format: 'pem' } + privateKeyEncoding: { type, format: 'pem' }, }); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.privateKeyEncoding.type' is invalid. " + - `Received ${inspect(type)}` + `Received ${inspect(type)}`, }); } @@ -1248,12 +1250,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 4096, namedCurve: 'P-256', publicKeyEncoding: { type: 'pkcs1', format: 'pem' }, - privateKeyEncoding: { type: 'pkcs8', format: 'pem' } + privateKeyEncoding: { type: 'pkcs8', format: 'pem' }, }); }, { name: 'Error', code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS', - message: 'The selected key encoding pkcs1 can only be used for RSA keys.' + message: 'The selected key encoding pkcs1 can only be used for RSA keys.', }); assert.throws(() => { @@ -1261,12 +1263,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 4096, namedCurve: 'P-256', publicKeyEncoding: { type: 'spki', format: 'pem' }, - privateKeyEncoding: { type: 'pkcs1', format: 'pem' } + privateKeyEncoding: { type: 'pkcs1', format: 'pem' }, }); }, { name: 'Error', code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS', - message: 'The selected key encoding pkcs1 can only be used for RSA keys.' + message: 'The selected key encoding pkcs1 can only be used for RSA keys.', }); } @@ -1275,12 +1277,12 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); generateKeyPairSync(type, { modulusLength: 4096, publicKeyEncoding: { type: 'spki', format: 'pem' }, - privateKeyEncoding: { type: 'sec1', format: 'pem' } + privateKeyEncoding: { type: 'sec1', format: 'pem' }, }); }, { name: 'Error', code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS', - message: 'The selected key encoding sec1 can only be used for EC keys.' + message: 'The selected key encoding sec1 can only be used for EC keys.', }); } @@ -1295,13 +1297,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); type, format: 'der', cipher: 'aes-128-cbc', - passphrase: 'hello' - } + passphrase: 'hello', + }, }); }, { name: 'Error', code: 'ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS', - message: `The selected key encoding ${type} does not support encryption.` + message: `The selected key encoding ${type} does not support encryption.`, }); } } @@ -1314,13 +1316,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 512, saltLength: 16, hash: 'sha256', - mgf1Hash: undefined + mgf1Hash: undefined, }); }, { name: 'TypeError', code: 'ERR_INVALID_CALLBACK', - message: 'Callback must be a function. Received undefined' + message: 'Callback must be a function. Received undefined', } ); @@ -1331,14 +1333,14 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); modulusLength: 512, saltLength: 16, hash: 'sha256', - mgf1Hash + mgf1Hash, }, common.mustNotCall()); }, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.mgf1Hash' is invalid. " + - `Received ${inspect(mgf1Hash)}` + `Received ${inspect(mgf1Hash)}`, } ); @@ -1357,15 +1359,15 @@ if (!common.hasOpenSSL3) { type, format: 'pem', cipher: 'aes-256-cbc', - passphrase: '' - } + passphrase: '', + }, }, common.mustSucceed((publicKey, privateKey) => { assert.strictEqual(publicKey.type, 'public'); for (const passphrase of ['', Buffer.alloc(0)]) { const privateKeyObject = createPrivateKey({ passphrase, - key: privateKey + key: privateKey, }); assert.strictEqual(privateKeyObject.asymmetricKeyType, 'rsa'); } @@ -1377,7 +1379,7 @@ if (!common.hasOpenSSL3) { }, { name: 'TypeError', code: 'ERR_MISSING_PASSPHRASE', - message: 'Passphrase required for encrypted key' + message: 'Passphrase required for encrypted key', }); })); } @@ -1393,7 +1395,7 @@ if (!common.hasOpenSSL3) { () => generateKeyPair('ec', { namedCurve }, common.mustNotCall()), { name: 'TypeError', - message: 'Invalid EC curve name' + message: 'Invalid EC curve name', } ); } @@ -1414,14 +1416,14 @@ if (!common.hasOpenSSL3) { namedCurve, publicKeyEncoding: { format: 'der', - type: 'spki' - } + type: 'spki', + }, }; assert.throws(() => { generateKeyPairSync('ec', params); }, { - code: expectedErrorCode + code: expectedErrorCode, }); generateKeyPair('ec', params, common.mustCall((err) => { diff --git a/test/parallel/test-crypto-op-during-process-exit.js b/test/parallel/test-crypto-op-during-process-exit.js index a9a70c39e095a3..6a485d1fa04c49 100644 --- a/test/parallel/test-crypto-op-during-process-exit.js +++ b/test/parallel/test-crypto-op-during-process-exit.js @@ -19,8 +19,8 @@ generateKeyPair('rsa', { modulusLength: 2048, privateKeyEncoding: { type: 'pkcs1', - format: 'pem' - } + format: 'pem', + }, }, (err/* , publicKey, privateKey */) => { assert.ifError(err); }); diff --git a/test/parallel/test-crypto-pbkdf2.js b/test/parallel/test-crypto-pbkdf2.js index c9ab6a9c48438e..ee866f6d6111d9 100644 --- a/test/parallel/test-crypto-pbkdf2.js +++ b/test/parallel/test-crypto-pbkdf2.js @@ -59,7 +59,7 @@ assert.throws( () => crypto.pbkdf2('password', 'salt', 1, 20, 'sha1'), { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', } ); @@ -70,7 +70,7 @@ for (const iterations of [-1, 0]) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "iterations" is out of range. ' + - `It must be >= 1 && < 4294967296. Received ${iterations}` + `It must be >= 1 && < 4294967296. Received ${iterations}`, } ); } @@ -83,7 +83,7 @@ for (const iterations of [-1, 0]) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "keylen" argument must be of type number.' + - `${common.invalidArgTypeHelper(notNumber)}` + `${common.invalidArgTypeHelper(notNumber)}`, }); }); @@ -96,7 +96,7 @@ for (const iterations of [-1, 0]) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "keylen" is out of range. It ' + - `must be an integer. Received ${input}` + `must be an integer. Received ${input}`, }); }); @@ -109,7 +109,7 @@ for (const iterations of [-1, 0]) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "keylen" is out of range. It must be >= 0 && < ' + - `4294967296. Received ${input === -1 ? '-1' : '4_294_967_297'}` + `4294967296. Received ${input === -1 ? '-1' : '4_294_967_297'}`, }); }); @@ -123,7 +123,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "digest" argument must be of type string. ' + - 'Received undefined' + 'Received undefined', }); assert.throws( @@ -132,7 +132,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "digest" argument must be of type string. ' + - 'Received undefined' + 'Received undefined', }); assert.throws( @@ -141,7 +141,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "digest" argument must be of type string. ' + - 'Received null' + 'Received null', }); [1, {}, [], true, undefined, null].forEach((input) => { assert.throws( @@ -184,7 +184,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: `The "iterations" argument must be of type number.${received}` + message: `The "iterations" argument must be of type number.${received}`, } ); @@ -193,7 +193,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: `The "iterations" argument must be of type number.${received}` + message: `The "iterations" argument must be of type number.${received}`, } ); }); @@ -210,7 +210,7 @@ assert.throws( { code: 'ERR_CRYPTO_INVALID_DIGEST', name: 'TypeError', - message: 'Invalid digest: md55' + message: 'Invalid digest: md55', } ); @@ -219,7 +219,7 @@ assert.throws( { code: 'ERR_CRYPTO_INVALID_DIGEST', name: 'TypeError', - message: 'Invalid digest: md55' + message: 'Invalid digest: md55', } ); @@ -239,7 +239,7 @@ if (!common.hasOpenSSL3) { { code: 'ERR_CRYPTO_INVALID_DIGEST', name: 'TypeError', - message: 'Invalid digest: %' + message: 'Invalid digest: %', } ); } diff --git a/test/parallel/test-crypto-prime.js b/test/parallel/test-crypto-prime.js index 749221b4514ef3..b6baeaa17d5283 100644 --- a/test/parallel/test-crypto-prime.js +++ b/test/parallel/test-crypto-prime.js @@ -19,55 +19,55 @@ const pCheckPrime = promisify(checkPrime); ['hello', false, {}, []].forEach((i) => { assert.throws(() => generatePrime(i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => generatePrimeSync(i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); ['hello', false, 123].forEach((i) => { assert.throws(() => generatePrime(80, i, common.mustNotCall()), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => generatePrimeSync(80, i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); ['hello', false, 123].forEach((i) => { assert.throws(() => generatePrime(80, {}), { - code: 'ERR_INVALID_CALLBACK' + code: 'ERR_INVALID_CALLBACK', }); }); [-1, 0].forEach((i) => { assert.throws(() => generatePrime(i, common.mustNotCall()), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => generatePrimeSync(i), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); }); ['test', -1, {}, []].forEach((i) => { assert.throws(() => generatePrime(8, { safe: i }, common.mustNotCall()), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => generatePrime(8, { rem: i }, common.mustNotCall()), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => generatePrime(8, { add: i }, common.mustNotCall()), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => generatePrimeSync(8, { safe: i }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => generatePrimeSync(8, { rem: i }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => generatePrimeSync(8, { add: i }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); @@ -77,19 +77,19 @@ const pCheckPrime = promisify(checkPrime); assert.throws(() => generatePrime(20, { add: -1n }, common.mustNotCall()), { code: 'ERR_OUT_OF_RANGE', message: 'The value of "options.add" is out of range. It must be >= 0. ' + - 'Received -1n' + 'Received -1n', }); assert.throws(() => generatePrime(20, { rem: -1n }, common.mustNotCall()), { code: 'ERR_OUT_OF_RANGE', message: 'The value of "options.rem" is out of range. It must be >= 0. ' + - 'Received -1n' + 'Received -1n', }); assert.throws(() => checkPrime(-1n, common.mustNotCall()), { code: 'ERR_OUT_OF_RANGE', message: 'The value of "candidate" is out of range. It must be >= 0. ' + - 'Received -1n' + 'Received -1n', }); } @@ -164,7 +164,7 @@ generatePrime( if (process.versions.openssl >= '1.1.1f') { generatePrime(128, { bigint: true, - add: 5n + add: 5n, }, common.mustSucceed((prime) => { assert(checkPrimeSync(prime)); assert.strictEqual(prime % 5n, 1n); @@ -173,7 +173,7 @@ generatePrime( generatePrime(128, { bigint: true, safe: true, - add: 5n + add: 5n, }, common.mustSucceed((prime) => { assert(checkPrimeSync(prime)); assert.strictEqual(prime % 5n, 3n); @@ -189,7 +189,7 @@ generatePrime( generatePrimeSync(64, { add }); }, { code: 'ERR_OUT_OF_RANGE', - message: 'invalid options.add' + message: 'invalid options.add', }); } @@ -199,7 +199,7 @@ generatePrime( generatePrimeSync(64, { add: 7n, rem }); }, { code: 'ERR_OUT_OF_RANGE', - message: 'invalid options.rem' + message: 'invalid options.rem', }); } @@ -208,7 +208,7 @@ generatePrime( assert.throws(() => { generatePrimeSync(3, { add: 8n, rem: 7n }); }, { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); if (process.versions.openssl >= '1.1.1f') { @@ -216,23 +216,23 @@ generatePrime( assert.strictEqual(generatePrimeSync(4, { add: 15n, rem: 13n, - bigint: true + bigint: true, }), 13n); } } [1, 'hello', {}, []].forEach((i) => { assert.throws(() => checkPrime(i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); ['hello', {}, []].forEach((i) => { assert.throws(() => checkPrime(2, { checks: i }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }, common.mustNotCall()); assert.throws(() => checkPrimeSync(2, { checks: i }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); @@ -247,7 +247,7 @@ assert( { fast: true, trialDivision: true, - checks: 10 + checks: 10, })); (async function() { diff --git a/test/parallel/test-crypto-random.js b/test/parallel/test-crypto-random.js index bc62d4b6847064..664c4d1a692bb8 100644 --- a/test/parallel/test-crypto-random.js +++ b/test/parallel/test-crypto-random.js @@ -45,7 +45,7 @@ common.expectWarning('DeprecationWarning', code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "size" argument must be of type number.' + - common.invalidArgTypeHelper(value) + common.invalidArgTypeHelper(value), }; assert.throws(() => f(value), errObj); assert.throws(() => f(value, common.mustNotCall()), errObj); @@ -56,7 +56,7 @@ common.expectWarning('DeprecationWarning', code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "size" is out of range. It must be >= 0 && <= ' + - `${kMaxPossibleLength}. Received ${value}` + `${kMaxPossibleLength}. Received ${value}`, }; assert.throws(() => f(value), errObj); assert.throws(() => f(value, common.mustNotCall()), errObj); @@ -232,7 +232,7 @@ common.expectWarning('DeprecationWarning', code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "offset" argument must be of type number. ' + - "Received type string ('test')" + "Received type string ('test')", }; assert.throws(() => crypto.randomFillSync(buf, 'test'), typeErrObj); @@ -254,7 +254,7 @@ common.expectWarning('DeprecationWarning', code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be >= 0 && <= 10. Received ${offsetSize}` + `It must be >= 0 && <= 10. Received ${offsetSize}`, }; assert.throws(() => crypto.randomFillSync(buf, offsetSize), errObj); @@ -277,7 +277,7 @@ common.expectWarning('DeprecationWarning', code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "size + offset" is out of range. ' + - 'It must be <= 10. Received 11' + 'It must be <= 10. Received 11', }; assert.throws(() => crypto.randomFillSync(buf, 1, 10), rangeErrObj); @@ -297,7 +297,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "size" is out of range. ' + - `It must be >= 0 && <= ${kMaxPossibleLength}. Received 4294967296` + `It must be >= 0 && <= ${kMaxPossibleLength}. Received 4294967296`, } ); @@ -307,14 +307,14 @@ assert.throws( () => crypto.randomFillSync(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => crypto.randomFill(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( @@ -322,7 +322,7 @@ assert.throws( { code: 'ERR_INVALID_CALLBACK', name: 'TypeError', - message: `Callback must be a function. Received ${inspect(i)}` + message: `Callback must be a function. Received ${inspect(i)}`, }); }); @@ -332,7 +332,7 @@ assert.throws( { code: 'ERR_INVALID_CALLBACK', name: 'TypeError', - message: `Callback must be a function. Received ${inspect(i)}` + message: `Callback must be a function. Received ${inspect(i)}`, } ); }); @@ -490,7 +490,7 @@ assert.throws( name: 'RangeError', message: 'The value of "max" is out of range. It must be greater than ' + `the value of "min" (${arg[arg.length - 2] || 0}). ` + - `Received ${arg[arg.length - 1]}` + `Received ${arg[arg.length - 1]}`, }); } @@ -504,7 +504,7 @@ assert.throws( name: 'RangeError', message: 'The value of "max - min" is out of range. ' + `It must be <= ${MAX_RANGE}. ` + - 'Received 281_474_976_710_656' + 'Received 281_474_976_710_656', } ); @@ -513,14 +513,14 @@ assert.throws( name: 'RangeError', message: 'The value of "max" is out of range. ' + `It must be <= ${MAX_RANGE}. ` + - 'Received 281_474_976_710_656' + 'Received 281_474_976_710_656', }); [true, NaN, null, {}, [], 10].forEach((i) => { const cbError = { code: 'ERR_INVALID_CALLBACK', name: 'TypeError', - message: `Callback must be a function. Received ${inspect(i)}` + message: `Callback must be a function. Received ${inspect(i)}`, }; assert.throws(() => crypto.randomInt(0, 1, i), cbError); }); diff --git a/test/parallel/test-crypto-randomuuid.js b/test/parallel/test-crypto-randomuuid.js index 23e97fb8cf49a1..fbf1abc40ac185 100644 --- a/test/parallel/test-crypto-randomuuid.js +++ b/test/parallel/test-crypto-randomuuid.js @@ -49,10 +49,10 @@ for (let n = 0; n < 130; n++) { testMatch(randomUUID({ disableEntropyCache: true })); assert.throws(() => randomUUID(1), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => randomUUID({ disableEntropyCache: '' }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); } diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index 567d8650c5a177..c954622aff5362 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -70,7 +70,7 @@ function getBufferCopy(buf) { crypto.publicEncrypt(new DataView(ab), new DataView(ab2enc)); otherEncrypted = crypto.publicEncrypt({ key: Buffer.from(ab).toString('hex'), - encoding: 'hex' + encoding: 'hex', }, Buffer.from(ab2enc).toString('hex')); } @@ -84,12 +84,12 @@ function getBufferCopy(buf) { let decryptedBufferWithPassword = crypto.privateDecrypt({ key: rsaKeyPemEncrypted, - passphrase: 'password' + passphrase: 'password', }, encryptedBuffer); const otherDecryptedBufferWithPassword = crypto.privateDecrypt({ key: rsaKeyPemEncrypted, - passphrase: ec.encode('password') + passphrase: ec.encode('password'), }, encryptedBuffer); assert.strictEqual( @@ -98,30 +98,30 @@ function getBufferCopy(buf) { decryptedBufferWithPassword = crypto.privateDecrypt({ key: rsaKeyPemEncrypted, - passphrase: 'password' + passphrase: 'password', }, encryptedBuffer); assert.strictEqual(decryptedBufferWithPassword.toString(), input); encryptedBuffer = crypto.publicEncrypt({ key: rsaKeyPemEncrypted, - passphrase: 'password' + passphrase: 'password', }, bufferToEncrypt); decryptedBufferWithPassword = crypto.privateDecrypt({ key: rsaKeyPemEncrypted, - passphrase: 'password' + passphrase: 'password', }, encryptedBuffer); assert.strictEqual(decryptedBufferWithPassword.toString(), input); encryptedBuffer = crypto.privateEncrypt({ key: rsaKeyPemEncrypted, - passphrase: bufferPassword + passphrase: bufferPassword, }, bufferToEncrypt); decryptedBufferWithPassword = crypto.publicDecrypt({ key: rsaKeyPemEncrypted, - passphrase: bufferPassword + passphrase: bufferPassword, }, encryptedBuffer); assert.strictEqual(decryptedBufferWithPassword.toString(), input); @@ -129,20 +129,20 @@ function getBufferCopy(buf) { encryptedBuffer = crypto.privateEncrypt({ padding: crypto.constants.RSA_PKCS1_PADDING, key: rsaKeyPemEncrypted, - passphrase: bufferPassword + passphrase: bufferPassword, }, bufferToEncrypt); decryptedBufferWithPassword = crypto.publicDecrypt({ padding: crypto.constants.RSA_PKCS1_PADDING, key: rsaKeyPemEncrypted, - passphrase: bufferPassword + passphrase: bufferPassword, }, encryptedBuffer); assert.strictEqual(decryptedBufferWithPassword.toString(), input); // Omitting padding should be okay because RSA_PKCS1_PADDING is the default. decryptedBufferWithPassword = crypto.publicDecrypt({ key: rsaKeyPemEncrypted, - passphrase: bufferPassword + passphrase: bufferPassword, }, encryptedBuffer); assert.strictEqual(decryptedBufferWithPassword.toString(), input); @@ -155,13 +155,13 @@ function getBufferCopy(buf) { encryptedBuffer = crypto.privateEncrypt({ padding: crypto.constants.RSA_NO_PADDING, key: rsaKeyPemEncrypted, - passphrase: bufferPassword + passphrase: bufferPassword, }, Buffer.from(plaintext)); decryptedBufferWithPassword = crypto.publicDecrypt({ padding: crypto.constants.RSA_NO_PADDING, key: rsaKeyPemEncrypted, - passphrase: bufferPassword + passphrase: bufferPassword, }, encryptedBuffer); assert.strictEqual(decryptedBufferWithPassword.toString(), plaintext); } @@ -185,26 +185,26 @@ function getBufferCopy(buf) { assert.throws(() => { crypto.privateDecrypt({ key: rsaKeyPemEncrypted, - passphrase: 'wrong' + passphrase: 'wrong', }, bufferToEncrypt); }, decryptError); assert.throws(() => { crypto.publicEncrypt({ key: rsaKeyPemEncrypted, - passphrase: 'wrong' + passphrase: 'wrong', }, encryptedBuffer); }, decryptError); encryptedBuffer = crypto.privateEncrypt({ key: rsaKeyPemEncrypted, - passphrase: Buffer.from('password') + passphrase: Buffer.from('password'), }, bufferToEncrypt); assert.throws(() => { crypto.publicDecrypt({ key: rsaKeyPemEncrypted, - passphrase: Buffer.from('wrong') + passphrase: Buffer.from('wrong'), }, encryptedBuffer); }, decryptError); } @@ -221,20 +221,20 @@ function test_rsa(padding, encryptOaepHash, decryptOaepHash) { const encryptedBuffer = crypto.publicEncrypt({ key: rsaPubPem, padding: padding, - oaepHash: encryptOaepHash + oaepHash: encryptOaepHash, }, bufferToEncrypt); let decryptedBuffer = crypto.privateDecrypt({ key: rsaKeyPem, padding: padding, - oaepHash: decryptOaepHash + oaepHash: decryptOaepHash, }, encryptedBuffer); assert.deepStrictEqual(decryptedBuffer, input); decryptedBuffer = crypto.privateDecrypt({ key: rsaPkcs8KeyPem, padding: padding, - oaepHash: decryptOaepHash + oaepHash: decryptOaepHash, }, encryptedBuffer); assert.deepStrictEqual(decryptedBuffer, input); } @@ -251,7 +251,7 @@ test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha512', 'sha512'); assert.throws(() => { test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha256', 'sha512'); }, { - code: 'ERR_OSSL_RSA_OAEP_DECODING_ERROR' + code: 'ERR_OSSL_RSA_OAEP_DECODING_ERROR', }); // The following RSA-OAEP test cases were created using the WebCrypto API to @@ -267,7 +267,7 @@ assert.throws(() => { const decrypted = crypto.privateDecrypt({ key: rsaPkcs8KeyPem, oaepHash, - oaepLabel: oaepLabel ? label : undefined + oaepLabel: oaepLabel ? label : undefined, }, Buffer.from(ct, 'hex')); assert.strictEqual(decrypted.toString('utf8'), 'Hello Node.js'); @@ -275,7 +275,7 @@ assert.throws(() => { const otherDecrypted = crypto.privateDecrypt({ key: rsaPkcs8KeyPem, oaepHash, - oaepLabel: copiedLabel + oaepLabel: copiedLabel, }, Buffer.from(ct, 'hex')); assert.strictEqual(otherDecrypted.toString('utf8'), 'Hello Node.js'); @@ -287,20 +287,20 @@ for (const fn of [crypto.publicEncrypt, crypto.privateDecrypt]) { assert.throws(() => { fn({ key: rsaPubPem, - oaepHash: 'Hello world' + oaepHash: 'Hello world', }, Buffer.alloc(10)); }, { - code: 'ERR_OSSL_EVP_INVALID_DIGEST' + code: 'ERR_OSSL_EVP_INVALID_DIGEST', }); for (const oaepHash of [0, false, null, Symbol(), () => {}]) { assert.throws(() => { fn({ key: rsaPubPem, - oaepHash + oaepHash, }, Buffer.alloc(10)); }, { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); } @@ -308,10 +308,10 @@ for (const fn of [crypto.publicEncrypt, crypto.privateDecrypt]) { assert.throws(() => { fn({ key: rsaPubPem, - oaepLabel + oaepLabel, }, Buffer.alloc(10)); }, { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); } } diff --git a/test/parallel/test-crypto-scrypt.js b/test/parallel/test-crypto-scrypt.js index 7b695a36f2b5a4..f745fc4027190d 100644 --- a/test/parallel/test-crypto-scrypt.js +++ b/test/parallel/test-crypto-scrypt.js @@ -170,7 +170,7 @@ for (const options of bad) { for (const options of toobig) { const expected = { - message: /Invalid scrypt param/ + message: /Invalid scrypt param/, }; assert.throws(() => crypto.scrypt('pass', 'salt', 1, options, () => {}), expected); @@ -228,7 +228,7 @@ for (const { args, expected } of badargs) { // Values that exceed Number.isSafeInteger should not be allowed. assert.throws(() => crypto.scryptSync('', '', 0, { maxmem: 2 ** 53 }), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); } @@ -243,7 +243,7 @@ for (const { args, expected } of badargs) { get [name]() { accessCount++; return value; - } + }, }); // Try to crash the process on the last access. @@ -253,10 +253,10 @@ for (const { args, expected } of badargs) { if (--accessCount === 0) return ''; return value; - } + }, }); }, { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); } diff --git a/test/parallel/test-crypto-secret-keygen.js b/test/parallel/test-crypto-secret-keygen.js index ab662aeb5d123b..b4948f6a8d419f 100644 --- a/test/parallel/test-crypto-secret-keygen.js +++ b/test/parallel/test-crypto-secret-keygen.js @@ -7,67 +7,67 @@ const assert = require('assert'); const { generateKey, - generateKeySync + generateKeySync, } = require('crypto'); [1, true, [], {}, Infinity, null, undefined].forEach((i) => { assert.throws(() => generateKey(i, 1, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - message: /The "type" argument must be / + message: /The "type" argument must be /, }); assert.throws(() => generateKeySync(i, 1), { code: 'ERR_INVALID_ARG_TYPE', - message: /The "type" argument must be / + message: /The "type" argument must be /, }); }); ['', true, [], null, undefined].forEach((i) => { assert.throws(() => generateKey('aes', i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - message: /The "options" argument must be / + message: /The "options" argument must be /, }); assert.throws(() => generateKeySync('aes', i), { code: 'ERR_INVALID_ARG_TYPE', - message: /The "options" argument must be / + message: /The "options" argument must be /, }); }); ['', true, {}, [], null, undefined].forEach((length) => { assert.throws(() => generateKey('hmac', { length }, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - message: /The "options\.length" property must be / + message: /The "options\.length" property must be /, }); assert.throws(() => generateKeySync('hmac', { length }), { code: 'ERR_INVALID_ARG_TYPE', - message: /The "options\.length" property must be / + message: /The "options\.length" property must be /, }); }); assert.throws(() => generateKey('aes', { length: 256 }), { - code: 'ERR_INVALID_CALLBACK' + code: 'ERR_INVALID_CALLBACK', }); assert.throws(() => generateKey('hmac', { length: -1 }, common.mustNotCall()), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws( () => generateKey('hmac', { length: 2 ** 31 }, common.mustNotCall()), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => generateKeySync('hmac', { length: -1 }), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws( () => generateKeySync('hmac', { length: 2 ** 31 }), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => generateKeySync('aes', { length: 123 }), { code: 'ERR_INVALID_ARG_VALUE', - message: /The property 'options\.length' must be one of: 128, 192, 256/ + message: /The property 'options\.length' must be one of: 128, 192, 256/, }); { @@ -112,10 +112,10 @@ assert.throws(() => generateKeySync('aes', { length: 123 }), { assert.throws( () => generateKey('unknown', { length: 123 }, common.mustNotCall()), { code: 'ERR_INVALID_ARG_VALUE', - message: /The argument 'type' must be a supported key type/ + message: /The argument 'type' must be a supported key type/, }); assert.throws(() => generateKeySync('unknown', { length: 123 }), { code: 'ERR_INVALID_ARG_VALUE', - message: /The argument 'type' must be a supported key type/ + message: /The argument 'type' must be a supported key type/, }); diff --git a/test/parallel/test-crypto-secure-heap.js b/test/parallel/test-crypto-secure-heap.js index fd6a90658d129d..f6f35cb1d599a0 100644 --- a/test/parallel/test-crypto-secure-heap.js +++ b/test/parallel/test-crypto-secure-heap.js @@ -63,7 +63,7 @@ child.on('exit', common.mustCall((code) => { { const child = fork(fixtures.path('a.js'), { execArgv: ['--secure-heap=3', '--secure-heap-min=3'], - stdio: 'pipe' + stdio: 'pipe', }); let res = ''; child.on('exit', common.mustCall((code) => { diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js index 15fa3db4a69f19..896cb1f5a28ac6 100644 --- a/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js @@ -38,7 +38,7 @@ const keySize = 2048; configurable: true, set() { throw new Error('bye, bye, library'); - } + }, }; Object.defineProperty(Object.prototype, 'library', library); @@ -55,7 +55,7 @@ const keySize = 2048; configurable: true, set() { throw new Error('bye, bye, error stack'); - } + }, }; Object.defineProperty(Object.prototype, 'opensslErrorStack', errorStack); @@ -64,7 +64,7 @@ const keySize = 2048; .update('Test123') .sign({ key: keyPem, - padding: crypto.constants.RSA_PKCS1_OAEP_PADDING + padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, }); }, { message: common.hasOpenSSL3 ? 'error:1C8000A5:Provider routines::illegal or unsupported padding mode' : @@ -197,14 +197,14 @@ assert.throws( .sign({ key: keyPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: signSaltLength + saltLength: signSaltLength, }); }, errMessage); assert.throws(() => { crypto.sign(algo, data, { key: keyPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: signSaltLength + saltLength: signSaltLength, }); }, errMessage); } else { @@ -214,12 +214,12 @@ assert.throws( .sign({ key: keyPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: signSaltLength + saltLength: signSaltLength, }); const s4_2 = crypto.sign(algo, data, { key: keyPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: signSaltLength + saltLength: signSaltLength, }); [s4, s4_2].forEach((sig) => { @@ -232,12 +232,12 @@ assert.throws( .verify({ key: certPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: verifySaltLength + saltLength: verifySaltLength, }, sig); assert.strictEqual(verified, crypto.verify(algo, data, { key: certPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: verifySaltLength + saltLength: verifySaltLength, }, sig)); const saltLengthCorrect = getEffectiveSaltLength(signSaltLength) === getEffectiveSaltLength(verifySaltLength); @@ -250,13 +250,13 @@ assert.throws( .verify({ key: certPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO + saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO, }, sig); assert.strictEqual(verified, true); assert.strictEqual(verified, crypto.verify(algo, data, { key: certPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO + saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO, }, sig)); // Verifying an incorrect message should never work @@ -266,13 +266,13 @@ assert.throws( .verify({ key: certPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO + saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO, }, sig); assert.strictEqual(verified, false); assert.strictEqual(verified, crypto.verify(algo, wrongData, { key: certPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO + saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO, }, sig)); }); } @@ -293,7 +293,7 @@ assert.throws( .verify({ key: cert, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: vector.salt.length / 2 + saltLength: vector.salt.length / 2, }, vector.signature, 'hex'); assert.strictEqual(verified, true); } @@ -316,11 +316,11 @@ assert.throws( .update('Test123') .sign({ key: keyPem, - padding: invalidValue + padding: invalidValue, }); }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => { @@ -329,11 +329,11 @@ assert.throws( .sign({ key: keyPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: invalidValue + saltLength: invalidValue, }); }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -342,7 +342,7 @@ assert.throws( .update('Test123') .sign({ key: keyPem, - padding: crypto.constants.RSA_PKCS1_OAEP_PADDING + padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, }); }, common.hasOpenSSL3 ? { code: 'ERR_OSSL_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE', @@ -363,7 +363,7 @@ assert.throws( crypto.createSign('SHA1').update('Test123').sign(null, 'base64'); }, { code: 'ERR_CRYPTO_SIGN_KEY_REQUIRED', - name: 'Error' + name: 'Error', }); } @@ -376,7 +376,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "algorithm" argument must be of type string.' + - `${common.invalidArgTypeHelper(input)}` + `${common.invalidArgTypeHelper(input)}`, }; assert.throws(() => crypto.createSign(input), errObj); assert.throws(() => crypto.createVerify(input), errObj); @@ -549,7 +549,7 @@ assert.throws( assert.strictEqual( crypto.verify('sha256', data, { key: fixtures.readKey('ec-key.pem'), - dsaEncoding: 'ieee-p1363' + dsaEncoding: 'ieee-p1363', }, extSig), ok ); @@ -557,7 +557,7 @@ assert.throws( assert.strictEqual( crypto.createVerify('sha256').update(data).verify({ key: fixtures.readKey('ec-key.pem'), - dsaEncoding: 'ieee-p1363' + dsaEncoding: 'ieee-p1363', }, extSig), ok ); @@ -568,20 +568,20 @@ assert.throws( // Non-(EC)DSA keys should ignore the option. const sig = crypto.sign('sha1', data, { key: keyPem, - dsaEncoding: 'ieee-p1363' + dsaEncoding: 'ieee-p1363', }); assert.strictEqual(crypto.verify('sha1', data, certPem, sig), true); assert.strictEqual( crypto.verify('sha1', data, { key: certPem, - dsaEncoding: 'ieee-p1363' + dsaEncoding: 'ieee-p1363', }, sig), true ); assert.strictEqual( crypto.verify('sha1', data, { key: certPem, - dsaEncoding: 'der' + dsaEncoding: 'der', }, sig), true ); @@ -590,10 +590,10 @@ assert.throws( assert.throws(() => { crypto.sign('sha1', data, { key: certPem, - dsaEncoding + dsaEncoding, }); }, { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); } } @@ -614,7 +614,7 @@ assert.throws( .update(msg) .sign({ key: privkey, - padding: crypto.constants.RSA_PKCS1_PSS_PADDING + padding: crypto.constants.RSA_PKCS1_PSS_PADDING, }); const tmpdir = require('../common/tmpdir'); diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js index ad7d5d4f86d52b..3b6d924d857ef9 100644 --- a/test/parallel/test-crypto-verify-failure.js +++ b/test/parallel/test-crypto-verify-failure.js @@ -33,7 +33,7 @@ const certPem = fixtures.readKey('rsa_cert.crt'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = tls.Server(options, (socket) => { @@ -54,7 +54,7 @@ function verify() { server.listen(0, common.mustCall(() => { tls.connect({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { verify(); })) diff --git a/test/parallel/test-crypto-x509.js b/test/parallel/test-crypto-x509.js index c85a79b4854369..c139022fbf5384 100644 --- a/test/parallel/test-crypto-x509.js +++ b/test/parallel/test-crypto-x509.js @@ -11,7 +11,7 @@ const { } = require('crypto'); const { - isX509Certificate + isX509Certificate, } = require('internal/crypto/x509'); const assert = require('assert'); @@ -26,7 +26,7 @@ const privateKey = createPrivateKey(key); [1, {}, false, null].forEach((i) => { assert.throws(() => new X509Certificate(i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); @@ -117,7 +117,7 @@ const der = Buffer.from( assert(x509.checkPrivateKey(privateKey)); assert.throws(() => x509.checkPrivateKey(x509.publicKey), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); assert.strictEqual(x509.checkIP('127.0.0.1'), undefined); @@ -127,21 +127,21 @@ const der = Buffer.from( assert.strictEqual(x509.checkEmail('ry@tinyclouds.org'), 'ry@tinyclouds.org'); assert.strictEqual(x509.checkEmail('sally@example.com'), undefined); assert.throws(() => x509.checkHost('agent\x001'), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); assert.throws(() => x509.checkIP('[::]'), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); assert.throws(() => x509.checkEmail('not\x00hing'), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); [1, false, null].forEach((i) => { assert.throws(() => x509.checkHost('agent1', i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => x509.checkHost('agent1', { subject: i }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); @@ -153,7 +153,7 @@ const der = Buffer.from( ].forEach((key) => { [1, '', null, {}].forEach((i) => { assert.throws(() => x509.checkHost('agent1', { [key]: i }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); }); @@ -166,19 +166,19 @@ const der = Buffer.from( assert(!x509.verify(x509.publicKey)); assert.throws(() => x509.checkIssued({}), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => x509.checkIssued(''), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => x509.verify({}), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => x509.verify(''), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => x509.verify(privateKey), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); // X509Certificate can be cloned via MessageChannel/MessagePort @@ -226,7 +226,7 @@ const der = Buffer.from( fingerprint256: 'B0:BE:46:49:B8:29:63:E0:6F:63:C8:8A:57:9C:3F:9B:72:' + 'C6:F5:89:E3:0D:84:AC:5B:08:9A:20:89:B6:8F:D6', - serialNumber: 'ECC9B856270DA9A8' + serialNumber: 'ECC9B856270DA9A8', }; const legacyObject = x509.toLegacyObject(); diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js index 58441be4d093f0..fec890dfe7ffe3 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js @@ -28,7 +28,7 @@ if (!common.hasCrypto) common.expectWarning({ DeprecationWarning: [ ['crypto.createCipher is deprecated.', 'DEP0106'], - ] + ], }); const assert = require('assert'); @@ -97,7 +97,7 @@ assert.throws( () => crypto.createHash('sha1').update({ foo: 'bar' }), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); @@ -228,7 +228,7 @@ assert.throws(() => { library: 'rsa routines', function: 'RSA_sign', reason: 'digest too big for rsa key', - code: 'ERR_OSSL_RSA_DIGEST_TOO_BIG_FOR_RSA_KEY' + code: 'ERR_OSSL_RSA_DIGEST_TOO_BIG_FOR_RSA_KEY', }); return true; }); @@ -305,9 +305,9 @@ testEncoding(undefined, assertionHashUtf8); testEncoding({}, assertionHashUtf8); testEncoding({ - defaultEncoding: 'utf8' + defaultEncoding: 'utf8', }, assertionHashUtf8); testEncoding({ - defaultEncoding: 'latin1' + defaultEncoding: 'latin1', }, assertionHashLatin1); diff --git a/test/parallel/test-dgram-bind-fd-error.js b/test/parallel/test-dgram-bind-fd-error.js index a8a95bd07fc6a8..c0818341c9e072 100644 --- a/test/parallel/test-dgram-bind-fd-error.js +++ b/test/parallel/test-dgram-bind-fd-error.js @@ -26,7 +26,7 @@ const TYPE = 'udp4'; }, { code: 'EEXIST', name: 'Error', - message: /^open EEXIST$/ + message: /^open EEXIST$/, }); socket.close(); @@ -49,7 +49,7 @@ const TYPE = 'udp4'; }, { code: 'ERR_INVALID_FD_TYPE', name: 'TypeError', - message: /^Unsupported fd type: TCP$/ + message: /^Unsupported fd type: TCP$/, }); handle.close(); diff --git a/test/parallel/test-dgram-bind.js b/test/parallel/test-dgram-bind.js index 8ae1213c7f4188..b53a9fd5d8f2a2 100644 --- a/test/parallel/test-dgram-bind.js +++ b/test/parallel/test-dgram-bind.js @@ -32,7 +32,7 @@ socket.on('listening', common.mustCall(() => { }, { code: 'ERR_SOCKET_ALREADY_BOUND', name: 'Error', - message: /^Socket is already bound$/ + message: /^Socket is already bound$/, }); socket.close(); diff --git a/test/parallel/test-dgram-close-signal.js b/test/parallel/test-dgram-close-signal.js index 26de38b504dd4a..65f5c4248471c1 100644 --- a/test/parallel/test-dgram-close-signal.js +++ b/test/parallel/test-dgram-close-signal.js @@ -10,7 +10,7 @@ const dgram = require('dgram'); () => dgram.createSocket({ type: 'udp4', signal: {} }), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); } diff --git a/test/parallel/test-dgram-connect.js b/test/parallel/test-dgram-connect.js index 30e817f344a42c..079f7cb347be4a 100644 --- a/test/parallel/test-dgram-connect.js +++ b/test/parallel/test-dgram-connect.js @@ -15,7 +15,7 @@ client.connect(PORT, common.mustCall(() => { }, { name: 'Error', message: 'Already connected', - code: 'ERR_SOCKET_DGRAM_IS_CONNECTED' + code: 'ERR_SOCKET_DGRAM_IS_CONNECTED', }); client.disconnect(); @@ -24,7 +24,7 @@ client.connect(PORT, common.mustCall(() => { }, { name: 'Error', message: 'Not connected', - code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED' + code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED', }); assert.throws(() => { @@ -32,7 +32,7 @@ client.connect(PORT, common.mustCall(() => { }, { name: 'Error', message: 'Not connected', - code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED' + code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED', }); client.once('connect', common.mustCall(() => client.close())); @@ -44,7 +44,7 @@ assert.throws(() => { }, { name: 'Error', message: 'Already connected', - code: 'ERR_SOCKET_DGRAM_IS_CONNECTED' + code: 'ERR_SOCKET_DGRAM_IS_CONNECTED', }); assert.throws(() => { @@ -52,7 +52,7 @@ assert.throws(() => { }, { name: 'Error', message: 'Not connected', - code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED' + code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED', }); [ 0, null, 78960, undefined ].forEach((port) => { @@ -61,6 +61,6 @@ assert.throws(() => { }, { name: 'RangeError', message: /^Port should be > 0 and < 65536/, - code: 'ERR_SOCKET_BAD_PORT' + code: 'ERR_SOCKET_BAD_PORT', }); }); diff --git a/test/parallel/test-dgram-createSocket-type.js b/test/parallel/test-dgram-createSocket-type.js index 19bbd6c1b2b088..13b3520c135554 100644 --- a/test/parallel/test-dgram-createSocket-type.js +++ b/test/parallel/test-dgram-createSocket-type.js @@ -28,7 +28,7 @@ invalidTypes.forEach((invalidType) => { }, { code: 'ERR_SOCKET_BAD_TYPE', name: 'TypeError', - message: errMessage + message: errMessage, }); }); @@ -43,7 +43,7 @@ validTypes.forEach((validType) => { const socket = dgram.createSocket({ type: 'udp4', recvBufferSize: 10000, - sendBufferSize: 15000 + sendBufferSize: 15000, }); socket.bind(common.mustCall(() => { diff --git a/test/parallel/test-dgram-custom-lookup.js b/test/parallel/test-dgram-custom-lookup.js index 4f80451c526625..65d9a66319772e 100644 --- a/test/parallel/test-dgram-custom-lookup.js +++ b/test/parallel/test-dgram-custom-lookup.js @@ -42,7 +42,7 @@ const dns = require('dns'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "lookup" argument must be of type function.' + - common.invalidArgTypeHelper(value) + common.invalidArgTypeHelper(value), }); }); } diff --git a/test/parallel/test-dgram-membership.js b/test/parallel/test-dgram-membership.js index ebfdaa9cb6325f..9ea6215e777d6e 100644 --- a/test/parallel/test-dgram-membership.js +++ b/test/parallel/test-dgram-membership.js @@ -16,7 +16,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); }, { code: 'ERR_SOCKET_DGRAM_NOT_RUNNING', name: 'Error', - message: /^Not running$/ + message: /^Not running$/, }); })); } @@ -30,7 +30,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); }, { code: 'ERR_SOCKET_DGRAM_NOT_RUNNING', name: 'Error', - message: /^Not running$/ + message: /^Not running$/, }); })); } @@ -43,7 +43,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); }, { code: 'ERR_MISSING_ARGS', name: 'TypeError', - message: /^The "multicastAddress" argument must be specified$/ + message: /^The "multicastAddress" argument must be specified$/, }); socket.close(); } @@ -56,7 +56,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); }, { code: 'ERR_MISSING_ARGS', name: 'TypeError', - message: /^The "multicastAddress" argument must be specified$/ + message: /^The "multicastAddress" argument must be specified$/, }); socket.close(); } @@ -85,7 +85,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "sourceAddress" argument must be of type string. ' + - 'Received type number (0)' + 'Received type number (0)', }); socket.close(); } @@ -98,7 +98,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "groupAddress" argument must be of type string. ' + - 'Received type number (0)' + 'Received type number (0)', }); socket.close(); } @@ -110,7 +110,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); socket.addSourceSpecificMembership(multicastAddress, '0'); }, { code: 'EINVAL', - message: 'addSourceSpecificMembership EINVAL' + message: 'addSourceSpecificMembership EINVAL', }); socket.close(); } @@ -123,7 +123,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "sourceAddress" argument must be of type string. ' + - 'Received type number (0)' + 'Received type number (0)', }); socket.close(); } @@ -136,7 +136,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "groupAddress" argument must be of type string. ' + - 'Received type number (0)' + 'Received type number (0)', }); socket.close(); } @@ -148,7 +148,7 @@ const setup = dgram.createSocket.bind(dgram, { type: 'udp4', reuseAddr: true }); socket.dropSourceSpecificMembership(multicastAddress, '0'); }, { code: 'EINVAL', - message: 'dropSourceSpecificMembership EINVAL' + message: 'dropSourceSpecificMembership EINVAL', }); socket.close(); } diff --git a/test/parallel/test-dgram-multicast-setTTL.js b/test/parallel/test-dgram-multicast-setTTL.js index 756d63c890457b..4901fe906853c9 100644 --- a/test/parallel/test-dgram-multicast-setTTL.js +++ b/test/parallel/test-dgram-multicast-setTTL.js @@ -41,7 +41,7 @@ socket.on('listening', common.mustCall(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "ttl" argument must be of type number. Received type string' + - " ('foo')" + " ('foo')", }); // Close the socket diff --git a/test/parallel/test-dgram-send-address-types.js b/test/parallel/test-dgram-send-address-types.js index a88ef088dcf8a9..0f6f9b1919ff8a 100644 --- a/test/parallel/test-dgram-send-address-types.js +++ b/test/parallel/test-dgram-send-address-types.js @@ -26,7 +26,7 @@ const client = dgram.createSocket('udp4').bind(0, () => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "address" argument must be of type string or falsy.' + - `${common.invalidArgTypeHelper(invalidInput)}` + `${common.invalidArgTypeHelper(invalidInput)}`, }; assert.throws(() => client.send(buf, port, invalidInput), expectedError); }); diff --git a/test/parallel/test-dgram-send-bad-arguments.js b/test/parallel/test-dgram-send-bad-arguments.js index 3e42f31b1af4b6..270ea41719b39f 100644 --- a/test/parallel/test-dgram-send-bad-arguments.js +++ b/test/parallel/test-dgram-send-bad-arguments.js @@ -36,7 +36,7 @@ function checkArgs(connected) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "buffer" argument must be of type string or an instance ' + - 'of Buffer, TypedArray, or DataView. Received undefined' + 'of Buffer, TypedArray, or DataView. Received undefined', } ); @@ -47,7 +47,7 @@ function checkArgs(connected) { { code: 'ERR_SOCKET_DGRAM_IS_CONNECTED', name: 'Error', - message: 'Already connected' + message: 'Already connected', } ); @@ -56,7 +56,7 @@ function checkArgs(connected) { { code: 'ERR_SOCKET_DGRAM_IS_CONNECTED', name: 'Error', - message: 'Already connected' + message: 'Already connected', } ); @@ -65,7 +65,7 @@ function checkArgs(connected) { { code: 'ERR_SOCKET_DGRAM_IS_CONNECTED', name: 'Error', - message: 'Already connected' + message: 'Already connected', } ); @@ -74,7 +74,7 @@ function checkArgs(connected) { { code: 'ERR_SOCKET_DGRAM_IS_CONNECTED', name: 'Error', - message: 'Already connected' + message: 'Already connected', } ); } else { @@ -90,7 +90,7 @@ function checkArgs(connected) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "buffer" argument must be of type string or an instance ' + - 'of Buffer, TypedArray, or DataView. Received type number (23)' + 'of Buffer, TypedArray, or DataView. Received type number (23)', } ); @@ -102,7 +102,7 @@ function checkArgs(connected) { name: 'TypeError', message: 'The "buffer list arguments" argument must be of type string ' + 'or an instance of Buffer, TypedArray, or DataView. ' + - 'Received an instance of Array' + 'Received an instance of Array', } ); } diff --git a/test/parallel/test-dgram-sendto.js b/test/parallel/test-dgram-sendto.js index 967a22383fabd8..6ba1dc3573c10e 100644 --- a/test/parallel/test-dgram-sendto.js +++ b/test/parallel/test-dgram-sendto.js @@ -8,7 +8,7 @@ const errObj = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "offset" argument must be of type number. Received ' + - 'undefined' + 'undefined', }; assert.throws(() => socket.sendto(), errObj); diff --git a/test/parallel/test-dgram-setTTL.js b/test/parallel/test-dgram-setTTL.js index 4252f4b00148a7..e1e9f7b1457b41 100644 --- a/test/parallel/test-dgram-setTTL.js +++ b/test/parallel/test-dgram-setTTL.js @@ -15,7 +15,7 @@ socket.on('listening', common.mustCall(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "ttl" argument must be of type number. Received type string' + - " ('foo')" + " ('foo')", }); // TTL must be a number from > 0 to < 256 diff --git a/test/parallel/test-dgram-socket-buffer-size.js b/test/parallel/test-dgram-socket-buffer-size.js index c03b8bf48b0221..f8eb9b3115a62d 100644 --- a/test/parallel/test-dgram-socket-buffer-size.js +++ b/test/parallel/test-dgram-socket-buffer-size.js @@ -9,7 +9,7 @@ const { internalBinding } = require('internal/test/binding'); const { UV_EBADF, UV_EINVAL, - UV_ENOTSOCK + UV_ENOTSOCK, } = internalBinding('uv'); function getExpectedError(type) { @@ -28,8 +28,8 @@ function getExpectedError(type) { code, message, errno, - syscall - } + syscall, + }, }; return error; } @@ -85,7 +85,7 @@ function getExpectedError(type) { const errorObj = { code: 'ERR_SOCKET_BAD_BUFFER_SIZE', name: 'TypeError', - message: /^Buffer size must be a positive integer$/ + message: /^Buffer size must be a positive integer$/, }; const badBufferSizes = [-1, Infinity, 'Doh!']; @@ -127,14 +127,14 @@ function getExpectedError(type) { code: 'EINVAL', message: 'invalid argument', errno: UV_EINVAL, - syscall: 'uv_recv_buffer_size' + syscall: 'uv_recv_buffer_size', }; const errorObj = { code: 'ERR_SOCKET_BUFFER_SIZE', name: 'SystemError', message: 'Could not get or set buffer size: uv_recv_buffer_size ' + 'returned EINVAL (invalid argument)', - info + info, }; const socket = dgram.createSocket('udp4'); socket.bind(common.mustCall(() => { @@ -150,14 +150,14 @@ function getExpectedError(type) { code: 'EINVAL', message: 'invalid argument', errno: UV_EINVAL, - syscall: 'uv_send_buffer_size' + syscall: 'uv_send_buffer_size', }; const errorObj = { code: 'ERR_SOCKET_BUFFER_SIZE', name: 'SystemError', message: 'Could not get or set buffer size: uv_send_buffer_size ' + 'returned EINVAL (invalid argument)', - info + info, }; const socket = dgram.createSocket('udp4'); socket.bind(common.mustCall(() => { diff --git a/test/parallel/test-diagnostics-channel-http-server-start.js b/test/parallel/test-diagnostics-channel-http-server-start.js index 9a8136d4cc5839..0e6ebb1ce2b2e6 100644 --- a/test/parallel/test-diagnostics-channel-http-server-start.js +++ b/test/parallel/test-diagnostics-channel-http-server-start.js @@ -25,7 +25,7 @@ outgoingFinishChannel.subscribe(common.mustCall((message) => { request, response, server, - socket: request.socket + socket: request.socket, }; // Context is maintained diff --git a/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js b/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js index cbc5b4d2e9a953..d4800adbaee8a8 100644 --- a/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js +++ b/test/parallel/test-diagnostics-channel-object-channel-pub-sub.js @@ -6,7 +6,7 @@ const assert = require('assert'); const { Channel } = dc; const input = { - foo: 'bar' + foo: 'bar', }; // Should not have named channel diff --git a/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js b/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js index b0c5ab2480e374..33fabdda9d2511 100644 --- a/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js +++ b/test/parallel/test-diagnostics-channel-safe-subscriber-errors.js @@ -5,7 +5,7 @@ const dc = require('diagnostics_channel'); const assert = require('assert'); const input = { - foo: 'bar' + foo: 'bar', }; const channel = dc.channel('fail'); diff --git a/test/parallel/test-diagnostics-channel-symbol-named.js b/test/parallel/test-diagnostics-channel-symbol-named.js index 96fe0fa53596e2..ce31acac114ccb 100644 --- a/test/parallel/test-diagnostics-channel-symbol-named.js +++ b/test/parallel/test-diagnostics-channel-symbol-named.js @@ -5,7 +5,7 @@ const dc = require('diagnostics_channel'); const assert = require('assert'); const input = { - foo: 'bar' + foo: 'bar', }; const symbol = Symbol('test'); diff --git a/test/parallel/test-disable-proto-throw.js b/test/parallel/test-disable-proto-throw.js index a39cfef0d8bd43..997ce3c74eb7e5 100644 --- a/test/parallel/test-disable-proto-throw.js +++ b/test/parallel/test-disable-proto-throw.js @@ -13,7 +13,7 @@ assert.throws(() => { // eslint-disable-next-line no-proto,no-unused-expressions ({}).__proto__; }, { - code: 'ERR_PROTO_ACCESS' + code: 'ERR_PROTO_ACCESS', }); assert.throws(() => { @@ -28,7 +28,7 @@ const ctx = vm.createContext(); assert.throws(() => { vm.runInContext('({}).__proto__;', ctx); }, { - code: 'ERR_PROTO_ACCESS' + code: 'ERR_PROTO_ACCESS', }); assert.throws(() => { diff --git a/test/parallel/test-dns-channel-cancel-promise.js b/test/parallel/test-dns-channel-cancel-promise.js index 382ac3dd508d68..b15493fef433bf 100644 --- a/test/parallel/test-dns-channel-cancel-promise.js +++ b/test/parallel/test-dns-channel-cancel-promise.js @@ -31,7 +31,7 @@ server.bind(0, common.mustCall(async () => { { code: 'ECANCELLED', syscall: 'queryA', - hostname + hostname, } ); } @@ -52,7 +52,7 @@ server.bind(0, common.mustCall(async () => { { code: 'ECANCELLED', syscall: 'queryA', - hostname: hostname + hostname: hostname, } ) ); diff --git a/test/parallel/test-dns-lookup-promises.js b/test/parallel/test-dns-lookup-promises.js index 31c7dbd2458fe6..a463aed7a3eed3 100644 --- a/test/parallel/test-dns-lookup-promises.js +++ b/test/parallel/test-dns-lookup-promises.js @@ -35,27 +35,27 @@ async function lookupPositive() { { stub: getaddrinfoPositive(['::1']), factory: () => dnsPromises.lookup('example.com'), - expectation: { address: '::1', family: 6 } + expectation: { address: '::1', family: 6 }, }, { stub: getaddrinfoPositive(['127.0.0.1']), factory: () => dnsPromises.lookup('example.com'), - expectation: { address: '127.0.0.1', family: 4 } + expectation: { address: '127.0.0.1', family: 4 }, }, { stub: getaddrinfoPositive(['127.0.0.1'], { family: 4 }), factory: () => dnsPromises.lookup('example.com'), - expectation: { address: '127.0.0.1', family: 4 } + expectation: { address: '127.0.0.1', family: 4 }, }, { stub: getaddrinfoPositive(['some-address']), factory: () => dnsPromises.lookup('example.com'), - expectation: { address: 'some-address', family: 0 } + expectation: { address: 'some-address', family: 0 }, }, { stub: getaddrinfoPositive(['some-address2']), factory: () => dnsPromises.lookup('example.com', { family: 6 }), - expectation: { address: 'some-address2', family: 6 } + expectation: { address: 'some-address2', family: 6 }, }, ].forEach(async ({ stub, factory, expectation }) => { getaddrinfoStub = stub; @@ -68,7 +68,7 @@ async function lookupNegative() { const expected = { code: 'ENOMEM', hostname: 'example.com', - syscall: 'getaddrinfo' + syscall: 'getaddrinfo', }; return assert.rejects(dnsPromises.lookup('example.com'), expected); } @@ -81,7 +81,7 @@ async function lookupallPositive() { expectation: [ { address: '::1', family: 6 }, { address: '::2', family: 6 }, - ] + ], }, { stub: getaddrinfoPositive(['::1', '::2']), @@ -89,7 +89,7 @@ async function lookupallPositive() { expectation: [ { address: '::1', family: 4 }, { address: '::2', family: 4 }, - ] + ], }, { stub: getaddrinfoPositive(['127.0.0.1', 'some-address']), @@ -97,7 +97,7 @@ async function lookupallPositive() { expectation: [ { address: '127.0.0.1', family: 4 }, { address: 'some-address', family: 0 }, - ] + ], }, { stub: getaddrinfoPositive(['127.0.0.1', 'some-address']), @@ -105,12 +105,12 @@ async function lookupallPositive() { expectation: [ { address: '127.0.0.1', family: 6 }, { address: 'some-address', family: 6 }, - ] + ], }, { stub: getaddrinfoPositive([]), factory: () => dnsPromises.lookup('example', { all: true }), - expectation: [] + expectation: [], }, ].forEach(async ({ stub, factory, expectation }) => { getaddrinfoStub = stub; @@ -123,7 +123,7 @@ async function lookupallNegative() { const expected = { code: 'ENOMEM', hostname: 'example.com', - syscall: 'getaddrinfo' + syscall: 'getaddrinfo', }; return assert.rejects(dnsPromises.lookup('example.com', { all: true }), expected); diff --git a/test/parallel/test-dns-lookup.js b/test/parallel/test-dns-lookup.js index 14dfec61ee08f6..666bc4548cd13f 100644 --- a/test/parallel/test-dns-lookup.js +++ b/test/parallel/test-dns-lookup.js @@ -16,7 +16,7 @@ const dnsPromises = dns.promises; const err = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "hostname" argument must be of type string\. Received type number/ + message: /^The "hostname" argument must be of type string\. Received type number/, }; assert.throws(() => dns.lookup(1, {}), err); @@ -32,34 +32,34 @@ common.expectWarning({ // For calling `dns.lookup` with falsy `hostname`. 'DeprecationWarning': { DEP0118: 'The provided hostname "false" is not a valid ' + - 'hostname, and is supported in the dns module solely for compatibility.' - } + 'hostname, and is supported in the dns module solely for compatibility.', + }, }); assert.throws(() => { dns.lookup(false, 'cb'); }, { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => { dns.lookup(false, 'options', 'cb'); }, { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); { const err = { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: "The argument 'hints' is invalid. Received 100" + message: "The argument 'hints' is invalid. Received 100", }; const options = { hints: 100, family: 0, - all: false + all: false, }; assert.throws(() => { dnsPromises.lookup(false, options); }, err); @@ -72,12 +72,12 @@ assert.throws(() => { const err = { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: "The argument 'family' must be one of: 0, 4, 6. Received 20" + message: "The argument 'family' must be one of: 0, 4, 6. Received 20", }; const options = { hints: 0, family: 20, - all: false + all: false, }; assert.throws(() => { dnsPromises.lookup(false, options); }, err); @@ -92,21 +92,21 @@ assert.throws(() => { res = await dnsPromises.lookup(false, { hints: 0, family: 0, - all: true + all: true, }); assert.deepStrictEqual(res, []); res = await dnsPromises.lookup('127.0.0.1', { hints: 0, family: 4, - all: true + all: true, }); assert.deepStrictEqual(res, [{ address: '127.0.0.1', family: 4 }]); res = await dnsPromises.lookup('127.0.0.1', { hints: 0, family: 4, - all: false + all: false, }); assert.deepStrictEqual(res, { address: '127.0.0.1', family: 4 }); })().then(common.mustCall()); @@ -114,7 +114,7 @@ assert.throws(() => { dns.lookup(false, { hints: 0, family: 0, - all: true + all: true, }, common.mustSucceed((result, addressType) => { assert.deepStrictEqual(result, []); assert.strictEqual(addressType, undefined); @@ -123,11 +123,11 @@ dns.lookup(false, { dns.lookup('127.0.0.1', { hints: 0, family: 4, - all: true + all: true, }, common.mustSucceed((result, addressType) => { assert.deepStrictEqual(result, [{ address: '127.0.0.1', - family: 4 + family: 4, }]); assert.strictEqual(addressType, undefined); })); @@ -135,7 +135,7 @@ dns.lookup('127.0.0.1', { dns.lookup('127.0.0.1', { hints: 0, family: 4, - all: false + all: false, }, common.mustSucceed((result, addressType) => { assert.deepStrictEqual(result, '127.0.0.1'); assert.strictEqual(addressType, 4); diff --git a/test/parallel/test-dns-lookupService.js b/test/parallel/test-dns-lookupService.js index dc04893c28f9fd..6a67ae0037ad30 100644 --- a/test/parallel/test-dns-lookupService.js +++ b/test/parallel/test-dns-lookupService.js @@ -21,7 +21,7 @@ assert.throws( { code: 'ENOENT', message: 'getnameinfo ENOENT 127.0.0.1', - syscall: 'getnameinfo' + syscall: 'getnameinfo', } ); @@ -30,6 +30,6 @@ assert.rejects( { code: 'ENOENT', message: 'getnameinfo ENOENT 127.0.0.1', - syscall: 'getnameinfo' + syscall: 'getnameinfo', } ); diff --git a/test/parallel/test-dns-multi-channel.js b/test/parallel/test-dns-multi-channel.js index 026ef44e339e85..638a5e3004d04e 100644 --- a/test/parallel/test-dns-multi-channel.js +++ b/test/parallel/test-dns-multi-channel.js @@ -8,11 +8,11 @@ const dgram = require('dgram'); const servers = [ { socket: dgram.createSocket('udp4'), - reply: { type: 'A', address: '1.2.3.4', ttl: 123, domain: 'example.org' } + reply: { type: 'A', address: '1.2.3.4', ttl: 123, domain: 'example.org' }, }, { socket: dgram.createSocket('udp4'), - reply: { type: 'A', address: '5.6.7.8', ttl: 123, domain: 'example.org' } + reply: { type: 'A', address: '5.6.7.8', ttl: 123, domain: 'example.org' }, }, ]; @@ -39,7 +39,7 @@ for (const { socket, reply } of servers) { function ready() { const resolvers = servers.map((server) => ({ server, - resolver: new Resolver() + resolver: new Resolver(), })); for (const { server: { socket, reply }, resolver } of resolvers) { diff --git a/test/parallel/test-dns-resolve-promises.js b/test/parallel/test-dns-resolve-promises.js index 783ed2a709edb6..b07a7a3a832dd2 100644 --- a/test/parallel/test-dns-resolve-promises.js +++ b/test/parallel/test-dns-resolve-promises.js @@ -15,6 +15,6 @@ assert.rejects( { code: 'EPERM', syscall: 'queryA', - hostname: 'example.org' + hostname: 'example.org', } ); diff --git a/test/parallel/test-dns-resolveany-bad-ancount.js b/test/parallel/test-dns-resolveany-bad-ancount.js index 71fcbe03cd58f1..249678c24664cb 100644 --- a/test/parallel/test-dns-resolveany-bad-ancount.js +++ b/test/parallel/test-dns-resolveany-bad-ancount.js @@ -32,7 +32,7 @@ server.bind(0, common.mustCall(async () => { .catch(common.expectsError({ code: 'EBADRESP', syscall: 'queryAny', - hostname: 'example.org' + hostname: 'example.org', })); dns.resolveAny('example.org', common.mustCall((err) => { diff --git a/test/parallel/test-dns-resolveany.js b/test/parallel/test-dns-resolveany.js index 0bbfe8f9f18432..60e2db19342f4f 100644 --- a/test/parallel/test-dns-resolveany.js +++ b/test/parallel/test-dns-resolveany.js @@ -21,12 +21,12 @@ const answers = [ refresh: 900, retry: 900, expire: 1800, - minttl: 60 + minttl: 60, }, { type: 'CAA', critical: 128, - issue: 'platynum.ch' + issue: 'platynum.ch', }, ]; diff --git a/test/parallel/test-dns-resolvens-typeerror.js b/test/parallel/test-dns-resolvens-typeerror.js index 54e0da57604ed8..d7da9f20dc5473 100644 --- a/test/parallel/test-dns-resolvens-typeerror.js +++ b/test/parallel/test-dns-resolvens-typeerror.js @@ -35,7 +35,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "name" argument must be of type string/ + message: /^The "name" argument must be of type string/, } ); assert.throws( @@ -43,13 +43,13 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "name" argument must be of type string/ + message: /^The "name" argument must be of type string/, } ); assert.throws( () => dns.resolveNs(''), // bad callback { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', } ); diff --git a/test/parallel/test-dns-setserver-when-querying.js b/test/parallel/test-dns-setserver-when-querying.js index 0432f2d4655a07..85ec9473b8505e 100644 --- a/test/parallel/test-dns-setserver-when-querying.js +++ b/test/parallel/test-dns-setserver-when-querying.js @@ -16,7 +16,7 @@ const localhost = [ '127.0.0.1' ]; assert.throws(resolver.setServers.bind(resolver, localhost), { code: 'ERR_DNS_SET_SERVERS_FAILED', - message: /^c-ares failed to set servers: "There are pending queries\." \[.+\]$/g + message: /^c-ares failed to set servers: "There are pending queries\." \[.+\]$/g, }); } diff --git a/test/parallel/test-dns-setservers-type-check.js b/test/parallel/test-dns-setservers-type-check.js index 007cae4f95d681..2d4050bc9d78b0 100644 --- a/test/parallel/test-dns-setservers-type-check.js +++ b/test/parallel/test-dns-setservers-type-check.js @@ -14,14 +14,14 @@ const promiseResolver = new dns.promises.Resolver(); Number(addresses.DNS4_SERVER), addresses.DNS4_SERVER, { - address: addresses.DNS4_SERVER + address: addresses.DNS4_SERVER, }, ].forEach((val) => { const errObj = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "servers" argument must be an instance of Array.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), }; assert.throws( () => { @@ -53,7 +53,7 @@ const promiseResolver = new dns.promises.Resolver(); [Number(addresses.DNS4_SERVER)], [ { - address: addresses.DNS4_SERVER + address: addresses.DNS4_SERVER, }, ], ].forEach((val) => { @@ -61,7 +61,7 @@ const promiseResolver = new dns.promises.Resolver(); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "servers[0]" argument must be of type string.' + - common.invalidArgTypeHelper(val[0]) + common.invalidArgTypeHelper(val[0]), }; assert.throws( () => { @@ -89,7 +89,7 @@ const promiseResolver = new dns.promises.Resolver(); // This test for 'dns/promises' { const { - setServers + setServers, } = require('dns/promises'); // This should not throw any error. @@ -103,7 +103,7 @@ const promiseResolver = new dns.promises.Resolver(); [Number(addresses.DNS4_SERVER)], [ { - address: addresses.DNS4_SERVER + address: addresses.DNS4_SERVER, }, ], ].forEach((val) => { @@ -111,7 +111,7 @@ const promiseResolver = new dns.promises.Resolver(); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "servers[0]" argument must be of type string.' + - common.invalidArgTypeHelper(val[0]) + common.invalidArgTypeHelper(val[0]), }; assert.throws(() => { setServers(val); diff --git a/test/parallel/test-dns.js b/test/parallel/test-dns.js index a6e17c26531aca..d1b4a52ec55081 100644 --- a/test/parallel/test-dns.js +++ b/test/parallel/test-dns.js @@ -54,7 +54,7 @@ assert(existing.length > 0); get: () => { servers.length = 3; return '0.0.0.0'; - } + }, }); dns.setServers(servers); @@ -84,7 +84,7 @@ assert(existing.length > 0); }, { name: 'TypeError', - code: 'ERR_INVALID_IP_ADDRESS' + code: 'ERR_INVALID_IP_ADDRESS', } ); }); @@ -99,12 +99,12 @@ assert.deepStrictEqual(dns.getServers(), goog); assert.throws(() => dns.setServers(['foobar']), { code: 'ERR_INVALID_IP_ADDRESS', name: 'TypeError', - message: 'Invalid IP address: foobar' + message: 'Invalid IP address: foobar', }); assert.throws(() => dns.setServers(['127.0.0.1:va']), { code: 'ERR_INVALID_IP_ADDRESS', name: 'TypeError', - message: 'Invalid IP address: 127.0.0.1:va' + message: 'Invalid IP address: 127.0.0.1:va', }); assert.deepStrictEqual(dns.getServers(), goog); @@ -144,7 +144,7 @@ assert.deepStrictEqual(dns.getServers(), []); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "rrtype" argument must be of type string. ' + - 'Received an instance of Array' + 'Received an instance of Array', }; assert.throws(() => { dns.resolve('example.com', [], common.mustNotCall()); @@ -158,7 +158,7 @@ assert.deepStrictEqual(dns.getServers(), []); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "name" argument must be of type string. ' + - 'Received undefined' + 'Received undefined', }; assert.throws(() => { dnsPromises.resolve(); @@ -170,7 +170,7 @@ assert.deepStrictEqual(dns.getServers(), []); const errorReg = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "hostname" argument must be of type string\. Received .*/ + message: /^The "hostname" argument must be of type string\. Received .*/, }; assert.throws(() => dns.lookup({}, common.mustNotCall()), errorReg); @@ -218,7 +218,7 @@ assert.deepStrictEqual(dns.getServers(), []); const err = { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: /The argument 'hints' is invalid\. Received \d+/ + message: /The argument 'hints' is invalid\. Received \d+/, }; assert.throws(() => { @@ -231,37 +231,37 @@ assert.deepStrictEqual(dns.getServers(), []); assert.throws(() => dns.lookup('nodejs.org'), { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => dns.lookup('nodejs.org', 4), { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); dns.lookup('', { family: 4, hints: 0 }, common.mustCall()); dns.lookup('', { family: 6, - hints: dns.ADDRCONFIG + hints: dns.ADDRCONFIG, }, common.mustCall()); dns.lookup('', { hints: dns.V4MAPPED }, common.mustCall()); dns.lookup('', { - hints: dns.ADDRCONFIG | dns.V4MAPPED + hints: dns.ADDRCONFIG | dns.V4MAPPED, }, common.mustCall()); dns.lookup('', { - hints: dns.ALL + hints: dns.ALL, }, common.mustCall()); dns.lookup('', { - hints: dns.V4MAPPED | dns.ALL + hints: dns.V4MAPPED | dns.ALL, }, common.mustCall()); dns.lookup('', { - hints: dns.ADDRCONFIG | dns.V4MAPPED | dns.ALL + hints: dns.ADDRCONFIG | dns.V4MAPPED | dns.ALL, }, common.mustCall()); (async function() { @@ -272,7 +272,7 @@ dns.lookup('', { await dnsPromises.lookup('', { hints: dns.ALL }); await dnsPromises.lookup('', { hints: dns.V4MAPPED | dns.ALL }); await dnsPromises.lookup('', { - hints: dns.ADDRCONFIG | dns.V4MAPPED | dns.ALL + hints: dns.ADDRCONFIG | dns.V4MAPPED | dns.ALL, }); })().then(common.mustCall()); @@ -281,7 +281,7 @@ dns.lookup('', { code: 'ERR_MISSING_ARGS', name: 'TypeError', message: 'The "address", "port", and "callback" arguments must be ' + - 'specified' + 'specified', }; assert.throws(() => dns.lookupService('0.0.0.0'), err); @@ -294,7 +294,7 @@ dns.lookup('', { const err = { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: `The argument 'address' is invalid. Received '${invalidAddress}'` + message: `The argument 'address' is invalid. Received '${invalidAddress}'`, }; assert.throws(() => { @@ -311,7 +311,7 @@ const portErr = (port) => { code: 'ERR_SOCKET_BAD_PORT', message: `Port should be >= 0 and < 65536. Received ${port}.`, - name: 'RangeError' + name: 'RangeError', }; assert.throws(() => { @@ -331,7 +331,7 @@ assert.throws(() => { dns.lookupService('0.0.0.0', 80, null); }, { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); { @@ -360,7 +360,7 @@ assert.throws(() => { refresh: 900, retry: 900, expire: 1800, - minttl: 3333333333 + minttl: 3333333333, }, ] }, @@ -382,7 +382,7 @@ assert.throws(() => { refresh: 900, retry: 900, expire: 1800, - minttl: 3333333333 + minttl: 3333333333, }, ] }, ]; diff --git a/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js b/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js index 4018220711517f..0437fffd183c40 100644 --- a/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js +++ b/test/parallel/test-domain-load-after-set-uncaught-exception-capture.js @@ -9,7 +9,7 @@ assert.throws( { code: 'ERR_DOMAIN_CALLBACK_NOT_AVAILABLE', name: 'Error', - message: /^A callback was registered.*with using the `domain` module/ + message: /^A callback was registered.*with using the `domain` module/, } ); diff --git a/test/parallel/test-domain-set-uncaught-exception-capture-after-load.js b/test/parallel/test-domain-set-uncaught-exception-capture-after-load.js index 55e2e5368d7d17..220ee7b95c1d24 100644 --- a/test/parallel/test-domain-set-uncaught-exception-capture-after-load.js +++ b/test/parallel/test-domain-set-uncaught-exception-capture-after-load.js @@ -13,7 +13,7 @@ assert.throws( { code: 'ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE', name: 'Error', - message: /^The `domain` module is in use, which is mutually/ + message: /^The `domain` module is in use, which is mutually/, } )(err); diff --git a/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js b/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js index a2afebd838f410..8fedd518fdc944 100644 --- a/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js +++ b/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js @@ -71,7 +71,7 @@ function runTestWithoutAbortOnUncaughtException() { function runTestWithAbortOnUncaughtException() { child_process.exec(createTestCmdLine({ - withAbortOnUncaughtException: true + withAbortOnUncaughtException: true, }), function onTestDone(err, stdout, stderr) { assert.notStrictEqual(err.code, RAN_UNCAUGHT_EXCEPTION_HANDLER_EXIT_CODE, 'child process should not have run its ' + diff --git a/test/parallel/test-domain-uncaught-exception.js b/test/parallel/test-domain-uncaught-exception.js index a9a28c35ec26a7..8e028187d40c3e 100644 --- a/test/parallel/test-domain-uncaught-exception.js +++ b/test/parallel/test-domain-uncaught-exception.js @@ -27,7 +27,7 @@ function test1() { tests.push({ fn: test1, - expectedMessages: ['uncaughtException'] + expectedMessages: ['uncaughtException'], }); function test2() { @@ -41,7 +41,7 @@ function test2() { tests.push({ fn: test2, - expectedMessages: ['uncaughtException'] + expectedMessages: ['uncaughtException'], }); function test3() { @@ -64,7 +64,7 @@ function test3() { tests.push({ fn: test3, - expectedMessages: ['errorHandledByDomain'] + expectedMessages: ['errorHandledByDomain'], }); function test4() { @@ -93,7 +93,7 @@ function test4() { tests.push({ fn: test4, - expectedMessages: ['uncaughtException'] + expectedMessages: ['uncaughtException'], }); function test5() { @@ -115,7 +115,7 @@ function test5() { } tests.push({ fn: test5, - expectedMessages: ['errorHandledByDomain'] + expectedMessages: ['errorHandledByDomain'], }); function test6() { @@ -141,7 +141,7 @@ function test6() { tests.push({ fn: test6, - expectedMessages: ['errorHandledByDomain'] + expectedMessages: ['errorHandledByDomain'], }); if (process.argv[2] === 'child') { diff --git a/test/parallel/test-domain-with-abort-on-uncaught-exception.js b/test/parallel/test-domain-with-abort-on-uncaught-exception.js index 5eed67d28ffa58..6c05c6e59e4a5f 100644 --- a/test/parallel/test-domain-with-abort-on-uncaught-exception.js +++ b/test/parallel/test-domain-with-abort-on-uncaught-exception.js @@ -133,35 +133,35 @@ if (process.argv[2] === 'child') { testDomainExceptionHandling('--abort_on_uncaught_exception', { throwInDomainErrHandler: false, - useTryCatch: false + useTryCatch: false, }); testDomainExceptionHandling('--abort_on_uncaught_exception', { throwInDomainErrHandler: false, - useTryCatch: true + useTryCatch: true, }); testDomainExceptionHandling('--abort_on_uncaught_exception', { throwInDomainErrHandler: true, - useTryCatch: false + useTryCatch: false, }); testDomainExceptionHandling('--abort_on_uncaught_exception', { throwInDomainErrHandler: true, - useTryCatch: true + useTryCatch: true, }); testDomainExceptionHandling({ - throwInDomainErrHandler: false + throwInDomainErrHandler: false, }); testDomainExceptionHandling({ throwInDomainErrHandler: false, - useTryCatch: false + useTryCatch: false, }); testDomainExceptionHandling({ throwInDomainErrHandler: true, - useTryCatch: true + useTryCatch: true, }); } diff --git a/test/parallel/test-err-name-deprecation.js b/test/parallel/test-err-name-deprecation.js index 5f3fb28f100663..1cce5a8f1c5951 100644 --- a/test/parallel/test-err-name-deprecation.js +++ b/test/parallel/test-err-name-deprecation.js @@ -10,7 +10,7 @@ common.expectWarning({ ['Directly calling process.binding(\'uv\').errname() is being ' + 'deprecated. Please make sure to use util.getSystemErrorName() instead.', 'DEP0119'], - ] + ], }); process.binding('uv').errname(-1); diff --git a/test/parallel/test-errors-systemerror-frozen-intrinsics.js b/test/parallel/test-errors-systemerror-frozen-intrinsics.js index 439950083ce1de..2286124ff10810 100644 --- a/test/parallel/test-errors-systemerror-frozen-intrinsics.js +++ b/test/parallel/test-errors-systemerror-frozen-intrinsics.js @@ -12,7 +12,7 @@ const ctx = { message: 'code message', syscall: 'syscall_test', path: '/str', - dest: '/str2' + dest: '/str2', }; assert.throws( () => { throw new ERR_TEST(ctx); }, diff --git a/test/parallel/test-errors-systemerror-stackTraceLimit-custom-setter.js b/test/parallel/test-errors-systemerror-stackTraceLimit-custom-setter.js index d89ec22fc4656a..83cb61387f796d 100644 --- a/test/parallel/test-errors-systemerror-stackTraceLimit-custom-setter.js +++ b/test/parallel/test-errors-systemerror-stackTraceLimit-custom-setter.js @@ -18,7 +18,7 @@ const ctx = { message: 'code message', syscall: 'syscall_test', path: '/str', - dest: '/str2' + dest: '/str2', }; assert.throws( () => { throw new ERR_TEST(ctx); }, diff --git a/test/parallel/test-errors-systemerror-stackTraceLimit-deleted-and-Error-sealed.js b/test/parallel/test-errors-systemerror-stackTraceLimit-deleted-and-Error-sealed.js index ef6a9d16f48140..40f684fc20e693 100644 --- a/test/parallel/test-errors-systemerror-stackTraceLimit-deleted-and-Error-sealed.js +++ b/test/parallel/test-errors-systemerror-stackTraceLimit-deleted-and-Error-sealed.js @@ -15,7 +15,7 @@ const ctx = { message: 'code message', syscall: 'syscall_test', path: '/str', - dest: '/str2' + dest: '/str2', }; assert.throws( () => { throw new ERR_TEST(ctx); }, diff --git a/test/parallel/test-errors-systemerror-stackTraceLimit-deleted.js b/test/parallel/test-errors-systemerror-stackTraceLimit-deleted.js index 2967ff84ed7c5c..ce9df1ad5e0ed6 100644 --- a/test/parallel/test-errors-systemerror-stackTraceLimit-deleted.js +++ b/test/parallel/test-errors-systemerror-stackTraceLimit-deleted.js @@ -14,7 +14,7 @@ const ctx = { message: 'code message', syscall: 'syscall_test', path: '/str', - dest: '/str2' + dest: '/str2', }; assert.throws( () => { throw new ERR_TEST(ctx); }, diff --git a/test/parallel/test-errors-systemerror-stackTraceLimit-has-only-a-getter.js b/test/parallel/test-errors-systemerror-stackTraceLimit-has-only-a-getter.js index 49c39e1576220c..928eac05b97d97 100644 --- a/test/parallel/test-errors-systemerror-stackTraceLimit-has-only-a-getter.js +++ b/test/parallel/test-errors-systemerror-stackTraceLimit-has-only-a-getter.js @@ -14,7 +14,7 @@ const ctx = { message: 'code message', syscall: 'syscall_test', path: '/str', - dest: '/str2' + dest: '/str2', }; assert.throws( () => { throw new ERR_TEST(ctx); }, diff --git a/test/parallel/test-errors-systemerror-stackTraceLimit-not-writable.js b/test/parallel/test-errors-systemerror-stackTraceLimit-not-writable.js index 8650c5f88738dd..90c098fde57f9c 100644 --- a/test/parallel/test-errors-systemerror-stackTraceLimit-not-writable.js +++ b/test/parallel/test-errors-systemerror-stackTraceLimit-not-writable.js @@ -17,7 +17,7 @@ const ctx = { message: 'code message', syscall: 'syscall_test', path: '/str', - dest: '/str2' + dest: '/str2', }; assert.throws( () => { throw new ERR_TEST(ctx); }, diff --git a/test/parallel/test-errors-systemerror.js b/test/parallel/test-errors-systemerror.js index 2a20588e75b386..9c17b8b5d79e56 100644 --- a/test/parallel/test-errors-systemerror.js +++ b/test/parallel/test-errors-systemerror.js @@ -9,7 +9,7 @@ assert.throws( () => { new SystemError(); }, { name: 'TypeError', - message: 'String.prototype.match called on null or undefined' + message: 'String.prototype.match called on null or undefined', } ); @@ -22,7 +22,7 @@ const { ERR_TEST } = codes; message: 'code message', syscall: 'syscall_test', path: '/str', - dest: '/str2' + dest: '/str2', }; assert.throws( @@ -32,7 +32,7 @@ const { ERR_TEST } = codes; name: 'SystemError', message: 'custom message: syscall_test returned ETEST (code message)' + ' /str => /str2', - info: ctx + info: ctx, } ); } @@ -43,7 +43,7 @@ const { ERR_TEST } = codes; message: 'code message', syscall: 'syscall_test', path: Buffer.from('/buf'), - dest: '/str2' + dest: '/str2', }; assert.throws( () => { throw new ERR_TEST(ctx); }, @@ -52,7 +52,7 @@ const { ERR_TEST } = codes; name: 'SystemError', message: 'custom message: syscall_test returned ETEST (code message)' + ' /buf => /str2', - info: ctx + info: ctx, } ); } @@ -63,7 +63,7 @@ const { ERR_TEST } = codes; message: 'code message', syscall: 'syscall_test', path: Buffer.from('/buf'), - dest: Buffer.from('/buf2') + dest: Buffer.from('/buf2'), }; assert.throws( () => { throw new ERR_TEST(ctx); }, @@ -72,7 +72,7 @@ const { ERR_TEST } = codes; name: 'SystemError', message: 'custom message: syscall_test returned ETEST (code message)' + ' /buf => /buf2', - info: ctx + info: ctx, } ); } @@ -84,7 +84,7 @@ const { ERR_TEST } = codes; message: 'something happened', syscall: 'syscall_test', path: Buffer.from('a'), - dest: Buffer.from('b') + dest: Buffer.from('b'), }; const err = new ERR_TEST(ctx); assert.strictEqual(err.info, ctx); @@ -116,7 +116,7 @@ const { ERR_TEST } = codes; const ctx = { code: 'ERR_TEST', message: 'Error occurred', - syscall: 'syscall_test' + syscall: 'syscall_test', }; assert.throws( () => { @@ -129,7 +129,7 @@ const { ERR_TEST } = codes; name: 'Foobar', message: 'custom message: syscall_test returned ERR_TEST ' + '(Error occurred)', - info: ctx + info: ctx, } ); } diff --git a/test/parallel/test-eslint-alphabetize-errors.js b/test/parallel/test-eslint-alphabetize-errors.js index df822f27409520..d5a64af30982a0 100644 --- a/test/parallel/test-eslint-alphabetize-errors.js +++ b/test/parallel/test-eslint-alphabetize-errors.js @@ -23,7 +23,7 @@ new RuleTester().run('alphabetize-errors', rule, { E('AAA', 'foo'); E('CCC', 'baz'); `, - errors: [{ message: 'Out of ASCIIbetical order - BBB >= AAA', line: 3 }] + errors: [{ message: 'Out of ASCIIbetical order - BBB >= AAA', line: 3 }], }, - ] + ], }); diff --git a/test/parallel/test-eslint-async-iife-no-unused-result.js b/test/parallel/test-eslint-async-iife-no-unused-result.js index 6e7f60c183b830..3092316a15e236 100644 --- a/test/parallel/test-eslint-async-iife-no-unused-result.js +++ b/test/parallel/test-eslint-async-iife-no-unused-result.js @@ -45,5 +45,5 @@ tester.run('async-iife-no-unused-result', rule, { output: "const common = require('../common');(async function() {})()" + '.then(common.mustCall())', }, - ] + ], }); diff --git a/test/parallel/test-eslint-crypto-check.js b/test/parallel/test-eslint-crypto-check.js index 164149131a9758..b0c135a4c83640 100644 --- a/test/parallel/test-eslint-crypto-check.js +++ b/test/parallel/test-eslint-crypto-check.js @@ -36,7 +36,7 @@ new RuleTester().run('crypto-check', rule, { 'if (!common.hasCrypto) {\n' + ' common.skip("missing crypto");\n' + '}', - errors: [{ message }] + errors: [{ message }], }, { code: 'require("common")\n' + @@ -46,7 +46,7 @@ new RuleTester().run('crypto-check', rule, { 'if (!common.hasCrypto) {' + ' common.skip("missing crypto");' + '}\n' + - 'require("crypto")' + 'require("crypto")', }, { code: 'require("common")\n' + @@ -58,7 +58,7 @@ new RuleTester().run('crypto-check', rule, { ' common.skip("missing crypto");' + '}\n' + 'if (common.foo) {}\n' + - 'require("crypto")' + 'require("crypto")', }, { code: 'require("common")\n' + @@ -70,7 +70,7 @@ new RuleTester().run('crypto-check', rule, { ' common.skip("missing crypto");' + '}\n' + 'if (common.foo) {}\n' + - 'internalBinding("crypto")' + 'internalBinding("crypto")', }, - ] + ], }); diff --git a/test/parallel/test-eslint-documented-errors.js b/test/parallel/test-eslint-documented-errors.js index e8abd38a983e5b..8fe8ad9ec24dd1 100644 --- a/test/parallel/test-eslint-documented-errors.js +++ b/test/parallel/test-eslint-documented-errors.js @@ -24,14 +24,14 @@ new RuleTester().run('documented-errors', rule, { errors: [ { message: `"${invalidCode}" is not documented in doc/api/errors.md`, - line: 2 + line: 2, }, { message: `doc/api/errors.md does not have an anchor for "${invalidCode}"`, - line: 2 + line: 2, }, - ] + ], }, - ] + ], }); diff --git a/test/parallel/test-eslint-eslint-check.js b/test/parallel/test-eslint-eslint-check.js index 28ec2e1f10fdb3..105550d5b8ea5b 100644 --- a/test/parallel/test-eslint-eslint-check.js +++ b/test/parallel/test-eslint-eslint-check.js @@ -27,7 +27,7 @@ new RuleTester().run('eslint-check', rule, { errors: [{ message }], output: 'require("common")\n' + 'common.skipIfEslintMissing();\n' + - 'require("../../tools/node_modules/eslint").RuleTester' + 'require("../../tools/node_modules/eslint").RuleTester', }, - ] + ], }); diff --git a/test/parallel/test-eslint-inspector-check.js b/test/parallel/test-eslint-inspector-check.js index 2d945c3da33188..27bad678cddc6f 100644 --- a/test/parallel/test-eslint-inspector-check.js +++ b/test/parallel/test-eslint-inspector-check.js @@ -26,7 +26,7 @@ new RuleTester().run('inspector-check', rule, { errors: [{ message }], output: 'require("common")\n' + 'common.skipIfInspectorDisabled();\n' + - 'require("inspector")' + 'require("inspector")', }, - ] + ], }); diff --git a/test/parallel/test-eslint-lowercase-name-for-primitive.js b/test/parallel/test-eslint-lowercase-name-for-primitive.js index 11cba8f3f8e697..f86b865b8ef99a 100644 --- a/test/parallel/test-eslint-lowercase-name-for-primitive.js +++ b/test/parallel/test-eslint-lowercase-name-for-primitive.js @@ -37,5 +37,5 @@ new RuleTester().run('lowercase-name-for-primitive', rule, { ], output: "new e.TypeError('ERR_INVALID_ARG_TYPE', a, ['string','number'])", }, - ] + ], }); diff --git a/test/parallel/test-eslint-no-array-destructuring.js b/test/parallel/test-eslint-no-array-destructuring.js index be59ee69309755..d59a3b29a8c683 100644 --- a/test/parallel/test-eslint-no-array-destructuring.js +++ b/test/parallel/test-eslint-no-array-destructuring.js @@ -16,7 +16,7 @@ const USE_ARRAY_METHODS = new RuleTester({ parserOptions: { ecmaVersion: 2021 }, - env: { es6: true } + env: { es6: true }, }) .run('no-array-destructuring', rule, { valid: [ @@ -29,7 +29,7 @@ new RuleTester({ { code: 'const [Array] = args;', errors: [{ message: USE_OBJ_DESTRUCTURING }], - output: 'const {0:Array} = args;' + output: 'const {0:Array} = args;', }, { code: 'const [ , res] = args;', @@ -137,5 +137,5 @@ new RuleTester({ errors: [{ message: USE_OBJ_DESTRUCTURING }], output: 'class name{ method({0:key}, ...args){} }', }, - ] + ], }); diff --git a/test/parallel/test-eslint-no-unescaped-regexp-dot.js b/test/parallel/test-eslint-no-unescaped-regexp-dot.js index 7cf69877ca12ed..b6ff81ebe4a211 100644 --- a/test/parallel/test-eslint-no-unescaped-regexp-dot.js +++ b/test/parallel/test-eslint-no-unescaped-regexp-dot.js @@ -22,11 +22,11 @@ new RuleTester().run('no-unescaped-regexp-dot', rule, { invalid: [ { code: '/./', - errors: [{ message: 'Unescaped dot character in regular expression' }] + errors: [{ message: 'Unescaped dot character in regular expression' }], }, { code: String.raw`/\\./`, - errors: [{ message: 'Unescaped dot character in regular expression' }] + errors: [{ message: 'Unescaped dot character in regular expression' }], }, - ] + ], }); diff --git a/test/parallel/test-eslint-non-ascii-character.js b/test/parallel/test-eslint-non-ascii-character.js index 0b4a09f813431b..ea01f6b1613bea 100644 --- a/test/parallel/test-eslint-non-ascii-character.js +++ b/test/parallel/test-eslint-non-ascii-character.js @@ -13,7 +13,7 @@ new RuleTester().run('non-ascii-characters', rule, { valid: [ { code: 'console.log("fhqwhgads")', - options: [] + options: [], }, ], invalid: [ @@ -22,5 +22,5 @@ new RuleTester().run('non-ascii-characters', rule, { options: [], errors: [{ message: "Non-ASCII character 'μ' detected." }], }, - ] + ], }); diff --git a/test/parallel/test-eslint-prefer-assert-iferror.js b/test/parallel/test-eslint-prefer-assert-iferror.js index 5ccb7883393f46..2b4f97f7c32e1c 100644 --- a/test/parallel/test-eslint-prefer-assert-iferror.js +++ b/test/parallel/test-eslint-prefer-assert-iferror.js @@ -22,14 +22,14 @@ new RuleTester().run('prefer-assert-iferror', rule, { 'if (err) throw err;', errors: [{ message: 'Use assert.ifError(err) instead.' }], output: 'require("assert");\n' + - 'assert.ifError(err);' + 'assert.ifError(err);', }, { code: 'require("assert");\n' + 'if (error) { throw error; }', errors: [{ message: 'Use assert.ifError(error) instead.' }], output: 'require("assert");\n' + - 'assert.ifError(error);' + 'assert.ifError(error);', }, - ] + ], }); diff --git a/test/parallel/test-eslint-prefer-assert-methods.js b/test/parallel/test-eslint-prefer-assert-methods.js index 3271f6ab1856b0..b7cea62f152a09 100644 --- a/test/parallel/test-eslint-prefer-assert-methods.js +++ b/test/parallel/test-eslint-prefer-assert-methods.js @@ -27,30 +27,30 @@ new RuleTester().run('prefer-assert-methods', rule, { { code: 'assert(foo == bar);', errors: [{ - message: "'assert.equal' should be used instead of '=='" + message: "'assert.equal' should be used instead of '=='", }], - output: 'assert.equal(foo, bar);' + output: 'assert.equal(foo, bar);', }, { code: 'assert(foo === bar);', errors: [{ - message: "'assert.strictEqual' should be used instead of '==='" + message: "'assert.strictEqual' should be used instead of '==='", }], - output: 'assert.strictEqual(foo, bar);' + output: 'assert.strictEqual(foo, bar);', }, { code: 'assert(foo != bar);', errors: [{ - message: "'assert.notEqual' should be used instead of '!='" + message: "'assert.notEqual' should be used instead of '!='", }], - output: 'assert.notEqual(foo, bar);' + output: 'assert.notEqual(foo, bar);', }, { code: 'assert(foo !== bar);', errors: [{ - message: "'assert.notStrictEqual' should be used instead of '!=='" + message: "'assert.notStrictEqual' should be used instead of '!=='", }], - output: 'assert.notStrictEqual(foo, bar);' + output: 'assert.notStrictEqual(foo, bar);', }, - ] + ], }); diff --git a/test/parallel/test-eslint-prefer-common-mustnotcall.js b/test/parallel/test-eslint-prefer-common-mustnotcall.js index 5c360bb1ecbec6..9dc1db10cc5c01 100644 --- a/test/parallel/test-eslint-prefer-common-mustnotcall.js +++ b/test/parallel/test-eslint-prefer-common-mustnotcall.js @@ -21,11 +21,11 @@ new RuleTester().run('prefer-common-mustnotcall', rule, { invalid: [ { code: 'common.mustCall(fn, 0)', - errors: [{ message }] + errors: [{ message }], }, { code: 'common.mustCall(0)', - errors: [{ message }] + errors: [{ message }], }, - ] + ], }); diff --git a/test/parallel/test-eslint-prefer-common-mustsucceed.js b/test/parallel/test-eslint-prefer-common-mustsucceed.js index 302b6a0bee4f38..398c0c2e16c27a 100644 --- a/test/parallel/test-eslint-prefer-common-mustsucceed.js +++ b/test/parallel/test-eslint-prefer-common-mustsucceed.js @@ -15,7 +15,7 @@ const msg2 = 'Please use common.mustSucceed instead of ' + 'common.mustCall with assert.ifError.'; new RuleTester({ - parserOptions: { ecmaVersion: 2015 } + parserOptions: { ecmaVersion: 2015 }, }).run('prefer-common-mustsucceed', rule, { valid: [ 'foo((err) => assert.ifError(err))', @@ -26,27 +26,27 @@ new RuleTester({ invalid: [ { code: 'common.mustCall(assert.ifError)', - errors: [{ message: msg1 }] + errors: [{ message: msg1 }], }, { code: 'common.mustCall((err) => assert.ifError(err))', - errors: [{ message: msg2 }] + errors: [{ message: msg2 }], }, { code: 'common.mustCall((e) => assert.ifError(e))', - errors: [{ message: msg2 }] + errors: [{ message: msg2 }], }, { code: 'common.mustCall(function(e) { assert.ifError(e); })', - errors: [{ message: msg2 }] + errors: [{ message: msg2 }], }, { code: 'common.mustCall(function(e) { return assert.ifError(e); })', - errors: [{ message: msg2 }] + errors: [{ message: msg2 }], }, { code: 'common.mustCall(function(e) {{ assert.ifError(e); }})', - errors: [{ message: msg2 }] + errors: [{ message: msg2 }], }, - ] + ], }); diff --git a/test/parallel/test-eslint-prefer-primordials.js b/test/parallel/test-eslint-prefer-primordials.js index 143ddd2b0d118f..229913e11cecab 100644 --- a/test/parallel/test-eslint-prefer-primordials.js +++ b/test/parallel/test-eslint-prefer-primordials.js @@ -11,7 +11,7 @@ const rule = require('../../tools/eslint-rules/prefer-primordials'); new RuleTester({ parserOptions: { ecmaVersion: 6 }, - env: { es6: true } + env: { es6: true }, }) .run('prefer-primordials', rule, { valid: [ @@ -29,44 +29,44 @@ new RuleTester({ `, { code: 'const { Array } = primordials; new Array()', - options: [{ name: 'Array' }] + options: [{ name: 'Array' }], }, { code: 'const { JSONStringify } = primordials; JSONStringify({})', - options: [{ name: 'JSON' }] + options: [{ name: 'JSON' }], }, { code: 'const { SymbolFor } = primordials; SymbolFor("xxx")', - options: [{ name: 'Symbol' }] + options: [{ name: 'Symbol' }], }, { code: ` const { SymbolIterator } = primordials; class A { *[SymbolIterator] () { yield "a"; } } `, - options: [{ name: 'Symbol' }] + options: [{ name: 'Symbol' }], }, { code: ` const { Symbol } = primordials; const a = { *[Symbol.iterator] () { yield "a"; } } `, - options: [{ name: 'Symbol', ignore: ['iterator'] }] + options: [{ name: 'Symbol', ignore: ['iterator'] }], }, { code: ` const { ObjectDefineProperty, Symbol } = primordials; ObjectDefineProperty(o, Symbol.toStringTag, { value: "o" }) `, - options: [{ name: 'Symbol', ignore: ['toStringTag'] }] + options: [{ name: 'Symbol', ignore: ['toStringTag'] }], }, { code: 'const { Symbol } = primordials; Symbol.for("xxx")', - options: [{ name: 'Symbol', ignore: ['for'] }] + options: [{ name: 'Symbol', ignore: ['for'] }], }, { code: 'const { NumberParseInt } = primordials; NumberParseInt("xxx")', - options: [{ name: 'parseInt', into: 'Number' }] + options: [{ name: 'parseInt', into: 'Number' }], }, { code: ` @@ -86,31 +86,31 @@ new RuleTester({ { code: 'new Array()', options: [{ name: 'Array' }], - errors: [{ message: /const { Array } = primordials/ }] + errors: [{ message: /const { Array } = primordials/ }], }, { code: 'JSON.parse("{}")', options: [{ name: 'JSON' }], errors: [ { message: /const { JSONParse } = primordials/ }, - ] + ], }, { code: 'const { JSON } = primordials; JSON.parse("{}")', options: [{ name: 'JSON' }], - errors: [{ message: /const { JSONParse } = primordials/ }] + errors: [{ message: /const { JSONParse } = primordials/ }], }, { code: 'Symbol.for("xxx")', options: [{ name: 'Symbol' }], errors: [ { message: /const { SymbolFor } = primordials/ }, - ] + ], }, { code: 'const { Symbol } = primordials; Symbol.for("xxx")', options: [{ name: 'Symbol' }], - errors: [{ message: /const { SymbolFor } = primordials/ }] + errors: [{ message: /const { SymbolFor } = primordials/ }], }, { code: ` @@ -118,7 +118,7 @@ new RuleTester({ class A { *[Symbol.iterator] () { yield "a"; } } `, options: [{ name: 'Symbol' }], - errors: [{ message: /const { SymbolIterator } = primordials/ }] + errors: [{ message: /const { SymbolIterator } = primordials/ }], }, { code: ` @@ -126,7 +126,7 @@ new RuleTester({ const a = { *[Symbol.iterator] () { yield "a"; } } `, options: [{ name: 'Symbol' }], - errors: [{ message: /const { SymbolIterator } = primordials/ }] + errors: [{ message: /const { SymbolIterator } = primordials/ }], }, { code: ` @@ -134,7 +134,7 @@ new RuleTester({ ObjectDefineProperty(o, Symbol.toStringTag, { value: "o" }) `, options: [{ name: 'Symbol' }], - errors: [{ message: /const { SymbolToStringTag } = primordials/ }] + errors: [{ message: /const { SymbolToStringTag } = primordials/ }], }, { code: ` @@ -142,12 +142,12 @@ new RuleTester({ Number.parseInt('10') `, options: [{ name: 'Number' }], - errors: [{ message: /const { NumberParseInt } = primordials/ }] + errors: [{ message: /const { NumberParseInt } = primordials/ }], }, { code: 'parseInt("10")', options: [{ name: 'parseInt', into: 'Number' }], - errors: [{ message: /const { NumberParseInt } = primordials/ }] + errors: [{ message: /const { NumberParseInt } = primordials/ }], }, { code: ` @@ -156,12 +156,12 @@ new RuleTester({ } `, options: [{ name: 'Reflect' }], - errors: [{ message: /const { ReflectOwnKeys } = primordials/ }] + errors: [{ message: /const { ReflectOwnKeys } = primordials/ }], }, { code: 'new Map()', options: [{ name: 'Map', into: 'Safe' }], - errors: [{ message: /const { SafeMap } = primordials/ }] + errors: [{ message: /const { SafeMap } = primordials/ }], }, { code: ` @@ -169,7 +169,7 @@ new RuleTester({ const noop = Function.prototype; `, options: [{ name: 'Function' }], - errors: [{ message: /const { FunctionPrototype } = primordials/ }] + errors: [{ message: /const { FunctionPrototype } = primordials/ }], }, - ] + ], }); diff --git a/test/parallel/test-eslint-prefer-util-format-errors.js b/test/parallel/test-eslint-prefer-util-format-errors.js index a6c2662a382418..bbaeaf7a090633 100644 --- a/test/parallel/test-eslint-prefer-util-format-errors.js +++ b/test/parallel/test-eslint-prefer-util-format-errors.js @@ -24,8 +24,8 @@ new RuleTester({ parserOptions: { ecmaVersion: 6 } }) code: 'E(\'ABC\', (arg1, arg2) => `${arg1}${arg2}`);', errors: [{ message: 'Please use a printf-like formatted string that ' + - 'util.format can consume.' - }] + 'util.format can consume.', + }], }, - ] + ], }); diff --git a/test/parallel/test-eslint-require-common-first.js b/test/parallel/test-eslint-require-common-first.js index b3d132e11fdc3f..be607018d1375b 100644 --- a/test/parallel/test-eslint-require-common-first.js +++ b/test/parallel/test-eslint-require-common-first.js @@ -13,7 +13,7 @@ new RuleTester().run('require-common-first', rule, { valid: [ { code: 'require("common")\n' + - 'require("assert")' + 'require("assert")', }, ], invalid: [ @@ -21,7 +21,7 @@ new RuleTester().run('require-common-first', rule, { code: 'require("assert")\n' + 'require("common")', errors: [{ message: 'Mandatory module "common" must be loaded ' + - 'before any other modules.' }] + 'before any other modules.' }], }, - ] + ], }); diff --git a/test/parallel/test-eslint-required-modules.js b/test/parallel/test-eslint-required-modules.js index c891e2350711a4..0431ad90f7d092 100644 --- a/test/parallel/test-eslint-required-modules.js +++ b/test/parallel/test-eslint-required-modules.js @@ -13,39 +13,39 @@ new RuleTester().run('required-modules', rule, { valid: [ { code: 'require("common")', - options: [{ common: 'common' }] + options: [{ common: 'common' }], }, { code: 'foo', - options: [] + options: [], }, { code: 'require("common")', - options: [{ common: 'common(/index\\.(m)?js)?$' }] + options: [{ common: 'common(/index\\.(m)?js)?$' }], }, { code: 'require("common/index.js")', - options: [{ common: 'common(/index\\.(m)?js)?$' }] + options: [{ common: 'common(/index\\.(m)?js)?$' }], }, ], invalid: [ { code: 'foo', options: [{ common: 'common' }], - errors: [{ message: 'Mandatory module "common" must be loaded.' }] + errors: [{ message: 'Mandatory module "common" must be loaded.' }], }, { code: 'require("common/fixtures.js")', options: [{ common: 'common(/index\\.(m)?js)?$' }], errors: [{ message: - 'Mandatory module "common" must be loaded.' - }] + 'Mandatory module "common" must be loaded.', + }], }, { code: 'require("somethingElse")', options: [{ common: 'common' }], - errors: [{ message: 'Mandatory module "common" must be loaded.' }] + errors: [{ message: 'Mandatory module "common" must be loaded.' }], }, - ] + ], }); diff --git a/test/parallel/test-event-capture-rejections.js b/test/parallel/test-event-capture-rejections.js index 233b6b35d55072..f966b8662c4b6a 100644 --- a/test/parallel/test-event-capture-rejections.js +++ b/test/parallel/test-event-capture-rejections.js @@ -145,7 +145,7 @@ function thenable() { assert.strictEqual(resolved, undefined); rejected(_err); }); - }, 1) // Only 1 call for Promises/A+ compat. + }, 1), // Only 1 call for Promises/A+ compat. }); return obj; @@ -220,7 +220,7 @@ function thenableThatThrows() { Object.defineProperty(obj, 'then', { get: common.mustCall(() => { throw _err; - }, 1) // Only 1 call for Promises/A+ compat. + }, 1), // Only 1 call for Promises/A+ compat. }); return obj; @@ -286,14 +286,14 @@ function argValidation() { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.captureRejections" property must be of type ' + - `boolean. Received ${received}` + `boolean. Received ${received}`, }); assert.throws(() => EventEmitter.captureRejections = obj, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "EventEmitter.captureRejections" property must be of ' + - `type boolean. Received ${received}` + `type boolean. Received ${received}`, }); } diff --git a/test/parallel/test-event-emitter-errors.js b/test/parallel/test-event-emitter-errors.js index 0a5e707a61a178..f22fc3bd58c2b1 100644 --- a/test/parallel/test-event-emitter-errors.js +++ b/test/parallel/test-event-emitter-errors.js @@ -11,7 +11,7 @@ assert.throws( { code: 'ERR_UNHANDLED_ERROR', name: 'Error', - message: "Unhandled error. ('Accepts a string')" + message: "Unhandled error. ('Accepts a string')", } ); @@ -20,18 +20,18 @@ assert.throws( { code: 'ERR_UNHANDLED_ERROR', name: 'Error', - message: "Unhandled error. ({ message: 'Error!' })" + message: "Unhandled error. ({ message: 'Error!' })", } ); assert.throws( () => EE.emit('error', { message: 'Error!', - [util.inspect.custom]() { throw new Error(); } + [util.inspect.custom]() { throw new Error(); }, }), { code: 'ERR_UNHANDLED_ERROR', name: 'Error', - message: 'Unhandled error. ([object Object])' + message: 'Unhandled error. ([object Object])', } ); diff --git a/test/parallel/test-event-emitter-invalid-listener.js b/test/parallel/test-event-emitter-invalid-listener.js index 3070d4ed7517de..1abd84e1acc723 100644 --- a/test/parallel/test-event-emitter-invalid-listener.js +++ b/test/parallel/test-event-emitter-invalid-listener.js @@ -15,6 +15,6 @@ for (const method of eventsMethods) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "listener" argument must be of type function. ' + - 'Received null' + 'Received null', }, `event.${method}('foo', null) should throw the proper error`); } diff --git a/test/parallel/test-event-emitter-max-listeners.js b/test/parallel/test-event-emitter-max-listeners.js index a881bf86497f16..7bd1a6d619af23 100644 --- a/test/parallel/test-event-emitter-max-listeners.js +++ b/test/parallel/test-event-emitter-max-listeners.js @@ -40,7 +40,7 @@ for (const obj of throwsObjs) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "n" is out of range. ' + - `It must be a non-negative number. Received ${inspect(obj)}` + `It must be a non-negative number. Received ${inspect(obj)}`, } ); @@ -50,7 +50,7 @@ for (const obj of throwsObjs) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "defaultMaxListeners" is out of range. ' + - `It must be a non-negative number. Received ${inspect(obj)}` + `It must be a non-negative number. Received ${inspect(obj)}`, } ); } diff --git a/test/parallel/test-event-on-async-iterator.js b/test/parallel/test-event-on-async-iterator.js index 192326e12bcc39..115f3c81130a6a 100644 --- a/test/parallel/test-event-on-async-iterator.js +++ b/test/parallel/test-event-on-async-iterator.js @@ -5,7 +5,7 @@ const common = require('../common'); const assert = require('assert'); const { on, EventEmitter } = require('events'); const { - NodeEventTarget + NodeEventTarget, } = require('internal/event_target'); async function basic() { @@ -124,18 +124,18 @@ async function next() { assert.deepStrictEqual(results, [{ value: ['bar'], - done: false + done: false, }, { value: [42], - done: false + done: false, }, { value: undefined, - done: true + done: true, }]); assert.deepStrictEqual(await iterable.next(), { value: undefined, - done: true + done: true, }); } @@ -153,19 +153,19 @@ async function nextError() { ]); assert.deepStrictEqual(results, [{ status: 'rejected', - reason: _err + reason: _err, }, { status: 'fulfilled', value: { value: undefined, - done: true - } + done: true, + }, }, { status: 'fulfilled', value: { value: undefined, - done: true - } + done: true, + }, }]); assert.strictEqual(ee.listeners('error').length, 0); } @@ -189,7 +189,7 @@ async function iterableThrow() { }, { message: 'The "EventEmitter.AsyncIterator" property must be' + ' an instance of Error. Received undefined', - name: 'TypeError' + name: 'TypeError', }); const expected = [['bar'], [42]]; @@ -251,11 +251,11 @@ async function abortableOnBefore() { const abortedSignal = AbortSignal.abort(); [1, {}, null, false, 'hi'].forEach((signal) => { assert.throws(() => on(ee, 'foo', { signal }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); assert.throws(() => on(ee, 'foo', { signal: abortedSignal }), { - name: 'AbortError' + name: 'AbortError', }); } @@ -264,11 +264,11 @@ async function eventTargetAbortableOnBefore() { const abortedSignal = AbortSignal.abort(); [1, {}, null, false, 'hi'].forEach((signal) => { assert.throws(() => on(et, 'foo', { signal }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); assert.throws(() => on(et, 'foo', { signal: abortedSignal }), { - name: 'AbortError' + name: 'AbortError', }); } diff --git a/test/parallel/test-events-once.js b/test/parallel/test-events-once.js index 56042b1ecee4f9..2a3992c640fbd1 100644 --- a/test/parallel/test-events-once.js +++ b/test/parallel/test-events-once.js @@ -138,12 +138,12 @@ async function abortSignalBefore() { await Promise.all([1, {}, 'hi', null, false].map((signal) => { return rejects(once(ee, 'foo', { signal }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); })); return rejects(once(ee, 'foo', { signal: abortedSignal }), { - name: 'AbortError' + name: 'AbortError', }); } @@ -152,7 +152,7 @@ async function abortSignalAfter() { const ac = new AbortController(); ee.on('error', common.mustNotCall()); const r = rejects(once(ee, 'foo', { signal: ac.signal }), { - name: 'AbortError' + name: 'AbortError', }); process.nextTick(() => ac.abort()); return r; @@ -187,12 +187,12 @@ async function eventTargetAbortSignalBefore() { await Promise.all([1, {}, 'hi', null, false].map((signal) => { return rejects(once(et, 'foo', { signal }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); })); return rejects(once(et, 'foo', { signal: abortedSignal }), { - name: 'AbortError' + name: 'AbortError', }); } @@ -200,7 +200,7 @@ async function eventTargetAbortSignalAfter() { const et = new EventTarget(); const ac = new AbortController(); const r = rejects(once(et, 'foo', { signal: ac.signal }), { - name: 'AbortError' + name: 'AbortError', }); process.nextTick(() => ac.abort()); return r; diff --git a/test/parallel/test-events-static-geteventlisteners.js b/test/parallel/test-events-static-geteventlisteners.js index eba92de4a00c90..b6370f7e159d13 100644 --- a/test/parallel/test-events-static-geteventlisteners.js +++ b/test/parallel/test-events-static-geteventlisteners.js @@ -5,7 +5,7 @@ const { kWeakHandler } = require('internal/event_target'); const { deepStrictEqual, - throws + throws, } = require('assert'); const { getEventListeners, EventEmitter } = require('events'); diff --git a/test/parallel/test-eventtarget-memoryleakwarning.js b/test/parallel/test-eventtarget-memoryleakwarning.js index d58a4edb37a299..bb4002e30c6e6d 100644 --- a/test/parallel/test-eventtarget-memoryleakwarning.js +++ b/test/parallel/test-eventtarget-memoryleakwarning.js @@ -3,7 +3,7 @@ const common = require('../common'); const { setMaxListeners, - EventEmitter + EventEmitter, } = require('events'); const assert = require('assert'); diff --git a/test/parallel/test-eventtarget-whatwg-passive.js b/test/parallel/test-eventtarget-whatwg-passive.js index 97984bd9aff828..349b1ee854ea25 100644 --- a/test/parallel/test-eventtarget-whatwg-passive.js +++ b/test/parallel/test-eventtarget-whatwg-passive.js @@ -8,7 +8,7 @@ const common = require('../common'); const { fail, ok, - strictEqual + strictEqual, } = require('assert'); { @@ -22,7 +22,7 @@ const { get dummy() { fail('dummy value getter invoked'); return false; - } + }, }; document.addEventListener('test_event', null, query_options); diff --git a/test/parallel/test-eventtarget.js b/test/parallel/test-eventtarget.js index a85e2cd7f1b9f9..a5ea9a0d2533f2 100644 --- a/test/parallel/test-eventtarget.js +++ b/test/parallel/test-eventtarget.js @@ -65,7 +65,7 @@ let asyncTest = Promise.resolve(); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object.' + - common.invalidArgTypeHelper(i) + common.invalidArgTypeHelper(i), }) )); } @@ -141,7 +141,7 @@ let asyncTest = Promise.resolve(); handleEvent: common.mustCall(function(event) { strictEqual(event.type, 'foo'); strictEqual(this, ev2); - }) + }), }; eventTarget.addEventListener('foo', ev1); @@ -239,7 +239,7 @@ let asyncTest = Promise.resolve(); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "event" argument must be an instance of Event.' + - common.invalidArgTypeHelper(i) + common.invalidArgTypeHelper(i), }); }); @@ -247,7 +247,7 @@ let asyncTest = Promise.resolve(); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "listener" argument must be an instance of EventListener.' + - common.invalidArgTypeHelper(arg) + common.invalidArgTypeHelper(arg), }); [ @@ -310,7 +310,7 @@ let asyncTest = Promise.resolve(); const event = new Event('foo'); target1.addEventListener('foo', common.mustCall((event) => { throws(() => target2.dispatchEvent(event), { - code: 'ERR_EVENT_RECURSION' + code: 'ERR_EVENT_RECURSION', }); })); target1.dispatchEvent(event); @@ -401,7 +401,7 @@ let asyncTest = Promise.resolve(); /a/, ].forEach((i) => { throws(() => target.dispatchEvent.call(i, event), { - code: 'ERR_INVALID_THIS' + code: 'ERR_INVALID_THIS', }); }); } @@ -542,12 +542,12 @@ let asyncTest = Promise.resolve(); { const ev = new Event('test'); const evConstructorName = inspect(ev, { - depth: -1 + depth: -1, }); strictEqual(evConstructorName, 'Event'); const inspectResult = inspect(ev, { - depth: 1 + depth: 1, }); ok(inspectResult.includes('Event')); } @@ -555,7 +555,7 @@ let asyncTest = Promise.resolve(); { const et = new EventTarget(); const inspectResult = inspect(et, { - depth: 1 + depth: 1, }); ok(inspectResult.includes('EventTarget')); } diff --git a/test/parallel/test-file-validate-mode-flag.js b/test/parallel/test-file-validate-mode-flag.js index 2ee0716de6e18f..c8056fbf976f88 100644 --- a/test/parallel/test-file-validate-mode-flag.js +++ b/test/parallel/test-file-validate-mode-flag.js @@ -15,25 +15,25 @@ const { // These should throw, not crash. assert.throws(() => open(__filename, 2176057344, common.mustNotCall()), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => open(__filename, 0, 2176057344, common.mustNotCall()), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => openSync(__filename, 2176057344), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => openSync(__filename, 0, 2176057344), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.rejects(openPromise(__filename, 2176057344), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.rejects(openPromise(__filename, 0, 2176057344), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); diff --git a/test/parallel/test-file-write-stream.js b/test/parallel/test-file-write-stream.js index 09f2063e5623f3..a29d08e84fca1c 100644 --- a/test/parallel/test-file-write-stream.js +++ b/test/parallel/test-file-write-stream.js @@ -29,7 +29,7 @@ const tmpdir = require('../common/tmpdir'); const fn = path.join(tmpdir.path, 'write.txt'); tmpdir.refresh(); const file = fs.createWriteStream(fn, { - highWaterMark: 10 + highWaterMark: 10, }); const EXPECTED = '012345678910'; @@ -37,7 +37,7 @@ const EXPECTED = '012345678910'; const callbacks = { open: -1, drain: -2, - close: -1 + close: -1, }; file @@ -65,7 +65,7 @@ file file.write('should not work anymore', common.expectsError({ code: 'ERR_STREAM_WRITE_AFTER_END', name: 'Error', - message: 'write after end' + message: 'write after end', })); file.on('error', common.mustNotCall()); diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js index 487b5d44054373..429e3321493420 100644 --- a/test/parallel/test-file-write-stream2.js +++ b/test/parallel/test-file-write-stream2.js @@ -64,7 +64,7 @@ tmpdir.refresh(); // Drain at 0, return false at 10. const file = fs.createWriteStream(filepath, { - highWaterMark: 11 + highWaterMark: 11, }); file.on('open', function(fd) { diff --git a/test/parallel/test-file-write-stream3.js b/test/parallel/test-file-write-stream3.js index b68fdbf3a1fbfc..8ece36a1d8b1e3 100644 --- a/test/parallel/test-file-write-stream3.js +++ b/test/parallel/test-file-write-stream3.js @@ -188,7 +188,7 @@ const run_test_4 = common.mustCall(function() { code: 'ERR_OUT_OF_RANGE', message: 'The value of "start" is out of range. ' + `It must be >= 0 && <= ${Number.MAX_SAFE_INTEGER}. Received -5`, - name: 'RangeError' + name: 'RangeError', }; assert.throws(fn, err); }); @@ -206,7 +206,7 @@ const run_test_5 = common.mustCall(function() { message: 'The value of "start" is out of range. It must be ' + `>= 0 && <= ${Number.MAX_SAFE_INTEGER}. ` + 'Received 9_007_199_254_740_992', - name: 'RangeError' + name: 'RangeError', }; assert.throws(fn, err); }); diff --git a/test/parallel/test-file-write-stream4.js b/test/parallel/test-file-write-stream4.js index 2a81efcb66756f..0984eecdaa91aa 100644 --- a/test/parallel/test-file-write-stream4.js +++ b/test/parallel/test-file-write-stream4.js @@ -14,7 +14,7 @@ const filepath = path.join(tmpdir.path, 'write_pos.txt'); const fileReadStream = fs.createReadStream(process.execPath); const fileWriteStream = fs.createWriteStream(filepath, { - emitClose: true + emitClose: true, }); fileReadStream.pipe(fileWriteStream); diff --git a/test/parallel/test-filehandle-close.js b/test/parallel/test-filehandle-close.js index 457b06a486f90f..51dae8149c6913 100644 --- a/test/parallel/test-filehandle-close.js +++ b/test/parallel/test-filehandle-close.js @@ -12,6 +12,6 @@ const fs = require('fs'); assert.rejects(() => fh.close(), { code: 'EBADF', - syscall: 'close' + syscall: 'close', }); })().then(common.mustCall()); diff --git a/test/parallel/test-fs-access.js b/test/parallel/test-fs-access.js index 9fa4dfcf1fe4d8..3f2c9c131d4cc9 100644 --- a/test/parallel/test-fs-access.js +++ b/test/parallel/test-fs-access.js @@ -139,7 +139,7 @@ assert.throws( }, { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); assert.throws( @@ -148,7 +148,7 @@ assert.throws( }, { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); // Regular access should not throw. @@ -169,14 +169,14 @@ fs.accessSync(readWriteFile, mode); () => fs.access(readWriteFile, mode, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - message: /"mode" argument.+integer/ + message: /"mode" argument.+integer/, } ); assert.throws( () => fs.accessSync(readWriteFile, mode), { code: 'ERR_INVALID_ARG_TYPE', - message: /"mode" argument.+integer/ + message: /"mode" argument.+integer/, } ); }); @@ -193,14 +193,14 @@ fs.accessSync(readWriteFile, mode); () => fs.access(readWriteFile, mode, common.mustNotCall()), { code: 'ERR_OUT_OF_RANGE', - message: /"mode".+It must be an integer >= 0 && <= 7/ + message: /"mode".+It must be an integer >= 0 && <= 7/, } ); assert.throws( () => fs.accessSync(readWriteFile, mode), { code: 'ERR_OUT_OF_RANGE', - message: /"mode".+It must be an integer >= 0 && <= 7/ + message: /"mode".+It must be an integer >= 0 && <= 7/, } ); }); diff --git a/test/parallel/test-fs-append-file.js b/test/parallel/test-fs-append-file.js index 70919830f6cb0b..d7b347ad381f8f 100644 --- a/test/parallel/test-fs-append-file.js +++ b/test/parallel/test-fs-append-file.js @@ -124,7 +124,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; [false, 5, {}, null, undefined].forEach(async (data) => { const errObj = { code: 'ERR_INVALID_ARG_TYPE', - message: /"data"|"buffer"/ + message: /"data"|"buffer"/, }; const filename = join(tmpdir.path, 'append-invalid-data.txt'); @@ -147,7 +147,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; () => fs.statSync(filename), { code: 'ENOENT', - message: /no such file or directory/ + message: /no such file or directory/, } ); }); diff --git a/test/parallel/test-fs-buffer.js b/test/parallel/test-fs-buffer.js index 4c81c13e26977f..2eded543c25d70 100644 --- a/test/parallel/test-fs-buffer.js +++ b/test/parallel/test-fs-buffer.js @@ -25,7 +25,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "path" argument must be of type string or an instance of ' + - 'Buffer or URL. Received type boolean (true)' + 'Buffer or URL. Received type boolean (true)', } ); diff --git a/test/parallel/test-fs-chmod.js b/test/parallel/test-fs-chmod.js index 99e47adc3dcf29..f01aeb39e53637 100644 --- a/test/parallel/test-fs-chmod.js +++ b/test/parallel/test-fs-chmod.js @@ -142,7 +142,7 @@ if (fs.lchmod) { name: 'TypeError', message: 'The "path" argument must be of type string or an instance ' + 'of Buffer or URL.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), }; assert.throws(() => fs.chmod(input, 1, common.mustNotCall()), errObj); assert.throws(() => fs.chmodSync(input, 1), errObj); diff --git a/test/parallel/test-fs-chown-type-check.js b/test/parallel/test-fs-chown-type-check.js index 0ca78aa86ea981..deb8df07219892 100644 --- a/test/parallel/test-fs-chown-type-check.js +++ b/test/parallel/test-fs-chown-type-check.js @@ -9,14 +9,14 @@ const fs = require('fs'); () => fs.chown(i, 1, 1, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.chownSync(i, 1, 1), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -26,28 +26,28 @@ const fs = require('fs'); () => fs.chown('not_a_file_that_exists', i, 1, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.chown('not_a_file_that_exists', 1, i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.chownSync('not_a_file_that_exists', i, 1), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.chownSync('not_a_file_that_exists', 1, i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-close-errors.js b/test/parallel/test-fs-close-errors.js index 52930a203eddbb..938edca667325c 100644 --- a/test/parallel/test-fs-close-errors.js +++ b/test/parallel/test-fs-close-errors.js @@ -12,7 +12,7 @@ const fs = require('fs'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "fd" argument must be of type number.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), }; assert.throws(() => fs.close(input), errObj); assert.throws(() => fs.closeSync(input), errObj); @@ -24,7 +24,7 @@ const fs = require('fs'); const errObj = { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }; ['', false, null, {}, []].forEach((input) => { diff --git a/test/parallel/test-fs-copyfile.js b/test/parallel/test-fs-copyfile.js index 51250d7b83145c..b1653781f086dc 100644 --- a/test/parallel/test-fs-copyfile.js +++ b/test/parallel/test-fs-copyfile.js @@ -8,7 +8,7 @@ const fs = require('fs'); const { internalBinding } = require('internal/test/binding'); const { UV_ENOENT, - UV_EEXIST + UV_EEXIST, } = internalBinding('uv'); const path = require('path'); const src = fixtures.path('a.js'); @@ -19,7 +19,7 @@ const { COPYFILE_FICLONE_FORCE, UV_FS_COPYFILE_EXCL, UV_FS_COPYFILE_FICLONE, - UV_FS_COPYFILE_FICLONE_FORCE + UV_FS_COPYFILE_FICLONE_FORCE, } = fs.constants; function verify(src, dest) { @@ -104,7 +104,7 @@ assert.throws(() => { fs.copyFile(src, dest, 0, 0); }, { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); // Throws if the source path is not a string. @@ -114,7 +114,7 @@ assert.throws(() => { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /src/ + message: /src/, } ); assert.throws( @@ -122,7 +122,7 @@ assert.throws(() => { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /dest/ + message: /dest/, } ); assert.throws( @@ -130,7 +130,7 @@ assert.throws(() => { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /src/ + message: /src/, } ); assert.throws( @@ -138,7 +138,7 @@ assert.throws(() => { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /dest/ + message: /dest/, } ); }); @@ -148,7 +148,7 @@ assert.throws(() => { }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /mode/ + message: /mode/, }); assert.throws(() => { @@ -157,7 +157,7 @@ assert.throws(() => { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "mode" is out of range. It must be an integer ' + - '>= 0 && <= 7. Received 8' + '>= 0 && <= 7. Received 8', }); assert.throws(() => { @@ -165,5 +165,5 @@ assert.throws(() => { }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /mode/ + message: /mode/, }); diff --git a/test/parallel/test-fs-error-messages.js b/test/parallel/test-fs-error-messages.js index dd9639d99657b6..f099f83fbe9b13 100644 --- a/test/parallel/test-fs-error-messages.js +++ b/test/parallel/test-fs-error-messages.js @@ -51,7 +51,7 @@ const { UV_ENOENT, UV_ENOTDIR, UV_ENOTEMPTY, - UV_EPERM + UV_EPERM, } = internalBinding('uv'); // Template tag function for escaping special characters in strings so that: @@ -667,7 +667,7 @@ if (!common.isAIX) { { const validateError = { message: /"mode".+must be an integer >= 0 && <= 7\. Received -1/, - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }; assert.throws( diff --git a/test/parallel/test-fs-fchmod.js b/test/parallel/test-fs-fchmod.js index da37080ddeedd8..c8200b9cd14ce3 100644 --- a/test/parallel/test-fs-fchmod.js +++ b/test/parallel/test-fs-fchmod.js @@ -12,7 +12,7 @@ const fs = require('fs'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "fd" argument must be of type number.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), }; assert.throws(() => fs.fchmod(input), errObj); assert.throws(() => fs.fchmodSync(input), errObj); @@ -28,7 +28,7 @@ const fs = require('fs'); }); assert.throws(() => fs.fchmod(1, '123x'), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); [-1, 2 ** 32].forEach((input) => { @@ -36,7 +36,7 @@ assert.throws(() => fs.fchmod(1, '123x'), { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "fd" is out of range. It must be >= 0 && <= ' + - `2147483647. Received ${input}` + `2147483647. Received ${input}`, }; assert.throws(() => fs.fchmod(input), errObj); assert.throws(() => fs.fchmodSync(input), errObj); @@ -47,7 +47,7 @@ assert.throws(() => fs.fchmod(1, '123x'), { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "mode" is out of range. It must be >= 0 && <= ' + - `4294967295. Received ${input}` + `4294967295. Received ${input}`, }; assert.throws(() => fs.fchmod(1, input), errObj); @@ -59,7 +59,7 @@ assert.throws(() => fs.fchmod(1, '123x'), { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "fd" is out of range. It must be an integer. ' + - `Received ${input}` + `Received ${input}`, }; assert.throws(() => fs.fchmod(input), errObj); assert.throws(() => fs.fchmodSync(input), errObj); @@ -73,7 +73,7 @@ assert.throws(() => fs.fchmod(1, '123x'), { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "fd" is out of range. It must be an integer. ' + - `Received ${input}` + `Received ${input}`, }; assert.throws(() => fs.fchmod(input), errObj); assert.throws(() => fs.fchmodSync(input), errObj); diff --git a/test/parallel/test-fs-fchown.js b/test/parallel/test-fs-fchown.js index 03a9ef3780ae6b..9f51b2d2f55a8c 100644 --- a/test/parallel/test-fs-fchown.js +++ b/test/parallel/test-fs-fchown.js @@ -23,7 +23,7 @@ function testGid(input, errObj) { const errObj = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /fd|uid|gid/ + message: /fd|uid|gid/, }; testFd(input, errObj); testUid(input, errObj); @@ -35,7 +35,7 @@ function testGid(input, errObj) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "fd" is out of range. It must be an integer. ' + - `Received ${input}` + `Received ${input}`, }; testFd(input, errObj); errObj.message = errObj.message.replace('fd', 'uid'); @@ -49,7 +49,7 @@ function testGid(input, errObj) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "fd" is out of range. It must be ' + - `>= 0 && <= 2147483647. Received ${input}` + `>= 0 && <= 2147483647. Received ${input}`, }; testFd(input, errObj); errObj.message = 'The value of "uid" is out of range. It must be >= -1 && ' + diff --git a/test/parallel/test-fs-filehandle-use-after-close.js b/test/parallel/test-fs-filehandle-use-after-close.js index 7b99e41cd02284..ef16e29c2352cd 100644 --- a/test/parallel/test-fs-filehandle-use-after-close.js +++ b/test/parallel/test-fs-filehandle-use-after-close.js @@ -18,7 +18,7 @@ const fs = require('fs').promises; assert.rejects(() => filehandle.stat(), { code: 'EBADF', - syscall: 'fstat' + syscall: 'fstat', }); await otherFilehandle.close(); diff --git a/test/parallel/test-fs-filehandle.js b/test/parallel/test-fs-filehandle.js index 818a3824904431..58d45d85505447 100644 --- a/test/parallel/test-fs-filehandle.js +++ b/test/parallel/test-fs-filehandle.js @@ -32,7 +32,7 @@ common.expectWarning({ 'Warning': [ `Closing file descriptor ${fdnum} on garbage collection`, ], - 'DeprecationWarning': [[deprecationWarning, 'DEP0137']] + 'DeprecationWarning': [[deprecationWarning, 'DEP0137']], }); global.gc(); diff --git a/test/parallel/test-fs-fmap.js b/test/parallel/test-fs-fmap.js index 4b21ce8d95a12f..e9ad3d33ace3b5 100644 --- a/test/parallel/test-fs-fmap.js +++ b/test/parallel/test-fs-fmap.js @@ -9,7 +9,7 @@ const { O_RDONLY = 0, O_TRUNC = 0, O_WRONLY = 0, - UV_FS_O_FILEMAP = 0 + UV_FS_O_FILEMAP = 0, } = fs.constants; const tmpdir = require('../common/tmpdir'); diff --git a/test/parallel/test-fs-fsync.js b/test/parallel/test-fs-fsync.js index c60fe0af728e39..82fd6de98796ba 100644 --- a/test/parallel/test-fs-fsync.js +++ b/test/parallel/test-fs-fsync.js @@ -50,7 +50,7 @@ fs.open(fileTemp, 'a', 0o777, common.mustSucceed((fd) => { ['', false, null, undefined, {}, []].forEach((input) => { const errObj = { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }; assert.throws(() => fs.fdatasync(input), errObj); assert.throws(() => fs.fdatasyncSync(input), errObj); diff --git a/test/parallel/test-fs-lchmod.js b/test/parallel/test-fs-lchmod.js index d0cba919b64754..b5d39cae7e5500 100644 --- a/test/parallel/test-fs-lchmod.js +++ b/test/parallel/test-fs-lchmod.js @@ -24,14 +24,14 @@ assert.throws(() => fs.lchmod(f, {}), { code: 'ERR_INVALID_CALLBACK' }); () => fs.lchmod(i, 0o777, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.lchmodSync(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -47,10 +47,10 @@ assert.throws(() => fs.lchmod(f, {}), { code: 'ERR_INVALID_CALLBACK' }); }); assert.throws(() => fs.lchmod(f, '123x', common.mustNotCall()), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); assert.throws(() => fs.lchmodSync(f, '123x'), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); [-1, 2 ** 32].forEach((input) => { @@ -58,7 +58,7 @@ assert.throws(() => fs.lchmodSync(f, '123x'), { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "mode" is out of range. It must be >= 0 && <= ' + - `4294967295. Received ${input}` + `4294967295. Received ${input}`, }; assert.rejects(promises.lchmod(f, input, () => {}), errObj); diff --git a/test/parallel/test-fs-lchown.js b/test/parallel/test-fs-lchown.js index ba2b4b85fb9c90..0811a2b4b72d71 100644 --- a/test/parallel/test-fs-lchown.js +++ b/test/parallel/test-fs-lchown.js @@ -46,7 +46,7 @@ const { promises } = fs; [false, 1, 'test', {}, [], null, undefined].forEach((i) => { assert.throws(() => fs.lchown('not_a_file_that_exists', 1, 1, i), { name: 'TypeError', - code: 'ERR_INVALID_CALLBACK' + code: 'ERR_INVALID_CALLBACK', }); }); diff --git a/test/parallel/test-fs-link.js b/test/parallel/test-fs-link.js index ffa0e0bc635707..745744987b0d63 100644 --- a/test/parallel/test-fs-link.js +++ b/test/parallel/test-fs-link.js @@ -27,28 +27,28 @@ fs.link(srcPath, dstPath, common.mustCall(callback)); () => fs.link(i, '', common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.link('', i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.linkSync(i, ''), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.linkSync('', i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-long-path.js b/test/parallel/test-fs-long-path.js index 1cb66fa6046152..8ea2fab1b335bf 100644 --- a/test/parallel/test-fs-long-path.js +++ b/test/parallel/test-fs-long-path.js @@ -38,7 +38,7 @@ tmpdir.refresh(); console.log({ filenameLength: fileName.length, - fullPathLength: fullPath.length + fullPathLength: fullPath.length, }); fs.writeFile(fullPath, 'ok', common.mustSucceed(() => { diff --git a/test/parallel/test-fs-make-callback.js b/test/parallel/test-fs-make-callback.js index 0cbc4a7fe3e186..da387c376b64c5 100644 --- a/test/parallel/test-fs-make-callback.js +++ b/test/parallel/test-fs-make-callback.js @@ -20,7 +20,7 @@ function invalidCallbackThrowsTests() { callbackThrowValues.forEach((value) => { assert.throws(testMakeCallback(value), { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); }); } diff --git a/test/parallel/test-fs-makeStatsCallback.js b/test/parallel/test-fs-makeStatsCallback.js index 52d129db2b6bc8..25198e87bd6239 100644 --- a/test/parallel/test-fs-makeStatsCallback.js +++ b/test/parallel/test-fs-makeStatsCallback.js @@ -18,7 +18,7 @@ function invalidCallbackThrowsTests() { callbackThrowValues.forEach((value) => { assert.throws(testMakeStatsCallback(value), { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); }); } diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index 4124a638a20234..7a4adc77e4c8c9 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -89,14 +89,14 @@ function nextdir() { () => fs.mkdir(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.mkdirSync(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -167,7 +167,7 @@ function nextdir() { message: /ENOTDIR: .*mkdir/, name: 'Error', syscall: 'mkdir', - path: pathname // See: https://github.com/nodejs/node/issues/28015 + path: pathname, // See: https://github.com/nodejs/node/issues/28015 } ); } @@ -249,7 +249,7 @@ if (common.isMainThread && (common.isLinux || common.isOSX)) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.recursive" property must be of type boolean.' + - received + received, } ); assert.throws( @@ -258,7 +258,7 @@ if (common.isMainThread && (common.isLinux || common.isOSX)) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.recursive" property must be of type boolean.' + - received + received, } ); }); diff --git a/test/parallel/test-fs-mkdtemp-prefix-check.js b/test/parallel/test-fs-mkdtemp-prefix-check.js index 1d9d88232a067e..172d5dbf03ad47 100644 --- a/test/parallel/test-fs-mkdtemp-prefix-check.js +++ b/test/parallel/test-fs-mkdtemp-prefix-check.js @@ -12,7 +12,7 @@ function fail(value) { }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); } @@ -23,7 +23,7 @@ function failAsync(value) { }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); } diff --git a/test/parallel/test-fs-non-number-arguments-throw.js b/test/parallel/test-fs-non-number-arguments-throw.js index a0d533667b3c1f..9eac316cf6f898 100644 --- a/test/parallel/test-fs-non-number-arguments-throw.js +++ b/test/parallel/test-fs-non-number-arguments-throw.js @@ -20,7 +20,7 @@ assert.throws( }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); assert.throws( @@ -29,7 +29,7 @@ assert.throws( }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); assert.throws( @@ -38,7 +38,7 @@ assert.throws( }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); saneEmitter.on('data', common.mustCall(function(data) { diff --git a/test/parallel/test-fs-null-bytes.js b/test/parallel/test-fs-null-bytes.js index d4548c02c07009..90d9ea35e19881 100644 --- a/test/parallel/test-fs-null-bytes.js +++ b/test/parallel/test-fs-null-bytes.js @@ -46,7 +46,7 @@ function check(async, sync) { }, { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', }); } } diff --git a/test/parallel/test-fs-open.js b/test/parallel/test-fs-open.js index 92dd8f5f48718b..27023c336ff43c 100644 --- a/test/parallel/test-fs-open.js +++ b/test/parallel/test-fs-open.js @@ -59,7 +59,7 @@ assert.throws( () => fs.open(__filename, 'r', 'boom', common.mustNotCall()), { code: 'ERR_INVALID_ARG_VALUE', - name: 'TypeError' + name: 'TypeError', } ); @@ -68,7 +68,7 @@ for (const extra of [[], ['r'], ['r', 0], ['r', 0, 'bad callback']]) { () => fs.open(__filename, ...extra), { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', } ); } @@ -78,21 +78,21 @@ for (const extra of [[], ['r'], ['r', 0], ['r', 0, 'bad callback']]) { () => fs.open(i, 'r', common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.openSync(i, 'r', common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.rejects( fs.promises.open(i, 'r'), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -102,19 +102,19 @@ for (const extra of [[], ['r'], ['r', 0], ['r', 0, 'bad callback']]) { assert.throws( () => fs.open(__filename, 'r', mode, common.mustNotCall()), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); assert.throws( () => fs.openSync(__filename, 'r', mode, common.mustNotCall()), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); assert.rejects( fs.promises.open(__filename, 'r', mode), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); }); diff --git a/test/parallel/test-fs-opendir.js b/test/parallel/test-fs-opendir.js index 4c4681ef48e2ff..cd0ee134d20c41 100644 --- a/test/parallel/test-fs-opendir.js +++ b/test/parallel/test-fs-opendir.js @@ -30,16 +30,16 @@ function assertDirent(dirent) { } const dirclosedError = { - code: 'ERR_DIR_CLOSED' + code: 'ERR_DIR_CLOSED', }; const dirconcurrentError = { - code: 'ERR_DIR_CONCURRENT_OPERATION' + code: 'ERR_DIR_CONCURRENT_OPERATION', }; const invalidCallbackObj = { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }; // Check the opendir Sync version @@ -105,14 +105,14 @@ fs.opendir(__filename, common.mustCall(function(e) { () => fs.opendir(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.opendirSync(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -198,14 +198,14 @@ for (const bufferSize of [-1, 0, 0.5, 1.5, Infinity, NaN]) { assert.throws( () => fs.opendirSync(testDir, { bufferSize }), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); } for (const bufferSize of ['', '1', null]) { assert.throws( () => fs.opendirSync(testDir, { bufferSize }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); } diff --git a/test/parallel/test-fs-promises-file-handle-aggregate-errors.js b/test/parallel/test-fs-promises-file-handle-aggregate-errors.js index d4c3b37d652d12..f0d3757c8656cc 100644 --- a/test/parallel/test-fs-promises-file-handle-aggregate-errors.js +++ b/test/parallel/test-fs-promises-file-handle-aggregate-errors.js @@ -46,7 +46,7 @@ async function checkAggregateError(op) { const opError = new Error('INTERNAL_ERROR'); opError.code = 123; throw opError; - } + }, }); await assert.rejects(op(filePath), common.mustCall((err) => { diff --git a/test/parallel/test-fs-promises-file-handle-close-errors.js b/test/parallel/test-fs-promises-file-handle-close-errors.js index b975b3f3e1583c..3957517c1af188 100644 --- a/test/parallel/test-fs-promises-file-handle-close-errors.js +++ b/test/parallel/test-fs-promises-file-handle-close-errors.js @@ -44,7 +44,7 @@ async function checkCloseError(op) { throw closeError; }; return originalFd.get.call(this); - } + }, }); await assert.rejects(op(filePath), { diff --git a/test/parallel/test-fs-promises-file-handle-close.js b/test/parallel/test-fs-promises-file-handle-close.js index d6417964746720..85205c7cb47c30 100644 --- a/test/parallel/test-fs-promises-file-handle-close.js +++ b/test/parallel/test-fs-promises-file-handle-close.js @@ -21,7 +21,7 @@ async function doOpen() { common.expectWarning({ Warning: [[`Closing file descriptor ${fh.fd} on garbage collection`]], - DeprecationWarning: [[warning, 'DEP0137']] + DeprecationWarning: [[warning, 'DEP0137']], }); return fh; diff --git a/test/parallel/test-fs-promises-file-handle-op-errors.js b/test/parallel/test-fs-promises-file-handle-op-errors.js index 7110b5d9d40467..83cbcd910c34a4 100644 --- a/test/parallel/test-fs-promises-file-handle-op-errors.js +++ b/test/parallel/test-fs-promises-file-handle-op-errors.js @@ -38,7 +38,7 @@ async function checkOperationError(op) { const opError = new Error('INTERNAL_ERROR'); opError.code = 123; throw opError; - } + }, }); await assert.rejects(op(filePath), { diff --git a/test/parallel/test-fs-promises-file-handle-read-worker.js b/test/parallel/test-fs-promises-file-handle-read-worker.js index ccf3338d14506a..784e6529806240 100644 --- a/test/parallel/test-fs-promises-file-handle-read-worker.js +++ b/test/parallel/test-fs-promises-file-handle-read-worker.js @@ -16,7 +16,7 @@ if (isMainThread || !workerData) { handle.on('close', common.mustNotCall()); new Worker(__filename, { workerData: { handle }, - transferList: [handle] + transferList: [handle], }); }); fs.promises.open(file, 'r').then((handle) => { @@ -24,7 +24,7 @@ if (isMainThread || !workerData) { assert.throws(() => { new Worker(__filename, { workerData: { handle }, - transferList: [handle] + transferList: [handle], }); }, { code: 25, diff --git a/test/parallel/test-fs-promises-file-handle-readFile.js b/test/parallel/test-fs-promises-file-handle-readFile.js index fc28dd23328df7..3efa54f9c316f3 100644 --- a/test/parallel/test-fs-promises-file-handle-readFile.js +++ b/test/parallel/test-fs-promises-file-handle-readFile.js @@ -60,7 +60,7 @@ async function doReadAndCancel() { fs.writeFileSync(filePathForHandle, buffer); const signal = AbortSignal.abort(); await assert.rejects(readFile(fileHandle, { signal }), { - name: 'AbortError' + name: 'AbortError', }); await fileHandle.close(); } @@ -75,7 +75,7 @@ async function doReadAndCancel() { const { signal } = controller; process.nextTick(() => controller.abort()); await assert.rejects(readFile(fileHandle, { signal }), { - name: 'AbortError' + name: 'AbortError', }, 'tick-0'); await fileHandle.close(); } @@ -92,7 +92,7 @@ async function doReadAndCancel() { const { signal } = controller; tick(1, () => controller.abort()); await assert.rejects(fileHandle.readFile({ signal, encoding: 'utf8' }), { - name: 'AbortError' + name: 'AbortError', }, 'tick-1'); await fileHandle.close(); @@ -111,7 +111,7 @@ async function doReadAndCancel() { await assert.rejects(fileHandle.readFile(), { name: 'RangeError', - code: 'ERR_FS_FILE_TOO_LARGE' + code: 'ERR_FS_FILE_TOO_LARGE', }); await fileHandle.close(); } diff --git a/test/parallel/test-fs-promises-file-handle-sync.js b/test/parallel/test-fs-promises-file-handle-sync.js index 53eb2424549f93..fc2024f6afdbda 100644 --- a/test/parallel/test-fs-promises-file-handle-sync.js +++ b/test/parallel/test-fs-promises-file-handle-sync.js @@ -14,7 +14,7 @@ async function validate() { copyFile(fixtures.path('baz.js'), dest, 'r'), { code: 'ERR_INVALID_ARG_TYPE', - message: /mode.*integer.*string/ + message: /mode.*integer.*string/, } ); await copyFile(fixtures.path('baz.js'), dest); diff --git a/test/parallel/test-fs-promises-file-handle-writeFile.js b/test/parallel/test-fs-promises-file-handle-writeFile.js index 7ad1beb4bcdd7b..c62d4b0b3c6851 100644 --- a/test/parallel/test-fs-promises-file-handle-writeFile.js +++ b/test/parallel/test-fs-promises-file-handle-writeFile.js @@ -35,7 +35,7 @@ async function doWriteAndCancel() { const { signal } = controller; process.nextTick(() => controller.abort()); await assert.rejects(writeFile(fileHandle, buffer, { signal }), { - name: 'AbortError' + name: 'AbortError', }); } diff --git a/test/parallel/test-fs-promises-readfile.js b/test/parallel/test-fs-promises-readfile.js index a7fc46e5a6544a..48d43bd9b7ad14 100644 --- a/test/parallel/test-fs-promises-readfile.js +++ b/test/parallel/test-fs-promises-readfile.js @@ -45,7 +45,7 @@ async function validateReadFileProc() { function validateReadFileAbortLogicBefore() { const signal = AbortSignal.abort(); assert.rejects(readFile(fn, { signal }), { - name: 'AbortError' + name: 'AbortError', }); } @@ -54,7 +54,7 @@ function validateReadFileAbortLogicDuring() { const signal = controller.signal; process.nextTick(() => controller.abort()); assert.rejects(readFile(fn, { signal }), { - name: 'AbortError' + name: 'AbortError', }); } diff --git a/test/parallel/test-fs-promises-writefile.js b/test/parallel/test-fs-promises-writefile.js index 494a9015773d13..d6f716abe5c7d5 100644 --- a/test/parallel/test-fs-promises-writefile.js +++ b/test/parallel/test-fs-promises-writefile.js @@ -23,21 +23,21 @@ const iterable = { yield 'a'; yield 'b'; yield 'c'; - } + }, }; const veryLargeBuffer = { expected: 'dogs running'.repeat(512 * 1024), *[Symbol.iterator]() { yield Buffer.from('dogs running'.repeat(512 * 1024), 'utf8'); - } + }, }; function iterableWith(value) { return { *[Symbol.iterator]() { yield value; - } + }, }; } const bufferIterable = { @@ -46,7 +46,7 @@ const bufferIterable = { yield Buffer.from('a'); yield Buffer.from('b'); yield Buffer.from('c'); - } + }, }; const asyncIterable = { expected: 'abc', @@ -54,7 +54,7 @@ const asyncIterable = { yield 'a'; yield 'b'; yield 'c'; - } + }, }; async function doWrite() { @@ -75,7 +75,7 @@ async function doWriteStreamWithCancel() { const { signal } = controller; process.nextTick(() => controller.abort()); assert.rejects(fsPromises.writeFile(otherDest, stream, { signal }), { - name: 'AbortError' + name: 'AbortError', }); } @@ -135,7 +135,7 @@ async function doWriteWithCancel() { const { signal } = controller; process.nextTick(() => controller.abort()); assert.rejects(fsPromises.writeFile(otherDest, buffer, { signal }), { - name: 'AbortError' + name: 'AbortError', }); } diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js index f0140084732056..bc5a523213f5b7 100644 --- a/test/parallel/test-fs-promises.js +++ b/test/parallel/test-fs-promises.js @@ -31,7 +31,7 @@ const { truncate, unlink, utimes, - writeFile + writeFile, } = fsPromises; const tmpDir = tmpdir.path; @@ -56,7 +56,7 @@ assert.strictEqual( { code: 'ENOENT', name: 'Error', - message: /^ENOENT: no such file or directory, access/ + message: /^ENOENT: no such file or directory, access/, } ); @@ -64,7 +64,7 @@ assert.strictEqual( access(__filename, 8), { code: 'ERR_OUT_OF_RANGE', - message: /"mode".*must be an integer >= 0 && <= 7\. Received 8$/ + message: /"mode".*must be an integer >= 0 && <= 7\. Received 8$/, } ); @@ -72,7 +72,7 @@ assert.strictEqual( access(__filename, { [Symbol.toPrimitive]() { return 5; } }), { code: 'ERR_INVALID_ARG_TYPE', - message: /"mode" argument.+integer\. Received an instance of Object$/ + message: /"mode" argument.+integer\. Received an instance of Object$/, } ); } @@ -197,7 +197,7 @@ async function getHandle(dest) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "gid" is out of range. ' + - 'It must be >= -1 && <= 4294967295. Received -2' + 'It must be >= -1 && <= 4294967295. Received -2', }); assert.rejects( @@ -208,7 +208,7 @@ async function getHandle(dest) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "gid" is out of range. ' + - 'It must be >= -1 && <= 4294967295. Received -2' + 'It must be >= -1 && <= 4294967295. Received -2', }); await handle.close(); @@ -227,7 +227,7 @@ async function getHandle(dest) { // expect it to be ENOSYS common.expectsError({ code: 'ENOSYS', - name: 'Error' + name: 'Error', })(err); } @@ -281,7 +281,7 @@ async function getHandle(dest) { common.expectsError({ code: 'ERR_METHOD_NOT_IMPLEMENTED', name: 'Error', - message: 'The lchmod() method is not implemented' + message: 'The lchmod() method is not implemented', }) ), ]); @@ -417,7 +417,7 @@ async function getHandle(dest) { async () => mkdir(dir, { recursive }), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -431,7 +431,7 @@ async function getHandle(dest) { async () => mkdtemp(1), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); } @@ -444,7 +444,7 @@ async function getHandle(dest) { async () => handle.write('abc', 0, 'hex'), { code: 'ERR_INVALID_ARG_VALUE', - message: /'encoding' is invalid for data of length 3/ + message: /'encoding' is invalid for data of length 3/, } ); @@ -458,7 +458,7 @@ async function getHandle(dest) { const handle = await getHandle(dest); assert.rejects(() => handle.stat.call({}), { code: 'ERR_INTERNAL_ASSERTION', - message: /handle must be an instance of FileHandle/ + message: /handle must be an instance of FileHandle/, }); await handle.close(); } diff --git a/test/parallel/test-fs-read-empty-buffer.js b/test/parallel/test-fs-read-empty-buffer.js index 7ec5e5c186f5eb..c517575d955d05 100644 --- a/test/parallel/test-fs-read-empty-buffer.js +++ b/test/parallel/test-fs-read-empty-buffer.js @@ -15,7 +15,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_VALUE', message: 'The argument \'buffer\' is empty and cannot be written. ' + - 'Received Uint8Array(0) []' + 'Received Uint8Array(0) []', } ); @@ -24,7 +24,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_VALUE', message: 'The argument \'buffer\' is empty and cannot be written. ' + - 'Received Uint8Array(0) []' + 'Received Uint8Array(0) []', } ); @@ -35,7 +35,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_VALUE', message: 'The argument \'buffer\' is empty and cannot be written. ' + - 'Received Uint8Array(0) []' + 'Received Uint8Array(0) []', } ); })().then(common.mustCall()); diff --git a/test/parallel/test-fs-read-optional-params.js b/test/parallel/test-fs-read-optional-params.js index aac5f51d0bb2db..6b9ce80e1d1139 100644 --- a/test/parallel/test-fs-read-optional-params.js +++ b/test/parallel/test-fs-read-optional-params.js @@ -28,7 +28,7 @@ fs.read(fd, { buffer: bufferAsOption, offset: 0, length: bufferAsOption.length, - position: 0 + position: 0, }, common.mustCall((err, bytesRead, buffer) => { assert.strictEqual(bytesRead, expected.length); diff --git a/test/parallel/test-fs-read-stream-encoding.js b/test/parallel/test-fs-read-stream-encoding.js index 8eeaee6572bf72..b0832bd19ffb98 100644 --- a/test/parallel/test-fs-read-stream-encoding.js +++ b/test/parallel/test-fs-read-stream-encoding.js @@ -11,7 +11,7 @@ const assertStream = new stream.Writable({ write: function(chunk, enc, next) { const expected = Buffer.from('xyz'); assert(chunk.equals(expected)); - } + }, }); assertStream.setDefaultEncoding(encoding); fs.createReadStream(example, encoding).pipe(assertStream); diff --git a/test/parallel/test-fs-read-stream-err.js b/test/parallel/test-fs-read-stream-err.js index 1d280f64874fc7..d797d7dbd11af3 100644 --- a/test/parallel/test-fs-read-stream-err.js +++ b/test/parallel/test-fs-read-stream-err.js @@ -25,7 +25,7 @@ const assert = require('assert'); const fs = require('fs'); const stream = fs.createReadStream(__filename, { - bufferSize: 64 + bufferSize: 64, }); const err = new Error('BAM'); diff --git a/test/parallel/test-fs-read-stream-file-handle.js b/test/parallel/test-fs-read-stream-file-handle.js index 063075aa25f64e..20e1a8940b17f9 100644 --- a/test/parallel/test-fs-read-stream-file-handle.js +++ b/test/parallel/test-fs-read-stream-file-handle.js @@ -59,7 +59,7 @@ fs.promises.open(file, 'r').then(common.mustCall((handle) => { }, { code: 'ERR_METHOD_NOT_IMPLEMENTED', name: 'Error', - message: 'The FileHandle with fs method is not implemented' + message: 'The FileHandle with fs method is not implemented', }); handle.close(); })); diff --git a/test/parallel/test-fs-read-stream-inherit.js b/test/parallel/test-fs-read-stream-inherit.js index 5c8bbef0e499c0..ae6b3c232abbe9 100644 --- a/test/parallel/test-fs-read-stream-inherit.js +++ b/test/parallel/test-fs-read-stream-inherit.js @@ -120,7 +120,7 @@ const rangeFile = fixtures.path('x.txt'); { code: 'ERR_OUT_OF_RANGE', message, - name: 'RangeError' + name: 'RangeError', }); } diff --git a/test/parallel/test-fs-read-stream-pos.js b/test/parallel/test-fs-read-stream-pos.js index c9470cb23ddeb6..8e5f1c268712dd 100644 --- a/test/parallel/test-fs-read-stream-pos.js +++ b/test/parallel/test-fs-read-stream-pos.js @@ -33,7 +33,7 @@ setInterval(() => { stream = fs.createReadStream(file, { highWaterMark: hwm, - start: cur + start: cur, }); stream.on('data', common.mustCallAtLeast((chunk) => { cur += chunk.length; diff --git a/test/parallel/test-fs-read-stream-throw-type-error.js b/test/parallel/test-fs-read-stream-throw-type-error.js index a01d23d5abdd10..c1889304b83ace 100644 --- a/test/parallel/test-fs-read-stream-throw-type-error.js +++ b/test/parallel/test-fs-read-stream-throw-type-error.js @@ -22,12 +22,12 @@ const createReadStreamErr = (path, opt, error) => { const typeError = { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }; const rangeError = { code: 'ERR_OUT_OF_RANGE', - name: 'RangeError' + name: 'RangeError', }; [123, 0, true, false].forEach((opts) => diff --git a/test/parallel/test-fs-read-stream.js b/test/parallel/test-fs-read-stream.js index 243fc78afcda89..72063a79232a56 100644 --- a/test/parallel/test-fs-read-stream.js +++ b/test/parallel/test-fs-read-stream.js @@ -94,7 +94,7 @@ test1({ open: common.mustCall(fs.open), read: common.mustCallAtLeast(fs.read, 1), close: common.mustCall(fs.close), - } + }, }); { @@ -160,7 +160,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', message: 'The value of "start" is out of range. It must be <= "end"' + ' (here: 2). Received 10', - name: 'RangeError' + name: 'RangeError', }); { diff --git a/test/parallel/test-fs-read-type.js b/test/parallel/test-fs-read-type.js index 2baab18dc9f483..48e8056414939b 100644 --- a/test/parallel/test-fs-read-type.js +++ b/test/parallel/test-fs-read-type.js @@ -16,7 +16,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "buffer" argument must be an instance of Buffer, ' + - 'TypedArray, or DataView. Received type number (4)' + 'TypedArray, or DataView. Received type number (4)', } ); @@ -30,7 +30,7 @@ assert.throws( common.mustNotCall()); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -57,7 +57,7 @@ assert.throws(() => { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. It must be an integer. ' + - 'Received NaN' + 'Received NaN', }); assert.throws(() => { @@ -71,7 +71,7 @@ assert.throws(() => { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "length" is out of range. ' + - 'It must be >= 0. Received -1' + 'It must be >= 0. Received -1', }); [true, () => {}, {}, ''].forEach((value) => { @@ -84,7 +84,7 @@ assert.throws(() => { common.mustNotCall()); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -98,7 +98,7 @@ assert.throws(() => { common.mustNotCall()); }, { code: 'ERR_OUT_OF_RANGE', - name: 'RangeError' + name: 'RangeError', }); }); @@ -129,7 +129,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "buffer" argument must be an instance of Buffer, ' + - 'TypedArray, or DataView. Received type number (4)' + 'TypedArray, or DataView. Received type number (4)', } ); @@ -142,7 +142,7 @@ assert.throws( 0); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -167,7 +167,7 @@ assert.throws(() => { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. It must be an integer. ' + - 'Received NaN' + 'Received NaN', }); assert.throws(() => { @@ -180,7 +180,7 @@ assert.throws(() => { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "length" is out of range. ' + - 'It must be >= 0. Received -1' + 'It must be >= 0. Received -1', }); assert.throws(() => { @@ -193,7 +193,7 @@ assert.throws(() => { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "length" is out of range. ' + - 'It must be <= 4. Received 5' + 'It must be <= 4. Received 5', }); [true, () => {}, {}, ''].forEach((value) => { @@ -205,7 +205,7 @@ assert.throws(() => { value); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -218,7 +218,7 @@ assert.throws(() => { value); }, { code: 'ERR_OUT_OF_RANGE', - name: 'RangeError' + name: 'RangeError', }); }); diff --git a/test/parallel/test-fs-readdir-stack-overflow.js b/test/parallel/test-fs-readdir-stack-overflow.js index e35ad8736325b1..e05f0c207ceaab 100644 --- a/test/parallel/test-fs-readdir-stack-overflow.js +++ b/test/parallel/test-fs-readdir-stack-overflow.js @@ -14,6 +14,6 @@ assert.throws( () => recurse(), { name: 'RangeError', - message: 'Maximum call stack size exceeded' + message: 'Maximum call stack size exceeded', } ); diff --git a/test/parallel/test-fs-readdir-types.js b/test/parallel/test-fs-readdir-types.js index 9116a04f44ed70..9879ce0ffd24dc 100644 --- a/test/parallel/test-fs-readdir-types.js +++ b/test/parallel/test-fs-readdir-types.js @@ -20,7 +20,7 @@ const types = { isCharacterDevice: constants.UV_DIRENT_CHAR, isSymbolicLink: constants.UV_DIRENT_LINK, isFIFO: constants.UV_DIRENT_FIFO, - isSocket: constants.UV_DIRENT_SOCKET + isSocket: constants.UV_DIRENT_SOCKET, }; const typeMethods = Object.keys(types); @@ -52,28 +52,28 @@ function assertDirents(dirents) { assertDirents(fs.readdirSync(readdirDir, { withFileTypes: true })); fs.readdir(__filename, { - withFileTypes: true + withFileTypes: true, }, common.mustCall((err) => { assert.throws( () => { throw err; }, { code: 'ENOTDIR', name: 'Error', - message: `ENOTDIR: not a directory, scandir '${__filename}'` + message: `ENOTDIR: not a directory, scandir '${__filename}'`, } ); })); // Check the readdir async version fs.readdir(readdirDir, { - withFileTypes: true + withFileTypes: true, }, common.mustSucceed((dirents) => { assertDirents(dirents); })); (async () => { const dirents = await fs.promises.readdir(readdirDir, { - withFileTypes: true + withFileTypes: true, }); assertDirents(dirents); })().then(common.mustCall()); @@ -102,7 +102,7 @@ binding.readdir = common.mustCall((path, encoding, types, req, ctx) => { }, 2); assertDirents(fs.readdirSync(readdirDir, { withFileTypes: true })); fs.readdir(readdirDir, { - withFileTypes: true + withFileTypes: true, }, common.mustSucceed((dirents) => { assertDirents(dirents); })); diff --git a/test/parallel/test-fs-readdir.js b/test/parallel/test-fs-readdir.js index 6ae29045cdd7a3..e9d992c70b54af 100644 --- a/test/parallel/test-fs-readdir.js +++ b/test/parallel/test-fs-readdir.js @@ -40,14 +40,14 @@ fs.readdir(__filename, common.mustCall(function(e) { () => fs.readdir(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.readdirSync(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-readfile-error.js b/test/parallel/test-fs-readfile-error.js index 9d92638ed48dbe..b2ae50c7fb785d 100644 --- a/test/parallel/test-fs-readfile-error.js +++ b/test/parallel/test-fs-readfile-error.js @@ -62,6 +62,6 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', message: 'The "path" argument must be of type string or an instance of ' + 'Buffer or URL. Received type function ([Function (anonymous)])', - name: 'TypeError' + name: 'TypeError', } ); diff --git a/test/parallel/test-fs-readlink-type-check.js b/test/parallel/test-fs-readlink-type-check.js index 58d431308c76b1..a2fa1237a52e19 100644 --- a/test/parallel/test-fs-readlink-type-check.js +++ b/test/parallel/test-fs-readlink-type-check.js @@ -9,14 +9,14 @@ const fs = require('fs'); () => fs.readlink(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.readlinkSync(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-readv-sync.js b/test/parallel/test-fs-readv-sync.js index 9da39824d7f583..238d83e189840c 100644 --- a/test/parallel/test-fs-readv-sync.js +++ b/test/parallel/test-fs-readv-sync.js @@ -71,7 +71,7 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined]; assert.throws( () => fs.readvSync(fd, wrongInput, null), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -86,7 +86,7 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined]; () => fs.readvSync(wrongInput), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-readv.js b/test/parallel/test-fs-readv.js index 2ca79b302c636f..ee9068d8644122 100644 --- a/test/parallel/test-fs-readv.js +++ b/test/parallel/test-fs-readv.js @@ -73,7 +73,7 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined]; assert.throws( () => fs.readv(fd, wrongInput, null, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -88,7 +88,7 @@ const wrongInputs = [false, 'test', {}, [{}], ['sdf'], null, undefined]; () => fs.readv(wrongInput, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-realpath-pipe.js b/test/parallel/test-fs-realpath-pipe.js index 29fe1d3b7d28e1..923bcfe1be837f 100644 --- a/test/parallel/test-fs-realpath-pipe.js +++ b/test/parallel/test-fs-realpath-pipe.js @@ -29,7 +29,7 @@ for (const code of [ }`, ]) { const child = spawnSync(process.execPath, ['-e', code], { - stdio: 'pipe' + stdio: 'pipe', }); if (child.status !== 2) { console.log(code); diff --git a/test/parallel/test-fs-rename-type-check.js b/test/parallel/test-fs-rename-type-check.js index 09004dcb623b6c..5dc1b09c9e4197 100644 --- a/test/parallel/test-fs-rename-type-check.js +++ b/test/parallel/test-fs-rename-type-check.js @@ -12,7 +12,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: `The "oldPath" argument must be ${type}` + message: `The "oldPath" argument must be ${type}`, } ); assert.throws( @@ -20,7 +20,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: `The "newPath" argument must be ${type}` + message: `The "newPath" argument must be ${type}`, } ); assert.throws( @@ -28,7 +28,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: `The "oldPath" argument must be ${type}` + message: `The "oldPath" argument must be ${type}`, } ); assert.throws( @@ -36,7 +36,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: `The "newPath" argument must be ${type}` + message: `The "newPath" argument must be ${type}`, } ); }); diff --git a/test/parallel/test-fs-rm.js b/test/parallel/test-fs-rm.js index 5bb5d2de553eee..ea62655f7b9238 100644 --- a/test/parallel/test-fs-rm.js +++ b/test/parallel/test-fs-rm.js @@ -141,7 +141,7 @@ function removeAsync(dir) { }, { code: 'ENOENT', name: 'Error', - message: /^ENOENT: no such file or directory, stat/ + message: /^ENOENT: no such file or directory, stat/, }); // Should delete a file @@ -169,7 +169,7 @@ function removeAsync(dir) { // Removal should fail without the recursive option set to true. assert.rejects(fs.promises.rm(dir), { syscall: 'rm' }); assert.rejects(fs.promises.rm(dir, { recursive: false }), { - syscall: 'rm' + syscall: 'rm', }); // Recursive removal should succeed. @@ -185,7 +185,7 @@ function removeAsync(dir) { ), { code: 'ENOENT', name: 'Error', - message: /^ENOENT: no such file or directory, stat/ + message: /^ENOENT: no such file or directory, stat/, }); // Should not fail if target does not exist and force option is true @@ -213,25 +213,25 @@ function removeAsync(dir) { retryDelay: 100, maxRetries: 0, recursive: false, - force: false + force: false, }; const modified = { retryDelay: 953, maxRetries: 5, recursive: true, - force: false + force: false, }; assert.deepStrictEqual(validateRmOptionsSync(filePath), defaults); assert.deepStrictEqual(validateRmOptionsSync(filePath, {}), defaults); assert.deepStrictEqual(validateRmOptionsSync(filePath, modified), modified); assert.deepStrictEqual(validateRmOptionsSync(filePath, { - maxRetries: 99 + maxRetries: 99, }), { retryDelay: 100, maxRetries: 99, recursive: false, - force: false + force: false, }); [null, 'foo', 5, NaN].forEach((bad) => { @@ -240,7 +240,7 @@ function removeAsync(dir) { }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "options" argument must be of type object\./ + message: /^The "options" argument must be of type object\./, }); }); @@ -250,7 +250,7 @@ function removeAsync(dir) { }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "options\.recursive" property must be of type boolean\./ + message: /^The "options\.recursive" property must be of type boolean\./, }); }); @@ -260,7 +260,7 @@ function removeAsync(dir) { }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "options\.force" property must be of type boolean\./ + message: /^The "options\.force" property must be of type boolean\./, }); }); @@ -269,7 +269,7 @@ function removeAsync(dir) { }, { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', - message: /^The value of "options\.retryDelay" is out of range\./ + message: /^The value of "options\.retryDelay" is out of range\./, }); assert.throws(() => { @@ -277,6 +277,6 @@ function removeAsync(dir) { }, { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', - message: /^The value of "options\.maxRetries" is out of range\./ + message: /^The value of "options\.maxRetries" is out of range\./, }); } diff --git a/test/parallel/test-fs-rmdir-recursive.js b/test/parallel/test-fs-rmdir-recursive.js index 39934b5e42a11c..0af446ae5eb885 100644 --- a/test/parallel/test-fs-rmdir-recursive.js +++ b/test/parallel/test-fs-rmdir-recursive.js @@ -143,7 +143,7 @@ function removeAsync(dir) { // Removal should fail without the recursive option set to true. assert.rejects(fs.promises.rmdir(dir), { syscall: 'rmdir' }); assert.rejects(fs.promises.rmdir(dir, { recursive: false }), { - syscall: 'rmdir' + syscall: 'rmdir', }); // Recursive removal should succeed. @@ -162,23 +162,23 @@ function removeAsync(dir) { const defaults = { retryDelay: 100, maxRetries: 0, - recursive: false + recursive: false, }; const modified = { retryDelay: 953, maxRetries: 5, - recursive: true + recursive: true, }; assert.deepStrictEqual(validateRmdirOptions(), defaults); assert.deepStrictEqual(validateRmdirOptions({}), defaults); assert.deepStrictEqual(validateRmdirOptions(modified), modified); assert.deepStrictEqual(validateRmdirOptions({ - maxRetries: 99 + maxRetries: 99, }), { retryDelay: 100, maxRetries: 99, - recursive: false + recursive: false, }); [null, 'foo', 5, NaN].forEach((bad) => { @@ -187,7 +187,7 @@ function removeAsync(dir) { }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "options" argument must be of type object\./ + message: /^The "options" argument must be of type object\./, }); }); @@ -197,7 +197,7 @@ function removeAsync(dir) { }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "options\.recursive" property must be of type boolean\./ + message: /^The "options\.recursive" property must be of type boolean\./, }); }); @@ -206,7 +206,7 @@ function removeAsync(dir) { }, { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', - message: /^The value of "options\.retryDelay" is out of range\./ + message: /^The value of "options\.retryDelay" is out of range\./, }); assert.throws(() => { @@ -214,7 +214,7 @@ function removeAsync(dir) { }, { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', - message: /^The value of "options\.maxRetries" is out of range\./ + message: /^The value of "options\.maxRetries" is out of range\./, }); } diff --git a/test/parallel/test-fs-rmdir-type-check.js b/test/parallel/test-fs-rmdir-type-check.js index 7014ce27f8e345..a2038a688f7784 100644 --- a/test/parallel/test-fs-rmdir-type-check.js +++ b/test/parallel/test-fs-rmdir-type-check.js @@ -9,14 +9,14 @@ const fs = require('fs'); () => fs.rmdir(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.rmdirSync(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-stat.js b/test/parallel/test-fs-stat.js index 92a6ec8fa3280c..c9bf79662303f0 100644 --- a/test/parallel/test-fs-stat.js +++ b/test/parallel/test-fs-stat.js @@ -113,7 +113,7 @@ fs.stat(__filename, common.mustSucceed((s) => { () => fs[fnName](input), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -124,28 +124,28 @@ fs.stat(__filename, common.mustSucceed((s) => { () => fs.lstat(input, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.lstatSync(input), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.stat(input, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.statSync(input), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-stream-fs-options.js b/test/parallel/test-fs-stream-fs-options.js index 65144c0d617e9b..eb0ad22347e944 100644 --- a/test/parallel/test-fs-stream-fs-options.js +++ b/test/parallel/test-fs-stream-fs-options.js @@ -22,14 +22,14 @@ const originalFs = { fs }; if (fn === 'write') overrideFs.writev = null; const opts = { - fs: overrideFs + fs: overrideFs, }; assert.throws( () => fs.createWriteStream(file, opts), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: `The "options.fs.${fn}" property must be of type function. ` + - 'Received null' + 'Received null', }, `createWriteStream options.fs.${fn} should throw if isn't a function` ); @@ -40,14 +40,14 @@ const originalFs = { fs }; const file = path.join(tmpdir.path, 'write-end-test0.txt'); const overrideFs = Object.assign({}, originalFs.fs, { writev: 'not a fn' }); const opts = { - fs: overrideFs + fs: overrideFs, }; assert.throws( () => fs.createWriteStream(file, opts), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.fs.writev" property must be of type function. ' + - 'Received type string (\'not a fn\')' + 'Received type string (\'not a fn\')', }, 'createWriteStream options.fs.writev should throw if isn\'t a function' ); @@ -58,14 +58,14 @@ const originalFs = { fs }; readStreamOptions.forEach((fn) => { const overrideFs = Object.assign({}, originalFs.fs, { [fn]: null }); const opts = { - fs: overrideFs + fs: overrideFs, }; assert.throws( () => fs.createReadStream(file, opts), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: `The "options.fs.${fn}" property must be of type function. ` + - 'Received null' + 'Received null', }, `createReadStream options.fs.${fn} should throw if isn't a function` ); diff --git a/test/parallel/test-fs-symlink.js b/test/parallel/test-fs-symlink.js index 836dfeae17016c..8c1ce5ddb9b9d7 100644 --- a/test/parallel/test-fs-symlink.js +++ b/test/parallel/test-fs-symlink.js @@ -67,7 +67,7 @@ fs.symlink(linkData, linkPath, common.mustSucceed(() => { const errObj = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /target|path/ + message: /target|path/, }; assert.throws(() => fs.symlink(input, '', common.mustNotCall()), errObj); assert.throws(() => fs.symlinkSync(input, ''), errObj); @@ -80,7 +80,7 @@ const errObj = { code: 'ERR_FS_INVALID_SYMLINK_TYPE', name: 'Error', message: - 'Symlink type must be one of "dir", "file", or "junction". Received "🍏"' + 'Symlink type must be one of "dir", "file", or "junction". Received "🍏"', }; assert.throws(() => fs.symlink('', '', '🍏', common.mustNotCall()), errObj); assert.throws(() => fs.symlinkSync('', '', '🍏'), errObj); diff --git a/test/parallel/test-fs-syncwritestream.js b/test/parallel/test-fs-syncwritestream.js index 35591876e849d4..b4afc973302d02 100644 --- a/test/parallel/test-fs-syncwritestream.js +++ b/test/parallel/test-fs-syncwritestream.js @@ -28,7 +28,7 @@ const filename = path.join(tmpdir.path, 'stdout'); const stdoutFd = fs.openSync(filename, 'w'); const proc = spawn(process.execPath, [__filename, 'child'], { - stdio: ['inherit', stdoutFd, stdoutFd ] + stdio: ['inherit', stdoutFd, stdoutFd ], }); proc.on('close', common.mustCall(() => { diff --git a/test/parallel/test-fs-timestamp-parsing-error.js b/test/parallel/test-fs-timestamp-parsing-error.js index 1fe0294f68b714..a654f667bb27fe 100644 --- a/test/parallel/test-fs-timestamp-parsing-error.js +++ b/test/parallel/test-fs-timestamp-parsing-error.js @@ -10,7 +10,7 @@ const fs = require('fs'); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -20,7 +20,7 @@ assert.throws( }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); const okInputs = [1, -1, '1', '-1', Date.now()]; diff --git a/test/parallel/test-fs-truncate.js b/test/parallel/test-fs-truncate.js index de9687ebb27f0c..2807be22b5c40b 100644 --- a/test/parallel/test-fs-truncate.js +++ b/test/parallel/test-fs-truncate.js @@ -182,7 +182,7 @@ function testFtruncate(cb) { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: `The "len" argument must be of type number.${received}` + message: `The "len" argument must be of type number.${received}`, } ); @@ -191,7 +191,7 @@ function testFtruncate(cb) { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: `The "len" argument must be of type number.${received}` + message: `The "len" argument must be of type number.${received}`, } ); }); @@ -203,7 +203,7 @@ function testFtruncate(cb) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "len" is out of range. It must be ' + - `an integer. Received ${input}` + `an integer. Received ${input}`, } ); @@ -213,7 +213,7 @@ function testFtruncate(cb) { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "len" is out of range. It must be ' + - `an integer. Received ${input}` + `an integer. Received ${input}`, } ); }); @@ -262,7 +262,7 @@ function testFtruncate(cb) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "len" argument must be of type number.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), } ); }); @@ -275,7 +275,7 @@ function testFtruncate(cb) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "fd" argument must be of type number.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), } ); }); diff --git a/test/parallel/test-fs-unlink-type-check.js b/test/parallel/test-fs-unlink-type-check.js index 006e9ad7348543..80dc8dc826b848 100644 --- a/test/parallel/test-fs-unlink-type-check.js +++ b/test/parallel/test-fs-unlink-type-check.js @@ -9,14 +9,14 @@ const fs = require('fs'); () => fs.unlink(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.unlinkSync(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-util-validateoffsetlengthwrite.js b/test/parallel/test-fs-util-validateoffsetlengthwrite.js index 57fb7a9bc70674..eab274bfdf166e 100644 --- a/test/parallel/test-fs-util-validateoffsetlengthwrite.js +++ b/test/parallel/test-fs-util-validateoffsetlengthwrite.js @@ -21,7 +21,7 @@ const kIoMaxLength = 2 ** 31 - 1; code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - `It must be <= ${byteLength}. Received ${offset}` + `It must be <= ${byteLength}. Received ${offset}`, } ); } @@ -37,7 +37,7 @@ const kIoMaxLength = 2 ** 31 - 1; code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "length" is out of range. ' + - `It must be <= ${byteLength - offset}. Received ${length}` + `It must be <= ${byteLength - offset}. Received ${length}`, } ); } diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index 8f8286f8a3343f..6adc3a242bc44c 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -158,7 +158,7 @@ function runTests(iter) { const expectTypeError = { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }; // utimes-only error cases { @@ -196,7 +196,7 @@ const expectRangeError = { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "fd" is out of range. ' + - 'It must be >= 0 && <= 2147483647. Received -1' + 'It must be >= 0 && <= 2147483647. Received -1', }; // futimes-only error cases { diff --git a/test/parallel/test-fs-watch-enoent.js b/test/parallel/test-fs-watch-enoent.js index b76fa825e251a7..684d052790bf87 100644 --- a/test/parallel/test-fs-watch-enoent.js +++ b/test/parallel/test-fs-watch-enoent.js @@ -16,7 +16,7 @@ const nonexistentFile = path.join(tmpdir.path, 'non-existent'); const { internalBinding } = require('internal/test/binding'); const { UV_ENODEV, - UV_ENOENT + UV_ENOENT, } = internalBinding('uv'); tmpdir.refresh(); diff --git a/test/parallel/test-fs-watch.js b/test/parallel/test-fs-watch.js index 6fcf6c4df63fdc..e8590f7e394793 100644 --- a/test/parallel/test-fs-watch.js +++ b/test/parallel/test-fs-watch.js @@ -92,7 +92,7 @@ for (const testCase of cases) { () => fs.watch(input, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-watchfile.js b/test/parallel/test-fs-watchfile.js index 4e5af9d77bb15a..9f14a2ab92d35c 100644 --- a/test/parallel/test-fs-watchfile.js +++ b/test/parallel/test-fs-watchfile.js @@ -14,7 +14,7 @@ assert.throws( }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); assert.throws( @@ -23,7 +23,7 @@ assert.throws( }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => { diff --git a/test/parallel/test-fs-whatwg-url.js b/test/parallel/test-fs-whatwg-url.js index 829cfa92fafebd..6fc2541215ca7f 100644 --- a/test/parallel/test-fs-whatwg-url.js +++ b/test/parallel/test-fs-whatwg-url.js @@ -35,7 +35,7 @@ assert.throws( { code: 'ERR_INVALID_URL_SCHEME', name: 'TypeError', - message: 'The URL must be of scheme file' + message: 'The URL must be of scheme file', }); // pct-encoded characters in the path will be decoded and checked @@ -49,7 +49,7 @@ if (common.isWindows) { { code: 'ERR_INVALID_FILE_URL_PATH', name: 'TypeError', - message: 'File URL path must not include encoded \\ or / characters' + message: 'File URL path must not include encoded \\ or / characters', } ); }); @@ -61,7 +61,7 @@ if (common.isWindows) { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', message: 'The argument \'path\' must be a string or Uint8Array without ' + - "null bytes. Received 'c:\\\\tmp\\\\\\x00test'" + "null bytes. Received 'c:\\\\tmp\\\\\\x00test'", } ); } else { @@ -74,7 +74,7 @@ if (common.isWindows) { { code: 'ERR_INVALID_FILE_URL_PATH', name: 'TypeError', - message: 'File URL path must not include encoded / characters' + message: 'File URL path must not include encoded / characters', }); }); assert.throws( @@ -84,7 +84,7 @@ if (common.isWindows) { { code: 'ERR_INVALID_FILE_URL_HOST', name: 'TypeError', - message: `File URL host must be "localhost" or empty on ${os.platform()}` + message: `File URL host must be "localhost" or empty on ${os.platform()}`, } ); assert.throws( @@ -95,7 +95,7 @@ if (common.isWindows) { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', message: "The argument 'path' must be a string or Uint8Array without " + - "null bytes. Received '/tmp/\\x00test'" + "null bytes. Received '/tmp/\\x00test'", } ); } diff --git a/test/parallel/test-fs-write-buffer-large.js b/test/parallel/test-fs-write-buffer-large.js index a80072354eaa0f..80d9bc0b9421c1 100644 --- a/test/parallel/test-fs-write-buffer-large.js +++ b/test/parallel/test-fs-write-buffer-large.js @@ -33,7 +33,7 @@ fs.open(filename, 'w', 0o644, common.mustSucceed((fd) => { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "length" is out of range. ' + - 'It must be >= 0 && <= 2147483647. Received 2147483648' + 'It must be >= 0 && <= 2147483647. Received 2147483648', }); fs.closeSync(fd); diff --git a/test/parallel/test-fs-write-buffer.js b/test/parallel/test-fs-write-buffer.js index a70c44eaceffe5..c2026eb87822f6 100644 --- a/test/parallel/test-fs-write-buffer.js +++ b/test/parallel/test-fs-write-buffer.js @@ -140,7 +140,7 @@ tmpdir.refresh(); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "offset" is out of range. ' + - 'It must be an integer. Received NaN' + 'It must be an integer. Received NaN', }); fs.closeSync(fd); diff --git a/test/parallel/test-fs-write-file-invalid-path.js b/test/parallel/test-fs-write-file-invalid-path.js index a4c8ff5bf73a03..bc4e46978d557c 100644 --- a/test/parallel/test-fs-write-file-invalid-path.js +++ b/test/parallel/test-fs-write-file-invalid-path.js @@ -34,7 +34,7 @@ fs.writeFileSync(pathname, DATA_VALUE); let content = ''; const fileDataStream = fs.createReadStream(pathname, { - encoding: 'utf8' + encoding: 'utf8', }); fileDataStream.on('data', (data) => { diff --git a/test/parallel/test-fs-write-file-sync.js b/test/parallel/test-fs-write-file-sync.js index 2ef7d14365b781..ba354c6d68d0e0 100644 --- a/test/parallel/test-fs-write-file-sync.js +++ b/test/parallel/test-fs-write-file-sync.js @@ -108,7 +108,7 @@ tmpdir.refresh(); const data = { toString() { return 'hello world!'; - } + }, }; fs.writeFileSync(file, data, { encoding: 'utf8', flag: 'a' }); diff --git a/test/parallel/test-fs-write-stream-double-close.js b/test/parallel/test-fs-write-stream-double-close.js index 28e53061f74c3b..4065bb089739fa 100644 --- a/test/parallel/test-fs-write-stream-double-close.js +++ b/test/parallel/test-fs-write-stream-double-close.js @@ -38,7 +38,7 @@ tmpdir.refresh(); { const s = fs.createWriteStream(path.join(tmpdir.path, 'rw'), { - autoClose: false + autoClose: false, }); s.close(common.mustCall()); diff --git a/test/parallel/test-fs-write-stream-encoding.js b/test/parallel/test-fs-write-stream-encoding.js index 5803d99fd7b33d..259f549c87b60f 100644 --- a/test/parallel/test-fs-write-stream-encoding.js +++ b/test/parallel/test-fs-write-stream-encoding.js @@ -15,11 +15,11 @@ const dummyPath = path.join(tmpdir.path, 'x.txt'); tmpdir.refresh(); const exampleReadStream = fs.createReadStream(examplePath, { - encoding: firstEncoding + encoding: firstEncoding, }); const dummyWriteStream = fs.createWriteStream(dummyPath, { - encoding: firstEncoding + encoding: firstEncoding, }); exampleReadStream.pipe(dummyWriteStream).on('finish', function() { @@ -27,10 +27,10 @@ exampleReadStream.pipe(dummyWriteStream).on('finish', function() { write: function(chunk, enc, next) { const expected = Buffer.from('xyz\n'); assert(chunk.equals(expected)); - } + }, }); assertWriteStream.setDefaultEncoding(secondEncoding); fs.createReadStream(dummyPath, { - encoding: secondEncoding + encoding: secondEncoding, }).pipe(assertWriteStream); }); diff --git a/test/parallel/test-fs-write-stream-err.js b/test/parallel/test-fs-write-stream-err.js index 6d6f25b21f0e27..5a128539eaba4c 100644 --- a/test/parallel/test-fs-write-stream-err.js +++ b/test/parallel/test-fs-write-stream-err.js @@ -28,7 +28,7 @@ const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); const stream = fs.createWriteStream(`${tmpdir.path}/out`, { - highWaterMark: 10 + highWaterMark: 10, }); const err = new Error('BAM'); diff --git a/test/parallel/test-fs-write-stream-fs.js b/test/parallel/test-fs-write-stream-fs.js index 2e15f57c764838..c7e027d8a7e232 100644 --- a/test/parallel/test-fs-write-stream-fs.js +++ b/test/parallel/test-fs-write-stream-fs.js @@ -13,7 +13,7 @@ tmpdir.refresh(); open: common.mustCall(fs.open), write: common.mustCallAtLeast(fs.write, 1), close: common.mustCall(fs.close), - } + }, }); stream.end('asd'); stream.on('close', common.mustCall()); @@ -28,7 +28,7 @@ tmpdir.refresh(); write: fs.write, writev: common.mustCallAtLeast(fs.writev, 1), close: common.mustCall(fs.close), - } + }, }); stream.write('asd'); stream.write('asd'); diff --git a/test/parallel/test-fs-write-stream-throw-type-error.js b/test/parallel/test-fs-write-stream-throw-type-error.js index 77d546a61ace3d..f122a1823db13e 100644 --- a/test/parallel/test-fs-write-stream-throw-type-error.js +++ b/test/parallel/test-fs-write-stream-throw-type-error.js @@ -22,7 +22,7 @@ const createWriteStreamErr = (path, opt) => { }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }; diff --git a/test/parallel/test-fs-write-stream.js b/test/parallel/test-fs-write-stream.js index 9f422a644379e8..d064a1a70b0295 100644 --- a/test/parallel/test-fs-write-stream.js +++ b/test/parallel/test-fs-write-stream.js @@ -61,7 +61,7 @@ tmpdir.refresh(); stream.write(42); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); stream.destroy(); } diff --git a/test/parallel/test-fs-write.js b/test/parallel/test-fs-write.js index 30e25b15808dd2..e46e498024162a 100644 --- a/test/parallel/test-fs-write.js +++ b/test/parallel/test-fs-write.js @@ -133,7 +133,7 @@ fs.open(fn4, 'w', 0o644, common.mustSucceed((fd) => { }); const data = { - toString() { return expected; } + toString() { return expected; }, }; fs.write(fd, data, done); })); @@ -143,14 +143,14 @@ fs.open(fn4, 'w', 0o644, common.mustSucceed((fd) => { () => fs.write(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); assert.throws( () => fs.writeSync(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -160,14 +160,14 @@ fs.open(fn4, 'w', 0o644, common.mustSucceed((fd) => { () => fs.write(1, data, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - message: /"buffer"/ + message: /"buffer"/, } ); assert.throws( () => fs.writeSync(1, data), { code: 'ERR_INVALID_ARG_TYPE', - message: /"buffer"/ + message: /"buffer"/, } ); }); @@ -180,7 +180,7 @@ fs.open(fn4, 'w', 0o644, common.mustSucceed((fd) => { () => fs.writeSync(fd, 'abc', 0, 'hex'), { code: 'ERR_INVALID_ARG_VALUE', - message: /'encoding' is invalid for data of length 3/ + message: /'encoding' is invalid for data of length 3/, } ); @@ -188,7 +188,7 @@ fs.open(fn4, 'w', 0o644, common.mustSucceed((fd) => { () => fs.writeSync(fd, 'abc', 0, 'hex', common.mustNotCall()), { code: 'ERR_INVALID_ARG_VALUE', - message: /'encoding' is invalid for data of length 3/ + message: /'encoding' is invalid for data of length 3/, } ); diff --git a/test/parallel/test-fs-writev-sync.js b/test/parallel/test-fs-writev-sync.js index b01e85bcae19f7..1317ed59f839c2 100644 --- a/test/parallel/test-fs-writev-sync.js +++ b/test/parallel/test-fs-writev-sync.js @@ -67,7 +67,7 @@ const getFileName = (i) => path.join(tmpdir.path, `writev_sync_${i}.txt`); assert.throws( () => fs.writevSync(fd, i, null), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -81,7 +81,7 @@ const getFileName = (i) => path.join(tmpdir.path, `writev_sync_${i}.txt`); () => fs.writevSync(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-fs-writev.js b/test/parallel/test-fs-writev.js index a516f9c328f1b2..47de1b3620817f 100644 --- a/test/parallel/test-fs-writev.js +++ b/test/parallel/test-fs-writev.js @@ -68,7 +68,7 @@ const getFileName = (i) => path.join(tmpdir.path, `writev_${i}.txt`); assert.throws( () => fs.writev(fd, i, null, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -82,7 +82,7 @@ const getFileName = (i) => path.join(tmpdir.path, `writev_${i}.txt`); () => fs.writev(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-gc-http-client-connaborted.js b/test/parallel/test-gc-http-client-connaborted.js index fa6bf20c176560..30b020910ca77b 100644 --- a/test/parallel/test-gc-http-client-connaborted.js +++ b/test/parallel/test-gc-http-client-connaborted.js @@ -31,7 +31,7 @@ function getall() { const req = http.get({ hostname: 'localhost', pathname: '/', - port: server.address().port + port: server.address().port, }, cb).on('error', cb); count++; diff --git a/test/parallel/test-gc-http-client-onerror.js b/test/parallel/test-gc-http-client-onerror.js index 30b272ed94aae9..a3d57260e45d05 100644 --- a/test/parallel/test-gc-http-client-onerror.js +++ b/test/parallel/test-gc-http-client-onerror.js @@ -31,7 +31,7 @@ function getAll() { const req = http.get({ hostname: 'localhost', pathname: '/', - port: server.address().port + port: server.address().port, }, cb).on('error', onerror); count++; diff --git a/test/parallel/test-gc-http-client-timeout.js b/test/parallel/test-gc-http-client-timeout.js index 359f890dc3944e..b7b5647852bc45 100644 --- a/test/parallel/test-gc-http-client-timeout.js +++ b/test/parallel/test-gc-http-client-timeout.js @@ -32,7 +32,7 @@ function getall() { const req = http.get({ hostname: 'localhost', pathname: '/', - port: server.address().port + port: server.address().port, }, cb); req.setTimeout(10, function() { diff --git a/test/parallel/test-heapdump-async-hooks-init-promise.js b/test/parallel/test-heapdump-async-hooks-init-promise.js index c59cb89baa3d18..7e3334f40ddfa1 100644 --- a/test/parallel/test-heapdump-async-hooks-init-promise.js +++ b/test/parallel/test-heapdump-async-hooks-init-promise.js @@ -38,7 +38,7 @@ async_hooks.createHook({ destroy(id) { if (promiseIds.includes(id)) createSnapshot(); - } + }, }).enable(); diff --git a/test/parallel/test-heapsnapshot-near-heap-limit-worker.js b/test/parallel/test-heapsnapshot-near-heap-limit-worker.js index 46744cbd44d82c..f75c5f2ff03d5d 100644 --- a/test/parallel/test-heapsnapshot-near-heap-limit-worker.js +++ b/test/parallel/test-heapsnapshot-near-heap-limit-worker.js @@ -8,7 +8,7 @@ const fixtures = require('../common/fixtures'); const fs = require('fs'); const env = { ...process.env, - NODE_DEBUG_NATIVE: 'diagnostics' + NODE_DEBUG_NATIVE: 'diagnostics', }; { @@ -20,8 +20,8 @@ const env = { env: { TEST_SNAPSHOTS: 1, TEST_OLD_SPACE_SIZE: 50, - ...env - } + ...env, + }, }); console.log(child.stdout.toString()); const stderr = child.stderr.toString(); diff --git a/test/parallel/test-http-1.0-keep-alive.js b/test/parallel/test-http-1.0-keep-alive.js index 6d117035a5c727..c1f5a9f4c1be0d 100644 --- a/test/parallel/test-http-1.0-keep-alive.js +++ b/test/parallel/test-http-1.0-keep-alive.js @@ -31,19 +31,19 @@ check([{ expectClose: true, data: 'POST / HTTP/1.0\r\n' + 'Connection: keep-alive\r\n' + - '\r\n' + '\r\n', }, { expectClose: true, data: 'POST / HTTP/1.0\r\n' + 'Connection: keep-alive\r\n' + - '\r\n' + '\r\n', }], responses: [{ headers: { 'Connection': 'keep-alive' }, - chunks: ['OK'] + chunks: ['OK'], }, { - chunks: [] - }] + chunks: [], + }], }, { name: 'keep-alive, with TE: chunked', requests: [{ @@ -51,56 +51,56 @@ check([{ data: 'POST / HTTP/1.0\r\n' + 'Connection: keep-alive\r\n' + 'TE: chunked\r\n' + - '\r\n' + '\r\n', }, { expectClose: true, data: 'POST / HTTP/1.0\r\n' + - '\r\n' + '\r\n', }], responses: [{ headers: { 'Connection': 'keep-alive' }, - chunks: ['OK'] + chunks: ['OK'], }, { - chunks: [] - }] + chunks: [], + }], }, { name: 'keep-alive, with Transfer-Encoding: chunked', requests: [{ expectClose: false, data: 'POST / HTTP/1.0\r\n' + 'Connection: keep-alive\r\n' + - '\r\n' + '\r\n', }, { expectClose: true, data: 'POST / HTTP/1.0\r\n' + - '\r\n' + '\r\n', }], responses: [{ headers: { 'Connection': 'keep-alive', 'Transfer-Encoding': 'chunked' }, - chunks: ['OK'] + chunks: ['OK'], }, { - chunks: [] - }] + chunks: [], + }], }, { name: 'keep-alive, with Content-Length', requests: [{ expectClose: false, data: 'POST / HTTP/1.0\r\n' + 'Connection: keep-alive\r\n' + - '\r\n' + '\r\n', }, { expectClose: true, data: 'POST / HTTP/1.0\r\n' + - '\r\n' + '\r\n', }], responses: [{ headers: { 'Connection': 'keep-alive', 'Content-Length': '2' }, - chunks: ['OK'] + chunks: ['OK'], }, { - chunks: [] - }] + chunks: [], + }], }]); function check(tests) { diff --git a/test/parallel/test-http-abort-before-end.js b/test/parallel/test-http-abort-before-end.js index 5577f256ca2ec9..fc3ab48ecbe50f 100644 --- a/test/parallel/test-http-abort-before-end.js +++ b/test/parallel/test-http-abort-before-end.js @@ -29,7 +29,7 @@ server.listen(0, common.mustCall(() => { const req = http.request({ method: 'GET', host: '127.0.0.1', - port: server.address().port + port: server.address().port, }); req.on('abort', common.mustCall(() => { diff --git a/test/parallel/test-http-abort-client.js b/test/parallel/test-http-abort-client.js index 8a4666df1c28c3..0c6378fbdbe175 100644 --- a/test/parallel/test-http-abort-client.js +++ b/test/parallel/test-http-abort-client.js @@ -33,7 +33,7 @@ const server = http.Server(common.mustCall((req, res) => { server.listen(0, common.mustCall(() => { http.get({ port: server.address().port, - headers: { connection: 'keep-alive' } + headers: { connection: 'keep-alive' }, }, common.mustCall((res) => { server.close(); serverRes.destroy(); @@ -42,7 +42,7 @@ server.listen(0, common.mustCall(() => { res.on('end', common.mustNotCall()); res.on('aborted', common.mustCall()); res.on('error', common.expectsError({ - code: 'ECONNRESET' + code: 'ECONNRESET', })); res.on('close', common.mustCall()); res.socket.on('close', common.mustCall()); diff --git a/test/parallel/test-http-abort-queued.js b/test/parallel/test-http-abort-queued.js index 17950c106c3769..483c1a06ba193c 100644 --- a/test/parallel/test-http-abort-queued.js +++ b/test/parallel/test-http-abort-queued.js @@ -48,7 +48,7 @@ server.listen(0, common.mustCall(() => { port: server.address().port, method: 'GET', path: '/', - agent: agent + agent: agent, }; const req1 = http.request(options); @@ -61,7 +61,7 @@ server.listen(0, common.mustCall(() => { host: 'localhost', port: server.address().port, path: '/thatotherone', - agent: agent + agent: agent, }); assert.strictEqual(Object.keys(agent.sockets).length, 1); assert.strictEqual(Object.keys(agent.requests).length, 1); diff --git a/test/parallel/test-http-aborted.js b/test/parallel/test-http-aborted.js index e22e7ca4cc330f..876972d468965c 100644 --- a/test/parallel/test-http-aborted.js +++ b/test/parallel/test-http-aborted.js @@ -21,14 +21,14 @@ const assert = require('assert'); server.listen(0, common.mustCall(() => { const req = http.get({ port: server.address().port, - headers: { connection: 'keep-alive' } + headers: { connection: 'keep-alive' }, }, common.mustCall((res) => { res.on('aborted', common.mustCall(() => { assert.strictEqual(res.aborted, true); })); res.on('error', common.expectsError({ code: 'ECONNRESET', - message: 'aborted' + message: 'aborted', })); req.abort(); })); @@ -50,7 +50,7 @@ const assert = require('assert'); server.listen(0, common.mustCall(() => { const req = http.get({ port: server.address().port, - headers: { connection: 'keep-alive' } + headers: { connection: 'keep-alive' }, }, common.mustCall((res) => { res.on('aborted', common.mustCall(() => { assert.strictEqual(res.aborted, true); diff --git a/test/parallel/test-http-addrequest-localaddress.js b/test/parallel/test-http-addrequest-localaddress.js index 5e4da01ab4a22d..21e960a9f67958 100644 --- a/test/parallel/test-http-addrequest-localaddress.js +++ b/test/parallel/test-http-addrequest-localaddress.js @@ -10,7 +10,7 @@ const agent = require('http').globalAgent; // Small stub just so we can call addRequest directly const req = { - getHeader: () => {} + getHeader: () => {}, }; agent.maxSockets = 0; @@ -29,7 +29,7 @@ agent.addRequest(req, { host: 'localhost', port: 8080, localAddress: '127.0.0.1', - path: '/foo' + path: '/foo', }); assert.strictEqual(Object.keys(agent.requests).length, 1); assert.strictEqual( diff --git a/test/parallel/test-http-after-connect.js b/test/parallel/test-http-after-connect.js index d209c82083e639..598c42567e37af 100644 --- a/test/parallel/test-http-after-connect.js +++ b/test/parallel/test-http-after-connect.js @@ -44,7 +44,7 @@ server.listen(0, common.mustCall(() => { const req = http.request({ port: server.address().port, method: 'CONNECT', - path: 'google.com:80' + path: 'google.com:80', }); req.on('connect', common.mustCall((res, socket) => { socket.end(); @@ -60,7 +60,7 @@ server.listen(0, common.mustCall(() => { function doRequest(i) { http.get({ port: server.address().port, - path: `/request${i}` + path: `/request${i}`, }, common.mustCall((res) => { let data = ''; res.setEncoding('utf8'); diff --git a/test/parallel/test-http-agent-abort-controller.js b/test/parallel/test-http-agent-abort-controller.js index c5ece3ab353bf0..3009ba1d848cb7 100644 --- a/test/parallel/test-http-agent-abort-controller.js +++ b/test/parallel/test-http-agent-abort-controller.js @@ -13,7 +13,7 @@ server.listen(0, common.mustCall(async () => { const options = { port: port, host: host, - _agentKey: agent.getName({ port, host }) + _agentKey: agent.getName({ port, host }), }; async function postCreateConnection() { diff --git a/test/parallel/test-http-agent-close.js b/test/parallel/test-http-agent-close.js index 84ed5e57c5fb86..d40f6a73324e6b 100644 --- a/test/parallel/test-http-agent-close.js +++ b/test/parallel/test-http-agent-close.js @@ -11,7 +11,7 @@ agent.createSocket = function(req, options, cb) { const req = http .request({ - agent + agent, }) .on('error', common.mustCall((err) => { assert.strictEqual(err, _err); diff --git a/test/parallel/test-http-agent-destroyed-socket.js b/test/parallel/test-http-agent-destroyed-socket.js index 47123ed6c364b2..8c661ef5f141cd 100644 --- a/test/parallel/test-http-agent-destroyed-socket.js +++ b/test/parallel/test-http-agent-destroyed-socket.js @@ -37,7 +37,7 @@ const server = http.createServer(common.mustCall((req, res) => { agent: agent, host: 'localhost', port: server.address().port, - path: '/' + path: '/', }; const request1 = http.get(requestOptions, common.mustCall((response) => { diff --git a/test/parallel/test-http-agent-domain-reused-gc.js b/test/parallel/test-http-agent-domain-reused-gc.js index 9470b23b472662..3bfcf56fa1e0f1 100644 --- a/test/parallel/test-http-agent-domain-reused-gc.js +++ b/test/parallel/test-http-agent-domain-reused-gc.js @@ -29,7 +29,7 @@ async_hooks.createHook({ global.gc(); checkBeforeCalled(); } - } + }, }).enable(); // We use a DuplexPair rather than TLS sockets to keep the domain from being @@ -47,7 +47,7 @@ wrappedClientSide._handle.asyncReset = // Dummy server implementation, could be any server for this test... const server = http.createServer(common.mustCall((req, res) => { res.writeHead(200, { - 'Content-Type': 'text/plain' + 'Content-Type': 'text/plain', }); res.end('Hello, world!'); }, 2)); diff --git a/test/parallel/test-http-agent-error-on-idle.js b/test/parallel/test-http-agent-error-on-idle.js index 8edfa24811417a..720c9c0b095fae 100644 --- a/test/parallel/test-http-agent-error-on-idle.js +++ b/test/parallel/test-http-agent-error-on-idle.js @@ -16,7 +16,7 @@ server.listen(0, () => { host: 'localhost', port: server.address().port, agent: agent, - path: '/' + path: '/', }; const socketKey = agent.getName(requestParams); diff --git a/test/parallel/test-http-agent-false.js b/test/parallel/test-http-agent-false.js index 2f4505ef66ef3e..105716dc92933b 100644 --- a/test/parallel/test-http-agent-false.js +++ b/test/parallel/test-http-agent-false.js @@ -31,7 +31,7 @@ const opts = { port: null, path: '/', method: 'GET', - agent: false + agent: false, }; // We just want an "error" (no local HTTP server on port 80) or "response" diff --git a/test/parallel/test-http-agent-getname.js b/test/parallel/test-http-agent-getname.js index ab946a4bde3ddf..7cde35766fad84 100644 --- a/test/parallel/test-http-agent-getname.js +++ b/test/parallel/test-http-agent-getname.js @@ -13,7 +13,7 @@ const agent = new http.Agent(); assert.strictEqual( agent.getName({ port: 80, - localAddress: '192.168.1.1' + localAddress: '192.168.1.1', }), 'localhost:80:192.168.1.1' ); @@ -29,7 +29,7 @@ assert.strictEqual( agent.getName({ host: '0.0.0.0', port: 80, - localAddress: '192.168.1.1' + localAddress: '192.168.1.1', }), '0.0.0.0:80:192.168.1.1' ); @@ -38,7 +38,7 @@ assert.strictEqual( const socketPath = path.join(tmpdir.path, 'foo', 'bar'); assert.strictEqual( agent.getName({ - socketPath + socketPath, }), `localhost:::${socketPath}` ); diff --git a/test/parallel/test-http-agent-keepalive.js b/test/parallel/test-http-agent-keepalive.js index a1f902fab091e1..634d56520ae95f 100644 --- a/test/parallel/test-http-agent-keepalive.js +++ b/test/parallel/test-http-agent-keepalive.js @@ -31,7 +31,7 @@ const agent = new Agent({ keepAlive: true, keepAliveMsecs: 1000, maxSockets: 5, - maxFreeSockets: 5 + maxFreeSockets: 5, }); const server = http.createServer(common.mustCall((req, res) => { @@ -51,7 +51,7 @@ function get(path, callback) { host: 'localhost', port: server.address().port, agent: agent, - path: path + path: path, }, callback).on('socket', common.mustCall(checkListeners)); } diff --git a/test/parallel/test-http-agent-maxsockets-respected.js b/test/parallel/test-http-agent-maxsockets-respected.js index 51db7e2f492362..d58f0882733fdc 100644 --- a/test/parallel/test-http-agent-maxsockets-respected.js +++ b/test/parallel/test-http-agent-maxsockets-respected.js @@ -14,7 +14,7 @@ const agent = new http.Agent({ keepAlive: true, keepAliveMsecs: 1000, maxSockets: MAX_SOCKETS, - maxFreeSockets: 2 + maxFreeSockets: 2, }); const server = http.createServer( @@ -31,7 +31,7 @@ function get(path, callback) { host: 'localhost', port: server.address().port, agent: agent, - path: path + path: path, }, callback ); diff --git a/test/parallel/test-http-agent-maxsockets.js b/test/parallel/test-http-agent-maxsockets.js index 267f820e0435eb..c64690600cd3be 100644 --- a/test/parallel/test-http-agent-maxsockets.js +++ b/test/parallel/test-http-agent-maxsockets.js @@ -8,7 +8,7 @@ const agent = new http.Agent({ keepAlive: true, keepAliveMsecs: 1000, maxSockets: 2, - maxFreeSockets: 2 + maxFreeSockets: 2, }); const server = http.createServer(common.mustCall((req, res) => { @@ -22,7 +22,7 @@ function get(path, callback) { host: 'localhost', port: server.address().port, agent: agent, - path: path + path: path, }, callback); } diff --git a/test/parallel/test-http-agent-maxtotalsockets.js b/test/parallel/test-http-agent-maxtotalsockets.js index c44c8db627d330..1d65bcdba0c79a 100644 --- a/test/parallel/test-http-agent-maxtotalsockets.js +++ b/test/parallel/test-http-agent-maxtotalsockets.js @@ -37,7 +37,7 @@ function start(param = {}) { keepAliveMsecs: 1000, maxTotalSockets, maxSockets, - maxFreeSockets: 3 + maxFreeSockets: 3, }); const server = http.createServer(common.mustCall((req, res) => { diff --git a/test/parallel/test-http-agent-null.js b/test/parallel/test-http-agent-null.js index 0f87d098134b50..53caa1104bfc87 100644 --- a/test/parallel/test-http-agent-null.js +++ b/test/parallel/test-http-agent-null.js @@ -28,7 +28,7 @@ const server = http.createServer(common.mustCall((req, res) => { })).listen(0, common.mustCall(() => { const options = { agent: null, - port: server.address().port + port: server.address().port, }; http.get(options, common.mustCall((res) => { res.resume(); diff --git a/test/parallel/test-http-agent-remove.js b/test/parallel/test-http-agent-remove.js index 24fc7fcb8282fe..d0ea1316e4aa64 100644 --- a/test/parallel/test-http-agent-remove.js +++ b/test/parallel/test-http-agent-remove.js @@ -10,7 +10,7 @@ const server = http.createServer(mustCall((req, res) => { server.listen(0, mustCall(() => { const req = http.get({ - port: server.address().port + port: server.address().port, }, mustCall(() => { const { socket } = req; socket.emit('agentRemove'); diff --git a/test/parallel/test-http-agent-scheduling.js b/test/parallel/test-http-agent-scheduling.js index 768519d5977831..820e8da45ff8d4 100644 --- a/test/parallel/test-http-agent-scheduling.js +++ b/test/parallel/test-http-agent-scheduling.js @@ -51,7 +51,7 @@ function defaultTest() { const url = `http://localhost:${server.address().port}`; const agent = new http.Agent({ keepAlive: true, - maxSockets: 5 + maxSockets: 5, }); bulkRequest(url, agent, (ports) => { @@ -79,7 +79,7 @@ function fifoTest() { const agent = new http.Agent({ keepAlive: true, maxSockets: 5, - scheduling: 'fifo' + scheduling: 'fifo', }); bulkRequest(url, agent, (ports) => { @@ -107,7 +107,7 @@ function lifoTest() { const agent = new http.Agent({ keepAlive: true, maxSockets: 5, - scheduling: 'lifo' + scheduling: 'lifo', }); bulkRequest(url, agent, (ports) => { @@ -131,7 +131,7 @@ function badSchedulingOptionTest() { new http.Agent({ keepAlive: true, maxSockets: 5, - scheduling: 'filo' + scheduling: 'filo', }); } catch (err) { assert.strictEqual(err.code, 'ERR_INVALID_ARG_VALUE'); diff --git a/test/parallel/test-http-agent-timeout-option.js b/test/parallel/test-http-agent-timeout-option.js index 60a86779838520..3d10d026618441 100644 --- a/test/parallel/test-http-agent-timeout-option.js +++ b/test/parallel/test-http-agent-timeout-option.js @@ -10,7 +10,7 @@ const { Agent, get } = require('http'); const request = get({ agent: new Agent({ timeout: 50 }), - lookup: () => {} + lookup: () => {}, }); request.on('socket', mustCall((socket) => { diff --git a/test/parallel/test-http-allow-req-after-204-res.js b/test/parallel/test-http-allow-req-after-204-res.js index 84dd876985e2e6..f15cbc9a787150 100644 --- a/test/parallel/test-http-allow-req-after-204-res.js +++ b/test/parallel/test-http-allow-req-after-204-res.js @@ -42,7 +42,7 @@ function nextRequest() { const request = http.get({ port: server.address().port, - path: '/' + path: '/', }, common.mustCall((response) => { response.on('end', common.mustCall(() => { if (countdown.dec()) { diff --git a/test/parallel/test-http-automatic-headers.js b/test/parallel/test-http-automatic-headers.js index 5e99f1ee39dd6b..210ea1c3848ee3 100644 --- a/test/parallel/test-http-automatic-headers.js +++ b/test/parallel/test-http-automatic-headers.js @@ -16,7 +16,7 @@ server.on('listening', common.mustCall(() => { http.get({ port: server.address().port, path: '/hello', - agent: agent + agent: agent, }, common.mustCall((res) => { assert.strictEqual(res.statusCode, 200); assert.strictEqual(res.headers['x-date'], 'foo'); diff --git a/test/parallel/test-http-blank-header.js b/test/parallel/test-http-blank-header.js index 696b16f4995b57..13bfbde3e0bdff 100644 --- a/test/parallel/test-http-blank-header.js +++ b/test/parallel/test-http-blank-header.js @@ -31,7 +31,7 @@ const server = http.createServer(common.mustCall((req, res) => { assert.deepStrictEqual(req.headers, { host: 'example.org:443', origin: 'http://example.org', - cookie: '' + cookie: '', }); })); diff --git a/test/parallel/test-http-buffer-sanity.js b/test/parallel/test-http-buffer-sanity.js index 05c027fd482582..4493c4401e47d0 100644 --- a/test/parallel/test-http-buffer-sanity.js +++ b/test/parallel/test-http-buffer-sanity.js @@ -58,7 +58,7 @@ server.listen(0, common.mustCall(() => { port: server.address().port, method: 'POST', path: '/', - headers: { 'content-length': buffer.length } + headers: { 'content-length': buffer.length }, }, common.mustCall((res) => { res.setEncoding('utf8'); let data = ''; diff --git a/test/parallel/test-http-chunk-problem.js b/test/parallel/test-http-chunk-problem.js index ebfd940687947e..6c28e52195a7b0 100644 --- a/test/parallel/test-http-chunk-problem.js +++ b/test/parallel/test-http-chunk-problem.js @@ -10,7 +10,7 @@ if (process.argv[2] === 'request') { const http = require('http'); const options = { port: +process.argv[3], - path: '/' + path: '/', }; http.get(options, (res) => { diff --git a/test/parallel/test-http-chunked.js b/test/parallel/test-http-chunked.js index 264a87be6adc7f..f2c859eb2ff2e6 100644 --- a/test/parallel/test-http-chunked.js +++ b/test/parallel/test-http-chunked.js @@ -43,7 +43,7 @@ server.listen(0, common.mustCall(() => { http.get({ path: '/', host: 'localhost', - port: server.address().port + port: server.address().port, }, common.mustCall((x) => { x.setEncoding('utf8'); x.on('data', (c) => data += c); diff --git a/test/parallel/test-http-client-abort-event.js b/test/parallel/test-http-client-abort-event.js index 0392060196405c..f36d97b6c16434 100644 --- a/test/parallel/test-http-client-abort-event.js +++ b/test/parallel/test-http-client-abort-event.js @@ -7,7 +7,7 @@ const server = http.createServer(function(req, res) { server.listen(0, common.mustCall(function() { const req = http.request({ - port: this.address().port + port: this.address().port, }, common.mustNotCall()); req.on('abort', common.mustCall(function() { diff --git a/test/parallel/test-http-client-abort-keep-alive-destroy-res.js b/test/parallel/test-http-client-abort-keep-alive-destroy-res.js index 238430a83d31fd..691bce766de10c 100644 --- a/test/parallel/test-http-client-abort-keep-alive-destroy-res.js +++ b/test/parallel/test-http-client-abort-keep-alive-destroy-res.js @@ -19,7 +19,7 @@ server.listen(0, common.mustCall(() => { const port = server.address().port; const agent = new Agent({ keepAlive: true, - maxSockets: 1 + maxSockets: 1, }); const req = http.get({ agent, port }, common.mustCall((res) => { diff --git a/test/parallel/test-http-client-abort-keep-alive-queued-tcp-socket.js b/test/parallel/test-http-client-abort-keep-alive-queued-tcp-socket.js index c9614f01c3db3f..e33058d0ffe538 100644 --- a/test/parallel/test-http-client-abort-keep-alive-queued-tcp-socket.js +++ b/test/parallel/test-http-client-abort-keep-alive-queued-tcp-socket.js @@ -21,7 +21,7 @@ for (const destroyer of ['destroy', 'abort']) { const port = server.address().port; const agent = new Agent({ keepAlive: true, - maxSockets: 1 + maxSockets: 1, }); http.get({ agent, port }, (res) => res.resume()); diff --git a/test/parallel/test-http-client-abort-keep-alive-queued-unix-socket.js b/test/parallel/test-http-client-abort-keep-alive-queued-unix-socket.js index 745ed4ceeee887..b7c1fd8d355bf6 100644 --- a/test/parallel/test-http-client-abort-keep-alive-queued-unix-socket.js +++ b/test/parallel/test-http-client-abort-keep-alive-queued-unix-socket.js @@ -22,7 +22,7 @@ tmpdir.refresh(); server.listen(socketPath, common.mustCall(() => { const agent = new Agent({ keepAlive: true, - maxSockets: 1 + maxSockets: 1, }); http.get({ agent, socketPath }, (res) => res.resume()); diff --git a/test/parallel/test-http-client-abort-no-agent.js b/test/parallel/test-http-client-abort-no-agent.js index 2f9fda96d49b65..88a2aebf9c8e08 100644 --- a/test/parallel/test-http-client-abort-no-agent.js +++ b/test/parallel/test-http-client-abort-no-agent.js @@ -12,7 +12,7 @@ server.listen(0, common.mustCall(() => { socket.once('close', () => server.close()); return socket; }, - port: server.address().port + port: server.address().port, }); req.abort(); diff --git a/test/parallel/test-http-client-abort-response-event.js b/test/parallel/test-http-client-abort-response-event.js index c8a80f57884fb7..2348bc3d7f7bed 100644 --- a/test/parallel/test-http-client-abort-response-event.js +++ b/test/parallel/test-http-client-abort-response-event.js @@ -8,7 +8,7 @@ const server = http.createServer(function(req, res) { server.listen(0, common.mustCall(function() { const req = http.request({ - port: this.address().port + port: this.address().port, }, common.mustCall()); req.on('abort', common.mustCall(function() { diff --git a/test/parallel/test-http-client-abort-unix-socket.js b/test/parallel/test-http-client-abort-unix-socket.js index bf666b7935a3a6..17998bf4458a2e 100644 --- a/test/parallel/test-http-client-abort-unix-socket.js +++ b/test/parallel/test-http-client-abort-unix-socket.js @@ -18,7 +18,7 @@ tmpdir.refresh(); server.listen(common.PIPE, common.mustCall(() => { const req = http.get({ agent: new Agent(), - socketPath: common.PIPE + socketPath: common.PIPE, }); req.abort(); diff --git a/test/parallel/test-http-client-aborted-event.js b/test/parallel/test-http-client-aborted-event.js index b1401187705acb..6d0fde3dac13fb 100644 --- a/test/parallel/test-http-client-aborted-event.js +++ b/test/parallel/test-http-client-aborted-event.js @@ -12,13 +12,13 @@ const http = require('http'); server.listen(0, common.mustCall(function() { http.get({ port: this.address().port, - headers: { connection: 'keep-alive' } + headers: { connection: 'keep-alive' }, }, common.mustCall(function(res) { server.close(); serverRes.destroy(); res.on('aborted', common.mustCall()); res.on('error', common.expectsError({ - code: 'ECONNRESET' + code: 'ECONNRESET', })); })); })); @@ -35,7 +35,7 @@ const http = require('http'); server.listen(0, common.mustCall(function() { http.get({ port: this.address().port, - headers: { connection: 'keep-alive' } + headers: { connection: 'keep-alive' }, }, common.mustCall(function(res) { server.close(); serverRes.destroy(); diff --git a/test/parallel/test-http-client-agent-abort-close-event.js b/test/parallel/test-http-client-agent-abort-close-event.js index 69a48da232c369..9b4d2dba5ef2e2 100644 --- a/test/parallel/test-http-client-agent-abort-close-event.js +++ b/test/parallel/test-http-client-agent-abort-close-event.js @@ -10,7 +10,7 @@ const keepAliveAgent = new http.Agent({ keepAlive: true }); server.listen(0, common.mustCall(() => { const req = http.get({ port: server.address().port, - agent: keepAliveAgent + agent: keepAliveAgent, }); req diff --git a/test/parallel/test-http-client-agent-end-close-event.js b/test/parallel/test-http-client-agent-end-close-event.js index ce202f4d2f283c..f4b154a1155b2c 100644 --- a/test/parallel/test-http-client-agent-end-close-event.js +++ b/test/parallel/test-http-client-agent-end-close-event.js @@ -12,7 +12,7 @@ const keepAliveAgent = new http.Agent({ keepAlive: true }); server.listen(0, common.mustCall(() => { const req = http.get({ port: server.address().port, - agent: keepAliveAgent + agent: keepAliveAgent, }); req diff --git a/test/parallel/test-http-client-agent.js b/test/parallel/test-http-client-agent.js index 77616edd99d2fb..9638545c9ddb87 100644 --- a/test/parallel/test-http-client-agent.js +++ b/test/parallel/test-http-client-agent.js @@ -54,7 +54,7 @@ const countdown = new Countdown(max, () => { function request(i) { const req = http.get({ port: server.address().port, - path: `/${i}` + path: `/${i}`, }, function(res) { const socket = req.socket; socket.on('close', common.mustCall(() => { diff --git a/test/parallel/test-http-client-check-http-token.js b/test/parallel/test-http-client-check-http-token.js index ef2445ec66e520..0a5cd722ac508c 100644 --- a/test/parallel/test-http-client-check-http-token.js +++ b/test/parallel/test-http-client-check-http-token.js @@ -24,7 +24,7 @@ server.listen(0, common.mustCall(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.method" property must be of type string.' + - common.invalidArgTypeHelper(method) + common.invalidArgTypeHelper(method), }); }); diff --git a/test/parallel/test-http-client-default-headers-exist.js b/test/parallel/test-http-client-default-headers-exist.js index e19be4b7d70856..2dbecc5bd383be 100644 --- a/test/parallel/test-http-client-default-headers-exist.js +++ b/test/parallel/test-http-client-default-headers-exist.js @@ -33,7 +33,7 @@ const expectedHeaders = { 'OPTIONS': ['host', 'connection'], 'POST': ['host', 'connection', 'content-length'], 'PUT': ['host', 'connection', 'content-length'], - 'TRACE': ['host', 'connection'] + 'TRACE': ['host', 'connection'], }; const expectedMethods = Object.keys(expectedHeaders); @@ -63,7 +63,7 @@ server.listen(0, common.mustCall(() => { Promise.all(expectedMethods.map(async (method) => { const request = http.request({ method: method, - port: server.address().port + port: server.address().port, }).end(); return once(request, 'response'); })).then(common.mustCall(() => { server.close(); })); diff --git a/test/parallel/test-http-client-encoding.js b/test/parallel/test-http-client-encoding.js index a4701cdbd0abb1..e5b5f546e84ab0 100644 --- a/test/parallel/test-http-client-encoding.js +++ b/test/parallel/test-http-client-encoding.js @@ -30,7 +30,7 @@ const server = http.createServer((req, res) => { }).listen(0, common.mustCall(() => { http.request({ port: server.address().port, - encoding: 'utf8' + encoding: 'utf8', }, common.mustCall((res) => { let data = ''; res.on('data', (chunk) => data += chunk); diff --git a/test/parallel/test-http-client-finished.js b/test/parallel/test-http-client-finished.js index 2d7e5b95b3ca33..6c8d8492de95c6 100644 --- a/test/parallel/test-http-client-finished.js +++ b/test/parallel/test-http-client-finished.js @@ -12,7 +12,7 @@ const { finished } = require('stream'); server.listen(0, common.mustCall(function() { http.request({ - port: this.address().port + port: this.address().port, }) .on('response', (res) => { res.on('readable', () => { diff --git a/test/parallel/test-http-client-headers-array.js b/test/parallel/test-http-client-headers-array.js index 2665c3a97bcf77..5ce12cc192d7e0 100644 --- a/test/parallel/test-http-client-headers-array.js +++ b/test/parallel/test-http-client-headers-array.js @@ -10,7 +10,7 @@ function execute(options) { const expectHeaders = { 'x-foo': 'boom', 'cookie': 'a=1; b=2; c=3', - 'connection': 'close' + 'connection': 'close', }; // no Host header when you set headers an array @@ -32,7 +32,7 @@ function execute(options) { }).listen(0, function() { options = Object.assign(options, { port: this.address().port, - path: '/' + path: '/', }); const req = http.request(options); req.end(); diff --git a/test/parallel/test-http-client-headers-host-array.js b/test/parallel/test-http-client-headers-host-array.js index 53b25951413302..8771cf10b9e703 100644 --- a/test/parallel/test-http-client-headers-host-array.js +++ b/test/parallel/test-http-client-headers-host-array.js @@ -11,13 +11,13 @@ const http = require('http'); port: '80', path: '/', headers: { - host: [] - } + host: [], + }, }; assert.throws(() => { http.request(options); }, { - code: /ERR_INVALID_ARG_TYPE/ + code: /ERR_INVALID_ARG_TYPE/, }, 'http request should throw when passing array as header host'); } diff --git a/test/parallel/test-http-client-immediate-error.js b/test/parallel/test-http-client-immediate-error.js index ff29ad72bd8585..254e6639900d18 100644 --- a/test/parallel/test-http-client-immediate-error.js +++ b/test/parallel/test-http-client-immediate-error.js @@ -12,7 +12,7 @@ const { internalBinding } = require('internal/test/binding'); const { UV_ENETUNREACH } = internalBinding('uv'); const { newAsyncId, - symbols: { async_id_symbol } + symbols: { async_id_symbol }, } = require('internal/async_hooks'); const agent = new http.Agent(); @@ -25,7 +25,7 @@ agent.createConnection = common.mustCall((cfg) => { return UV_ENETUNREACH; }), readStart() {}, - close() {} + close() {}, }; // Simulate just enough socket handle initialization @@ -38,7 +38,7 @@ agent.createConnection = common.mustCall((cfg) => { http.get({ host: '127.0.0.1', port: 1, - agent + agent, }).on('error', common.mustCall((err) => { assert.strictEqual(err.code, 'ENETUNREACH'); })); diff --git a/test/parallel/test-http-client-incomingmessage-destroy.js b/test/parallel/test-http-client-incomingmessage-destroy.js index a0823d37786365..522a233109c8a8 100644 --- a/test/parallel/test-http-client-incomingmessage-destroy.js +++ b/test/parallel/test-http-client-incomingmessage-destroy.js @@ -18,7 +18,7 @@ process.on('uncaughtException', common.mustCall(onUncaught)); server.listen(0, () => { get({ - port: server.address().port + port: server.address().port, }, common.mustCall((res) => { res.destroy(new Error('Destroy test')); })); diff --git a/test/parallel/test-http-client-invalid-path.js b/test/parallel/test-http-client-invalid-path.js index c8d1fec18f9946..fff0af12348a70 100644 --- a/test/parallel/test-http-client-invalid-path.js +++ b/test/parallel/test-http-client-invalid-path.js @@ -5,9 +5,9 @@ const http = require('http'); assert.throws(() => { http.request({ - path: '/thisisinvalid\uffe2' + path: '/thisisinvalid\uffe2', }).end(); }, { code: 'ERR_UNESCAPED_CHARACTERS', - name: 'TypeError' + name: 'TypeError', }); diff --git a/test/parallel/test-http-client-keep-alive-release-before-finish.js b/test/parallel/test-http-client-keep-alive-release-before-finish.js index e6e0bac1bbac37..f2bcabe360ca12 100644 --- a/test/parallel/test-http-client-keep-alive-release-before-finish.js +++ b/test/parallel/test-http-client-keep-alive-release-before-finish.js @@ -7,7 +7,7 @@ const server = http.createServer((req, res) => { }).listen(0, common.mustCall(() => { const agent = new http.Agent({ maxSockets: 1, - keepAlive: true + keepAlive: true, }); const port = server.address().port; diff --git a/test/parallel/test-http-client-override-global-agent.js b/test/parallel/test-http-client-override-global-agent.js index f8b2928940e188..a27ae1aabb27ee 100644 --- a/test/parallel/test-http-client-override-global-agent.js +++ b/test/parallel/test-http-client-override-global-agent.js @@ -19,7 +19,7 @@ server.listen(0, common.mustCall(() => { function makeRequest() { const req = http.get({ - port: server.address().port + port: server.address().port, }); req.on('close', () => { assert.strictEqual(req.destroyed, true); diff --git a/test/parallel/test-http-client-parse-error.js b/test/parallel/test-http-client-parse-error.js index 2c18bdbede0139..c3cd95f49968c1 100644 --- a/test/parallel/test-http-client-parse-error.js +++ b/test/parallel/test-http-client-parse-error.js @@ -40,11 +40,11 @@ server.listen(0, common.mustCall(() => { for (let i = 0; i < 2; i++) { http.get({ port: server.address().port, - path: '/' + path: '/', }).on('error', common.mustCall((e) => { common.expectsError({ code: 'HPE_INVALID_CONSTANT', - message: 'Parse Error: Expected HTTP/' + message: 'Parse Error: Expected HTTP/', })(e); countdown.dec(); })); diff --git a/test/parallel/test-http-client-pipe-end.js b/test/parallel/test-http-client-pipe-end.js index ee88ce3d96672a..6347ae1f43497f 100644 --- a/test/parallel/test-http-client-pipe-end.js +++ b/test/parallel/test-http-client-pipe-end.js @@ -42,7 +42,7 @@ server.listen(common.PIPE, function() { socketPath: common.PIPE, headers: { 'Content-Length': '1' }, method: 'POST', - path: '/' + path: '/', }); req.write('.'); diff --git a/test/parallel/test-http-client-race-2.js b/test/parallel/test-http-client-race-2.js index 951b8e0d749261..38da4b570904d0 100644 --- a/test/parallel/test-http-client-race-2.js +++ b/test/parallel/test-http-client-race-2.js @@ -46,7 +46,7 @@ const server = http.createServer(function(req, res) { res.writeHead(200, { 'Content-Type': 'text/plain', - 'Content-Length': body.length + 'Content-Length': body.length, }); res.end(body); }); diff --git a/test/parallel/test-http-client-race.js b/test/parallel/test-http-client-race.js index 60b6b497372c7b..6fd4680c021f5c 100644 --- a/test/parallel/test-http-client-race.js +++ b/test/parallel/test-http-client-race.js @@ -32,7 +32,7 @@ const server = http.createServer(function(req, res) { const body = url.parse(req.url).pathname === '/1' ? body1_s : body2_s; res.writeHead(200, { 'Content-Type': 'text/plain', - 'Content-Length': body.length + 'Content-Length': body.length, }); res.end(body); }); diff --git a/test/parallel/test-http-client-read-in-error.js b/test/parallel/test-http-client-read-in-error.js index 5e38e49c1f6fde..fe13926597a9ed 100644 --- a/test/parallel/test-http-client-read-in-error.js +++ b/test/parallel/test-http-client-read-in-error.js @@ -34,7 +34,7 @@ class Agent extends http.Agent { const agent = new Agent(); http.request({ - agent + agent, }).once('error', function() { console.log('ignore'); this.on('data', common.mustNotCall()); diff --git a/test/parallel/test-http-client-readable.js b/test/parallel/test-http-client-readable.js index c35ab259f25f2b..e8815b8b6bd6d6 100644 --- a/test/parallel/test-http-client-readable.js +++ b/test/parallel/test-http-client-readable.js @@ -58,7 +58,7 @@ class FakeAgent extends http.Agent { let received = ''; const req = http.request({ - agent: new FakeAgent() + agent: new FakeAgent(), }, common.mustCall(function requestCallback(res) { res.on('data', function dataCallback(chunk) { received += chunk; diff --git a/test/parallel/test-http-client-reject-unexpected-agent.js b/test/parallel/test-http-client-reject-unexpected-agent.js index 8ec6506888bb05..eb827f068fd21e 100644 --- a/test/parallel/test-http-client-reject-unexpected-agent.js +++ b/test/parallel/test-http-client-reject-unexpected-agent.js @@ -54,7 +54,7 @@ server.listen(0, baseOptions.host, common.mustCall(function() { name: 'TypeError', message: 'The "options.agent" property must be one of Agent-like ' + 'Object, undefined, or false.' + - common.invalidArgTypeHelper(agent) + common.invalidArgTypeHelper(agent), } ); }); diff --git a/test/parallel/test-http-client-req-error-dont-double-fire.js b/test/parallel/test-http-client-req-error-dont-double-fire.js index b162df03d6df48..82c0b323c59f4a 100644 --- a/test/parallel/test-http-client-req-error-dont-double-fire.js +++ b/test/parallel/test-http-client-req-error-dont-double-fire.js @@ -15,7 +15,7 @@ const host = addresses.INVALID_HOST; const req = http.get({ host, - lookup: common.mustCall(errorLookupMock()) + lookup: common.mustCall(errorLookupMock()), }); const err = new Error('mock unexpected code error'); req.on('error', common.mustCall(() => { diff --git a/test/parallel/test-http-client-res-destroyed.js b/test/parallel/test-http-client-res-destroyed.js index 188ab06c155731..b30cd2593f4b1b 100644 --- a/test/parallel/test-http-client-res-destroyed.js +++ b/test/parallel/test-http-client-res-destroyed.js @@ -10,7 +10,7 @@ const http = require('http'); server.listen(0, common.mustCall(() => { http.get({ - port: server.address().port + port: server.address().port, }, common.mustCall((res) => { assert.strictEqual(res.destroyed, false); res.destroy(); @@ -29,7 +29,7 @@ const http = require('http'); server.listen(0, common.mustCall(() => { http.get({ - port: server.address().port + port: server.address().port, }, common.mustCall((res) => { assert.strictEqual(res.destroyed, false); res.on('close', common.mustCall(() => { diff --git a/test/parallel/test-http-client-response-domain.js b/test/parallel/test-http-client-response-domain.js index ace9efc7527087..0e853d678102fe 100644 --- a/test/parallel/test-http-client-response-domain.js +++ b/test/parallel/test-http-client-response-domain.js @@ -52,7 +52,7 @@ function test() { socketPath: common.PIPE, headers: { 'Content-Length': '1' }, method: 'POST', - path: '/' + path: '/', }); req.on('response', function(res) { res.on('end', function() { diff --git a/test/parallel/test-http-client-set-timeout.js b/test/parallel/test-http-client-set-timeout.js index 8cb83e3f1869d0..f7bbb2bfe6cdd3 100644 --- a/test/parallel/test-http-client-set-timeout.js +++ b/test/parallel/test-http-client-set-timeout.js @@ -34,7 +34,7 @@ server.listen(0, mustCall(() => { req.on('error', expectsError({ name: 'Error', code: 'ECONNRESET', - message: 'socket hang up' + message: 'socket hang up', })); req.on('close', mustCall(() => { diff --git a/test/parallel/test-http-client-spurious-aborted.js b/test/parallel/test-http-client-spurious-aborted.js index 850462dadc76f8..8287e66282fffa 100644 --- a/test/parallel/test-http-client-spurious-aborted.js +++ b/test/parallel/test-http-client-spurious-aborted.js @@ -45,7 +45,7 @@ function download() { const writable = new Writable({ write(chunk, encoding, callback) { callback(); - } + }, }); res.pipe(writable); const _handle = res.socket._handle; @@ -68,7 +68,7 @@ function download() { writable.end(); })); res.on('error', common.expectsError({ - code: 'ECONNRESET' + code: 'ECONNRESET', })); } diff --git a/test/parallel/test-http-client-timeout-event.js b/test/parallel/test-http-client-timeout-event.js index d5a63622bad03b..9857f7a646829d 100644 --- a/test/parallel/test-http-client-timeout-event.js +++ b/test/parallel/test-http-client-timeout-event.js @@ -28,7 +28,7 @@ const options = { method: 'GET', port: undefined, host: '127.0.0.1', - path: '/' + path: '/', }; const server = http.createServer(); diff --git a/test/parallel/test-http-client-timeout-option-listeners.js b/test/parallel/test-http-client-timeout-option-listeners.js index 1122eaf79e46f8..e08907d6ee99df 100644 --- a/test/parallel/test-http-client-timeout-option-listeners.js +++ b/test/parallel/test-http-client-timeout-option-listeners.js @@ -18,7 +18,7 @@ const options = { port: undefined, host: common.localhostIPv4, path: '/', - timeout: timeout + timeout: timeout, }; server.listen(0, options.host, common.mustCall(() => { diff --git a/test/parallel/test-http-client-timeout-option-with-agent.js b/test/parallel/test-http-client-timeout-option-with-agent.js index 833c21c8929b72..333eafa2f53069 100644 --- a/test/parallel/test-http-client-timeout-option-with-agent.js +++ b/test/parallel/test-http-client-timeout-option-with-agent.js @@ -10,7 +10,7 @@ const { strictEqual } = require('assert'); const request = get({ agent: new Agent({ timeout: 50 }), lookup: () => {}, - timeout: 100 + timeout: 100, }); request.on('socket', mustCall((socket) => { diff --git a/test/parallel/test-http-client-timeout-option.js b/test/parallel/test-http-client-timeout-option.js index 1003c28b5def56..2ae6864fef3bb6 100644 --- a/test/parallel/test-http-client-timeout-option.js +++ b/test/parallel/test-http-client-timeout-option.js @@ -12,7 +12,7 @@ const options = { port: undefined, host: '127.0.0.1', path: '/', - timeout: 1 + timeout: 1, }; const server = http.createServer(); diff --git a/test/parallel/test-http-client-timeout-with-data.js b/test/parallel/test-http-client-timeout-with-data.js index a3f7fdd9297356..8a9aba54faccb6 100644 --- a/test/parallel/test-http-client-timeout-with-data.js +++ b/test/parallel/test-http-client-timeout-with-data.js @@ -30,7 +30,7 @@ const options = { method: 'GET', port: undefined, host: '127.0.0.1', - path: '/' + path: '/', }; const server = http.createServer(function(req, res) { diff --git a/test/parallel/test-http-client-timeout.js b/test/parallel/test-http-client-timeout.js index b83bd1ddf010fe..9fb69593c7edfc 100644 --- a/test/parallel/test-http-client-timeout.js +++ b/test/parallel/test-http-client-timeout.js @@ -28,7 +28,7 @@ const options = { method: 'GET', port: undefined, host: '127.0.0.1', - path: '/' + path: '/', }; const server = http.createServer(function(req, res) { diff --git a/test/parallel/test-http-client-unescaped-path.js b/test/parallel/test-http-client-unescaped-path.js index 93b2f540f107bf..4865f31a50ce37 100644 --- a/test/parallel/test-http-client-unescaped-path.js +++ b/test/parallel/test-http-client-unescaped-path.js @@ -31,7 +31,7 @@ for (let i = 0; i <= 32; i += 1) { { code: 'ERR_UNESCAPED_CHARACTERS', name: 'TypeError', - message: 'Request path contains unescaped characters' + message: 'Request path contains unescaped characters', } ); } diff --git a/test/parallel/test-http-client-upload-buf.js b/test/parallel/test-http-client-upload-buf.js index 1c75612c807874..914cd2e2b2e99b 100644 --- a/test/parallel/test-http-client-upload-buf.js +++ b/test/parallel/test-http-client-upload-buf.js @@ -48,7 +48,7 @@ server.on('listening', common.mustCall(function() { const req = http.request({ port: this.address().port, method: 'POST', - path: '/' + path: '/', }, common.mustCall(function(res) { res.setEncoding('utf8'); res.on('data', function(chunk) { diff --git a/test/parallel/test-http-client-upload.js b/test/parallel/test-http-client-upload.js index 830c37da8ef567..506eaac53c8e46 100644 --- a/test/parallel/test-http-client-upload.js +++ b/test/parallel/test-http-client-upload.js @@ -49,7 +49,7 @@ server.on('listening', common.mustCall(function() { const req = http.request({ port: this.address().port, method: 'POST', - path: '/' + path: '/', }, common.mustCall(function(res) { res.setEncoding('utf8'); res.on('data', function(chunk) { diff --git a/test/parallel/test-http-conn-reset.js b/test/parallel/test-http-conn-reset.js index e218bbfdcea3f7..47b3f48af79f04 100644 --- a/test/parallel/test-http-conn-reset.js +++ b/test/parallel/test-http-conn-reset.js @@ -27,7 +27,7 @@ const net = require('net'); const options = { host: '127.0.0.1', - port: undefined + port: undefined, }; process.env.NODE_DEBUG = 'http'; diff --git a/test/parallel/test-http-connect-req-res.js b/test/parallel/test-http-connect-req-res.js index dfb83a41aa6236..6a15315fdf5331 100644 --- a/test/parallel/test-http-connect-req-res.js +++ b/test/parallel/test-http-connect-req-res.js @@ -30,7 +30,7 @@ server.listen(0, common.mustCall(function() { const req = http.request({ port: this.address().port, method: 'CONNECT', - path: 'example.com:443' + path: 'example.com:443', }, common.mustNotCall()); assert.strictEqual(req.destroyed, false); diff --git a/test/parallel/test-http-connect.js b/test/parallel/test-http-connect.js index b6053ba9d45187..866a2a87ac2526 100644 --- a/test/parallel/test-http-connect.js +++ b/test/parallel/test-http-connect.js @@ -55,7 +55,7 @@ server.listen(0, common.mustCall(() => { port: server.address().port, method: 'CONNECT', path: 'google.com:443', - timeout: 20000 + timeout: 20000, }, common.mustNotCall()); req.on('socket', common.mustCall((socket) => { diff --git a/test/parallel/test-http-content-length.js b/test/parallel/test-http-content-length.js index e6ba3719f95ba6..74bd12ba11436d 100644 --- a/test/parallel/test-http-content-length.js +++ b/test/parallel/test-http-content-length.js @@ -11,7 +11,7 @@ const expectedHeadersMultipleWrites = { const expectedHeadersEndWithData = { 'connection': 'close', - 'content-length': String('hello world'.length) + 'content-length': String('hello world'.length), }; const expectedHeadersEndNoData = { @@ -52,7 +52,7 @@ server.listen(0, function() { req = http.request({ port: this.address().port, method: 'POST', - path: '/multiple-writes' + path: '/multiple-writes', }); req.removeHeader('Date'); req.removeHeader('Host'); @@ -65,7 +65,7 @@ server.listen(0, function() { req = http.request({ port: this.address().port, method: 'POST', - path: '/end-with-data' + path: '/end-with-data', }); req.removeHeader('Date'); req.removeHeader('Host'); @@ -77,7 +77,7 @@ server.listen(0, function() { req = http.request({ port: this.address().port, method: 'POST', - path: '/empty' + path: '/empty', }); req.removeHeader('Date'); req.removeHeader('Host'); diff --git a/test/parallel/test-http-createConnection.js b/test/parallel/test-http-createConnection.js index 1425b964a75aa3..da39a6c1191579 100644 --- a/test/parallel/test-http-createConnection.js +++ b/test/parallel/test-http-createConnection.js @@ -48,10 +48,10 @@ const server = http.createServer(common.mustCall(function(req, res) { // Errors await assert.rejects(() => commonHttpGet(createConnectionError), { - message: 'sync' + message: 'sync', }); await assert.rejects(() => commonHttpGet(createConnectionAsyncError), { - message: 'async' + message: 'async', }); server.close(); diff --git a/test/parallel/test-http-date-header.js b/test/parallel/test-http-date-header.js index 169af2bf2a58c4..ef260c8ccc4d04 100644 --- a/test/parallel/test-http-date-header.js +++ b/test/parallel/test-http-date-header.js @@ -30,7 +30,7 @@ const server = http.createServer((req, res) => { assert.ok(!('date' in req.headers), 'Request headers contained a Date.'); res.writeHead(200, { - 'Content-Type': 'text/plain' + 'Content-Type': 'text/plain', }); res.end(testResBody); }); @@ -41,7 +41,7 @@ server.addListener('listening', () => { const options = { port: server.address().port, path: '/', - method: 'GET' + method: 'GET', }; const req = http.request(options, (res) => { assert.ok('date' in res.headers, diff --git a/test/parallel/test-http-default-encoding.js b/test/parallel/test-http-default-encoding.js index 8fcbf1a07f26ff..fe5e0d0a9c5da3 100644 --- a/test/parallel/test-http-default-encoding.js +++ b/test/parallel/test-http-default-encoding.js @@ -43,7 +43,7 @@ server.listen(0, function() { http.request({ port: this.address().port, path: '/', - method: 'POST' + method: 'POST', }, (res) => { console.log(res.statusCode); res.resume(); diff --git a/test/parallel/test-http-default-port.js b/test/parallel/test-http-default-port.js index 2005487502fe4f..3ad7f4f46d21a7 100644 --- a/test/parallel/test-http-default-port.js +++ b/test/parallel/test-http-default-port.js @@ -32,7 +32,7 @@ const assert = require('assert'); const hostExpect = 'localhost'; const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; for (const { mod, createServer } of [ @@ -51,8 +51,8 @@ for (const { mod, createServer } of [ host: 'localhost', rejectUnauthorized: false, headers: { - 'x-port': server.address().port - } + 'x-port': server.address().port, + }, }, common.mustCall((res) => { res.resume(); })); diff --git a/test/parallel/test-http-destroyed-socket-write2.js b/test/parallel/test-http-destroyed-socket-write2.js index 8511c43dddf155..4e4f48620330fe 100644 --- a/test/parallel/test-http-destroyed-socket-write2.js +++ b/test/parallel/test-http-destroyed-socket-write2.js @@ -41,7 +41,7 @@ server.listen(0, function() { const req = http.request({ port: this.address().port, path: '/', - method: 'POST' + method: 'POST', }); server.once(kResponseDestroyed, common.mustCall(function() { diff --git a/test/parallel/test-http-dns-error.js b/test/parallel/test-http-dns-error.js index 20e12f24fbf4f7..8c6afc9f768494 100644 --- a/test/parallel/test-http-dns-error.js +++ b/test/parallel/test-http-dns-error.js @@ -52,7 +52,7 @@ function tryRequest(mod, tries) { const req = mod.request({ method: 'GET', host: host, - port: 42 + port: 42, }, common.mustNotCall()); req.on('error', common.mustCall(function(err) { if (err.code === 'EAGAIN' && tries < MAX_TRIES) { diff --git a/test/parallel/test-http-double-content-length.js b/test/parallel/test-http-double-content-length.js index 53f924d652dd75..89bc1fd770de20 100644 --- a/test/parallel/test-http-double-content-length.js +++ b/test/parallel/test-http-double-content-length.js @@ -18,7 +18,7 @@ server.listen(0, () => { const req = http.get({ port: server.address().port, // Send two content-length header values. - headers: { 'Content-Length': [1, 2] } + headers: { 'Content-Length': [1, 2] }, }, common.mustNotCall('an error should have occurred')); req.on('error', common.mustCall(() => { server.close(); diff --git a/test/parallel/test-http-dump-req-when-res-ends.js b/test/parallel/test-http-dump-req-when-res-ends.js index 01dbbca1b393fb..bcd2bf69988f18 100644 --- a/test/parallel/test-http-dump-req-when-res-ends.js +++ b/test/parallel/test-http-dump-req-when-res-ends.js @@ -34,7 +34,7 @@ const server = http.createServer(mustCall(function(req, res) { server.listen(0, mustCall(function() { const req = http.request({ method: 'POST', - port: server.address().port + port: server.address().port, }); // Send the http request without waiting diff --git a/test/parallel/test-http-expect-continue.js b/test/parallel/test-http-expect-continue.js index 9d24a9278d82ea..940dab781e580c 100644 --- a/test/parallel/test-http-expect-continue.js +++ b/test/parallel/test-http-expect-continue.js @@ -34,7 +34,7 @@ const handler = common.mustCall((req, res) => { console.error('Server sending full response...'); res.writeHead(200, { 'Content-Type': 'text/plain', - 'ABCD': '1' + 'ABCD': '1', }); res.end(test_res_body); }); @@ -56,7 +56,7 @@ server.on('listening', common.mustCall(() => { port: server.address().port, method: 'POST', path: '/world', - headers: { 'Expect': '100-continue' } + headers: { 'Expect': '100-continue' }, }); console.error('Client sending request...'); let body = ''; diff --git a/test/parallel/test-http-expect-handling.js b/test/parallel/test-http-expect-handling.js index 0a39d49d923474..76d7ccd6c2aeb4 100644 --- a/test/parallel/test-http-expect-handling.js +++ b/test/parallel/test-http-expect-handling.js @@ -18,7 +18,7 @@ s.listen(0, nextTest); function nextTest() { const options = { port: s.address().port, - headers: { 'Expect': 'meoww' } + headers: { 'Expect': 'meoww' }, }; if (testIdx === tests.length) { diff --git a/test/parallel/test-http-full-response.js b/test/parallel/test-http-full-response.js index d08e091ebd9808..03220ae7071e58 100644 --- a/test/parallel/test-http-full-response.js +++ b/test/parallel/test-http-full-response.js @@ -33,7 +33,7 @@ const body = 'c'.repeat(bodyLength); const server = http.createServer(function(req, res) { res.writeHead(200, { 'Content-Length': bodyLength, - 'Content-Type': 'text/plain' + 'Content-Type': 'text/plain', }); res.end(body); }); diff --git a/test/parallel/test-http-generic-streams.js b/test/parallel/test-http-generic-streams.js index 706cba7b385957..1903d825163bc1 100644 --- a/test/parallel/test-http-generic-streams.js +++ b/test/parallel/test-http-generic-streams.js @@ -17,7 +17,7 @@ const MakeDuplexPair = require('../common/duplexpair'); server.emit('connection', serverSide); const req = http.request({ - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }, common.mustCall((res) => { res.setEncoding('utf8'); res.on('data', common.mustCall((data) => { @@ -43,7 +43,7 @@ const MakeDuplexPair = require('../common/duplexpair'); function doRequest(cb) { const req = http.request({ createConnection: common.mustCall(() => clientSide), - headers: { Connection: 'keep-alive' } + headers: { Connection: 'keep-alive' }, }, common.mustCall((res) => { res.setEncoding('utf8'); res.on('data', common.mustCall((data) => { @@ -85,7 +85,7 @@ const MakeDuplexPair = require('../common/duplexpair'); const req = http.request({ createConnection: common.mustCall(() => clientSide), method: 'PUT', - headers: { 'Connection': 'close' } + headers: { 'Connection': 'close' }, }, common.mustCall((res) => { res.setEncoding('utf8'); res.on('data', common.mustCall(function test3_res_data(data) { @@ -125,7 +125,7 @@ const MakeDuplexPair = require('../common/duplexpair'); const req = http.request({ createConnection: common.mustCall(() => clientSide), method: 'PUT', - headers: { 'Connection': 'close' } + headers: { 'Connection': 'close' }, }, common.mustCall((res) => { res.setEncoding('utf8'); assert.strictEqual(res.headers['content-length'], testData.length + ''); diff --git a/test/parallel/test-http-get-pipeline-problem.js b/test/parallel/test-http-get-pipeline-problem.js index b8b11e7e77c29a..8adc3eb67d11fc 100644 --- a/test/parallel/test-http-get-pipeline-problem.js +++ b/test/parallel/test-http-get-pipeline-problem.js @@ -50,7 +50,7 @@ const server = http.Server(function(req, res) { res.writeHead(200, { 'content-type': 'image/jpeg', 'connection': 'close', - 'content-length': image.length + 'content-length': image.length, }); res.end(image); }, 1); @@ -64,7 +64,7 @@ server.listen(0, function() { const opts = { port: server.address().port, - headers: { connection: 'close' } + headers: { connection: 'close' }, }; http.get(opts, function(res) { diff --git a/test/parallel/test-http-head-request.js b/test/parallel/test-http-head-request.js index 26d490d357dcfd..aefc7095de9ec3 100644 --- a/test/parallel/test-http-head-request.js +++ b/test/parallel/test-http-head-request.js @@ -37,7 +37,7 @@ function test(headers) { const request = http.request({ port: this.address().port, method: 'HEAD', - path: '/' + path: '/', }, common.mustCall(function(response) { console.error('response start'); response.on('end', common.mustCall(function() { @@ -50,8 +50,8 @@ function test(headers) { } test({ - 'Transfer-Encoding': 'chunked' + 'Transfer-Encoding': 'chunked', }); test({ - 'Content-Length': body.length + 'Content-Length': body.length, }); diff --git a/test/parallel/test-http-head-response-has-no-body-end.js b/test/parallel/test-http-head-response-has-no-body-end.js index 824a1bafe3a5e3..db072a9789ffe0 100644 --- a/test/parallel/test-http-head-response-has-no-body-end.js +++ b/test/parallel/test-http-head-response-has-no-body-end.js @@ -37,7 +37,7 @@ server.on('listening', common.mustCall(function() { const req = http.request({ port: this.address().port, method: 'HEAD', - path: '/' + path: '/', }, common.mustCall(function(res) { res.on('end', common.mustCall(function() { server.close(); diff --git a/test/parallel/test-http-head-response-has-no-body.js b/test/parallel/test-http-head-response-has-no-body.js index bd96d7161b7a4f..38277aa576324e 100644 --- a/test/parallel/test-http-head-response-has-no-body.js +++ b/test/parallel/test-http-head-response-has-no-body.js @@ -37,7 +37,7 @@ server.on('listening', common.mustCall(function() { const req = http.request({ port: this.address().port, method: 'HEAD', - path: '/' + path: '/', }, common.mustCall(function(res) { res.on('end', common.mustCall(function() { server.close(); diff --git a/test/parallel/test-http-header-obstext.js b/test/parallel/test-http-header-obstext.js index 23aea246d782f7..5b15d4c5bc5507 100644 --- a/test/parallel/test-http-header-obstext.js +++ b/test/parallel/test-http-header-obstext.js @@ -13,7 +13,7 @@ const server = http.createServer(common.mustCall((req, res) => { server.listen(0, () => { http.get({ port: server.address().port, - headers: { 'Test': 'Düsseldorf' } + headers: { 'Test': 'Düsseldorf' }, }, common.mustCall((res) => { assert.strictEqual(res.statusCode, 200); server.close(); diff --git a/test/parallel/test-http-header-overflow.js b/test/parallel/test-http-header-overflow.js index e53f5f05f81c31..5cbdfb4c52bee7 100644 --- a/test/parallel/test-http-header-overflow.js +++ b/test/parallel/test-http-header-overflow.js @@ -29,7 +29,7 @@ server.on('connection', mustCall((socket) => { message: 'Parse Error: Header overflow', code: 'HPE_HEADER_OVERFLOW', bytesParsed: maxHeaderSize + PAYLOAD_GET.length - (legacy ? -1 : 0), - rawPacket: Buffer.from(PAYLOAD) + rawPacket: Buffer.from(PAYLOAD), })); })); diff --git a/test/parallel/test-http-host-headers.js b/test/parallel/test-http-host-headers.js index 97d200ade1bb6a..ac1030f8370f3c 100644 --- a/test/parallel/test-http-host-headers.js +++ b/test/parallel/test-http-host-headers.js @@ -58,7 +58,7 @@ function testHttp() { path: `/${counter++}`, host: 'localhost', port: httpServer.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', common.mustNotCall()); http.request({ @@ -66,7 +66,7 @@ function testHttp() { path: `/${counter++}`, host: 'localhost', port: httpServer.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', common.mustNotCall()).end(); http.request({ @@ -74,7 +74,7 @@ function testHttp() { path: `/${counter++}`, host: 'localhost', port: httpServer.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', common.mustNotCall()).end(); http.request({ @@ -82,7 +82,7 @@ function testHttp() { path: `/${counter++}`, host: 'localhost', port: httpServer.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', common.mustNotCall()).end(); http.request({ @@ -90,7 +90,7 @@ function testHttp() { path: `/${counter++}`, host: 'localhost', port: httpServer.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', common.mustNotCall()).end(); }); } diff --git a/test/parallel/test-http-hostname-typechecking.js b/test/parallel/test-http-hostname-typechecking.js index bcb175ee34171b..e5f0b072bf603b 100644 --- a/test/parallel/test-http-hostname-typechecking.js +++ b/test/parallel/test-http-hostname-typechecking.js @@ -17,7 +17,7 @@ vals.forEach((v) => { name: 'TypeError', message: 'The "options.hostname" property must be of ' + 'type string or one of undefined or null.' + - received + received, } ); @@ -28,7 +28,7 @@ vals.forEach((v) => { name: 'TypeError', message: 'The "options.host" property must be of ' + 'type string or one of undefined or null.' + - received + received, } ); }); diff --git a/test/parallel/test-http-incoming-message-options.js b/test/parallel/test-http-incoming-message-options.js index 61e178eb47aeda..22c2e1260fcd85 100644 --- a/test/parallel/test-http-incoming-message-options.js +++ b/test/parallel/test-http-incoming-message-options.js @@ -12,7 +12,7 @@ server.listen(0, common.mustCall(() => { createConnection(options) { options.readableHighWaterMark = readableHighWaterMark; return net.createConnection(options); - } + }, }, common.mustCall((res) => { assert.strictEqual(res.socket, req.socket); assert.strictEqual(res.socket.readableHighWaterMark, readableHighWaterMark); diff --git a/test/parallel/test-http-information-headers.js b/test/parallel/test-http-information-headers.js index f5cfa5078b85ac..4ce511fbc0c91e 100644 --- a/test/parallel/test-http-information-headers.js +++ b/test/parallel/test-http-information-headers.js @@ -17,7 +17,7 @@ const server = http.createServer((req, res) => { console.error('Server sending full response...'); res.writeHead(200, { 'Content-Type': 'text/plain', - 'ABCD': '1' + 'ABCD': '1', }); res.end(test_res_body); }); @@ -25,7 +25,7 @@ const server = http.createServer((req, res) => { server.listen(0, function() { const req = http.request({ port: this.address().port, - path: '/world' + path: '/world', }); req.end(); console.error('Client sending request...'); diff --git a/test/parallel/test-http-information-processing.js b/test/parallel/test-http-information-processing.js index b9e5fea339ad0f..4a41bbee7a1ad5 100644 --- a/test/parallel/test-http-information-processing.js +++ b/test/parallel/test-http-information-processing.js @@ -15,7 +15,7 @@ const server = http.createServer((req, res) => { debug('Server sending full response...'); res.writeHead(200, { 'Content-Type': 'text/plain', - 'ABCD': '1' + 'ABCD': '1', }); res.end(testResBody); }); @@ -23,7 +23,7 @@ const server = http.createServer((req, res) => { server.listen(0, function() { const req = http.request({ port: this.address().port, - path: '/world' + path: '/world', }); req.end(); debug('Client sending request...'); diff --git a/test/parallel/test-http-insecure-parser-per-stream.js b/test/parallel/test-http-insecure-parser-per-stream.js index 2ba245c8f419b1..97e9cd41e25ae5 100644 --- a/test/parallel/test-http-insecure-parser-per-stream.js +++ b/test/parallel/test-http-insecure-parser-per-stream.js @@ -12,7 +12,7 @@ const MakeDuplexPair = require('../common/duplexpair'); const req = http.request({ createConnection: common.mustCall(() => clientSide), - insecureHTTPParser: true + insecureHTTPParser: true, }, common.mustCall((res) => { assert.strictEqual(res.headers.hello, 'foo\x08foo'); res.resume(); // We don’t actually care about contents. @@ -32,7 +32,7 @@ const MakeDuplexPair = require('../common/duplexpair'); const { clientSide, serverSide } = MakeDuplexPair(); const req = http.request({ - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }, common.mustNotCall()); req.end(); req.on('error', common.mustCall()); @@ -88,7 +88,7 @@ const MakeDuplexPair = require('../common/duplexpair'); common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', message: 'The "options.insecureHTTPParser" property must be of' + - ' type boolean. Received type number (0)' + ' type boolean. Received type number (0)', }) ); } diff --git a/test/parallel/test-http-invalid-path-chars.js b/test/parallel/test-http-invalid-path-chars.js index 56755faa8c835d..4887d9bfa62f91 100644 --- a/test/parallel/test-http-invalid-path-chars.js +++ b/test/parallel/test-http-invalid-path-chars.js @@ -14,7 +14,7 @@ for (let i = 0; i <= theExperimentallyDeterminedNumber; i++) { }, { code: 'ERR_UNESCAPED_CHARACTERS', name: 'TypeError', - message: 'Request path contains unescaped characters' + message: 'Request path contains unescaped characters', }); } } diff --git a/test/parallel/test-http-invalid-urls.js b/test/parallel/test-http-invalid-urls.js index a30c3eb5f65838..3aa42d5a888276 100644 --- a/test/parallel/test-http-invalid-urls.js +++ b/test/parallel/test-http-invalid-urls.js @@ -22,7 +22,7 @@ function test(host) { const throws = () => { modules[module][fn](host, doNotCall); }; assert.throws(throws, { name: 'TypeError', - code: 'ERR_INVALID_URL' + code: 'ERR_INVALID_URL', }); }); }); diff --git a/test/parallel/test-http-invalidheaderfield.js b/test/parallel/test-http-invalidheaderfield.js index 01315ba69044a2..a0440be5fb9eca 100644 --- a/test/parallel/test-http-invalidheaderfield.js +++ b/test/parallel/test-http-invalidheaderfield.js @@ -25,7 +25,7 @@ server.listen(0, function() { function() { const options = { port: server.address().port, - headers: { 'testing 123': 123 } + headers: { 'testing 123': 123 }, }; http.get(options, common.mustNotCall()); }, @@ -38,7 +38,7 @@ server.listen(0, function() { // Should not throw. const options = { port: server.address().port, - headers: { 'testing_123': 123 } + headers: { 'testing_123': 123 }, }; http.get(options, function() { ee.emit('done'); diff --git a/test/parallel/test-http-keep-alive-close-on-header.js b/test/parallel/test-http-keep-alive-close-on-header.js index fd0c52037fa78c..7841d518f464fc 100644 --- a/test/parallel/test-http-keep-alive-close-on-header.js +++ b/test/parallel/test-http-keep-alive-close-on-header.js @@ -44,7 +44,7 @@ server.listen(0, function() { path: '/', headers: headers, port: this.address().port, - agent: agent + agent: agent, }, function(res) { assert.strictEqual(agent.sockets[name].length, 1); res.resume(); @@ -61,7 +61,7 @@ server.listen(0, function() { path: '/', headers: headers, port: this.address().port, - agent: agent + agent: agent, }, function(res) { assert.strictEqual(agent.sockets[name].length, 1); res.resume(); @@ -77,7 +77,7 @@ server.listen(0, function() { path: '/', headers: headers, port: this.address().port, - agent: agent + agent: agent, }, function(response) { response.on('end', function() { assert.strictEqual(agent.sockets[name].length, 1); diff --git a/test/parallel/test-http-keep-alive-timeout-custom.js b/test/parallel/test-http-keep-alive-timeout-custom.js index a74aa5a2127b85..155614b1dd06d2 100644 --- a/test/parallel/test-http-keep-alive-timeout-custom.js +++ b/test/parallel/test-http-keep-alive-timeout-custom.js @@ -9,7 +9,7 @@ const server = http.createServer(common.mustCall((req, res) => { res.writeHead(200, { 'Content-Length': body.length, - 'Keep-Alive': 'timeout=50' + 'Keep-Alive': 'timeout=50', }); res.write(body); res.end(); @@ -20,7 +20,7 @@ const agent = new http.Agent({ maxSockets: 1, keepAlive: true }); server.listen(0, common.mustCall(function() { http.get({ - path: '/', port: this.address().port, agent: agent + path: '/', port: this.address().port, agent: agent, }, common.mustCall((response) => { response.resume(); assert.strictEqual( diff --git a/test/parallel/test-http-keep-alive-timeout.js b/test/parallel/test-http-keep-alive-timeout.js index 94f8adc4d86076..6c7c955f84c09d 100644 --- a/test/parallel/test-http-keep-alive-timeout.js +++ b/test/parallel/test-http-keep-alive-timeout.js @@ -17,7 +17,7 @@ const agent = new http.Agent({ maxSockets: 1, keepAlive: true }); server.listen(0, common.mustCall(function() { http.get({ - path: '/', port: this.address().port, agent: agent + path: '/', port: this.address().port, agent: agent, }, common.mustCall((response) => { response.resume(); assert.strictEqual( diff --git a/test/parallel/test-http-keep-alive.js b/test/parallel/test-http-keep-alive.js index bd075230d16db1..999d951dc5139b 100644 --- a/test/parallel/test-http-keep-alive.js +++ b/test/parallel/test-http-keep-alive.js @@ -39,7 +39,7 @@ let name; server.listen(0, common.mustCall(function() { name = agent.getName({ port: this.address().port }); http.get({ - path: '/', headers: headers, port: this.address().port, agent: agent + path: '/', headers: headers, port: this.address().port, agent: agent, }, common.mustCall((response) => { assert.strictEqual(agent.sockets[name].length, 1); assert.strictEqual(agent.requests[name].length, 2); @@ -47,7 +47,7 @@ server.listen(0, common.mustCall(function() { })); http.get({ - path: '/', headers: headers, port: this.address().port, agent: agent + path: '/', headers: headers, port: this.address().port, agent: agent, }, common.mustCall((response) => { assert.strictEqual(agent.sockets[name].length, 1); assert.strictEqual(agent.requests[name].length, 1); @@ -55,7 +55,7 @@ server.listen(0, common.mustCall(function() { })); http.get({ - path: '/', headers: headers, port: this.address().port, agent: agent + path: '/', headers: headers, port: this.address().port, agent: agent, }, common.mustCall((response) => { response.on('end', common.mustCall(() => { assert.strictEqual(agent.sockets[name].length, 1); diff --git a/test/parallel/test-http-keepalive-client.js b/test/parallel/test-http-keepalive-client.js index 5a9277feee9ae6..c8ff1953ac6902 100644 --- a/test/parallel/test-http-keepalive-client.js +++ b/test/parallel/test-http-keepalive-client.js @@ -59,7 +59,7 @@ function makeRequest(n) { const req = http.request({ port: server.address().port, agent: agent, - path: `/${n}` + path: `/${n}`, }); req.end(); diff --git a/test/parallel/test-http-keepalive-free.js b/test/parallel/test-http-keepalive-free.js index 0252c284962b39..43e0bbe322bdf5 100644 --- a/test/parallel/test-http-keepalive-free.js +++ b/test/parallel/test-http-keepalive-free.js @@ -15,7 +15,7 @@ for (const method of ['abort', 'destroy']) { const req = http .request({ port: server.address().port, - agent + agent, }) .on('socket', common.mustCall((socket) => { socket.on('free', common.mustCall()); diff --git a/test/parallel/test-http-keepalive-override.js b/test/parallel/test-http-keepalive-override.js index d25fc319747ad2..310cd80e379896 100644 --- a/test/parallel/test-http-keepalive-override.js +++ b/test/parallel/test-http-keepalive-override.js @@ -10,7 +10,7 @@ const server = http.createServer((req, res) => { const agent = http.Agent({ keepAlive: true, maxSockets: 5, - maxFreeSockets: 2 + maxFreeSockets: 2, }); const keepSocketAlive = agent.keepSocketAlive; @@ -45,7 +45,7 @@ const server = http.createServer((req, res) => { method: 'GET', path: '/', agent, - port: server.address().port + port: server.address().port, }, common.mustCall((res) => { res.resume(); res.once('end', common.mustCall(() => { diff --git a/test/parallel/test-http-keepalive-request.js b/test/parallel/test-http-keepalive-request.js index 574dea9ba562dc..a4956a707044bb 100644 --- a/test/parallel/test-http-keepalive-request.js +++ b/test/parallel/test-http-keepalive-request.js @@ -59,7 +59,7 @@ function makeRequest(n) { const req = http.request({ port: server.address().port, path: `/${n}`, - agent: agent + agent: agent, }); req.end(); diff --git a/test/parallel/test-http-localaddress-bind-error.js b/test/parallel/test-http-localaddress-bind-error.js index d4bd72bae1d5db..536fc08b1f38e2 100644 --- a/test/parallel/test-http-localaddress-bind-error.js +++ b/test/parallel/test-http-localaddress-bind-error.js @@ -42,7 +42,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { port: this.address().port, path: '/', method: 'GET', - localAddress: invalidLocalAddress + localAddress: invalidLocalAddress, }, function(res) { assert.fail('unexpectedly got response from server'); }).on('error', common.mustCall(function(e) { diff --git a/test/parallel/test-http-max-header-size-per-stream.js b/test/parallel/test-http-max-header-size-per-stream.js index 5edb8d3a954cef..a7bd5729e2d73b 100644 --- a/test/parallel/test-http-max-header-size-per-stream.js +++ b/test/parallel/test-http-max-header-size-per-stream.js @@ -12,7 +12,7 @@ const MakeDuplexPair = require('../common/duplexpair'); const req = http.request({ createConnection: common.mustCall(() => clientSide), - maxHeaderSize: http.maxHeaderSize * 4 + maxHeaderSize: http.maxHeaderSize * 4, }, common.mustCall((res) => { assert.strictEqual(res.headers.hello, 'A'.repeat(http.maxHeaderSize * 3)); res.resume(); // We don’t actually care about contents. @@ -32,7 +32,7 @@ const MakeDuplexPair = require('../common/duplexpair'); const { clientSide, serverSide } = MakeDuplexPair(); const req = http.request({ - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }, common.mustNotCall()); req.end(); req.on('error', common.mustCall()); diff --git a/test/parallel/test-http-max-headers-count.js b/test/parallel/test-http-max-headers-count.js index b707c62bfba8c7..f6fef014097c46 100644 --- a/test/parallel/test-http-max-headers-count.js +++ b/test/parallel/test-http-max-headers-count.js @@ -66,7 +66,7 @@ server.listen(0, function() { const expected = maxAndExpected[responses][1]; const req = http.request({ port: server.address().port, - headers: headers + headers: headers, }, function(res) { assert.strictEqual(Object.keys(res.headers).length, expected); res.on('end', function() { diff --git a/test/parallel/test-http-multi-line-headers.js b/test/parallel/test-http-multi-line-headers.js index 99c48cd97b58b9..fda013c0bdadf6 100644 --- a/test/parallel/test-http-multi-line-headers.js +++ b/test/parallel/test-http-multi-line-headers.js @@ -46,7 +46,7 @@ const server = net.createServer(function(conn) { server.listen(0, common.mustCall(function() { http.get({ host: '127.0.0.1', - port: this.address().port + port: this.address().port, }, common.mustCall(function(res) { assert.strictEqual(res.headers['content-type'], 'text/plain; x-unix-mode=0600; name="hello.txt"'); diff --git a/test/parallel/test-http-mutable-headers.js b/test/parallel/test-http-mutable-headers.js index 46f57832af156d..c20ebf9c2b75dd 100644 --- a/test/parallel/test-http-mutable-headers.js +++ b/test/parallel/test-http-mutable-headers.js @@ -55,7 +55,7 @@ const s = http.createServer(common.mustCall((req, res) => { { code: 'ERR_INVALID_HTTP_TOKEN', name: 'TypeError', - message: 'Header name must be a valid HTTP token ["undefined"]' + message: 'Header name must be a valid HTTP token ["undefined"]', } ); assert.throws( @@ -63,7 +63,7 @@ const s = http.createServer(common.mustCall((req, res) => { { code: 'ERR_HTTP_INVALID_HEADER_VALUE', name: 'TypeError', - message: 'Invalid value "undefined" for header "someHeader"' + message: 'Invalid value "undefined" for header "someHeader"', } ); assert.throws( @@ -72,7 +72,7 @@ const s = http.createServer(common.mustCall((req, res) => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "name" argument must be of type string. ' + - 'Received undefined' + 'Received undefined', } ); assert.throws( @@ -81,7 +81,7 @@ const s = http.createServer(common.mustCall((req, res) => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "name" argument must be of type string. ' + - 'Received undefined' + 'Received undefined', } ); @@ -99,7 +99,7 @@ const s = http.createServer(common.mustCall((req, res) => { 'x-test-header': 'testing', 'x-test-header2': 'testing', 'set-cookie': cookies, - 'x-test-array-header': arrayValues + 'x-test-array-header': arrayValues, }; Object.setPrototypeOf(expected, null); assert.deepStrictEqual(headersCopy, expected); @@ -129,7 +129,7 @@ const s = http.createServer(common.mustCall((req, res) => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "name" argument must be of type string.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), } ); }); @@ -177,7 +177,7 @@ function nextTest() { const req = http.get({ port: s.address().port, - headers: { 'X-foo': 'bar' } + headers: { 'X-foo': 'bar' }, }, common.mustCall((response) => { switch (test) { case 'headers': diff --git a/test/parallel/test-http-no-read-no-dump.js b/test/parallel/test-http-no-read-no-dump.js index 3f976bb087290c..ef931c791984a8 100644 --- a/test/parallel/test-http-no-read-no-dump.js +++ b/test/parallel/test-http-no-read-no-dump.js @@ -22,7 +22,7 @@ const server = http.createServer((req, res) => { }).listen(0, common.mustCall(() => { const agent = new http.Agent({ maxSockets: 1, - keepAlive: true + keepAlive: true, }); const port = server.address().port; diff --git a/test/parallel/test-http-outgoing-destroyed.js b/test/parallel/test-http-outgoing-destroyed.js index e0199a1cd5ef23..22f2232d00c83b 100644 --- a/test/parallel/test-http-outgoing-destroyed.js +++ b/test/parallel/test-http-outgoing-destroyed.js @@ -15,7 +15,7 @@ const server = http.createServer(common.mustCall((req, res) => { http .request({ port: server.address().port, - method: 'PUT' + method: 'PUT', }) .on('response', (res) => { res.destroy(); diff --git a/test/parallel/test-http-outgoing-end-cork.js b/test/parallel/test-http-outgoing-end-cork.js index 6a217238c447c4..59e1380f9e8461 100644 --- a/test/parallel/test-http-outgoing-end-cork.js +++ b/test/parallel/test-http-outgoing-end-cork.js @@ -56,7 +56,7 @@ const sendRequest = (agent) => new Promise((resolve, reject) => { http.get({ port: server.address().port, path: '/', - agent + agent, }, common.mustCall((res) => { const resData = []; res.on('data', (data) => resData.push(data)); diff --git a/test/parallel/test-http-outgoing-end-multiple.js b/test/parallel/test-http-outgoing-end-multiple.js index 696443f9390cd0..c71fc1a68350db 100644 --- a/test/parallel/test-http-outgoing-end-multiple.js +++ b/test/parallel/test-http-outgoing-end-multiple.js @@ -32,7 +32,7 @@ server.on('listening', common.mustCall(function() { .request({ port: server.address().port, method: 'GET', - path: '/' + path: '/', }) .end(); })); diff --git a/test/parallel/test-http-outgoing-end-types.js b/test/parallel/test-http-outgoing-end-types.js index 20b443bff2c1f5..52ddb826f80d3f 100644 --- a/test/parallel/test-http-outgoing-end-types.js +++ b/test/parallel/test-http-outgoing-end-types.js @@ -8,7 +8,7 @@ const httpServer = http.createServer(common.mustCall(function(req, res) { assert.throws(() => { res.end(['Throws.']); }, { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); res.end(); })); diff --git a/test/parallel/test-http-outgoing-finish-writable.js b/test/parallel/test-http-outgoing-finish-writable.js index e3c870164bac58..324dc8375f6b64 100644 --- a/test/parallel/test-http-outgoing-finish-writable.js +++ b/test/parallel/test-http-outgoing-finish-writable.js @@ -27,7 +27,7 @@ server.on('listening', common.mustCall(function() { const clientRequest = http.request({ port: server.address().port, method: 'GET', - path: '/' + path: '/', }); assert.strictEqual(clientRequest.writable, true); diff --git a/test/parallel/test-http-outgoing-finish.js b/test/parallel/test-http-outgoing-finish.js index f7931ec0dfa7e2..30d563ffb43f61 100644 --- a/test/parallel/test-http-outgoing-finish.js +++ b/test/parallel/test-http-outgoing-finish.js @@ -34,7 +34,7 @@ http.createServer(function(req, res) { }).listen(0, function() { const req = http.request({ port: this.address().port, - method: 'PUT' + method: 'PUT', }); write(req); req.on('response', function(res) { diff --git a/test/parallel/test-http-outgoing-finished.js b/test/parallel/test-http-outgoing-finished.js index 7da1b7429ae946..1b922c94389ac2 100644 --- a/test/parallel/test-http-outgoing-finished.js +++ b/test/parallel/test-http-outgoing-finished.js @@ -23,7 +23,7 @@ const server = http.createServer(function(req, res) { http .request({ port: this.address().port, - method: 'GET' + method: 'GET', }) .on('response', function(res) { res.resume(); diff --git a/test/parallel/test-http-outgoing-internal-headernames-setter.js b/test/parallel/test-http-outgoing-internal-headernames-setter.js index 5f943596dfb015..560b218d2a044a 100644 --- a/test/parallel/test-http-outgoing-internal-headernames-setter.js +++ b/test/parallel/test-http-outgoing-internal-headernames-setter.js @@ -10,6 +10,6 @@ common.expectWarning('DeprecationWarning', warn, 'DEP0066'); // Tests for _headerNames set method const outgoingMessage = new OutgoingMessage(); outgoingMessage._headerNames = { - 'x-flow-id': '61bba6c5-28a3-4eab-9241-2ecaa6b6a1fd' + 'x-flow-id': '61bba6c5-28a3-4eab-9241-2ecaa6b6a1fd', }; } diff --git a/test/parallel/test-http-outgoing-internal-headers.js b/test/parallel/test-http-outgoing-internal-headers.js index 7bd97bcb530955..9e8986837cebfd 100644 --- a/test/parallel/test-http-outgoing-internal-headers.js +++ b/test/parallel/test-http-outgoing-internal-headers.js @@ -21,13 +21,13 @@ common.expectWarning('DeprecationWarning', warn, 'DEP0066'); const outgoingMessage = new OutgoingMessage(); outgoingMessage._headers = { host: 'risingstack.com', - Origin: 'localhost' + Origin: 'localhost', }; assert.deepStrictEqual( Object.entries(outgoingMessage[kOutHeaders]), Object.entries({ host: ['host', 'risingstack.com'], - origin: ['Origin', 'localhost'] + origin: ['Origin', 'localhost'], })); } diff --git a/test/parallel/test-http-outgoing-message-capture-rejection.js b/test/parallel/test-http-outgoing-message-capture-rejection.js index 9fe9bdb21331d8..9c2ad1b8874774 100644 --- a/test/parallel/test-http-outgoing-message-capture-rejection.js +++ b/test/parallel/test-http-outgoing-message-capture-rejection.js @@ -26,7 +26,7 @@ events.captureRejections = true; const req = request({ method: 'GET', host: server.address().host, - port: server.address().port + port: server.address().port, }); req.end(); @@ -34,7 +34,7 @@ events.captureRejections = true; req.on('response', common.mustCall((res) => { res.on('aborted', common.mustCall()); res.on('error', common.expectsError({ - code: 'ECONNRESET' + code: 'ECONNRESET', })); res.resume(); server.close(); @@ -61,7 +61,7 @@ events.captureRejections = true; const req = request({ method: 'POST', host: server.address().host, - port: server.address().port + port: server.address().port, }); req.on('response', common.mustNotCall((res) => { diff --git a/test/parallel/test-http-outgoing-message-inheritance.js b/test/parallel/test-http-outgoing-message-inheritance.js index d0da4c68c3118f..a02a622ffab7eb 100644 --- a/test/parallel/test-http-outgoing-message-inheritance.js +++ b/test/parallel/test-http-outgoing-message-inheritance.js @@ -26,7 +26,7 @@ const ws = new Writable({ assert.strictEqual(chunk.length, 0); } setImmediate(callback); - }, 2) + }, 2), }); res.socket = ws; diff --git a/test/parallel/test-http-outgoing-message-write-callback.js b/test/parallel/test-http-outgoing-message-write-callback.js index 3a32285faaff55..49a8be93cdb8be 100644 --- a/test/parallel/test-http-outgoing-message-write-callback.js +++ b/test/parallel/test-http-outgoing-message-write-callback.js @@ -16,13 +16,13 @@ for (const method of ['GET, HEAD']) { const writable = new stream.Writable({ write(chunk, encoding, callback) { callback(); - } + }, }); const res = new http.ServerResponse({ method: method, httpVersionMajor: 1, - httpVersionMinor: 1 + httpVersionMinor: 1, }); res.assignSocket(writable); diff --git a/test/parallel/test-http-outgoing-properties.js b/test/parallel/test-http-outgoing-properties.js index ec25546c4b66ec..6d0ab9e52c2890 100644 --- a/test/parallel/test-http-outgoing-properties.js +++ b/test/parallel/test-http-outgoing-properties.js @@ -38,7 +38,7 @@ const OutgoingMessage = http.OutgoingMessage; const clientRequest = http.request({ port: server.address().port, method: 'GET', - path: '/' + path: '/', }); clientRequest.end(); })); @@ -64,7 +64,7 @@ const OutgoingMessage = http.OutgoingMessage; const req = http.request({ port: server.address().port, method: 'GET', - path: '/' + path: '/', }); assert.strictEqual(req.path, '/'); diff --git a/test/parallel/test-http-outgoing-proto.js b/test/parallel/test-http-outgoing-proto.js index 2d265c7ba64968..05a6af3f74fa7b 100644 --- a/test/parallel/test-http-outgoing-proto.js +++ b/test/parallel/test-http-outgoing-proto.js @@ -19,7 +19,7 @@ assert.throws(() => { }, { code: 'ERR_INVALID_HTTP_TOKEN', name: 'TypeError', - message: 'Header name must be a valid HTTP token ["undefined"]' + message: 'Header name must be a valid HTTP token ["undefined"]', }); assert.throws(() => { @@ -28,7 +28,7 @@ assert.throws(() => { }, { code: 'ERR_HTTP_INVALID_HEADER_VALUE', name: 'TypeError', - message: 'Invalid value "undefined" for header "test"' + message: 'Invalid value "undefined" for header "test"', }); assert.throws(() => { @@ -37,7 +37,7 @@ assert.throws(() => { }, { code: 'ERR_INVALID_HTTP_TOKEN', name: 'TypeError', - message: 'Header name must be a valid HTTP token ["404"]' + message: 'Header name must be a valid HTTP token ["404"]', }); assert.throws(() => { @@ -46,7 +46,7 @@ assert.throws(() => { }, { code: 'ERR_HTTP_HEADERS_SENT', name: 'Error', - message: 'Cannot set headers after they are sent to the client' + message: 'Cannot set headers after they are sent to the client', }); assert.throws(() => { @@ -55,7 +55,7 @@ assert.throws(() => { }, { code: 'ERR_INVALID_CHAR', name: 'TypeError', - message: 'Invalid character in header content ["200"]' + message: 'Invalid character in header content ["200"]', }); // write @@ -69,7 +69,7 @@ assert.throws(() => { { code: 'ERR_METHOD_NOT_IMPLEMENTED', name: 'Error', - message: 'The _implicitHeader() method is not implemented' + message: 'The _implicitHeader() method is not implemented', } ); } @@ -81,7 +81,7 @@ assert.throws(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "chunk" argument must be of type string or an instance of ' + - 'Buffer or Uint8Array. Received undefined' + 'Buffer or Uint8Array. Received undefined', }); assert.throws(() => { @@ -91,7 +91,7 @@ assert.throws(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "chunk" argument must be of type string or an instance of ' + - 'Buffer or Uint8Array. Received type number (1)' + 'Buffer or Uint8Array. Received type number (1)', }); assert.throws(() => { @@ -99,7 +99,7 @@ assert.throws(() => { outgoingMessage.write.call({ _header: 'test', _hasBody: 'test' }, null); }, { code: 'ERR_STREAM_NULL_VALUES', - name: 'TypeError' + name: 'TypeError', }); // addTrailers() @@ -117,7 +117,7 @@ assert.throws(() => { }, { code: 'ERR_INVALID_HTTP_TOKEN', name: 'TypeError', - message: 'Trailer name must be a valid HTTP token ["あ"]' + message: 'Trailer name must be a valid HTTP token ["あ"]', }); assert.throws(() => { @@ -126,7 +126,7 @@ assert.throws(() => { }, { code: 'ERR_INVALID_CHAR', name: 'TypeError', - message: 'Invalid character in trailer content ["404"]' + message: 'Invalid character in trailer content ["404"]', }); { diff --git a/test/parallel/test-http-outgoing-renderHeaders.js b/test/parallel/test-http-outgoing-renderHeaders.js index fa2de859cf4b02..6936ebd3d727a4 100644 --- a/test/parallel/test-http-outgoing-renderHeaders.js +++ b/test/parallel/test-http-outgoing-renderHeaders.js @@ -16,7 +16,7 @@ const OutgoingMessage = http.OutgoingMessage; { code: 'ERR_HTTP_HEADERS_SENT', name: 'Error', - message: 'Cannot render headers after they are sent to the client' + message: 'Cannot render headers after they are sent to the client', } ); } @@ -40,11 +40,11 @@ const OutgoingMessage = http.OutgoingMessage; const outgoingMessage = new OutgoingMessage(); outgoingMessage[kOutHeaders] = { host: ['host', 'nodejs.org'], - origin: ['Origin', 'localhost'] + origin: ['Origin', 'localhost'], }; const result = outgoingMessage._renderHeaders(); assert.deepStrictEqual(result, { host: 'nodejs.org', - Origin: 'localhost' + Origin: 'localhost', }); } diff --git a/test/parallel/test-http-outgoing-settimeout.js b/test/parallel/test-http-outgoing-settimeout.js index 3065c53f11191a..7d78d1ba7b0297 100644 --- a/test/parallel/test-http-outgoing-settimeout.js +++ b/test/parallel/test-http-outgoing-settimeout.js @@ -11,7 +11,7 @@ const { OutgoingMessage } = require('http'); outgoingMessage.socket = { setTimeout: common.mustCall((msecs) => { assert.strictEqual(msecs, expectedMsecs); - }) + }), }; outgoingMessage.setTimeout(expectedMsecs); } @@ -25,6 +25,6 @@ const { OutgoingMessage } = require('http'); outgoingMessage.emit('socket', { setTimeout: common.mustCall((msecs) => { assert.strictEqual(msecs, expectedMsecs); - }) + }), }); } diff --git a/test/parallel/test-http-outgoing-writableFinished.js b/test/parallel/test-http-outgoing-writableFinished.js index 6f84d91e714790..a7ad3212a87d51 100644 --- a/test/parallel/test-http-outgoing-writableFinished.js +++ b/test/parallel/test-http-outgoing-writableFinished.js @@ -19,7 +19,7 @@ server.on('listening', common.mustCall(function() { const clientRequest = http.request({ port: server.address().port, method: 'GET', - path: '/' + path: '/', }); assert.strictEqual(clientRequest.writableFinished, false); diff --git a/test/parallel/test-http-outgoing-write-types.js b/test/parallel/test-http-outgoing-write-types.js index 6257b87eea8eb1..6f9458c6949b39 100644 --- a/test/parallel/test-http-outgoing-write-types.js +++ b/test/parallel/test-http-outgoing-write-types.js @@ -8,7 +8,7 @@ const httpServer = http.createServer(common.mustCall(function(req, res) { assert.throws(() => { res.write(['Throws.']); }, { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); // should not throw res.write('1a2b3c'); diff --git a/test/parallel/test-http-parser-freed-before-upgrade.js b/test/parallel/test-http-parser-freed-before-upgrade.js index d0f1409f1d2b43..21c52b568590d2 100644 --- a/test/parallel/test-http-parser-freed-before-upgrade.js +++ b/test/parallel/test-http-parser-freed-before-upgrade.js @@ -21,8 +21,8 @@ server.listen(common.mustCall(() => { port: server.address().port, headers: { Connection: 'Upgrade', - Upgrade: 'WebSocket' - } + Upgrade: 'WebSocket', + }, }); request.on('upgrade', common.mustCall((response, socket) => { diff --git a/test/parallel/test-http-parser-lazy-loaded.js b/test/parallel/test-http-parser-lazy-loaded.js index 44bb59f052e6ce..9ea20983374a57 100644 --- a/test/parallel/test-http-parser-lazy-loaded.js +++ b/test/parallel/test-http-parser-lazy-loaded.js @@ -33,7 +33,7 @@ if (process.argv[2] !== 'child') { const child = spawn(process.execPath, [ '--expose-internals', __filename, 'child', ], { - stdio: ['inherit', 'inherit', 'inherit', 'ipc'] + stdio: ['inherit', 'inherit', 'inherit', 'ipc'], }); child.on('exit', common.mustCall((code, signal) => { assert.strictEqual(code, 0); diff --git a/test/parallel/test-http-pause-no-dump.js b/test/parallel/test-http-pause-no-dump.js index b794634c489326..777308f87bb45f 100644 --- a/test/parallel/test-http-pause-no-dump.js +++ b/test/parallel/test-http-pause-no-dump.js @@ -20,7 +20,7 @@ server.on('listening', common.mustCall(function() { const req = http.request({ port: this.address().port, method: 'POST', - path: '/' + path: '/', }, common.mustCall(function(res) { assert.strictEqual(res.statusCode, 200); res.resume(); diff --git a/test/parallel/test-http-pause-resume-one-end.js b/test/parallel/test-http-pause-resume-one-end.js index 34bf3be478f09c..dd8700f709de71 100644 --- a/test/parallel/test-http-pause-resume-one-end.js +++ b/test/parallel/test-http-pause-resume-one-end.js @@ -33,7 +33,7 @@ const server = http.Server(function(req, res) { server.listen(0, common.mustCall(function() { const opts = { port: this.address().port, - headers: { connection: 'close' } + headers: { connection: 'close' }, }; http.get(opts, common.mustCall(function(res) { diff --git a/test/parallel/test-http-pause.js b/test/parallel/test-http-pause.js index 555eece2e3f13b..e76f33840bd42f 100644 --- a/test/parallel/test-http-pause.js +++ b/test/parallel/test-http-pause.js @@ -53,7 +53,7 @@ server.listen(0, function() { const req = http.request({ port: this.address().port, path: '/', - method: 'POST' + method: 'POST', }, (res) => { console.error('pause client response'); res.pause(); diff --git a/test/parallel/test-http-perf_hooks.js b/test/parallel/test-http-perf_hooks.js index 826211472f222c..b074bbde58558c 100644 --- a/test/parallel/test-http-perf_hooks.js +++ b/test/parallel/test-http-perf_hooks.js @@ -46,13 +46,13 @@ server.listen(0, common.mustCall(async () => { port: server.address().port, path: '/', method: 'POST', - data: expected + data: expected, }), makeRequest({ port: server.address().port, path: '/', method: 'POST', - data: expected + data: expected, }), ]); server.close(); diff --git a/test/parallel/test-http-pipe-fs.js b/test/parallel/test-http-pipe-fs.js index dfb44ff3b25d99..4e7160fc7ca4ca 100644 --- a/test/parallel/test-http-pipe-fs.js +++ b/test/parallel/test-http-pipe-fs.js @@ -49,8 +49,8 @@ const server = http.createServer(common.mustCall(function(req, res) { port: server.address().port, method: 'POST', headers: { - 'Content-Length': 5 - } + 'Content-Length': 5, + }, }, function(res) { res.on('end', function() { console.error(`res${i + 1} end`); diff --git a/test/parallel/test-http-proxy.js b/test/parallel/test-http-proxy.js index af3497630b7f79..ebb98d766fa51d 100644 --- a/test/parallel/test-http-proxy.js +++ b/test/parallel/test-http-proxy.js @@ -45,7 +45,7 @@ const proxy = http.createServer(function(req, res) { console.error(`proxy req headers: ${JSON.stringify(req.headers)}`); http.get({ port: backend.address().port, - path: url.parse(req.url).pathname + path: url.parse(req.url).pathname, }, function(proxy_res) { console.error(`proxy res headers: ${JSON.stringify(proxy_res.headers)}`); @@ -76,7 +76,7 @@ function startReq() { http.get({ port: proxy.address().port, - path: '/test' + path: '/test', }, function(res) { console.error('got res'); assert.strictEqual(res.statusCode, 200); diff --git a/test/parallel/test-http-raw-headers.js b/test/parallel/test-http-raw-headers.js index d77a7cacc64c29..489801ead0b6d0 100644 --- a/test/parallel/test-http-raw-headers.js +++ b/test/parallel/test-http-raw-headers.js @@ -40,7 +40,7 @@ http.createServer(function(req, res) { 'host': `localhost:${this.address().port}`, 'transfer-encoding': 'CHUNKED', 'x-bar': 'yoyoyo', - 'connection': 'close' + 'connection': 'close', }; const expectRawTrailers = [ 'x-bAr', @@ -99,7 +99,7 @@ http.createServer(function(req, res) { 'trailer': 'x-foo', 'date': null, 'connection': 'close', - 'transfer-encoding': 'chunked' + 'transfer-encoding': 'chunked', }; res.rawHeaders[3] = null; res.headers.date = null; diff --git a/test/parallel/test-http-readable-data-event.js b/test/parallel/test-http-readable-data-event.js index 643176ec7b066a..c4951fc9ec528f 100644 --- a/test/parallel/test-http-readable-data-event.js +++ b/test/parallel/test-http-readable-data-event.js @@ -10,7 +10,7 @@ let next = null; const server = http.createServer((req, res) => { res.writeHead(200, { - 'Content-Length': `${(helloWorld.length + helloAgainLater.length)}` + 'Content-Length': `${(helloWorld.length + helloAgainLater.length)}`, }); // We need to make sure the data is flushed @@ -25,7 +25,7 @@ const server = http.createServer((req, res) => { const opts = { hostname: 'localhost', port: server.address().port, - path: '/' + path: '/', }; const expectedData = [helloWorld, helloAgainLater]; diff --git a/test/parallel/test-http-request-agent.js b/test/parallel/test-http-request-agent.js index 453ac380d0908f..ce7ad55bc52037 100644 --- a/test/parallel/test-http-request-agent.js +++ b/test/parallel/test-http-request-agent.js @@ -14,7 +14,7 @@ const https = require('https'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = https.createServer(options, function(req, res) { @@ -28,7 +28,7 @@ server.listen(0, common.mustCall(function() { agent: false, path: '/', port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function(res) { console.error(res.statusCode, res.headers); res.resume(); diff --git a/test/parallel/test-http-request-dont-override-options.js b/test/parallel/test-http-request-dont-override-options.js index 19b847dc0390f5..ab11509d46c1e5 100644 --- a/test/parallel/test-http-request-dont-override-options.js +++ b/test/parallel/test-http-request-dont-override-options.js @@ -24,7 +24,7 @@ server.listen(0, function() { defaultPort: undefined, path: undefined, method: undefined, - agent: agent + agent: agent, }; http.request(options, function(res) { diff --git a/test/parallel/test-http-request-end.js b/test/parallel/test-http-request-end.js index c9278945b7993b..e38595dcbe3436 100644 --- a/test/parallel/test-http-request-end.js +++ b/test/parallel/test-http-request-end.js @@ -47,7 +47,7 @@ server.listen(0, function() { const req = http.request({ port: this.address().port, path: '/', - method: 'POST' + method: 'POST', }, function(res) { console.log(res.statusCode); res.resume(); diff --git a/test/parallel/test-http-request-invalid-method-error.js b/test/parallel/test-http-request-invalid-method-error.js index 20897f08917683..a42c5954e915ee 100644 --- a/test/parallel/test-http-request-invalid-method-error.js +++ b/test/parallel/test-http-request-invalid-method-error.js @@ -8,6 +8,6 @@ assert.throws( { code: 'ERR_INVALID_HTTP_TOKEN', name: 'TypeError', - message: 'Method must be a valid HTTP token ["\u0000"]' + message: 'Method must be a valid HTTP token ["\u0000"]', } ); diff --git a/test/parallel/test-http-request-large-payload.js b/test/parallel/test-http-request-large-payload.js index 3be100b740417f..31c8fcc2d7f2ab 100644 --- a/test/parallel/test-http-request-large-payload.js +++ b/test/parallel/test-http-request-large-payload.js @@ -17,7 +17,7 @@ const server = http.createServer(function(req, res) { server.listen(0, function() { const req = http.request({ method: 'POST', - port: this.address().port + port: this.address().port, }); const payload = Buffer.alloc(16390, 'Й'); diff --git a/test/parallel/test-http-res-write-after-end.js b/test/parallel/test-http-res-write-after-end.js index 285938c8fe4d8c..6cd6fdd101faab 100644 --- a/test/parallel/test-http-res-write-after-end.js +++ b/test/parallel/test-http-res-write-after-end.js @@ -27,7 +27,7 @@ const http = require('http'); const server = http.Server(common.mustCall(function(req, res) { res.on('error', common.expectsError({ code: 'ERR_STREAM_WRITE_AFTER_END', - name: 'Error' + name: 'Error', })); res.write('This should write.'); diff --git a/test/parallel/test-http-response-add-header-after-sent.js b/test/parallel/test-http-response-add-header-after-sent.js index 27dc47529f9681..e00042ae64befe 100644 --- a/test/parallel/test-http-response-add-header-after-sent.js +++ b/test/parallel/test-http-response-add-header-after-sent.js @@ -11,7 +11,7 @@ const server = http.createServer((req, res) => { { code: 'ERR_HTTP_HEADERS_SENT', name: 'Error', - message: 'Cannot set headers after they are sent to the client' + message: 'Cannot set headers after they are sent to the client', } ); res.end(); diff --git a/test/parallel/test-http-response-no-headers.js b/test/parallel/test-http-response-no-headers.js index 22705936e08254..90d9d65b600387 100644 --- a/test/parallel/test-http-response-no-headers.js +++ b/test/parallel/test-http-response-no-headers.js @@ -28,7 +28,7 @@ const net = require('net'); const expected = { '0.9': 'I AM THE WALRUS', '1.0': 'I AM THE WALRUS', - '1.1': '' + '1.1': '', }; function test(httpVersion, callback) { @@ -41,7 +41,7 @@ function test(httpVersion, callback) { server.listen(0, '127.0.0.1', common.mustCall(function() { const options = { host: '127.0.0.1', - port: this.address().port + port: this.address().port, }; const req = http.get(options, common.mustCall(function(res) { diff --git a/test/parallel/test-http-response-remove-header-after-sent.js b/test/parallel/test-http-response-remove-header-after-sent.js index b5c0defac92b58..b18c2cf97fc93d 100644 --- a/test/parallel/test-http-response-remove-header-after-sent.js +++ b/test/parallel/test-http-response-remove-header-after-sent.js @@ -11,7 +11,7 @@ const server = http.createServer((req, res) => { { code: 'ERR_HTTP_HEADERS_SENT', name: 'Error', - message: 'Cannot remove headers after they are sent to the client' + message: 'Cannot remove headers after they are sent to the client', } ); res.end(); diff --git a/test/parallel/test-http-response-splitting.js b/test/parallel/test-http-response-splitting.js index 2b3bf8d7fb38c6..af934fd60e52bc 100644 --- a/test/parallel/test-http-response-splitting.js +++ b/test/parallel/test-http-response-splitting.js @@ -28,7 +28,7 @@ function test(res, code, key, value) { { code: 'ERR_INVALID_CHAR', name: 'TypeError', - message: `Invalid character in header content ["${key}"]` + message: `Invalid character in header content ["${key}"]`, } ); } diff --git a/test/parallel/test-http-response-status-message.js b/test/parallel/test-http-response-status-message.js index 3c22e40b43bf02..4b332db0cf3046 100644 --- a/test/parallel/test-http-response-status-message.js +++ b/test/parallel/test-http-response-status-message.js @@ -65,7 +65,7 @@ function runTest(testCaseIndex) { http.get({ port: server.address().port, - path: testCase.path + path: testCase.path, }, function(response) { console.log(`client: expected status message: ${testCase.statusMessage}`); console.log(`client: actual status message: ${response.statusMessage}`); diff --git a/test/parallel/test-http-response-statuscode.js b/test/parallel/test-http-response-statuscode.js index f552270407009c..6d70cd096f0903 100644 --- a/test/parallel/test-http-response-statuscode.js +++ b/test/parallel/test-http-response-statuscode.js @@ -13,7 +13,7 @@ function test(res, header, code) { }, { code: 'ERR_HTTP_INVALID_STATUS_CODE', name: 'RangeError', - message: `Invalid status code: ${code}` + message: `Invalid status code: ${code}`, }); } @@ -60,7 +60,7 @@ const server = http.Server(common.mustCall(function(req, res) { { code: 'ERR_HTTP_INVALID_STATUS_CODE', name: 'RangeError', - message: 'Invalid status code: undefined' + message: 'Invalid status code: undefined', }); this.close(); break; @@ -76,7 +76,7 @@ const countdown = new Countdown(MAX_REQUESTS, () => server.close()); server.on('listening', function makeRequest() { http.get({ - port: this.address().port + port: this.address().port, }, (res) => { assert.strictEqual(res.statusCode, 200); res.on('end', () => { diff --git a/test/parallel/test-http-reuse-socket.js b/test/parallel/test-http-reuse-socket.js index f5cd002fdbf519..10e79a0bdda356 100644 --- a/test/parallel/test-http-reuse-socket.js +++ b/test/parallel/test-http-reuse-socket.js @@ -30,7 +30,7 @@ function nextRequest() { port: server.address().port, path: '/', agent: agent, - method: methods.shift() + method: methods.shift(), }, common.mustCall((response) => { response.on('end', common.mustCall(() => { if (countdown.dec()) { diff --git a/test/parallel/test-http-server-capture-rejections.js b/test/parallel/test-http-server-capture-rejections.js index b437e27b589dfc..96d0d55b6da796 100644 --- a/test/parallel/test-http-server-capture-rejections.js +++ b/test/parallel/test-http-server-capture-rejections.js @@ -18,7 +18,7 @@ events.captureRejections = true; const req = request({ method: 'GET', host: server.address().host, - port: server.address().port + port: server.address().port, }); req.end(); @@ -62,7 +62,7 @@ events.captureRejections = true; const req = request({ method: 'GET', host: server.address().host, - port: server.address().port + port: server.address().port, }); req.end(); @@ -96,7 +96,7 @@ events.captureRejections = true; const req = request({ method: 'GET', host: server.address().host, - port: server.address().port + port: server.address().port, }); req.end(); diff --git a/test/parallel/test-http-server-consumed-timeout.js b/test/parallel/test-http-server-consumed-timeout.js index 865169ca010375..a0fcda7174f124 100644 --- a/test/parallel/test-http-server-consumed-timeout.js +++ b/test/parallel/test-http-server-consumed-timeout.js @@ -60,7 +60,7 @@ function runTest(timeoutDuration) { server.listen(0, common.mustCall(() => { const req = http.request({ port: server.address().port, - method: 'POST' + method: 'POST', }, () => { let lastIntervalTimestamp = Date.now(); const interval = setInterval(() => { diff --git a/test/parallel/test-http-server-de-chunked-trailer.js b/test/parallel/test-http-server-de-chunked-trailer.js index 96ce6b52ac6b00..9acc1a517bcfdb 100644 --- a/test/parallel/test-http-server-de-chunked-trailer.js +++ b/test/parallel/test-http-server-de-chunked-trailer.js @@ -12,7 +12,7 @@ const server = http.createServer(common.mustCall(function(req, res) { const trailerInvalidErr = { code: 'ERR_HTTP_TRAILER_INVALID', message: 'Trailers are invalid with this transfer encoding', - name: 'Error' + name: 'Error', }; assert.throws(() => res.writeHead(200, { 'Content-Length': '2' }), trailerInvalidErr); diff --git a/test/parallel/test-http-server-destroy-socket-on-client-error.js b/test/parallel/test-http-server-destroy-socket-on-client-error.js index 3cd38a4a7ec9d2..649e9f49b2e50c 100644 --- a/test/parallel/test-http-server-destroy-socket-on-client-error.js +++ b/test/parallel/test-http-server-destroy-socket-on-client-error.js @@ -17,7 +17,7 @@ server.on('connection', mustCall((socket) => { message: 'Parse Error: Invalid method encountered', code: 'HPE_INVALID_METHOD', bytesParsed: 1, - rawPacket: Buffer.from('FOO /\r\n') + rawPacket: Buffer.from('FOO /\r\n'), })); })); @@ -25,7 +25,7 @@ server.listen(0, () => { const chunks = []; const socket = createConnection({ allowHalfOpen: true, - port: server.address().port + port: server.address().port, }); socket.on('connect', mustCall(() => { diff --git a/test/parallel/test-http-server-incomingmessage-destroy.js b/test/parallel/test-http-server-incomingmessage-destroy.js index cfe7e4feecba45..32e5b66f039e94 100644 --- a/test/parallel/test-http-server-incomingmessage-destroy.js +++ b/test/parallel/test-http-server-incomingmessage-destroy.js @@ -14,7 +14,7 @@ process.on('uncaughtException', common.mustNotCall(onUncaught)); server.listen(0, common.mustCall(() => { get({ - port: server.address().port + port: server.address().port, }, (res) => { res.resume(); }).on('error', (error) => { diff --git a/test/parallel/test-http-server-keep-alive-timeout.js b/test/parallel/test-http-server-keep-alive-timeout.js index 3a604b5b8a4506..6f5d35166ecd32 100644 --- a/test/parallel/test-http-server-keep-alive-timeout.js +++ b/test/parallel/test-http-server-keep-alive-timeout.js @@ -45,7 +45,7 @@ function serverTest(withPipeline, cb) { server.listen(0, common.mustCall(() => { const options = { port: server.address().port, - allowHalfOpen: true + allowHalfOpen: true, }; const c = net.connect(options, () => { c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); diff --git a/test/parallel/test-http-server-multiheaders.js b/test/parallel/test-http-server-multiheaders.js index 8f633fdb998970..0c73154e0260b8 100644 --- a/test/parallel/test-http-server-multiheaders.js +++ b/test/parallel/test-http-server-multiheaders.js @@ -75,6 +75,6 @@ server.listen(0, function() { ['constructor', 'foo'], ['constructor', 'bar'], ['constructor', 'baz'], - ] + ], }); }); diff --git a/test/parallel/test-http-server-options-incoming-message.js b/test/parallel/test-http-server-options-incoming-message.js index d0f4a769d765a4..1fbb83680b3d11 100644 --- a/test/parallel/test-http-server-options-incoming-message.js +++ b/test/parallel/test-http-server-options-incoming-message.js @@ -17,7 +17,7 @@ class MyIncomingMessage extends http.IncomingMessage { } const server = http.createServer({ - IncomingMessage: MyIncomingMessage + IncomingMessage: MyIncomingMessage, }, common.mustCall(function(req, res) { assert.strictEqual(req.getUserAgent(), 'node-test'); res.statusCode = 200; @@ -29,8 +29,8 @@ server.on('listening', function makeRequest() { http.get({ port: this.address().port, headers: { - 'User-Agent': 'node-test' - } + 'User-Agent': 'node-test', + }, }, (res) => { assert.strictEqual(res.statusCode, 200); res.on('end', () => { diff --git a/test/parallel/test-http-server-options-server-response.js b/test/parallel/test-http-server-options-server-response.js index f5adf39bed6d16..b2f1e139979e75 100644 --- a/test/parallel/test-http-server-options-server-response.js +++ b/test/parallel/test-http-server-options-server-response.js @@ -17,7 +17,7 @@ class MyServerResponse extends http.ServerResponse { } const server = http.Server({ - ServerResponse: MyServerResponse + ServerResponse: MyServerResponse, }, common.mustCall(function(req, res) { res.status(200); res.end(); diff --git a/test/parallel/test-http-server-response-standalone.js b/test/parallel/test-http-server-response-standalone.js index ec6d1e89e38525..cbe1bb90a15325 100644 --- a/test/parallel/test-http-server-response-standalone.js +++ b/test/parallel/test-http-server-response-standalone.js @@ -12,7 +12,7 @@ const assert = require('assert'); const res = new ServerResponse({ method: 'GET', httpVersionMajor: 1, - httpVersionMinor: 1 + httpVersionMinor: 1, }); let firstChunk = true; @@ -26,7 +26,7 @@ const ws = new Writable({ assert.strictEqual(chunk.length, 0); } setImmediate(callback); - }, 2) + }, 2), }); res.assignSocket(ws); diff --git a/test/parallel/test-http-server-stale-close.js b/test/parallel/test-http-server-stale-close.js index b9322ed9fcf83a..fb36a9b402fb32 100644 --- a/test/parallel/test-http-server-stale-close.js +++ b/test/parallel/test-http-server-stale-close.js @@ -47,7 +47,7 @@ if (process.env.NODE_TEST_FORK_PORT) { }); server.listen(0, function() { fork(__filename, { - env: { ...process.env, NODE_TEST_FORK_PORT: this.address().port } + env: { ...process.env, NODE_TEST_FORK_PORT: this.address().port }, }); }); } diff --git a/test/parallel/test-http-server-unconsume-consume.js b/test/parallel/test-http-server-unconsume-consume.js index 0135205eb14ed9..36295c4abc498c 100644 --- a/test/parallel/test-http-server-unconsume-consume.js +++ b/test/parallel/test-http-server-unconsume-consume.js @@ -14,6 +14,6 @@ testServer.on('connect', common.mustCall((req, socket, head) => { testServer.listen(0, common.mustCall(() => { http.request({ port: testServer.address().port, - method: 'CONNECT' + method: 'CONNECT', }, (res) => {}).end(); })); diff --git a/test/parallel/test-http-server-write-after-end.js b/test/parallel/test-http-server-write-after-end.js index ba2877131227aa..a8e8489020cad6 100644 --- a/test/parallel/test-http-server-write-after-end.js +++ b/test/parallel/test-http-server-write-after-end.js @@ -17,7 +17,7 @@ function handle(req, res) { res.write('world', common.mustCall((err) => { common.expectsError({ code: 'ERR_STREAM_WRITE_AFTER_END', - name: 'Error' + name: 'Error', })(err); server.close(); })); diff --git a/test/parallel/test-http-server-write-end-after-end.js b/test/parallel/test-http-server-write-end-after-end.js index 02f86f611c1b8e..332c4f2f467254 100644 --- a/test/parallel/test-http-server-write-end-after-end.js +++ b/test/parallel/test-http-server-write-end-after-end.js @@ -19,7 +19,7 @@ function handle(req, res) { res.write('world', common.mustCall((err) => { common.expectsError({ code: 'ERR_STREAM_WRITE_AFTER_END', - name: 'Error' + name: 'Error', })(err); server.close(); })); diff --git a/test/parallel/test-http-server.js b/test/parallel/test-http-server.js index dcefc761728d36..30ac84e581cef7 100644 --- a/test/parallel/test-http-server.js +++ b/test/parallel/test-http-server.js @@ -36,7 +36,7 @@ invalid_options.forEach((option) => { assert.throws(() => { new http.Server(option); }, { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); diff --git a/test/parallel/test-http-set-header-chain.js b/test/parallel/test-http-set-header-chain.js index aa9519129a9123..cb2b19535f1f6c 100644 --- a/test/parallel/test-http-set-header-chain.js +++ b/test/parallel/test-http-set-header-chain.js @@ -6,7 +6,7 @@ const expected = { '__proto__': null, 'testheader1': 'foo', 'testheader2': 'bar', - 'testheader3': 'xyz' + 'testheader3': 'xyz', }; const server = http.createServer(common.mustCall((req, res) => { let retval = res.setHeader('testheader1', 'foo'); diff --git a/test/parallel/test-http-set-timeout-server.js b/test/parallel/test-http-set-timeout-server.js index 793046e57f0786..71b750ba952806 100644 --- a/test/parallel/test-http-set-timeout-server.js +++ b/test/parallel/test-http-set-timeout-server.js @@ -51,7 +51,7 @@ test(function serverTimeout(cb) { })); assert.ok(s instanceof http.Server); http.get({ - port: server.address().port + port: server.address().port, }).on('error', common.mustCall()); })); }); @@ -69,7 +69,7 @@ test(function serverRequestTimeout(cb) { server.listen(common.mustCall(() => { const req = http.request({ port: server.address().port, - method: 'POST' + method: 'POST', }); req.on('error', common.mustCall()); req.write('Hello'); @@ -89,7 +89,7 @@ test(function serverResponseTimeout(cb) { })); server.listen(common.mustCall(() => { http.get({ - port: server.address().port + port: server.address().port, }).on('error', common.mustCall()); })); }); @@ -108,7 +108,7 @@ test(function serverRequestNotTimeoutAfterEnd(cb) { })); server.listen(common.mustCall(() => { http.get({ - port: server.address().port + port: server.address().port, }).on('error', common.mustCall()); })); }); diff --git a/test/parallel/test-http-socket-encoding-error.js b/test/parallel/test-http-socket-encoding-error.js index 0ce984896d3aea..aa6395b2d12ca3 100644 --- a/test/parallel/test-http-socket-encoding-error.js +++ b/test/parallel/test-http-socket-encoding-error.js @@ -15,7 +15,7 @@ server.on('connection', common.mustCall((socket) => { code: 'ERR_HTTP_SOCKET_ENCODING', name: 'Error', message: 'Changing the socket encoding is not ' + - 'allowed per RFC7230 Section 3.' + 'allowed per RFC7230 Section 3.', } ); diff --git a/test/parallel/test-http-sync-write-error-during-continue.js b/test/parallel/test-http-sync-write-error-during-continue.js index 5476160942dadc..acb7a0df6666a4 100644 --- a/test/parallel/test-http-sync-write-error-during-continue.js +++ b/test/parallel/test-http-sync-write-error-during-continue.js @@ -28,8 +28,8 @@ Connection: close const req = http.request({ createConnection: common.mustCall(() => clientSide), headers: { - 'Expect': '100-continue' - } + 'Expect': '100-continue', + }, }); req.on('continue', common.mustCall((res) => { let sync = true; diff --git a/test/parallel/test-http-timeout-overflow.js b/test/parallel/test-http-timeout-overflow.js index e95405bc8b3554..df017c6a1415d8 100644 --- a/test/parallel/test-http-timeout-overflow.js +++ b/test/parallel/test-http-timeout-overflow.js @@ -34,7 +34,7 @@ server.listen(0, function() { const req = http.request({ port: this.address().port, path: '/', - agent: false + agent: false, }, function(res) { req.clearTimeout(callback); diff --git a/test/parallel/test-http-uncaught-from-request-callback.js b/test/parallel/test-http-uncaught-from-request-callback.js index 5c75958617898f..735703e6e8b565 100644 --- a/test/parallel/test-http-uncaught-from-request-callback.js +++ b/test/parallel/test-http-uncaught-from-request-callback.js @@ -6,7 +6,7 @@ const http = require('http'); // Regression test for https://github.com/nodejs/node/issues/31796 asyncHooks.createHook({ - after: () => {} + after: () => {}, }).enable(); @@ -22,7 +22,7 @@ const server = http.createServer(common.mustCall((request, response) => { server.listen(0, common.mustCall(() => { http.get({ host: 'localhost', - port: server.address().port + port: server.address().port, }, common.mustCall(() => { throw new Error('whoah'); })); diff --git a/test/parallel/test-http-unix-socket-keep-alive.js b/test/parallel/test-http-unix-socket-keep-alive.js index e1a2267e5c9689..f9f1106ab036cd 100644 --- a/test/parallel/test-http-unix-socket-keep-alive.js +++ b/test/parallel/test-http-unix-socket-keep-alive.js @@ -30,7 +30,7 @@ function asyncLoop(fn, times, cb) { function makeKeepAliveRequest(cb) { http.get({ socketPath: common.PIPE, - headers: { connection: 'keep-alive' } + headers: { connection: 'keep-alive' }, }, (res) => res.on('data', common.mustNotCall()) .on('error', assert.fail) .on('end', cb) diff --git a/test/parallel/test-http-unix-socket.js b/test/parallel/test-http-unix-socket.js index f8362d6183d8e1..102b71e3942124 100644 --- a/test/parallel/test-http-unix-socket.js +++ b/test/parallel/test-http-unix-socket.js @@ -27,7 +27,7 @@ const http = require('http'); const server = http.createServer(function(req, res) { res.writeHead(200, { 'Content-Type': 'text/plain', - 'Connection': 'close' + 'Connection': 'close', }); res.write('hello '); res.write('world\n'); @@ -41,7 +41,7 @@ server.listen(common.PIPE, common.mustCall(function() { const options = { socketPath: common.PIPE, - path: '/' + path: '/', }; const req = http.get(options, common.mustCall(function(res) { @@ -62,7 +62,7 @@ server.listen(common.PIPE, common.mustCall(function() { server.close(common.expectsError({ code: 'ERR_SERVER_NOT_RUNNING', message: 'Server is not running.', - name: 'Error' + name: 'Error', })); })); })); diff --git a/test/parallel/test-http-upgrade-advertise.js b/test/parallel/test-http-upgrade-advertise.js index 6d033ba36a5d60..858025761da300 100644 --- a/test/parallel/test-http-upgrade-advertise.js +++ b/test/parallel/test-http-upgrade-advertise.js @@ -28,7 +28,7 @@ function fire() { const req = http.request({ port: server.address().port, path: '/', - headers: test.headers + headers: test.headers, }, function onResponse(res) { res.resume(); done('regular'); @@ -52,7 +52,7 @@ function fire() { const server = http.createServer(function(req, res) { res.writeHead(200, { Connection: 'upgrade, keep-alive', - Upgrade: 'h2c' + Upgrade: 'h2c', }); res.end('hello world'); }).on('upgrade', function(req, socket) { diff --git a/test/parallel/test-http-upgrade-agent.js b/test/parallel/test-http-upgrade-agent.js index 28498819490b4f..abb979dae11483 100644 --- a/test/parallel/test-http-upgrade-agent.js +++ b/test/parallel/test-http-upgrade-agent.js @@ -53,8 +53,8 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { host: '127.0.0.1', headers: { 'connection': 'upgrade', - 'upgrade': 'websocket' - } + 'upgrade': 'websocket', + }, }; const name = `${options.host}:${options.port}`; diff --git a/test/parallel/test-http-upgrade-client.js b/test/parallel/test-http-upgrade-client.js index ea6972a18c7d49..0745ca1e09519b 100644 --- a/test/parallel/test-http-upgrade-client.js +++ b/test/parallel/test-http-upgrade-client.js @@ -54,7 +54,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { const headers = [ { connection: 'upgrade', - upgrade: 'websocket' + upgrade: 'websocket', }, [ ['Host', 'echo.websocket.org'], @@ -68,7 +68,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { headers.forEach(function(h) { const req = http.get({ port: port, - headers: h + headers: h, }); let sawUpgrade = false; req.on('upgrade', common.mustCall(function(res, socket, upgradeHead) { @@ -86,7 +86,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { const expectedHeaders = { hello: 'world', connection: 'upgrade', - upgrade: 'websocket' + upgrade: 'websocket', }; assert.deepStrictEqual(res.headers, expectedHeaders); socket.end(); diff --git a/test/parallel/test-http-upgrade-client2.js b/test/parallel/test-http-upgrade-client2.js index 8883faa9e05067..fad8b49940883a 100644 --- a/test/parallel/test-http-upgrade-client2.js +++ b/test/parallel/test-http-upgrade-client2.js @@ -43,7 +43,7 @@ server.listen(0, common.mustCall(function() { const header = { 'Connection': 'Upgrade', 'Upgrade': 'Test' }; const request = http.request({ port: server.address().port, - headers: header + headers: header, }); let wasUpgrade = false; diff --git a/test/parallel/test-http-upgrade-reconsume-stream.js b/test/parallel/test-http-upgrade-reconsume-stream.js index e712ea647b3ad9..f5be8b56e87904 100644 --- a/test/parallel/test-http-upgrade-reconsume-stream.js +++ b/test/parallel/test-http-upgrade-reconsume-stream.js @@ -23,7 +23,7 @@ server.listen(0, common.mustCall(() => { port: server.address().port, headers: { 'Connection': 'Upgrade', - 'Upgrade': 'websocket' - } + 'Upgrade': 'websocket', + }, }).on('error', () => {}); })); diff --git a/test/parallel/test-http-url.parse-auth-with-header-in-request.js b/test/parallel/test-http-url.parse-auth-with-header-in-request.js index ea5793ee18aef5..d44f8acc730b80 100644 --- a/test/parallel/test-http-url.parse-auth-with-header-in-request.js +++ b/test/parallel/test-http-url.parse-auth-with-header-in-request.js @@ -44,7 +44,7 @@ server.listen(0, function() { // The test here is if you set a specific authorization header in the // request we should not override that with basic auth testURL.headers = { - Authorization: 'NoAuthForYOU' + Authorization: 'NoAuthForYOU', }; // make the request diff --git a/test/parallel/test-http-url.parse-https.request.js b/test/parallel/test-http-url.parse-https.request.js index 2f18899176e73d..d07dc0fc8eb29e 100644 --- a/test/parallel/test-http-url.parse-https.request.js +++ b/test/parallel/test-http-url.parse-https.request.js @@ -32,7 +32,7 @@ const url = require('url'); // https options const httpsOptions = { key: readKey('agent1-key.pem'), - cert: readKey('agent1-cert.pem') + cert: readKey('agent1-cert.pem'), }; function check(request) { diff --git a/test/parallel/test-http-url.parse-only-support-http-https-protocol.js b/test/parallel/test-http-url.parse-only-support-http-https-protocol.js index 9b2a575ba7b1d7..9f2860659efe55 100644 --- a/test/parallel/test-http-url.parse-only-support-http-https-protocol.js +++ b/test/parallel/test-http-url.parse-only-support-http-https-protocol.js @@ -39,7 +39,7 @@ invalidUrls.forEach((invalid) => { () => { http.request(url.parse(invalid)); }, { code: 'ERR_INVALID_PROTOCOL', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-http-write-callbacks.js b/test/parallel/test-http-write-callbacks.js index 3730e57936b4a6..4e51233b25dd8a 100644 --- a/test/parallel/test-http-write-callbacks.js +++ b/test/parallel/test-http-write-callbacks.js @@ -75,7 +75,7 @@ server.listen(0, function() { const req = http.request({ port: this.address().port, method: 'PUT', - headers: { 'expect': '100-continue' } + headers: { 'expect': '100-continue' }, }); req.on('continue', () => { // ok, good to go. diff --git a/test/parallel/test-http-write-head.js b/test/parallel/test-http-write-head.js index 2199f11be61bb1..1edb0f8d940414 100644 --- a/test/parallel/test-http-write-head.js +++ b/test/parallel/test-http-write-head.js @@ -37,7 +37,7 @@ const s = http.createServer(common.mustCall((req, res) => { { code: 'ERR_INVALID_HTTP_TOKEN', name: 'TypeError', - message: 'Header name must be a valid HTTP token ["3840"]' + message: 'Header name must be a valid HTTP token ["3840"]', } ); @@ -47,7 +47,7 @@ const s = http.createServer(common.mustCall((req, res) => { { code: 'ERR_HTTP_INVALID_HEADER_VALUE', name: 'TypeError', - message: 'Invalid value "undefined" for header "foo"' + message: 'Invalid value "undefined" for header "foo"', } ); @@ -58,7 +58,7 @@ const s = http.createServer(common.mustCall((req, res) => { }, { code: 'ERR_HTTP_HEADERS_SENT', name: 'Error', - message: 'Cannot render headers after they are sent to the client' + message: 'Cannot render headers after they are sent to the client', }); res.end(); diff --git a/test/parallel/test-http.js b/test/parallel/test-http.js index b4916efcc96cb0..9103dc465a5023 100644 --- a/test/parallel/test-http.js +++ b/test/parallel/test-http.js @@ -69,9 +69,9 @@ server.on('listening', () => { headers: { Accept: '*/*', Foo: 'bar', - Cookie: [ 'foo=bar', 'bar=baz', 'baz=quux' ] + Cookie: [ 'foo=bar', 'bar=baz', 'baz=quux' ], }, - agent: agent + agent: agent, }, common.mustCall((res) => { const cookieHeaders = req._header.match(/^Cookie: .+$/img); assert.deepStrictEqual(cookieHeaders, @@ -90,7 +90,7 @@ server.on('listening', () => { port: server.address().port, method: 'PUT', path: '/there', - agent: agent + agent: agent, }, common.mustCall((res) => { const cookieHeaders = req._header.match(/^Cookie: .+$/img); assert.deepStrictEqual(cookieHeaders, ['Cookie: node=awesome; ta=da']); @@ -114,7 +114,7 @@ server.on('listening', () => { headers: [ ['Cookie', 'abc=123'], ['Cookie', 'def=456'], ['Cookie', 'ghi=789'] ], - agent: agent + agent: agent, }, common.mustCall((res) => { const cookieHeaders = req._header.match(/^Cookie: .+$/img); assert.deepStrictEqual(cookieHeaders, diff --git a/test/parallel/test-http2-altsvc.js b/test/parallel/test-http2-altsvc.js index c5abfc33265330..d421e0a12f2470 100644 --- a/test/parallel/test-http2-altsvc.js +++ b/test/parallel/test-http2-altsvc.js @@ -34,7 +34,7 @@ server.on('session', common.mustCall((session) => { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "originOrStream" is out of ' + - `range. It must be > 0 && < 4294967296. Received ${input}` + `range. It must be > 0 && < 4294967296. Received ${input}`, } ); }); @@ -45,7 +45,7 @@ server.on('session', common.mustCall((session) => { () => session.altsvc(input), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -56,7 +56,7 @@ server.on('session', common.mustCall((session) => { { code: 'ERR_INVALID_CHAR', name: 'TypeError', - message: 'Invalid character in alt' + message: 'Invalid character in alt', } ); }); @@ -66,7 +66,7 @@ server.on('session', common.mustCall((session) => { () => session.altsvc('clear', input), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -82,7 +82,7 @@ server.on('session', common.mustCall((session) => { { code: 'ERR_HTTP2_ALTSVC_INVALID_ORIGIN', name: 'TypeError', - message: 'HTTP/2 ALTSVC frames require a valid origin' + message: 'HTTP/2 ALTSVC frames require a valid origin', } ); }); @@ -96,7 +96,7 @@ server.on('session', common.mustCall((session) => { { code: 'ERR_HTTP2_ALTSVC_LENGTH', name: 'TypeError', - message: 'HTTP/2 ALTSVC frames are limited to 16382 bytes' + message: 'HTTP/2 ALTSVC frames are limited to 16382 bytes', } ); })); diff --git a/test/parallel/test-http2-backpressure.js b/test/parallel/test-http2-backpressure.js index 1f9687831eb1a8..1debc383b00619 100644 --- a/test/parallel/test-http2-backpressure.js +++ b/test/parallel/test-http2-backpressure.js @@ -15,7 +15,7 @@ const makeDuplexPair = require('../common/duplexpair'); server.on('stream', mustCallAsync(async (stream, headers) => { stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); req._readableState.highWaterMark = 20; stream._writableState.highWaterMark = 20; @@ -32,7 +32,7 @@ const makeDuplexPair = require('../common/duplexpair'); server.emit('connection', serverSide); const client = http2.connect('http://localhost:80', { - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }); req = client.request({ ':path': '/' }); diff --git a/test/parallel/test-http2-binding.js b/test/parallel/test-http2-binding.js index e81a58dfe8a5c1..39fae3405795dc 100644 --- a/test/parallel/test-http2-binding.js +++ b/test/parallel/test-http2-binding.js @@ -91,7 +91,7 @@ const expectedStatusCodes = { HTTP_STATUS_LOOP_DETECTED: 508, HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: 509, HTTP_STATUS_NOT_EXTENDED: 510, - HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: 511 + HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: 511, }; const expectedHeaderNames = { @@ -231,7 +231,7 @@ const expectedNGConstants = { NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: 4, NGHTTP2_SETTINGS_MAX_FRAME_SIZE: 5, NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6, - NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL: 8 + NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL: 8, }; const defaultSettings = { @@ -241,7 +241,7 @@ const defaultSettings = { DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: 65535, DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384, DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE: 65535, - DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL: 0 + DEFAULT_SETTINGS_ENABLE_CONNECT_PROTOCOL: 0, }; for (const name of Object.keys(constants)) { diff --git a/test/parallel/test-http2-capture-rejection.js b/test/parallel/test-http2-capture-rejection.js index 4469c6b7e64d20..cf4c9bc71c35d9 100644 --- a/test/parallel/test-http2-capture-rejection.js +++ b/test/parallel/test-http2-capture-rejection.js @@ -118,7 +118,7 @@ events.captureRejections = true; }, common.mustCall((err, push) => { push.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); push.end('pushed by the server'); @@ -126,7 +126,7 @@ events.captureRejections = true; })); stream.respond({ - ':status': 200 + ':status': 200, }); })); diff --git a/test/parallel/test-http2-clean-output.js b/test/parallel/test-http2-clean-output.js index 27b7c338c9a794..dc6c7cdea2029a 100644 --- a/test/parallel/test-http2-clean-output.js +++ b/test/parallel/test-http2-clean-output.js @@ -3,27 +3,27 @@ const { hasCrypto, mustCall, - skip + skip, } = require('../common'); if (!hasCrypto) skip('missing crypto'); const { - strictEqual + strictEqual, } = require('assert'); const { createServer, - connect + connect, } = require('http2'); const { - spawnSync + spawnSync, } = require('child_process'); // Validate that there is no unexpected output when // using http2 if (process.argv[2] !== 'child') { const { - stdout, stderr, status + stdout, stderr, status, } = spawnSync(process.execPath, [__filename, 'child'], { encoding: 'utf8' }); strictEqual(stderr, ''); strictEqual(stdout, ''); diff --git a/test/parallel/test-http2-client-destroy.js b/test/parallel/test-http2-client-destroy.js index c407ef1f508466..e3e722b238775c 100644 --- a/test/parallel/test-http2-client-destroy.js +++ b/test/parallel/test-http2-client-destroy.js @@ -63,7 +63,7 @@ const { getEventListeners } = require('events'); req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_CANCEL', name: 'Error', - message: 'The pending stream has been canceled' + message: 'The pending stream has been canceled', })); client.destroy(); @@ -73,7 +73,7 @@ const { getEventListeners } = require('events'); const sessionError = { name: 'Error', code: 'ERR_HTTP2_INVALID_SESSION', - message: 'The session has been destroyed' + message: 'The session has been destroyed', }; assert.throws(() => client.setNextStreamID(), sessionError); @@ -158,7 +158,7 @@ const { getEventListeners } = require('events'); req.on('error', common.expectsError({ code: 'ERR_HTTP2_GOAWAY_SESSION', name: 'Error', - message: 'New streams cannot be created after receiving a GOAWAY' + message: 'New streams cannot be created after receiving a GOAWAY', })); client.close(); diff --git a/test/parallel/test-http2-client-http1-server.js b/test/parallel/test-http2-client-http1-server.js index e6680ee14bdf50..5cc556697c772d 100644 --- a/test/parallel/test-http2-client-http1-server.js +++ b/test/parallel/test-http2-client-http1-server.js @@ -30,14 +30,14 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_ERROR', constructor: NghttpError, - message: 'Protocol error' + message: 'Protocol error', })); client.on('error', common.expectsError({ code: 'ERR_HTTP2_ERROR', constructor: NghttpError, name: 'Error', - message: 'Protocol error' + message: 'Protocol error', })); client.on('close', common.mustCall(() => server.close())); diff --git a/test/parallel/test-http2-client-jsstream-destroy.js b/test/parallel/test-http2-client-jsstream-destroy.js index 7e44241e985a64..63eacfef63706a 100644 --- a/test/parallel/test-http2-client-jsstream-destroy.js +++ b/test/parallel/test-http2-client-jsstream-destroy.js @@ -10,7 +10,7 @@ const { Duplex } = require('stream'); const server = h2.createSecureServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }); class JSSocket extends Duplex { @@ -38,11 +38,11 @@ server.listen(0, common.mustCall(function() { rejectUnauthorized: false, host: 'localhost', port: this.address().port, - ALPNProtocols: ['h2'] + ALPNProtocols: ['h2'], }, () => { const proxy = new JSSocket(socket); const client = h2.connect(`https://localhost:${this.address().port}`, { - createConnection: () => proxy + createConnection: () => proxy, }); const req = client.request(); diff --git a/test/parallel/test-http2-client-onconnect-errors.js b/test/parallel/test-http2-client-onconnect-errors.js index 04cbfe5befaeec..02d141020fb078 100644 --- a/test/parallel/test-http2-client-onconnect-errors.js +++ b/test/parallel/test-http2-client-onconnect-errors.js @@ -9,7 +9,7 @@ const { internalBinding } = require('internal/test/binding'); const { constants, Http2Session, - nghttp2ErrorString + nghttp2ErrorString, } = internalBinding('http2'); const http2 = require('http2'); const { NghttpError } = require('internal/http2/util'); @@ -31,18 +31,18 @@ const specificTests = [ code: 'ERR_HTTP2_OUT_OF_STREAMS', name: 'Error', message: 'No stream ID is available because ' + - 'maximum stream ID has been reached' + 'maximum stream ID has been reached', }, - type: 'stream' + type: 'stream', }, { ngError: constants.NGHTTP2_ERR_INVALID_ARGUMENT, error: { code: 'ERR_HTTP2_STREAM_SELF_DEPENDENCY', name: 'Error', - message: 'A stream cannot depend on itself' + message: 'A stream cannot depend on itself', }, - type: 'stream' + type: 'stream', }, ]; @@ -56,9 +56,9 @@ const genericTests = Object.getOwnPropertyNames(constants) code: 'ERR_HTTP2_ERROR', constructor: NghttpError, name: 'Error', - message: nghttp2ErrorString(constants[key]) + message: nghttp2ErrorString(constants[key]), }, - type: 'session' + type: 'session', })); const tests = specificTests.concat(genericTests); @@ -94,10 +94,10 @@ function runTest(test) { client.on('error', errorMustCall); req.on('error', (err) => { common.expectsError({ - code: 'ERR_HTTP2_STREAM_CANCEL' + code: 'ERR_HTTP2_STREAM_CANCEL', })(err); common.expectsError({ - code: 'ERR_HTTP2_ERROR' + code: 'ERR_HTTP2_ERROR', })(err.cause); }); } diff --git a/test/parallel/test-http2-client-request-options-errors.js b/test/parallel/test-http2-client-request-options-errors.js index f2950fe4d287b4..f89b50aca216f0 100644 --- a/test/parallel/test-http2-client-request-options-errors.js +++ b/test/parallel/test-http2-client-request-options-errors.js @@ -15,7 +15,7 @@ const optionsToTest = { weight: 'number', parent: 'number', exclusive: 'boolean', - silent: 'boolean' + silent: 'boolean', }; const types = { @@ -25,7 +25,7 @@ const types = { object: {}, array: [], null: null, - symbol: Symbol('test') + symbol: Symbol('test'), }; const server = http2.createServer(common.mustNotCall()); @@ -43,14 +43,14 @@ server.listen(0, common.mustCall(() => { assert.throws( () => client.request({ ':method': 'CONNECT', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }, { - [option]: types[type] + [option]: types[type], }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: `The property 'options.${option}' is invalid. ` + - `Received ${inspect(types[type])}` + `Received ${inspect(types[type])}`, }); }); }); diff --git a/test/parallel/test-http2-client-rststream-before-connect.js b/test/parallel/test-http2-client-rststream-before-connect.js index 2acdefdfbe28f8..f0576e64809af9 100644 --- a/test/parallel/test-http2-client-rststream-before-connect.js +++ b/test/parallel/test-http2-client-rststream-before-connect.js @@ -25,7 +25,7 @@ server.listen(0, common.mustCall(() => { name: 'RangeError', code: 'ERR_OUT_OF_RANGE', message: 'The value of "code" is out of range. It must be ' + - '>= 0 && <= 4294967295. Received 4294967296' + '>= 0 && <= 4294967295. Received 4294967296', } ); assert.strictEqual(req.closed, false); @@ -36,7 +36,7 @@ server.listen(0, common.mustCall(() => { { name: 'TypeError', code: 'ERR_INVALID_CALLBACK', - message: `Callback must be a function. Received ${inspect(notFunction)}` + message: `Callback must be a function. Received ${inspect(notFunction)}`, } ); assert.strictEqual(req.closed, false); @@ -61,7 +61,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_PROTOCOL_ERROR' + message: 'Stream closed with error code NGHTTP2_PROTOCOL_ERROR', })); // The `response` event should not fire as the server should receive the diff --git a/test/parallel/test-http2-client-setLocalWindowSize.js b/test/parallel/test-http2-client-setLocalWindowSize.js index 8e3b57ed0c1a6b..dc92b50463cc81 100644 --- a/test/parallel/test-http2-client-setLocalWindowSize.js +++ b/test/parallel/test-http2-client-setLocalWindowSize.js @@ -34,7 +34,7 @@ const http2 = require('http2'); name: 'RangeError', code: 'ERR_OUT_OF_RANGE', message: 'The value of "windowSize" is out of range.' + - ' It must be >= 0 && <= 2147483647. Received ' + outOfRangeNum + ' It must be >= 0 && <= 2147483647. Received ' + outOfRangeNum, } ); @@ -50,7 +50,7 @@ const http2 = require('http2'); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "windowSize" argument must be of type number.' + - common.invalidArgTypeHelper(value) + common.invalidArgTypeHelper(value), } ); }); diff --git a/test/parallel/test-http2-client-setNextStreamID-errors.js b/test/parallel/test-http2-client-setNextStreamID-errors.js index aace5845252af6..b84a88bdd2a629 100644 --- a/test/parallel/test-http2-client-setNextStreamID-errors.js +++ b/test/parallel/test-http2-client-setNextStreamID-errors.js @@ -20,7 +20,7 @@ const types = { object: {}, array: [], null: null, - symbol: Symbol('test') + symbol: Symbol('test'), }; server.listen(0, common.mustCall(() => { @@ -34,7 +34,7 @@ server.listen(0, common.mustCall(() => { name: 'RangeError', code: 'ERR_OUT_OF_RANGE', message: 'The value of "id" is out of range.' + - ' It must be > 0 and <= 4294967295. Received ' + outOfRangeNum + ' It must be > 0 and <= 4294967295. Received ' + outOfRangeNum, } ); @@ -50,7 +50,7 @@ server.listen(0, common.mustCall(() => { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "id" argument must be of type number.' + - common.invalidArgTypeHelper(value) + common.invalidArgTypeHelper(value), } ); }); diff --git a/test/parallel/test-http2-client-settings-before-connect.js b/test/parallel/test-http2-client-settings-before-connect.js index 406ddd86ab5e9b..18c9bded8526d1 100644 --- a/test/parallel/test-http2-client-settings-before-connect.js +++ b/test/parallel/test-http2-client-settings-before-connect.js @@ -44,7 +44,7 @@ server.listen(0, common.mustCall(() => { () => client.settings({ [name]: value }), { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', - name: errorType.name + name: errorType.name, } ) ); @@ -56,7 +56,7 @@ server.listen(0, common.mustCall(() => { name: 'TypeError', code: 'ERR_INVALID_CALLBACK', message: - `Callback must be a function. Received ${inspect(invalidCallback)}` + `Callback must be a function. Received ${inspect(invalidCallback)}`, } ) ); diff --git a/test/parallel/test-http2-client-stream-destroy-before-connect.js b/test/parallel/test-http2-client-stream-destroy-before-connect.js index 087b06d01bd837..c7522f1d400434 100644 --- a/test/parallel/test-http2-client-stream-destroy-before-connect.js +++ b/test/parallel/test-http2-client-stream-destroy-before-connect.js @@ -39,7 +39,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ name: 'Error', - message: 'test' + message: 'test', })); req.on('close', common.mustCall(() => { diff --git a/test/parallel/test-http2-client-unescaped-path.js b/test/parallel/test-http2-client-unescaped-path.js index ca061ccda484b6..d920bbc0cf5e20 100644 --- a/test/parallel/test-http2-client-unescaped-path.js +++ b/test/parallel/test-http2-client-unescaped-path.js @@ -27,7 +27,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_PROTOCOL_ERROR' + message: 'Stream closed with error code NGHTTP2_PROTOCOL_ERROR', })); req.on('close', common.mustCall(() => countdown.dec())); } diff --git a/test/parallel/test-http2-client-write-empty-string.js b/test/parallel/test-http2-client-write-empty-string.js index f0f0b8f0124964..1f72ad2d8f2aae 100644 --- a/test/parallel/test-http2-client-write-empty-string.js +++ b/test/parallel/test-http2-client-write-empty-string.js @@ -30,7 +30,7 @@ for (const chunkSequence of [ const req = client.request({ ':method': 'POST', - ':path': '/' + ':path': '/', }); req.on('response', common.mustCall((headers) => { diff --git a/test/parallel/test-http2-close-while-writing.js b/test/parallel/test-http2-close-while-writing.js index d8537c31b00eb6..435c4daac45c46 100644 --- a/test/parallel/test-http2-close-while-writing.js +++ b/test/parallel/test-http2-close-while-writing.js @@ -16,7 +16,7 @@ const ca = fixtures.readKey('fake-startcom-root-cert.pem', 'binary'); const server = http2.createSecureServer({ key, cert, - maxSessionMemory: 1000 + maxSessionMemory: 1000, }); let client_stream; @@ -34,7 +34,7 @@ server.on('session', common.mustCall(function(session) { server.listen(0, function() { const client = http2.connect(`https://localhost:${server.address().port}`, { ca, - maxSessionMemory: 1000 + maxSessionMemory: 1000, }); client_stream = client.request({ ':method': 'POST' }); client_stream.on('close', common.mustCall(() => { diff --git a/test/parallel/test-http2-compat-expect-continue-check.js b/test/parallel/test-http2-compat-expect-continue-check.js index 0f38e6ae1ff542..af81bc4f9675c6 100644 --- a/test/parallel/test-http2-compat-expect-continue-check.js +++ b/test/parallel/test-http2-compat-expect-continue-check.js @@ -33,7 +33,7 @@ server.listen(0, common.mustCall(() => { const client = http2.connect(`http://localhost:${server.address().port}`); const req = client.request({ ':method': 'POST', - 'expect': '100-continue' + 'expect': '100-continue', }); let gotContinue = false; diff --git a/test/parallel/test-http2-compat-expect-continue.js b/test/parallel/test-http2-compat-expect-continue.js index cb90e51f3bc9d7..efd665d9c6b15c 100644 --- a/test/parallel/test-http2-compat-expect-continue.js +++ b/test/parallel/test-http2-compat-expect-continue.js @@ -29,7 +29,7 @@ server.on('listening', common.mustCall(() => { const client = http2.connect(`http://localhost:${server.address().port}`); const req = client.request({ ':method': 'POST', - 'expect': '100-continue' + 'expect': '100-continue', }); let gotContinue = false; diff --git a/test/parallel/test-http2-compat-expect-handling.js b/test/parallel/test-http2-compat-expect-handling.js index 77f22758345cff..fe45281c894a3f 100644 --- a/test/parallel/test-http2-compat-expect-handling.js +++ b/test/parallel/test-http2-compat-expect-handling.js @@ -30,7 +30,7 @@ function nextTest(testsToRun) { ':method': 'GET', ':scheme': 'http', ':authority': `localhost:${port}`, - 'expect': expectValue + 'expect': expectValue, }); req.on('response', common.mustCall((headers) => { diff --git a/test/parallel/test-http2-compat-method-connect.js b/test/parallel/test-http2-compat-method-connect.js index 21ad23e92ba65b..b7eb3881f4878d 100644 --- a/test/parallel/test-http2-compat-method-connect.js +++ b/test/parallel/test-http2-compat-method-connect.js @@ -25,7 +25,7 @@ function testMethodConnect(testsToRun) { const client = http2.connect(`http://localhost:${port}`); const req = client.request({ ':method': 'CONNECT', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }); req.on('response', common.mustCall((headers) => { diff --git a/test/parallel/test-http2-compat-serverrequest-headers.js b/test/parallel/test-http2-compat-serverrequest-headers.js index 06f37c8a47ce19..82bddf3fc817a5 100644 --- a/test/parallel/test-http2-compat-serverrequest-headers.js +++ b/test/parallel/test-http2-compat-serverrequest-headers.js @@ -17,7 +17,7 @@ server.listen(0, common.mustCall(function() { ':method': 'GET', ':scheme': 'http', ':authority': `localhost:${port}`, - 'foo-bar': 'abc123' + 'foo-bar': 'abc123', }; assert.strictEqual(request.path, undefined); @@ -50,7 +50,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: "The argument 'method' is invalid. Received ' '" + message: "The argument 'method' is invalid. Received ' '", } ); assert.throws( @@ -59,7 +59,7 @@ server.listen(0, common.mustCall(function() { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "method" argument must be of type string. ' + - 'Received type boolean (true)' + 'Received type boolean (true)', } ); @@ -76,7 +76,7 @@ server.listen(0, common.mustCall(function() { ':method': 'GET', ':scheme': 'http', ':authority': `localhost:${port}`, - 'foo-bar': 'abc123' + 'foo-bar': 'abc123', }; const request = client.request(headers); request.on('end', common.mustCall(function() { diff --git a/test/parallel/test-http2-compat-serverrequest-host.js b/test/parallel/test-http2-compat-serverrequest-host.js index 36600f787ca2e3..de7324541d9210 100644 --- a/test/parallel/test-http2-compat-serverrequest-host.js +++ b/test/parallel/test-http2-compat-serverrequest-host.js @@ -19,7 +19,7 @@ server.listen(0, common.mustCall(function() { ':path': '/foobar', ':method': 'GET', ':scheme': 'http', - 'host': `localhost:${port}` + 'host': `localhost:${port}`, }; assert.strictEqual(request.authority, expected.host); @@ -51,7 +51,7 @@ server.listen(0, common.mustCall(function() { ':path': '/foobar', ':method': 'GET', ':scheme': 'http', - 'host': `localhost:${port}` + 'host': `localhost:${port}`, }; const request = client.request(headers); request.on('end', common.mustCall(function() { diff --git a/test/parallel/test-http2-compat-serverrequest-pause.js b/test/parallel/test-http2-compat-serverrequest-pause.js index 2abc9e3da449f1..5d2deaa1124e22 100644 --- a/test/parallel/test-http2-compat-serverrequest-pause.js +++ b/test/parallel/test-http2-compat-serverrequest-pause.js @@ -41,7 +41,7 @@ server.listen(0, common.mustCall(() => { ':path': '/foobar', ':method': 'POST', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }); request.resume(); request.end(testStr); diff --git a/test/parallel/test-http2-compat-serverrequest-settimeout.js b/test/parallel/test-http2-compat-serverrequest-settimeout.js index 44abf29cafb9d9..776a6058ce3e2c 100644 --- a/test/parallel/test-http2-compat-serverrequest-settimeout.js +++ b/test/parallel/test-http2-compat-serverrequest-settimeout.js @@ -31,7 +31,7 @@ server.listen(0, common.mustCall(() => { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }); req.on('end', common.mustCall(() => { client.close(); diff --git a/test/parallel/test-http2-compat-serverrequest-trailers.js b/test/parallel/test-http2-compat-serverrequest-trailers.js index 620ae69029a375..822fb3b422ad54 100644 --- a/test/parallel/test-http2-compat-serverrequest-trailers.js +++ b/test/parallel/test-http2-compat-serverrequest-trailers.js @@ -10,7 +10,7 @@ const h2 = require('http2'); const expectedTrailers = { 'x-foo': 'xOxOxOx, OxOxOxO, xOxOxOx, OxOxOxO', - 'x-foo-test': 'test, test' + 'x-foo-test': 'test, test', }; const server = h2.createServer(); @@ -48,7 +48,7 @@ server.listen(0, common.mustCall(function() { ':path': '/foobar', ':method': 'POST', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers, { waitForTrailers: true }); @@ -58,7 +58,7 @@ server.listen(0, common.mustCall(function() { 'x-foO': 'OxOxOxO', 'X-fOo': 'xOxOxOx', 'X-foO': 'OxOxOxO', - 'x-foo-test': 'test, test' + 'x-foo-test': 'test, test', }); }); diff --git a/test/parallel/test-http2-compat-serverrequest.js b/test/parallel/test-http2-compat-serverrequest.js index d92da61d943cb7..12af1a1f4970fd 100644 --- a/test/parallel/test-http2-compat-serverrequest.js +++ b/test/parallel/test-http2-compat-serverrequest.js @@ -16,7 +16,7 @@ server.listen(0, common.mustCall(function() { const expected = { version: '2.0', httpVersionMajor: 2, - httpVersionMinor: 0 + httpVersionMinor: 0, }; assert.strictEqual(request.httpVersion, expected.version); @@ -42,7 +42,7 @@ server.listen(0, common.mustCall(function() { ':path': '/foobar', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('end', common.mustCall(function() { diff --git a/test/parallel/test-http2-compat-serverresponse-createpushresponse.js b/test/parallel/test-http2-compat-serverresponse-createpushresponse.js index f25eab444f2dfd..8db71fccbd8381 100644 --- a/test/parallel/test-http2-compat-serverresponse-createpushresponse.js +++ b/test/parallel/test-http2-compat-serverresponse-createpushresponse.js @@ -19,19 +19,19 @@ const server = h2.createServer((request, response) => { assert.throws( () => response.createPushResponse({ ':path': '/pushed', - ':method': 'GET' + ':method': 'GET', }, undefined), { code: 'ERR_INVALID_CALLBACK', name: 'TypeError', - message: 'Callback must be a function. Received undefined' + message: 'Callback must be a function. Received undefined', } ); response.stream.on('close', () => { response.createPushResponse({ ':path': '/pushed', - ':method': 'GET' + ':method': 'GET', }, common.mustCall((error) => { assert.strictEqual(error.code, 'ERR_HTTP2_INVALID_STREAM'); })); @@ -39,7 +39,7 @@ const server = h2.createServer((request, response) => { response.createPushResponse({ ':path': '/pushed', - ':method': 'GET' + ':method': 'GET', }, common.mustSucceed((push) => { assert.strictEqual(push.stream.id % 2, 0); push.end(pushExpect); diff --git a/test/parallel/test-http2-compat-serverresponse-destroy.js b/test/parallel/test-http2-compat-serverresponse-destroy.js index 94d67330e86061..ce2f7f7476a9f4 100644 --- a/test/parallel/test-http2-compat-serverresponse-destroy.js +++ b/test/parallel/test-http2-compat-serverresponse-destroy.js @@ -57,7 +57,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR' + message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR', })); req.on('close', common.mustCall(() => countdown.dec())); @@ -72,7 +72,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR' + message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR', })); req.on('close', common.mustCall(() => countdown.dec())); diff --git a/test/parallel/test-http2-compat-serverresponse-drain.js b/test/parallel/test-http2-compat-serverresponse-drain.js index 7ccbb1f4d21209..20cd12eca3057d 100644 --- a/test/parallel/test-http2-compat-serverresponse-drain.js +++ b/test/parallel/test-http2-compat-serverresponse-drain.js @@ -26,7 +26,7 @@ server.listen(0, common.mustCall(() => { ':path': '/foobar', ':method': 'POST', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }); request.resume(); request.end(); diff --git a/test/parallel/test-http2-compat-serverresponse-end-after-statuses-without-body.js b/test/parallel/test-http2-compat-serverresponse-end-after-statuses-without-body.js index ce8cbe600c8bd8..c62a440632943c 100644 --- a/test/parallel/test-http2-compat-serverresponse-end-after-statuses-without-body.js +++ b/test/parallel/test-http2-compat-serverresponse-end-after-statuses-without-body.js @@ -12,7 +12,7 @@ const h2 = require('http2'); const { HTTP_STATUS_NO_CONTENT, HTTP_STATUS_RESET_CONTENT, - HTTP_STATUS_NOT_MODIFIED + HTTP_STATUS_NOT_MODIFIED, } = h2.constants; const statusWithoutBody = [ diff --git a/test/parallel/test-http2-compat-serverresponse-end.js b/test/parallel/test-http2-compat-serverresponse-end.js index 52d4c603e95e04..e34f819e99e931 100644 --- a/test/parallel/test-http2-compat-serverresponse-end.js +++ b/test/parallel/test-http2-compat-serverresponse-end.js @@ -5,7 +5,7 @@ const { mustNotCall, hasCrypto, platformTimeout, - skip + skip, } = require('../common'); if (!hasCrypto) skip('missing crypto'); @@ -15,8 +15,8 @@ const { connect, constants: { HTTP2_HEADER_STATUS, - HTTP_STATUS_OK - } + HTTP_STATUS_OK, + }, } = require('http2'); { @@ -45,7 +45,7 @@ const { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.setEncoding('utf8'); @@ -75,7 +75,7 @@ const { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.setEncoding('utf8'); @@ -104,7 +104,7 @@ const { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.setEncoding('utf8'); @@ -134,7 +134,7 @@ const { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('data', mustNotCall()); @@ -165,7 +165,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', mustCall((headers, flags) => { @@ -199,7 +199,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('data', mustNotCall()); @@ -230,7 +230,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', mustCall((headers, flags) => { @@ -265,7 +265,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', mustCall((headers, flags) => { @@ -305,7 +305,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', mustCall((headers, flags) => { @@ -338,7 +338,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', mustCall((headers, flags) => { diff --git a/test/parallel/test-http2-compat-serverresponse-finished.js b/test/parallel/test-http2-compat-serverresponse-finished.js index a42d40227ca33b..8accb6cf78839a 100644 --- a/test/parallel/test-http2-compat-serverresponse-finished.js +++ b/test/parallel/test-http2-compat-serverresponse-finished.js @@ -37,7 +37,7 @@ server.listen(0, common.mustCall(() => { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('end', common.mustCall(() => { diff --git a/test/parallel/test-http2-compat-serverresponse-flushheaders.js b/test/parallel/test-http2-compat-serverresponse-flushheaders.js index 7760bf8c7daed3..d047efa3449ca6 100644 --- a/test/parallel/test-http2-compat-serverresponse-flushheaders.js +++ b/test/parallel/test-http2-compat-serverresponse-flushheaders.js @@ -24,7 +24,7 @@ server.listen(0, common.mustCall(function() { assert.throws(() => { response.writeHead(400, { 'foo-bar': 'abc123' }); }, { - code: 'ERR_HTTP2_HEADERS_SENT' + code: 'ERR_HTTP2_HEADERS_SENT', }); response.on('finish', common.mustCall(function() { @@ -42,7 +42,7 @@ server.listen(0, common.mustCall(function() { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', common.mustCall(function(headers, flags) { diff --git a/test/parallel/test-http2-compat-serverresponse-headers-after-destroy.js b/test/parallel/test-http2-compat-serverresponse-headers-after-destroy.js index fc97a70f42d956..87c41b4ba8c8d0 100644 --- a/test/parallel/test-http2-compat-serverresponse-headers-after-destroy.js +++ b/test/parallel/test-http2-compat-serverresponse-headers-after-destroy.js @@ -35,7 +35,7 @@ server.listen(0, common.mustCall(function() { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('end', common.mustCall(function() { diff --git a/test/parallel/test-http2-compat-serverresponse-headers.js b/test/parallel/test-http2-compat-serverresponse-headers.js index 8b9b6d69278c60..1082cdc1d1eeff 100644 --- a/test/parallel/test-http2-compat-serverresponse-headers.js +++ b/test/parallel/test-http2-compat-serverresponse-headers.js @@ -48,7 +48,7 @@ server.listen(0, common.mustCall(function() { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "name" argument must be of type string. Received ' + - 'undefined' + 'undefined', } ); }); @@ -64,7 +64,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED', name: 'TypeError', - message: 'Cannot set HTTP/2 pseudo-headers' + message: 'Cannot set HTTP/2 pseudo-headers', }) ); assert.throws(() => { @@ -72,14 +72,14 @@ server.listen(0, common.mustCall(function() { }, { code: 'ERR_HTTP2_INVALID_HEADER_VALUE', name: 'TypeError', - message: 'Invalid value "null" for header "foo-bar"' + message: 'Invalid value "null" for header "foo-bar"', }); assert.throws(() => { response.setHeader(real, undefined); }, { code: 'ERR_HTTP2_INVALID_HEADER_VALUE', name: 'TypeError', - message: 'Invalid value "undefined" for header "foo-bar"' + message: 'Invalid value "undefined" for header "foo-bar"', }); assert.throws( () => response.setHeader(), // Header name undefined @@ -87,7 +87,7 @@ server.listen(0, common.mustCall(function() { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "name" argument must be of type string. Received ' + - 'undefined' + 'undefined', } ); assert.throws( @@ -95,7 +95,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_INVALID_HTTP_TOKEN', name: 'TypeError', - message: 'Header name must be a valid HTTP token [""]' + message: 'Header name must be a valid HTTP token [""]', } ); @@ -127,7 +127,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_HTTP2_HEADERS_SENT', name: 'Error', - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); assert.throws( @@ -135,7 +135,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_HTTP2_HEADERS_SENT', name: 'Error', - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); @@ -145,7 +145,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_HTTP2_HEADERS_SENT', name: 'Error', - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); assert.throws( @@ -153,7 +153,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_HTTP2_HEADERS_SENT', name: 'Error', - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); @@ -170,7 +170,7 @@ server.listen(0, common.mustCall(function() { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('end', common.mustCall(function() { diff --git a/test/parallel/test-http2-compat-serverresponse-settimeout.js b/test/parallel/test-http2-compat-serverresponse-settimeout.js index e24621ad097f3f..f89a80a26bfa7c 100644 --- a/test/parallel/test-http2-compat-serverresponse-settimeout.js +++ b/test/parallel/test-http2-compat-serverresponse-settimeout.js @@ -29,7 +29,7 @@ server.listen(0, common.mustCall(() => { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }); req.on('end', common.mustCall(() => { client.close(); diff --git a/test/parallel/test-http2-compat-serverresponse-statuscode.js b/test/parallel/test-http2-compat-serverresponse-statuscode.js index 6064a5936e2e1e..47ca1054abc7be 100644 --- a/test/parallel/test-http2-compat-serverresponse-statuscode.js +++ b/test/parallel/test-http2-compat-serverresponse-statuscode.js @@ -18,11 +18,11 @@ server.listen(0, common.mustCall(function() { ok: 200, multipleChoices: 300, badRequest: 400, - internalServerError: 500 + internalServerError: 500, }; const fakeStatusCodes = { tooLow: 99, - tooHigh: 600 + tooHigh: 600, }; assert.strictEqual(response.statusCode, expectedDefaultStatusCode); @@ -37,19 +37,19 @@ server.listen(0, common.mustCall(function() { response.statusCode = realStatusCodes.continue; }, { code: 'ERR_HTTP2_INFO_STATUS_NOT_ALLOWED', - name: 'RangeError' + name: 'RangeError', }); assert.throws(() => { response.statusCode = fakeStatusCodes.tooLow; }, { code: 'ERR_HTTP2_STATUS_INVALID', - name: 'RangeError' + name: 'RangeError', }); assert.throws(() => { response.statusCode = fakeStatusCodes.tooHigh; }, { code: 'ERR_HTTP2_STATUS_INVALID', - name: 'RangeError' + name: 'RangeError', }); response.on('finish', common.mustCall(function() { @@ -64,7 +64,7 @@ server.listen(0, common.mustCall(function() { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('end', common.mustCall(function() { diff --git a/test/parallel/test-http2-compat-serverresponse-statusmessage-property-set.js b/test/parallel/test-http2-compat-serverresponse-statusmessage-property-set.js index 87e172402899f2..c67583c03a40a8 100644 --- a/test/parallel/test-http2-compat-serverresponse-statusmessage-property-set.js +++ b/test/parallel/test-http2-compat-serverresponse-statusmessage-property-set.js @@ -35,7 +35,7 @@ server.listen(0, common.mustCall(function() { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', common.mustCall(function(headers) { diff --git a/test/parallel/test-http2-compat-serverresponse-statusmessage-property.js b/test/parallel/test-http2-compat-serverresponse-statusmessage-property.js index 8a083cf3ba1638..d35a21707d19e1 100644 --- a/test/parallel/test-http2-compat-serverresponse-statusmessage-property.js +++ b/test/parallel/test-http2-compat-serverresponse-statusmessage-property.js @@ -34,7 +34,7 @@ server.listen(0, common.mustCall(function() { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', common.mustCall(function(headers) { diff --git a/test/parallel/test-http2-compat-serverresponse-statusmessage.js b/test/parallel/test-http2-compat-serverresponse-statusmessage.js index dee916d1aeef54..e45d8b1a372ef3 100644 --- a/test/parallel/test-http2-compat-serverresponse-statusmessage.js +++ b/test/parallel/test-http2-compat-serverresponse-statusmessage.js @@ -37,7 +37,7 @@ server.listen(0, common.mustCall(function() { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', common.mustCall(function(headers) { diff --git a/test/parallel/test-http2-compat-serverresponse-trailers.js b/test/parallel/test-http2-compat-serverresponse-trailers.js index 4cfbae0bdaf952..bd6b85dccf91e6 100644 --- a/test/parallel/test-http2-compat-serverresponse-trailers.js +++ b/test/parallel/test-http2-compat-serverresponse-trailers.js @@ -11,7 +11,7 @@ server.listen(0, common.mustCall(() => { const port = server.address().port; server.once('request', common.mustCall((request, response) => { response.addTrailers({ - ABC: 123 + ABC: 123, }); response.setTrailer('ABCD', 123); @@ -20,7 +20,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_INVALID_HTTP_TOKEN', name: 'TypeError', - message: 'Header name must be a valid HTTP token [""]' + message: 'Header name must be a valid HTTP token [""]', } ); assert.throws( @@ -28,7 +28,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_HTTP2_INVALID_HEADER_VALUE', name: 'TypeError', - message: 'Invalid value "undefined" for header "test"' + message: 'Invalid value "undefined" for header "test"', } ); assert.throws( @@ -36,7 +36,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_HTTP2_INVALID_HEADER_VALUE', name: 'TypeError', - message: 'Invalid value "null" for header "test"' + message: 'Invalid value "null" for header "test"', } ); assert.throws( @@ -45,7 +45,7 @@ server.listen(0, common.mustCall(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "name" argument must be of type string. Received ' + - 'undefined' + 'undefined', } ); assert.throws( @@ -53,7 +53,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_INVALID_HTTP_TOKEN', name: 'TypeError', - message: 'Header name must be a valid HTTP token [""]' + message: 'Header name must be a valid HTTP token [""]', } ); diff --git a/test/parallel/test-http2-compat-serverresponse-write.js b/test/parallel/test-http2-compat-serverresponse-write.js index 1d7159d46e72bd..4c48930f32cf20 100644 --- a/test/parallel/test-http2-compat-serverresponse-write.js +++ b/test/parallel/test-http2-compat-serverresponse-write.js @@ -4,7 +4,7 @@ const { mustCall, mustNotCall, hasCrypto, - skip + skip, } = require('../common'); if (!hasCrypto) skip('missing crypto'); diff --git a/test/parallel/test-http2-compat-serverresponse-writehead-array.js b/test/parallel/test-http2-compat-serverresponse-writehead-array.js index c28f7329c1d0a1..0b6fc378d13cb8 100644 --- a/test/parallel/test-http2-compat-serverresponse-writehead-array.js +++ b/test/parallel/test-http2-compat-serverresponse-writehead-array.js @@ -26,7 +26,7 @@ server.listen(0, common.mustCall(() => { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', common.mustCall((headers) => { diff --git a/test/parallel/test-http2-compat-serverresponse-writehead.js b/test/parallel/test-http2-compat-serverresponse-writehead.js index 8157dcbedd0f2f..3b453e11ec5804 100644 --- a/test/parallel/test-http2-compat-serverresponse-writehead.js +++ b/test/parallel/test-http2-compat-serverresponse-writehead.js @@ -20,7 +20,7 @@ server.listen(0, common.mustCall(function() { assert.strictEqual(returnVal, response); assert.throws(() => { response.writeHead(300); }, { - code: 'ERR_HTTP2_HEADERS_SENT' + code: 'ERR_HTTP2_HEADERS_SENT', }); response.on('finish', common.mustCall(function() { @@ -40,7 +40,7 @@ server.listen(0, common.mustCall(function() { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', common.mustCall(function(headers) { diff --git a/test/parallel/test-http2-compat-serverresponse.js b/test/parallel/test-http2-compat-serverresponse.js index fbde58693b05a7..7b77953977a92d 100644 --- a/test/parallel/test-http2-compat-serverresponse.js +++ b/test/parallel/test-http2-compat-serverresponse.js @@ -31,7 +31,7 @@ server.listen(0, common.mustCall(function() { ':path': '/foobar', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('end', common.mustCall(function() { diff --git a/test/parallel/test-http2-compat-short-stream-client-server.js b/test/parallel/test-http2-compat-short-stream-client-server.js index f7ef9412106f59..13c8c1c1ab9307 100644 --- a/test/parallel/test-http2-compat-short-stream-client-server.js +++ b/test/parallel/test-http2-compat-short-stream-client-server.js @@ -13,7 +13,7 @@ const server = http2.createServer(common.mustCall((req, res) => { read() { this.push('test'); this.push(null); - } + }, }); input.pipe(res); })); diff --git a/test/parallel/test-http2-compat-socket-destroy-delayed.js b/test/parallel/test-http2-compat-socket-destroy-delayed.js index 62405047d8266e..425d8699ddee2f 100644 --- a/test/parallel/test-http2-compat-socket-destroy-delayed.js +++ b/test/parallel/test-http2-compat-socket-destroy-delayed.js @@ -27,7 +27,7 @@ app.listen(0, mustCall(() => { const session = http2.connect(`http://localhost:${app.address().port}`); const request = session.request({ [HTTP2_HEADER_PATH]: '/', - [HTTP2_HEADER_METHOD]: 'get' + [HTTP2_HEADER_METHOD]: 'get', }); request.once('response', mustCall((headers, flags) => { let data = ''; diff --git a/test/parallel/test-http2-compat-socket-set.js b/test/parallel/test-http2-compat-socket-set.js index b14a2f65d8e7fd..e971e365ae457a 100644 --- a/test/parallel/test-http2-compat-socket-set.js +++ b/test/parallel/test-http2-compat-socket-set.js @@ -13,7 +13,7 @@ const errMsg = { code: 'ERR_HTTP2_NO_SOCKET_MANIPULATION', name: 'Error', message: 'HTTP/2 sockets should not be directly manipulated ' + - '(e.g. read and written)' + '(e.g. read and written)', }; const server = h2.createServer(); @@ -94,7 +94,7 @@ server.listen(0, common.mustCall(function() { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('end', common.mustCall(() => { diff --git a/test/parallel/test-http2-compat-socket.js b/test/parallel/test-http2-compat-socket.js index 95bc42180ef8e9..ee9a10d33dfb51 100644 --- a/test/parallel/test-http2-compat-socket.js +++ b/test/parallel/test-http2-compat-socket.js @@ -19,7 +19,7 @@ const errMsg = { code: 'ERR_HTTP2_NO_SOCKET_MANIPULATION', name: 'Error', message: 'HTTP/2 sockets should not be directly manipulated ' + - '(e.g. read and written)' + '(e.g. read and written)', }; const server = h2.createServer(); @@ -81,7 +81,7 @@ server.listen(0, common.mustCall(function() { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('end', common.mustCall(() => { diff --git a/test/parallel/test-http2-connect-method-extended-cant-turn-off.js b/test/parallel/test-http2-connect-method-extended-cant-turn-off.js index f4d033efe65707..4cfd0bf3dae3f2 100644 --- a/test/parallel/test-http2-connect-method-extended-cant-turn-off.js +++ b/test/parallel/test-http2-connect-method-extended-cant-turn-off.js @@ -21,7 +21,7 @@ server.listen(0, common.mustCall(() => { assert(settings.enableConnectProtocol); const req = client.request({ ':method': 'CONNECT', - ':protocol': 'foo' + ':protocol': 'foo', }); req.on('error', common.mustCall(() => { server.close(); diff --git a/test/parallel/test-http2-connect-method-extended.js b/test/parallel/test-http2-connect-method-extended.js index bb424c73f0a2ad..3151bdf3d272d1 100644 --- a/test/parallel/test-http2-connect-method-extended.js +++ b/test/parallel/test-http2-connect-method-extended.js @@ -25,7 +25,7 @@ server.listen(0, common.mustCall(() => { assert(settings.enableConnectProtocol); const req = client.request({ ':method': 'CONNECT', - ':protocol': 'foo' + ':protocol': 'foo', }); req.resume(); req.on('end', common.mustCall()); diff --git a/test/parallel/test-http2-connect-method.js b/test/parallel/test-http2-connect-method.js index 4ada9f47553528..ebf6c5aa56d32a 100644 --- a/test/parallel/test-http2-connect-method.js +++ b/test/parallel/test-http2-connect-method.js @@ -13,7 +13,7 @@ const { HTTP2_HEADER_SCHEME, HTTP2_HEADER_PATH, NGHTTP2_CONNECT_ERROR, - NGHTTP2_REFUSED_STREAM + NGHTTP2_REFUSED_STREAM, } = http2.constants; const server = net.createServer(common.mustCall((socket) => { @@ -57,33 +57,33 @@ server.listen(0, common.mustCall(() => { // Confirm that :authority is required and :scheme & :path are forbidden assert.throws( () => client.request({ - [HTTP2_HEADER_METHOD]: 'CONNECT' + [HTTP2_HEADER_METHOD]: 'CONNECT', }), { code: 'ERR_HTTP2_CONNECT_AUTHORITY', - message: ':authority header is required for CONNECT requests' + message: ':authority header is required for CONNECT requests', } ); assert.throws( () => client.request({ [HTTP2_HEADER_METHOD]: 'CONNECT', [HTTP2_HEADER_AUTHORITY]: `localhost:${port}`, - [HTTP2_HEADER_SCHEME]: 'http' + [HTTP2_HEADER_SCHEME]: 'http', }), { code: 'ERR_HTTP2_CONNECT_SCHEME', - message: 'The :scheme header is forbidden for CONNECT requests' + message: 'The :scheme header is forbidden for CONNECT requests', } ); assert.throws( () => client.request({ [HTTP2_HEADER_METHOD]: 'CONNECT', [HTTP2_HEADER_AUTHORITY]: `localhost:${port}`, - [HTTP2_HEADER_PATH]: '/' + [HTTP2_HEADER_PATH]: '/', }), { code: 'ERR_HTTP2_CONNECT_PATH', - message: 'The :path header is forbidden for CONNECT requests' + message: 'The :path header is forbidden for CONNECT requests', } ); diff --git a/test/parallel/test-http2-connect-options.js b/test/parallel/test-http2-connect-options.js index 0c7ec807b84d38..0c6989233de8c2 100644 --- a/test/parallel/test-http2-connect-options.js +++ b/test/parallel/test-http2-connect-options.js @@ -29,7 +29,7 @@ server.listen(0, '127.0.0.1', common.mustCall(() => { options ); const req = client.request({ - ':path': '/' + ':path': '/', }); req.on('data', () => req.resume()); req.on('end', common.mustCall(function() { diff --git a/test/parallel/test-http2-connect-tls-with-delay.js b/test/parallel/test-http2-connect-tls-with-delay.js index 0b3753ae383642..7fcddd9f811fd0 100644 --- a/test/parallel/test-http2-connect-tls-with-delay.js +++ b/test/parallel/test-http2-connect-tls-with-delay.js @@ -10,7 +10,7 @@ const fixtures = require('../common/fixtures'); const serverOptions = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = http2.createSecureServer(serverOptions, (req, res) => { @@ -23,7 +23,7 @@ server.listen(0, '127.0.0.1', common.mustCall(() => { host: '127.0.0.1', servername: 'localhost', port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }; const socket = tls.connect(options, async () => { @@ -35,7 +35,7 @@ server.listen(0, '127.0.0.1', common.mustCall(() => { client.once('remoteSettings', common.mustCall(() => { const req = client.request({ - ':path': '/' + ':path': '/', }); req.on('data', () => req.resume()); req.on('end', common.mustCall(() => { diff --git a/test/parallel/test-http2-connect.js b/test/parallel/test-http2-connect.js index 9b4055373f25bd..44f89cfbc63434 100644 --- a/test/parallel/test-http2-connect.js +++ b/test/parallel/test-http2-connect.js @@ -5,7 +5,7 @@ const { hasCrypto, hasIPv6, skip, - expectsError + expectsError, } = require('../common'); if (!hasCrypto) skip('missing crypto'); @@ -76,7 +76,7 @@ const { connect: tlsConnect } = require('tls'); { const serverOptions = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = createSecureServer(serverOptions); server.listen(0, mustCall(() => { @@ -97,7 +97,7 @@ const { connect: tlsConnect } = require('tls'); const clientOptions = { ALPNProtocols: ['h2'], port, - rejectUnauthorized: false + rejectUnauthorized: false, }; const socket = tlsConnect(clientOptions, mustCall(onSocketConnect)); })); @@ -108,11 +108,11 @@ const { connect: tlsConnect } = require('tls'); createServer(function() { connect(`http://localhost:${this.address().port}`, { settings: { - maxFrameSize: 1 // An incorrect settings - } + maxFrameSize: 1, // An incorrect settings + }, }).on('error', expectsError({ code: 'ERR_HTTP2_INVALID_SETTING_VALUE', - name: 'RangeError' + name: 'RangeError', })); }); } @@ -124,7 +124,7 @@ const { connect: tlsConnect } = require('tls'); connect(authority); }, { code: 'ERR_HTTP2_UNSUPPORTED_PROTOCOL', - name: 'Error' + name: 'Error', }); } @@ -157,7 +157,7 @@ if (hasIPv6) { server.listen(0, mustCall(() => { connect('http://foo.bar', { host: 'localhost', - port: server.address().port + port: server.address().port, }, mustCall((session) => { session.close(); server.close(); diff --git a/test/parallel/test-http2-cookies.js b/test/parallel/test-http2-cookies.js index a270c1d73b1ba1..c781fad67bf84f 100644 --- a/test/parallel/test-http2-cookies.js +++ b/test/parallel/test-http2-cookies.js @@ -27,7 +27,7 @@ function onStream(stream, headers, flags) { stream.respond({ 'content-type': 'text/html', ':status': 200, - 'set-cookie': setCookie + 'set-cookie': setCookie, }); stream.end('hello world'); diff --git a/test/parallel/test-http2-create-client-connect.js b/test/parallel/test-http2-create-client-connect.js index 9859fe10677155..2d81786fb2df03 100644 --- a/test/parallel/test-http2-create-client-connect.js +++ b/test/parallel/test-http2-create-client-connect.js @@ -52,7 +52,7 @@ const url = require('url'); const options = { key: fixtures.readKey('agent3-key.pem'), - cert: fixtures.readKey('agent3-cert.pem') + cert: fixtures.readKey('agent3-cert.pem'), }; const server = h2.createSecureServer(options); diff --git a/test/parallel/test-http2-create-client-secure-session.js b/test/parallel/test-http2-create-client-secure-session.js index 4303786b3e435d..c6bf3dc0738596 100644 --- a/test/parallel/test-http2-create-client-secure-session.js +++ b/test/parallel/test-http2-create-client-secure-session.js @@ -31,7 +31,7 @@ function onStream(stream, headers) { stream.respond({ 'content-type': 'application/json' }); stream.end(JSON.stringify({ servername: socket.servername, - alpnProtocol: socket.alpnProtocol + alpnProtocol: socket.alpnProtocol, })); } diff --git a/test/parallel/test-http2-create-client-session.js b/test/parallel/test-http2-create-client-session.js index b2d6ddbe7a03e1..8a9294cc0b27c8 100644 --- a/test/parallel/test-http2-create-client-session.js +++ b/test/parallel/test-http2-create-client-session.js @@ -23,7 +23,7 @@ function onStream(stream, headers, flags) { assert.strictEqual(flags, 5); stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.write(body.slice(0, 20)); stream.end(body.slice(20)); diff --git a/test/parallel/test-http2-createsecureserver-options.js b/test/parallel/test-http2-createsecureserver-options.js index 269239fcf2874e..d0de49fe2cbf68 100644 --- a/test/parallel/test-http2-createsecureserver-options.js +++ b/test/parallel/test-http2-createsecureserver-options.js @@ -16,7 +16,7 @@ invalidOptions.forEach((invalidOption) => { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "options" argument must be of type object.' + - common.invalidArgTypeHelper(invalidOption) + common.invalidArgTypeHelper(invalidOption), } ); }); @@ -29,7 +29,7 @@ invalidOptions.forEach((invalidSettingsOption) => { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "options.settings" property must be of type object.' + - common.invalidArgTypeHelper(invalidSettingsOption) + common.invalidArgTypeHelper(invalidSettingsOption), } ); }); diff --git a/test/parallel/test-http2-createserver-options.js b/test/parallel/test-http2-createserver-options.js index 8814e2db9e8828..514817c147b125 100644 --- a/test/parallel/test-http2-createserver-options.js +++ b/test/parallel/test-http2-createserver-options.js @@ -16,7 +16,7 @@ invalidOptions.forEach((invalidOption) => { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "options" argument must be of type object.' + - common.invalidArgTypeHelper(invalidOption) + common.invalidArgTypeHelper(invalidOption), } ); }); @@ -29,7 +29,7 @@ invalidOptions.forEach((invalidSettingsOption) => { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "options.settings" property must be of type object.' + - common.invalidArgTypeHelper(invalidSettingsOption) + common.invalidArgTypeHelper(invalidSettingsOption), } ); }); @@ -67,7 +67,7 @@ Object.entries({ code: 'ERR_OUT_OF_RANGE', }, }, - ] + ], }).forEach(([opt, tests]) => { tests.forEach(({ val, err }) => { assert.throws( diff --git a/test/parallel/test-http2-createwritereq.js b/test/parallel/test-http2-createwritereq.js index 3015ad6c642801..cdc3ed40214126 100644 --- a/test/parallel/test-http2-createwritereq.js +++ b/test/parallel/test-http2-createwritereq.js @@ -24,7 +24,7 @@ const encodings = { 'ucs-2': 'ucs2', 'utf16le': 'ucs2', 'utf-16le': 'ucs2', - 'UTF8': 'utf8' // Should fall through to Buffer.from + 'UTF8': 'utf8', // Should fall through to Buffer.from }; const testsToRun = Object.keys(encodings).length; @@ -45,7 +45,7 @@ server.listen(0, common.mustCall(function() { const client = http2.connect(`http://localhost:${this.address().port}`); const req = client.request({ ':path': `/${writeEncoding}`, - ':method': 'POST' + ':method': 'POST', }); assert.strictEqual(req._writableState.decodeStrings, false); diff --git a/test/parallel/test-http2-destroy-after-write.js b/test/parallel/test-http2-destroy-after-write.js index 399df015b8879e..8d8679d0f31800 100644 --- a/test/parallel/test-http2-destroy-after-write.js +++ b/test/parallel/test-http2-destroy-after-write.js @@ -13,7 +13,7 @@ server.on('session', common.mustCall(function(session) { session.on('stream', common.mustCall(function(stream) { stream.on('end', common.mustCall(function() { this.respond({ - ':status': 200 + ':status': 200, }); this.write('foo'); this.destroy(); diff --git a/test/parallel/test-http2-empty-frame-without-eof.js b/test/parallel/test-http2-empty-frame-without-eof.js index fe65f26bb31d49..9261a8c644f41e 100644 --- a/test/parallel/test-http2-empty-frame-without-eof.js +++ b/test/parallel/test-http2-empty-frame-without-eof.js @@ -16,11 +16,11 @@ async function main() { for (const maxSessionInvalidFrames of [0, 2]) { const client = http2.connect(`http://localhost:${server.address().port}`, { - maxSessionInvalidFrames + maxSessionInvalidFrames, }); const stream = client.request({ ':method': 'GET', - ':path': '/' + ':path': '/', }); if (maxSessionInvalidFrames) { stream.on('error', common.mustNotCall()); @@ -28,7 +28,7 @@ async function main() { } else { const expected = { code: 'ERR_HTTP2_TOO_MANY_INVALID_FRAMES', - message: 'Too many invalid HTTP/2 frames' + message: 'Too many invalid HTTP/2 frames', }; stream.on('error', common.expectsError(expected)); client.on('error', common.expectsError(expected)); diff --git a/test/parallel/test-http2-forget-closed-streams.js b/test/parallel/test-http2-forget-closed-streams.js index c0b3bcd819140c..0b78fa306f3d76 100644 --- a/test/parallel/test-http2-forget-closed-streams.js +++ b/test/parallel/test-http2-forget-closed-streams.js @@ -24,9 +24,9 @@ server.on('session', function(session) { session.on('stream', function(stream) { stream.on('end', common.mustCall(function() { this.respond({ - ':status': 200 + ':status': 200, }, { - endStream: true + endStream: true, }); })); stream.resume(); diff --git a/test/parallel/test-http2-generic-streams-sendfile.js b/test/parallel/test-http2-generic-streams-sendfile.js index b752b0fdcb815a..a001e1922e87d7 100644 --- a/test/parallel/test-http2-generic-streams-sendfile.js +++ b/test/parallel/test-http2-generic-streams-sendfile.js @@ -17,7 +17,7 @@ const makeDuplexPair = require('../common/duplexpair'); server.emit('connection', serverSide); const client = http2.connect('http://localhost:80', { - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }); const req = client.request(); diff --git a/test/parallel/test-http2-generic-streams.js b/test/parallel/test-http2-generic-streams.js index d97e86a5ecea55..241f0438e6a9f2 100644 --- a/test/parallel/test-http2-generic-streams.js +++ b/test/parallel/test-http2-generic-streams.js @@ -12,7 +12,7 @@ const makeDuplexPair = require('../common/duplexpair'); server.on('stream', common.mustCall((stream, headers) => { stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end(testData); })); @@ -21,7 +21,7 @@ const makeDuplexPair = require('../common/duplexpair'); server.emit('connection', serverSide); const client = http2.connect('http://localhost:80', { - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }); const req = client.request({ ':path': '/' }); diff --git a/test/parallel/test-http2-getpackedsettings.js b/test/parallel/test-http2-getpackedsettings.js index 4f5970522f13b3..5cf3d5860b7c58 100644 --- a/test/parallel/test-http2-getpackedsettings.js +++ b/test/parallel/test-http2-getpackedsettings.js @@ -56,7 +56,7 @@ http2.getPackedSettings({ enablePush: false }); }, { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', name: 'RangeError', - message: `Invalid value for setting "${i[0]}": ${i[1]}` + message: `Invalid value for setting "${i[0]}": ${i[1]}`, }); }); @@ -68,7 +68,7 @@ http2.getPackedSettings({ enablePush: false }); }, { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', name: 'TypeError', - message: `Invalid value for setting "enablePush": ${i}` + message: `Invalid value for setting "enablePush": ${i}`, }); }); @@ -80,7 +80,7 @@ http2.getPackedSettings({ enablePush: false }); }, { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', name: 'TypeError', - message: `Invalid value for setting "enableConnectProtocol": ${i}` + message: `Invalid value for setting "enableConnectProtocol": ${i}`, }); }); @@ -104,7 +104,7 @@ http2.getPackedSettings({ enablePush: false }); maxHeaderSize: 100, enablePush: true, enableConnectProtocol: false, - foo: 'ignored' + foo: 'ignored', }); assert.strictEqual(packed.length, 42); assert.deepStrictEqual(packed, check); @@ -134,7 +134,7 @@ http2.getPackedSettings({ enablePush: false }); name: 'TypeError', message: 'The "buf" argument must be an instance of Buffer or TypedArray.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), }); }); @@ -143,7 +143,7 @@ http2.getPackedSettings({ enablePush: false }); }, { code: 'ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH', name: 'RangeError', - message: 'Packed settings length must be a multiple of six' + message: 'Packed settings length must be a multiple of six', }); const settings = http2.getUnpackedSettings(packed); @@ -174,7 +174,7 @@ http2.getPackedSettings({ enablePush: false }); }, { code: 'ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH', name: 'RangeError', - message: 'Packed settings length must be a multiple of six' + message: 'Packed settings length must be a multiple of six', }); const settings = http2.getUnpackedSettings(packed); @@ -207,7 +207,7 @@ http2.getPackedSettings({ enablePush: false }); name: 'TypeError', message: 'The "buf" argument must be an instance of Buffer or TypedArray.' + - common.invalidArgTypeHelper(packed) + common.invalidArgTypeHelper(packed), }); } @@ -253,6 +253,6 @@ http2.getPackedSettings({ enablePush: false }); }, { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', name: 'RangeError', - message: 'Invalid value for setting "maxFrameSize": 16777216' + message: 'Invalid value for setting "maxFrameSize": 16777216', }); } diff --git a/test/parallel/test-http2-head-request.js b/test/parallel/test-http2-head-request.js index 6cf0a4d81cd41c..ecc18b60006c6f 100644 --- a/test/parallel/test-http2-head-request.js +++ b/test/parallel/test-http2-head-request.js @@ -9,7 +9,7 @@ const http2 = require('http2'); const errCheck = common.expectsError({ name: 'Error', code: 'ERR_STREAM_WRITE_AFTER_END', - message: 'write after end' + message: 'write after end', }, 1); const { @@ -38,7 +38,7 @@ server.listen(0, () => { const req = client.request({ [HTTP2_HEADER_METHOD]: HTTP2_METHOD_HEAD, - [HTTP2_HEADER_PATH]: '/' + [HTTP2_HEADER_PATH]: '/', }); req.on('response', common.mustCall((headers, flags) => { diff --git a/test/parallel/test-http2-https-fallback-http-server-options.js b/test/parallel/test-http2-https-fallback-http-server-options.js index 8143f56d491ccc..ca39677a2a7744 100644 --- a/test/parallel/test-http2-https-fallback-http-server-options.js +++ b/test/parallel/test-http2-https-fallback-http-server-options.js @@ -24,7 +24,7 @@ function onRequest(request, response) { response.end(JSON.stringify({ alpnProtocol, httpVersion: request.httpVersion, - userAgent: request.getUserAgent() + userAgent: request.getUserAgent(), })); } @@ -47,7 +47,7 @@ class MyServerResponse extends http.ServerResponse { cert, key, allowHTTP1: true, Http1IncomingMessage: MyIncomingMessage, - Http1ServerResponse: MyServerResponse + Http1ServerResponse: MyServerResponse, }, common.mustCall(onRequest, 1) ); @@ -62,7 +62,7 @@ class MyServerResponse extends http.ServerResponse { https.get( Object.assign(url.parse(origin), { secureContext: tls.createSecureContext({ ca }), - headers: { 'User-Agent': 'node-test' } + headers: { 'User-Agent': 'node-test' }, }), common.mustCall((response) => { assert.strictEqual(response.statusCode, 200); diff --git a/test/parallel/test-http2-https-fallback.js b/test/parallel/test-http2-https-fallback.js index a872d686d34f85..0779b426ffdf26 100644 --- a/test/parallel/test-http2-https-fallback.js +++ b/test/parallel/test-http2-https-fallback.js @@ -27,7 +27,7 @@ function onRequest(request, response) { response.writeHead(200, { 'content-type': 'application/json' }); response.end(JSON.stringify({ alpnProtocol, - httpVersion: request.httpVersion + httpVersion: request.httpVersion, })); } @@ -36,7 +36,7 @@ function onSession(session, next) { ':path': '/', ':method': 'GET', ':scheme': 'https', - ':authority': `localhost:${this.server.address().port}` + ':authority': `localhost:${this.server.address().port}`, }; const request = session.request(headers); diff --git a/test/parallel/test-http2-info-headers-errors.js b/test/parallel/test-http2-info-headers-errors.js index aa1e28222c4c90..0d97522fcc82c3 100644 --- a/test/parallel/test-http2-info-headers-errors.js +++ b/test/parallel/test-http2-info-headers-errors.js @@ -9,7 +9,7 @@ const { internalBinding } = require('internal/test/binding'); const { constants, Http2Stream, - nghttp2ErrorString + nghttp2ErrorString, } = internalBinding('http2'); const { NghttpError } = require('internal/http2/util'); @@ -29,9 +29,9 @@ const genericTests = Object.getOwnPropertyNames(constants) code: 'ERR_HTTP2_ERROR', constructor: NghttpError, name: 'Error', - message: nghttp2ErrorString(constants[key]) + message: nghttp2ErrorString(constants[key]), }, - type: 'stream' + type: 'stream', })); @@ -73,7 +73,7 @@ function runTest(test) { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR' + message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR', })); req.on('close', common.mustCall(() => { diff --git a/test/parallel/test-http2-info-headers.js b/test/parallel/test-http2-info-headers.js index 3f2a50042581a0..374f5ca93e441c 100644 --- a/test/parallel/test-http2-info-headers.js +++ b/test/parallel/test-http2-info-headers.js @@ -22,14 +22,14 @@ function onStream(stream, headers, flags) { { code: 'ERR_HTTP2_INVALID_INFO_STATUS', name: 'RangeError', - message: /^Invalid informational status code: 201$/ + message: /^Invalid informational status code: 201$/, }); assert.throws(() => stream.additionalHeaders({ ':status': 101 }), { code: 'ERR_HTTP2_STATUS_101', name: 'Error', - message: status101regex + message: status101regex, }); assert.throws( @@ -37,7 +37,7 @@ function onStream(stream, headers, flags) { { code: 'ERR_HTTP2_INVALID_PSEUDOHEADER', name: 'TypeError', - message: '":method" is an invalid pseudoheader or is used incorrectly' + message: '":method" is an invalid pseudoheader or is used incorrectly', } ); @@ -47,14 +47,14 @@ function onStream(stream, headers, flags) { stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); assert.throws(() => stream.additionalHeaders({ abc: 123 }), { code: 'ERR_HTTP2_HEADERS_AFTER_RESPOND', name: 'Error', - message: afterRespondregex + message: afterRespondregex, }); stream.end('hello world'); diff --git a/test/parallel/test-http2-invalidargtypes-errors.js b/test/parallel/test-http2-invalidargtypes-errors.js index 5f126b060a9f49..5d70ec6d447f47 100644 --- a/test/parallel/test-http2-invalidargtypes-errors.js +++ b/test/parallel/test-http2-invalidargtypes-errors.js @@ -15,7 +15,7 @@ server.on('stream', common.mustCall((stream) => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "code" argument must be of type number. ' + - "Received type string ('string')" + "Received type string ('string')", } ); assert.throws( @@ -24,7 +24,7 @@ server.on('stream', common.mustCall((stream) => { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "code" is out of range. It must be an integer. ' + - 'Received 1.01' + 'Received 1.01', } ); [-1, 2 ** 32].forEach((code) => { @@ -35,7 +35,7 @@ server.on('stream', common.mustCall((stream) => { name: 'RangeError', message: 'The value of "code" is out of range. ' + 'It must be >= 0 && <= 4294967295. ' + - `Received ${code}` + `Received ${code}`, } ); }); diff --git a/test/parallel/test-http2-invalidheaderfield.js b/test/parallel/test-http2-invalidheaderfield.js index 0544113f0bd7a7..fea5f07d45bf71 100644 --- a/test/parallel/test-http2-invalidheaderfield.js +++ b/test/parallel/test-http2-invalidheaderfield.js @@ -15,12 +15,12 @@ const { throws, strictEqual } = require('assert'); throws(() => { res.setHeader(':path', '/'); }, { - code: 'ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED' + code: 'ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED', }); throws(() => { res.setHeader('t est', 123); }, { - code: 'ERR_INVALID_HTTP_TOKEN' + code: 'ERR_INVALID_HTTP_TOKEN', }); res.setHeader('TEST', 123); res.setHeader('test_', 123); @@ -49,7 +49,7 @@ const { throws, strictEqual } = require('assert'); throws(() => { session.request({ 't est': 123 }); }, { - code: 'ERR_INVALID_HTTP_TOKEN' + code: 'ERR_INVALID_HTTP_TOKEN', }); })); } @@ -66,7 +66,7 @@ const { throws, strictEqual } = require('assert'); throws(() => { session.request({ ' test': 123 }); }, { - code: 'ERR_INVALID_HTTP_TOKEN' + code: 'ERR_INVALID_HTTP_TOKEN', }); })); } @@ -78,7 +78,7 @@ const { throws, strictEqual } = require('assert'); throws(() => { session4.request({ ':test': 123 }); }, { - code: 'ERR_HTTP2_INVALID_PSEUDOHEADER' + code: 'ERR_HTTP2_INVALID_PSEUDOHEADER', }); session4.close(); server.close(); diff --git a/test/parallel/test-http2-invalidheaderfields-client.js b/test/parallel/test-http2-invalidheaderfields-client.js index a5681970faab27..4f41d53976efbf 100644 --- a/test/parallel/test-http2-invalidheaderfields-client.js +++ b/test/parallel/test-http2-invalidheaderfields-client.js @@ -12,7 +12,7 @@ server1.listen(0, common.mustCall(() => { assert.throws(() => { session.request({ 'no underscore': 123 }); }, { - code: 'ERR_INVALID_HTTP_TOKEN' + code: 'ERR_INVALID_HTTP_TOKEN', }); session.on('error', common.mustCall((e) => { assert.strictEqual(e.code, 'ERR_INVALID_HTTP_TOKEN'); @@ -25,7 +25,7 @@ const server2 = http2.createServer(common.mustCall((req, res) => { assert.throws(() => { res.setHeader('x y z', 123); }, { - code: 'ERR_INVALID_HTTP_TOKEN' + code: 'ERR_INVALID_HTTP_TOKEN', }); res.end(); })); @@ -43,10 +43,10 @@ const server3 = http2.createServer(common.mustCall((req, res) => { // check for writeHead assert.throws(common.mustCall(() => { res.writeHead(200, { - 'an invalid header': 123 + 'an invalid header': 123, }); }), { - code: 'ERR_INVALID_HTTP_TOKEN' + code: 'ERR_INVALID_HTTP_TOKEN', }); res.end(); })); diff --git a/test/parallel/test-http2-large-write-close.js b/test/parallel/test-http2-large-write-close.js index f9dee357d6da7b..887384b260f97a 100644 --- a/test/parallel/test-http2-large-write-close.js +++ b/test/parallel/test-http2-large-write-close.js @@ -10,13 +10,13 @@ const content = Buffer.alloc(1e5, 0x44); const server = http2.createSecureServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }); server.on('stream', common.mustCall((stream) => { stream.respond({ 'Content-Type': 'application/octet-stream', 'Content-Length': (content.length.toString() * 2), - 'Vary': 'Accept-Encoding' + 'Vary': 'Accept-Encoding', }); stream.write(content); diff --git a/test/parallel/test-http2-large-write-destroy.js b/test/parallel/test-http2-large-write-destroy.js index b59c66bb04755b..358d12f5ed74d2 100644 --- a/test/parallel/test-http2-large-write-destroy.js +++ b/test/parallel/test-http2-large-write-destroy.js @@ -13,13 +13,13 @@ const content = Buffer.alloc(60000, 0x44); const server = http2.createSecureServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }); server.on('stream', common.mustCall((stream) => { stream.respond({ 'Content-Type': 'application/octet-stream', 'Content-Length': (content.length.toString() * 2), - 'Vary': 'Accept-Encoding' + 'Vary': 'Accept-Encoding', }, { waitForTrailers: true }); stream.write(content); diff --git a/test/parallel/test-http2-large-write-multiple-requests.js b/test/parallel/test-http2-large-write-multiple-requests.js index 0d65c3479b409d..8508cba644c7f3 100644 --- a/test/parallel/test-http2-large-write-multiple-requests.js +++ b/test/parallel/test-http2-large-write-multiple-requests.js @@ -10,12 +10,12 @@ const http2 = require('http2'); const content = fixtures.readSync('person-large.jpg'); const server = http2.createServer({ - maxSessionMemory: 1000 + maxSessionMemory: 1000, }); server.on('stream', (stream, headers) => { stream.respond({ 'content-type': 'image/jpeg', - ':status': 200 + ':status': 200, }); stream.end(content); }); diff --git a/test/parallel/test-http2-large-writes-session-memory-leak.js b/test/parallel/test-http2-large-writes-session-memory-leak.js index 641923c06c9133..82981756f68af4 100644 --- a/test/parallel/test-http2-large-writes-session-memory-leak.js +++ b/test/parallel/test-http2-large-writes-session-memory-leak.js @@ -27,7 +27,7 @@ server.listen(0, common.mustCall(() => { servername: 'agent2', // Set maxSessionMemory to 1MB so the leak causes errors faster. - maxSessionMemory: 1 + maxSessionMemory: 1, }); // Repeatedly create a new stream and read the incoming data. Even though we diff --git a/test/parallel/test-http2-max-concurrent-streams.js b/test/parallel/test-http2-max-concurrent-streams.js index a280d04a34f980..2e3e23f693d60b 100644 --- a/test/parallel/test-http2-max-concurrent-streams.js +++ b/test/parallel/test-http2-max-concurrent-streams.js @@ -50,7 +50,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_REFUSED_STREAM' + message: 'Stream closed with error code NGHTTP2_REFUSED_STREAM', })); } })); diff --git a/test/parallel/test-http2-max-invalid-frames.js b/test/parallel/test-http2-max-invalid-frames.js index 671aa833593017..5c76ed03ca6d1e 100644 --- a/test/parallel/test-http2-max-invalid-frames.js +++ b/test/parallel/test-http2-max-invalid-frames.js @@ -16,7 +16,7 @@ const server = http2.createServer({ maxSessionInvalidFrames }); server.on('stream', (stream) => { stream.respond({ 'content-type': 'text/plain', - ':status': 200 + ':status': 200, }); stream.end('Hello, world!\n'); }); @@ -25,7 +25,7 @@ server.listen(0, () => { const h2header = Buffer.alloc(9); const conn = net.connect({ port: server.address().port, - allowHalfOpen: true + allowHalfOpen: true, }); conn.write('PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n'); diff --git a/test/parallel/test-http2-max-session-memory-leak.js b/test/parallel/test-http2-max-session-memory-leak.js index b066ca80bc5eab..d87bc28b1fec55 100644 --- a/test/parallel/test-http2-max-session-memory-leak.js +++ b/test/parallel/test-http2-max-session-memory-leak.js @@ -20,14 +20,14 @@ server.on('stream', (stream) => { server.listen(common.mustCall(() => { const client = http2.connect(`http://localhost:${server.address().port}`, { - maxSessionMemory + maxSessionMemory, }); function request() { return new Promise((resolve, reject) => { const stream = client.request({ ':method': 'POST', - 'content-length': bodyLength + 'content-length': bodyLength, }); stream.on('error', reject); stream.on('response', resolve); diff --git a/test/parallel/test-http2-methods.js b/test/parallel/test-http2-methods.js index 143b50b66b4dff..6f0c716ca5578c 100644 --- a/test/parallel/test-http2-methods.js +++ b/test/parallel/test-http2-methods.js @@ -20,7 +20,7 @@ function onStream(stream, headers, flags) { assert(methods.includes(method), `method ${method} not included`); stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end('hello world'); } diff --git a/test/parallel/test-http2-misbehaving-flow-control-paused.js b/test/parallel/test-http2-misbehaving-flow-control-paused.js index e54bb83238e7fa..addccee1034ab4 100644 --- a/test/parallel/test-http2-misbehaving-flow-control-paused.js +++ b/test/parallel/test-http2-misbehaving-flow-control-paused.js @@ -63,7 +63,7 @@ server.on('stream', (stream) => { stream.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_FLOW_CONTROL_ERROR' + message: 'Stream closed with error code NGHTTP2_FLOW_CONTROL_ERROR', })); stream.on('close', common.mustCall(() => { server.close(); diff --git a/test/parallel/test-http2-misbehaving-flow-control.js b/test/parallel/test-http2-misbehaving-flow-control.js index 6774be2237b109..ba908d2d904fdc 100644 --- a/test/parallel/test-http2-misbehaving-flow-control.js +++ b/test/parallel/test-http2-misbehaving-flow-control.js @@ -69,7 +69,7 @@ server.on('stream', (stream) => { stream.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_FLOW_CONTROL_ERROR' + message: 'Stream closed with error code NGHTTP2_FLOW_CONTROL_ERROR', })); stream.on('close', common.mustCall(() => { server.close(common.mustCall()); diff --git a/test/parallel/test-http2-misbehaving-multiplex.js b/test/parallel/test-http2-misbehaving-multiplex.js index 0e057e1ed28e7a..c67c93f48d5dfd 100644 --- a/test/parallel/test-http2-misbehaving-multiplex.js +++ b/test/parallel/test-http2-misbehaving-multiplex.js @@ -32,7 +32,7 @@ server.on('stream', common.mustCall((stream) => { common.expectsError({ constructor: NghttpError, code: 'ERR_HTTP2_ERROR', - message: 'Stream was already closed or invalid' + message: 'Stream was already closed or invalid', }); return; } @@ -50,7 +50,7 @@ server.on('session', common.mustCall((session) => { session.on('error', common.expectsError({ code: 'ERR_HTTP2_ERROR', constructor: NghttpError, - message: 'Stream was already closed or invalid' + message: 'Stream was already closed or invalid', })); })); diff --git a/test/parallel/test-http2-misc-util.js b/test/parallel/test-http2-misc-util.js index 53eed542e2a605..7bcfa5d23ad26e 100644 --- a/test/parallel/test-http2-misc-util.js +++ b/test/parallel/test-http2-misc-util.js @@ -9,7 +9,7 @@ const assert = require('assert'); const { assertIsObject, assertWithinRange, - sessionName + sessionName, } = require('internal/http2/util'); // Code coverage for sessionName utility function @@ -25,7 +25,7 @@ assert.throws( { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', name: 'RangeError', - message: 'Invalid value for setting "test": -1' + message: 'Invalid value for setting "test": -1', }); assertWithinRange('test', 1); @@ -36,7 +36,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "test" argument must be of type object. Received ' + - "type string ('foo')" + "type string ('foo')", }); assert.throws( @@ -45,7 +45,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "test" argument must be an instance of Date. Received type ' + - "string ('foo')" + "string ('foo')", }); assertIsObject({}, 'test'); diff --git a/test/parallel/test-http2-misused-pseudoheaders.js b/test/parallel/test-http2-misused-pseudoheaders.js index 230843c619ce7c..d3c2863f450c9d 100644 --- a/test/parallel/test-http2-misused-pseudoheaders.js +++ b/test/parallel/test-http2-misused-pseudoheaders.js @@ -17,7 +17,7 @@ server.on('stream', common.mustCall((stream) => { ].forEach((i) => { assert.throws(() => stream.respond({ [i]: '/' }), { - code: 'ERR_HTTP2_INVALID_PSEUDOHEADER' + code: 'ERR_HTTP2_INVALID_PSEUDOHEADER', }); }); @@ -27,7 +27,7 @@ server.on('stream', common.mustCall((stream) => { assert.throws(() => { stream.sendTrailers({ ':status': 'bar' }); }, { - code: 'ERR_HTTP2_INVALID_PSEUDOHEADER' + code: 'ERR_HTTP2_INVALID_PSEUDOHEADER', }); stream.close(); }); diff --git a/test/parallel/test-http2-multi-content-length.js b/test/parallel/test-http2-multi-content-length.js index 013dc8935c2a3a..3469659989fd5e 100644 --- a/test/parallel/test-http2-multi-content-length.js +++ b/test/parallel/test-http2-multi-content-length.js @@ -28,12 +28,12 @@ server.listen(0, common.mustCall(() => { client.request({ ':method': 'POST', 'content-length': 1, - 'Content-Length': 2 + 'Content-Length': 2, }); }, { code: 'ERR_HTTP2_HEADER_SINGLE_VALUE', name: 'TypeError', - message: 'Header field "content-length" must only have a single value' + message: 'Header field "content-length" must only have a single value', } ); @@ -41,7 +41,7 @@ server.listen(0, common.mustCall(() => { // Request 2 will succeed const req = client.request({ ':method': 'POST', - 'content-length': 1 + 'content-length': 1, }); req.resume(); req.on('end', common.mustCall()); @@ -59,7 +59,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_PROTOCOL_ERROR' + message: 'Stream closed with error code NGHTTP2_PROTOCOL_ERROR', })); } })); diff --git a/test/parallel/test-http2-multistream-destroy-on-read-tls.js b/test/parallel/test-http2-multistream-destroy-on-read-tls.js index 91cbec6b2dc975..c6f0eff89e87e6 100644 --- a/test/parallel/test-http2-multistream-destroy-on-read-tls.js +++ b/test/parallel/test-http2-multistream-destroy-on-read-tls.js @@ -11,7 +11,7 @@ const http2 = require('http2'); const server = http2.createSecureServer({ key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }); const filenames = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']; @@ -27,13 +27,13 @@ server.on('stream', common.mustCall((stream) => { server.listen(0, common.mustCall(() => { const client = http2.connect(`https://localhost:${server.address().port}`, { ca: fixtures.readKey('agent2-cert.pem'), - servername: 'agent2' + servername: 'agent2', }); let destroyed = 0; for (const entry of filenames) { const stream = client.request({ - ':path': `/${entry}` + ':path': `/${entry}`, }); stream.once('data', common.mustCall(() => { stream.destroy(); diff --git a/test/parallel/test-http2-no-more-streams.js b/test/parallel/test-http2-no-more-streams.js index 26ec5ab8adebef..1e446a64846e48 100644 --- a/test/parallel/test-http2-no-more-streams.js +++ b/test/parallel/test-http2-no-more-streams.js @@ -44,8 +44,8 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_OUT_OF_STREAMS', name: 'Error', - message: - 'No stream ID is available because maximum stream ID has been reached' + message: 'No stream ID is available' + + ' because maximum stream ID has been reached', })); req.on('error', () => countdown.dec()); } diff --git a/test/parallel/test-http2-onping.js b/test/parallel/test-http2-onping.js index 134a94ddb8f582..3a2476db695eee 100644 --- a/test/parallel/test-http2-onping.js +++ b/test/parallel/test-http2-onping.js @@ -3,17 +3,17 @@ const { hasCrypto, mustCall, - skip + skip, } = require('../common'); if (!hasCrypto) skip('missing crypto'); const { - deepStrictEqual + deepStrictEqual, } = require('assert'); const { createServer, - connect + connect, } = require('http2'); const check = Buffer.from([ 1, 2, 3, 4, 5, 6, 7, 8 ]); diff --git a/test/parallel/test-http2-options-max-headers-block-length.js b/test/parallel/test-http2-options-max-headers-block-length.js index 11632c6e825c53..5933e8087fb7a4 100644 --- a/test/parallel/test-http2-options-max-headers-block-length.js +++ b/test/parallel/test-http2-options-max-headers-block-length.js @@ -16,7 +16,7 @@ server.listen(0, common.mustCall(() => { // headers block that is too big should cause a 'frameError' to // be emitted, and will cause the stream to be shutdown. const options = { - maxSendHeaderBlockLength: 10 + maxSendHeaderBlockLength: 10, }; const client = h2.connect(`http://localhost:${server.address().port}`, @@ -38,6 +38,6 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_REFUSED_STREAM' + message: 'Stream closed with error code NGHTTP2_REFUSED_STREAM', })); })); diff --git a/test/parallel/test-http2-options-server-request.js b/test/parallel/test-http2-options-server-request.js index 2143d379823d51..fcacdf9bbdbb52 100644 --- a/test/parallel/test-http2-options-server-request.js +++ b/test/parallel/test-http2-options-server-request.js @@ -13,7 +13,7 @@ class MyServerRequest extends h2.Http2ServerRequest { } const server = h2.createServer({ - Http2ServerRequest: MyServerRequest + Http2ServerRequest: MyServerRequest, }, (req, res) => { assert.strictEqual(req.getUserAgent(), 'node-test'); @@ -27,7 +27,7 @@ server.on('listening', common.mustCall(() => { const client = h2.connect(`http://localhost:${server.address().port}`); const req = client.request({ ':path': '/', - 'User-Agent': 'node-test' + 'User-Agent': 'node-test', }); req.on('response', common.mustCall()); diff --git a/test/parallel/test-http2-options-server-response.js b/test/parallel/test-http2-options-server-response.js index 6f1ae1881d22d8..e10cd396d06f7b 100644 --- a/test/parallel/test-http2-options-server-response.js +++ b/test/parallel/test-http2-options-server-response.js @@ -12,7 +12,7 @@ class MyServerResponse extends h2.Http2ServerResponse { } const server = h2.createServer({ - Http2ServerResponse: MyServerResponse + Http2ServerResponse: MyServerResponse, }, (req, res) => { res.status(200); res.end(); diff --git a/test/parallel/test-http2-origin.js b/test/parallel/test-http2-origin.js index 5193af6d99ef7e..2b1c47949b51b9 100644 --- a/test/parallel/test-http2-origin.js +++ b/test/parallel/test-http2-origin.js @@ -4,7 +4,7 @@ const { hasCrypto, mustCall, mustNotCall, - skip + skip, } = require('../common'); if (!hasCrypto) skip('missing crypto'); @@ -12,12 +12,12 @@ if (!hasCrypto) const { deepStrictEqual, strictEqual, - throws + throws, } = require('assert'); const { createSecureServer, createServer, - connect + connect, } = require('http2'); const Countdown = require('../common/countdown'); @@ -46,7 +46,7 @@ const ca = readKey('fake-startcom-root-cert.pem', 'binary'); () => session.origin(input), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -56,7 +56,7 @@ const ca = readKey('fake-startcom-root-cert.pem', 'binary'); () => session.origin(input), { code: 'ERR_HTTP2_INVALID_ORIGIN', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -66,7 +66,7 @@ const ca = readKey('fake-startcom-root-cert.pem', 'binary'); () => session.origin(input), { code: 'ERR_INVALID_URL', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -75,7 +75,7 @@ const ca = readKey('fake-startcom-root-cert.pem', 'binary'); () => session.origin(longInput), { code: 'ERR_HTTP2_ORIGIN_LENGTH', - name: 'TypeError' + name: 'TypeError', } ); })); diff --git a/test/parallel/test-http2-pack-end-stream-flag.js b/test/parallel/test-http2-pack-end-stream-flag.js index 9c0b3246f35ed7..939af1c4ec6ca0 100644 --- a/test/parallel/test-http2-pack-end-stream-flag.js +++ b/test/parallel/test-http2-pack-end-stream-flag.js @@ -13,7 +13,7 @@ const server = http2.createServer(); server.on('stream', (stream, headers) => { stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); switch (headers[':path']) { case '/singleEnd': diff --git a/test/parallel/test-http2-padding-aligned.js b/test/parallel/test-http2-padding-aligned.js index f687c02a98dc6e..c67cbf0d4873fa 100644 --- a/test/parallel/test-http2-padding-aligned.js +++ b/test/parallel/test-http2-padding-aligned.js @@ -11,12 +11,12 @@ const makeDuplexPair = require('../common/duplexpair'); { const testData = '

Hello World.

'; const server = http2.createServer({ - paddingStrategy: PADDING_STRATEGY_ALIGNED + paddingStrategy: PADDING_STRATEGY_ALIGNED, }); server.on('stream', common.mustCall((stream, headers) => { stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end(testData); })); @@ -49,7 +49,7 @@ const makeDuplexPair = require('../common/duplexpair'); const client = http2.connect('http://localhost:80', { paddingStrategy: PADDING_STRATEGY_ALIGNED, - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }); const req = client.request({ ':path': '/a' }); diff --git a/test/parallel/test-http2-perf_hooks.js b/test/parallel/test-http2-perf_hooks.js index 5be9073a56ad5c..003a54b72f167f 100644 --- a/test/parallel/test-http2-perf_hooks.js +++ b/test/parallel/test-http2-perf_hooks.js @@ -79,7 +79,7 @@ function onStream(stream, headers, flags) { assert.strictEqual(flags, 5); stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.write(body.slice(0, 20)); stream.end(body.slice(20)); diff --git a/test/parallel/test-http2-ping-settings-heapdump.js b/test/parallel/test-http2-ping-settings-heapdump.js index 7d27310700c7a8..13cc550674d622 100644 --- a/test/parallel/test-http2-ping-settings-heapdump.js +++ b/test/parallel/test-http2-ping-settings-heapdump.js @@ -16,7 +16,7 @@ for (const variant of ['ping', 'settings']) { server.on('session', common.mustCall((session) => { if (variant === 'ping') { session.ping(common.expectsError({ - code: 'ERR_HTTP2_PING_CANCEL' + code: 'ERR_HTTP2_PING_CANCEL', })); } else { session.settings(undefined, common.mustNotCall()); diff --git a/test/parallel/test-http2-ping-unsolicited-ack.js b/test/parallel/test-http2-ping-unsolicited-ack.js index 5a3a261cb098b1..3a0dbb435c0e8c 100644 --- a/test/parallel/test-http2-ping-unsolicited-ack.js +++ b/test/parallel/test-http2-ping-unsolicited-ack.js @@ -19,7 +19,7 @@ server.on('stream', common.mustNotCall()); server.on('session', common.mustCall((session) => { session.on('error', common.expectsError({ code: 'ERR_HTTP2_ERROR', - message: 'Protocol error' + message: 'Protocol error', })); session.on('close', common.mustCall(() => server.close())); })); diff --git a/test/parallel/test-http2-ping.js b/test/parallel/test-http2-ping.js index d775e93333797e..edfa2300457e9e 100644 --- a/test/parallel/test-http2-ping.js +++ b/test/parallel/test-http2-ping.js @@ -33,7 +33,7 @@ const hook = async_hooks.createHook({ if (pings.has(id)) { events[3]++; } - } + }, }); hook.enable(); @@ -77,7 +77,7 @@ server.listen(0, common.mustCall(() => { assert(!client.ping(common.expectsError({ code: 'ERR_HTTP2_PING_CANCEL', name: 'Error', - message: 'HTTP2 ping cancelled' + message: 'HTTP2 ping cancelled', }))); // Should throw if payload is not of type ArrayBufferView @@ -90,7 +90,7 @@ server.listen(0, common.mustCall(() => { code: 'ERR_INVALID_ARG_TYPE', message: 'The "payload" argument must be an instance of Buffer, ' + 'TypedArray, or DataView.' + - common.invalidArgTypeHelper(payload) + common.invalidArgTypeHelper(payload), } ) ); @@ -106,7 +106,7 @@ server.listen(0, common.mustCall(() => { { name: 'RangeError', code: 'ERR_HTTP2_PING_LENGTH', - message: 'HTTP2 ping payload must be 8 bytes' + message: 'HTTP2 ping payload must be 8 bytes', } ) ); @@ -122,7 +122,7 @@ server.listen(0, common.mustCall(() => { name: 'TypeError', code: 'ERR_INVALID_CALLBACK', message: 'Callback must be a function. ' + - `Received ${inspect(invalidCallback)}` + `Received ${inspect(invalidCallback)}`, } ) ); diff --git a/test/parallel/test-http2-pipe-named-pipe.js b/test/parallel/test-http2-pipe-named-pipe.js index 7882f79657f701..0e56cbc481c9c8 100644 --- a/test/parallel/test-http2-pipe-named-pipe.js +++ b/test/parallel/test-http2-pipe-named-pipe.js @@ -34,7 +34,7 @@ server.listen(common.PIPE, common.mustCall(() => { const client = http2.connect('http://localhost', { createConnection(url) { return net.connect(server.address()); - } + }, }); const req = client.request({ ':method': 'POST' }); diff --git a/test/parallel/test-http2-priority-event.js b/test/parallel/test-http2-priority-event.js index 41ec6534b2de53..13b428f97def12 100644 --- a/test/parallel/test-http2-priority-event.js +++ b/test/parallel/test-http2-priority-event.js @@ -22,11 +22,11 @@ function onStream(stream, headers, flags) { stream.priority({ parent: 0, weight: 1, - exclusive: false + exclusive: false, }); stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end('hello world'); } @@ -44,7 +44,7 @@ server.on('listening', common.mustCall(() => { req.priority({ parent: 0, weight: 1, - exclusive: false + exclusive: false, }); }); diff --git a/test/parallel/test-http2-reset-flood.js b/test/parallel/test-http2-reset-flood.js index a20970862091ca..c0a5ad399eb945 100644 --- a/test/parallel/test-http2-reset-flood.js +++ b/test/parallel/test-http2-reset-flood.js @@ -17,7 +17,7 @@ if (process.env.HAS_STARTED_WORKER) { server.on('stream', (stream) => { stream.respond({ 'content-type': 'text/plain', - ':status': 200 + ':status': 200, }); stream.end('Hello, world!\n'); }); diff --git a/test/parallel/test-http2-respond-errors.js b/test/parallel/test-http2-respond-errors.js index cc733b6994a3bd..376344a2662f20 100644 --- a/test/parallel/test-http2-respond-errors.js +++ b/test/parallel/test-http2-respond-errors.js @@ -23,7 +23,7 @@ server.on('stream', common.mustCall((stream) => { { name: 'Error', code: 'ERR_HTTP2_HEADERS_SENT', - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); @@ -34,7 +34,7 @@ server.on('stream', common.mustCall((stream) => { { name: 'Error', code: 'ERR_HTTP2_INVALID_STREAM', - message: 'The stream has been destroyed' + message: 'The stream has been destroyed', } ); })); diff --git a/test/parallel/test-http2-respond-file-204.js b/test/parallel/test-http2-respond-file-204.js index 0c59b0e7294aad..e87db2c8b6dd00 100644 --- a/test/parallel/test-http2-respond-file-204.js +++ b/test/parallel/test-http2-respond-file-204.js @@ -9,7 +9,7 @@ const http2 = require('http2'); const { HTTP2_HEADER_CONTENT_TYPE, - HTTP2_HEADER_STATUS + HTTP2_HEADER_STATUS, } = http2.constants; const fname = fixtures.path('elipses.txt'); @@ -19,12 +19,12 @@ server.on('stream', (stream) => { assert.throws(() => { stream.respondWithFile(fname, { [HTTP2_HEADER_STATUS]: 204, - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', }); }, { code: 'ERR_HTTP2_PAYLOAD_FORBIDDEN', name: 'Error', - message: 'Responses with 204 status must not have a payload' + message: 'Responses with 204 status must not have a payload', }); stream.respond({}); stream.end(); diff --git a/test/parallel/test-http2-respond-file-304.js b/test/parallel/test-http2-respond-file-304.js index f59951730fbea4..cc7d7cf362a757 100644 --- a/test/parallel/test-http2-respond-file-304.js +++ b/test/parallel/test-http2-respond-file-304.js @@ -9,7 +9,7 @@ const assert = require('assert'); const { HTTP2_HEADER_CONTENT_TYPE, - HTTP2_HEADER_STATUS + HTTP2_HEADER_STATUS, } = http2.constants; const fname = fixtures.path('elipses.txt'); @@ -17,13 +17,13 @@ const fname = fixtures.path('elipses.txt'); const server = http2.createServer(); server.on('stream', (stream) => { stream.respondWithFile(fname, { - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', }, { statCheck(stat, headers) { // Abort the send and return a 304 Not Modified instead stream.respond({ [HTTP2_HEADER_STATUS]: 304 }); return false; - } + }, }); }); server.listen(0, () => { diff --git a/test/parallel/test-http2-respond-file-404.js b/test/parallel/test-http2-respond-file-404.js index 1279fba102a18e..bf1a7a530a1bbe 100644 --- a/test/parallel/test-http2-respond-file-404.js +++ b/test/parallel/test-http2-respond-file-404.js @@ -8,26 +8,26 @@ const assert = require('assert'); const path = require('path'); const { - HTTP2_HEADER_CONTENT_TYPE + HTTP2_HEADER_CONTENT_TYPE, } = http2.constants; const server = http2.createServer(); server.on('stream', (stream) => { const file = path.join(process.cwd(), 'not-a-file'); stream.respondWithFile(file, { - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', }, { onError(err) { common.expectsError({ code: 'ENOENT', name: 'Error', - message: `ENOENT: no such file or directory, open '${file}'` + message: `ENOENT: no such file or directory, open '${file}'`, })(err); stream.respond({ ':status': 404 }); stream.end(); }, - statCheck: common.mustNotCall() + statCheck: common.mustNotCall(), }); }); server.listen(0, () => { diff --git a/test/parallel/test-http2-respond-file-error-dir.js b/test/parallel/test-http2-respond-file-error-dir.js index 155e0054329296..61562e0054ae7b 100644 --- a/test/parallel/test-http2-respond-file-error-dir.js +++ b/test/parallel/test-http2-respond-file-error-dir.js @@ -9,19 +9,19 @@ const assert = require('assert'); const server = http2.createServer(); server.on('stream', (stream) => { stream.respondWithFile(process.cwd(), { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }, { onError(err) { common.expectsError({ code: 'ERR_HTTP2_SEND_FILE', name: 'Error', - message: 'Directories cannot be sent' + message: 'Directories cannot be sent', })(err); stream.respond({ ':status': 404 }); stream.end(); }, - statCheck: common.mustNotCall() + statCheck: common.mustNotCall(), }); }); server.listen(0, () => { diff --git a/test/parallel/test-http2-respond-file-error-pipe-offset.js b/test/parallel/test-http2-respond-file-error-pipe-offset.js index 39876baaf51dab..58030d401c6036 100644 --- a/test/parallel/test-http2-respond-file-error-pipe-offset.js +++ b/test/parallel/test-http2-respond-file-error-pipe-offset.js @@ -24,20 +24,20 @@ if (mkfifo.error && mkfifo.error.code === 'ENOENT') { const server = http2.createServer(); server.on('stream', (stream) => { stream.respondWithFile(pipeName, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }, { offset: 10, onError(err) { common.expectsError({ code: 'ERR_HTTP2_SEND_FILE_NOSEEK', name: 'Error', - message: 'Offset or length can only be specified for regular files' + message: 'Offset or length can only be specified for regular files', })(err); stream.respond({ ':status': 404 }); stream.end(); }, - statCheck: common.mustNotCall() + statCheck: common.mustNotCall(), }); }); server.listen(0, () => { diff --git a/test/parallel/test-http2-respond-file-errors.js b/test/parallel/test-http2-respond-file-errors.js index 5c3424f2bc3484..ef7559b6ef4514 100644 --- a/test/parallel/test-http2-respond-file-errors.js +++ b/test/parallel/test-http2-respond-file-errors.js @@ -11,7 +11,7 @@ const { inspect } = require('util'); const optionsWithTypeError = { offset: 'number', length: 'number', - statCheck: 'function' + statCheck: 'function', }; const types = { @@ -21,7 +21,7 @@ const types = { object: {}, array: [], null: null, - symbol: Symbol('test') + symbol: Symbol('test'), }; const fname = fixtures.path('elipses.txt'); @@ -39,15 +39,15 @@ server.on('stream', common.mustCall((stream) => { assert.throws( () => stream.respondWithFile(fname, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }, { - [option]: types[type] + [option]: types[type], }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: `The property 'options.${option}' is invalid. ` + - `Received ${inspect(types[type])}` + `Received ${inspect(types[type])}`, } ); }); @@ -61,7 +61,7 @@ server.on('stream', common.mustCall((stream) => { }), { code: 'ERR_HTTP2_PAYLOAD_FORBIDDEN', - message: `Responses with ${status} status must not have a payload` + message: `Responses with ${status} status must not have a payload`, } )); @@ -69,11 +69,11 @@ server.on('stream', common.mustCall((stream) => { stream.respond({ ':status': 200 }); assert.throws( () => stream.respondWithFile(fname, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }), { code: 'ERR_HTTP2_HEADERS_SENT', - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); @@ -81,11 +81,11 @@ server.on('stream', common.mustCall((stream) => { stream.destroy(); assert.throws( () => stream.respondWithFile(fname, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }), { code: 'ERR_HTTP2_INVALID_STREAM', - message: 'The stream has been destroyed' + message: 'The stream has been destroyed', } ); })); diff --git a/test/parallel/test-http2-respond-file-fd-errors.js b/test/parallel/test-http2-respond-file-fd-errors.js index 5f7e57ea4e45d2..5723b014e8c785 100644 --- a/test/parallel/test-http2-respond-file-fd-errors.js +++ b/test/parallel/test-http2-respond-file-fd-errors.js @@ -12,7 +12,7 @@ const { inspect } = require('util'); const optionsWithTypeError = { offset: 'number', length: 'number', - statCheck: 'function' + statCheck: 'function', }; const types = { @@ -22,7 +22,7 @@ const types = { object: {}, array: [], null: null, - symbol: Symbol('test') + symbol: Symbol('test'), }; const fname = fixtures.path('elipses.txt'); @@ -39,13 +39,13 @@ server.on('stream', common.mustCall((stream) => { assert.throws( () => stream.respondWithFD(types[type], { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }), { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "fd" argument must be of type number or an instance of' + - ` FileHandle.${common.invalidArgTypeHelper(types[type])}` + ` FileHandle.${common.invalidArgTypeHelper(types[type])}`, } ); }); @@ -59,15 +59,15 @@ server.on('stream', common.mustCall((stream) => { assert.throws( () => stream.respondWithFD(fd, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }, { - [option]: types[type] + [option]: types[type], }), { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: `The property 'options.${option}' is invalid. ` + - `Received ${inspect(types[type])}` + `Received ${inspect(types[type])}`, } ); }); @@ -82,7 +82,7 @@ server.on('stream', common.mustCall((stream) => { { code: 'ERR_HTTP2_PAYLOAD_FORBIDDEN', name: 'Error', - message: `Responses with ${status} status must not have a payload` + message: `Responses with ${status} status must not have a payload`, } )); @@ -90,12 +90,12 @@ server.on('stream', common.mustCall((stream) => { stream.respond(); assert.throws( () => stream.respondWithFD(fd, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }), { code: 'ERR_HTTP2_HEADERS_SENT', name: 'Error', - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); @@ -103,12 +103,12 @@ server.on('stream', common.mustCall((stream) => { stream.destroy(); assert.throws( () => stream.respondWithFD(fd, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }), { code: 'ERR_HTTP2_INVALID_STREAM', name: 'Error', - message: 'The stream has been destroyed' + message: 'The stream has been destroyed', } ); })); diff --git a/test/parallel/test-http2-respond-file-fd-invalid.js b/test/parallel/test-http2-respond-file-fd-invalid.js index 448258ef97b976..db025b152215a1 100644 --- a/test/parallel/test-http2-respond-file-fd-invalid.js +++ b/test/parallel/test-http2-respond-file-fd-invalid.js @@ -9,13 +9,13 @@ const fs = require('fs'); const http2 = require('http2'); const { - NGHTTP2_INTERNAL_ERROR + NGHTTP2_INTERNAL_ERROR, } = http2.constants; const errorCheck = common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR' + message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR', }, 2); const server = http2.createServer(); diff --git a/test/parallel/test-http2-respond-file-fd-range.js b/test/parallel/test-http2-respond-file-fd-range.js index 2dd73e0001544c..b36f7cd8d72bfd 100644 --- a/test/parallel/test-http2-respond-file-fd-range.js +++ b/test/parallel/test-http2-respond-file-fd-range.js @@ -13,7 +13,7 @@ const Countdown = require('../common/countdown'); const { HTTP2_HEADER_CONTENT_TYPE, - HTTP2_HEADER_CONTENT_LENGTH + HTTP2_HEADER_CONTENT_LENGTH, } = http2.constants; const fname = fixtures.path('printA.js'); @@ -35,7 +35,7 @@ server.on('stream', (stream, headers) => { const [ offset, length ] = getOffsetLength(headers.range); stream.respondWithFD(fd, { - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', }, { statCheck: common.mustCall((stat, headers, options) => { assert.strictEqual(options.length, length); @@ -44,7 +44,7 @@ server.on('stream', (stream, headers) => { Math.min(options.length, stat.size - offset); }), offset: offset, - length: length + length: length, }); }); server.on('close', common.mustCall(() => fs.closeSync(fd))); diff --git a/test/parallel/test-http2-respond-file-fd.js b/test/parallel/test-http2-respond-file-fd.js index 7d4395bbc360aa..38e35747a28e87 100644 --- a/test/parallel/test-http2-respond-file-fd.js +++ b/test/parallel/test-http2-respond-file-fd.js @@ -10,7 +10,7 @@ const fs = require('fs'); const { HTTP2_HEADER_CONTENT_TYPE, - HTTP2_HEADER_CONTENT_LENGTH + HTTP2_HEADER_CONTENT_LENGTH, } = http2.constants; const fname = fixtures.path('elipses.txt'); diff --git a/test/parallel/test-http2-respond-file-filehandle.js b/test/parallel/test-http2-respond-file-filehandle.js index bc7bfbe356ff92..1537e7d8705602 100644 --- a/test/parallel/test-http2-respond-file-filehandle.js +++ b/test/parallel/test-http2-respond-file-filehandle.js @@ -10,7 +10,7 @@ const fs = require('fs'); const { HTTP2_HEADER_CONTENT_TYPE, - HTTP2_HEADER_CONTENT_LENGTH + HTTP2_HEADER_CONTENT_LENGTH, } = http2.constants; const fname = fixtures.path('elipses.txt'); diff --git a/test/parallel/test-http2-respond-file-push.js b/test/parallel/test-http2-respond-file-push.js index a5229beb07d1a7..1835bdaff29571 100644 --- a/test/parallel/test-http2-respond-file-push.js +++ b/test/parallel/test-http2-respond-file-push.js @@ -13,7 +13,7 @@ const fs = require('fs'); const { HTTP2_HEADER_CONTENT_TYPE, HTTP2_HEADER_CONTENT_LENGTH, - HTTP2_HEADER_LAST_MODIFIED + HTTP2_HEADER_LAST_MODIFIED, } = http2.constants; const fname = fixtures.path('elipses.txt'); @@ -28,13 +28,13 @@ server.on('stream', (stream) => { stream.pushStream({ ':path': '/file.txt', - ':method': 'GET' + ':method': 'GET', }, (err, stream) => { assert.ifError(err); stream.respondWithFD(fd, { [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', [HTTP2_HEADER_CONTENT_LENGTH]: stat.size, - [HTTP2_HEADER_LAST_MODIFIED]: stat.mtime.toUTCString() + [HTTP2_HEADER_LAST_MODIFIED]: stat.mtime.toUTCString(), }); }); diff --git a/test/parallel/test-http2-respond-file-range.js b/test/parallel/test-http2-respond-file-range.js index 4e6a6074514f14..d1efe9ab93ce12 100644 --- a/test/parallel/test-http2-respond-file-range.js +++ b/test/parallel/test-http2-respond-file-range.js @@ -11,7 +11,7 @@ const fs = require('fs'); const { HTTP2_HEADER_CONTENT_TYPE, HTTP2_HEADER_CONTENT_LENGTH, - HTTP2_HEADER_LAST_MODIFIED + HTTP2_HEADER_LAST_MODIFIED, } = http2.constants; const fname = fixtures.path('printA.js'); @@ -21,13 +21,13 @@ const stat = fs.statSync(fname); const server = http2.createServer(); server.on('stream', (stream) => { stream.respondWithFile(fname, { - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', }, { statCheck: common.mustCall((stat, headers) => { headers[HTTP2_HEADER_LAST_MODIFIED] = stat.mtime.toUTCString(); }), offset: 8, - length: 3 + length: 3, }); }); server.listen(0, () => { diff --git a/test/parallel/test-http2-respond-file-with-pipe.js b/test/parallel/test-http2-respond-file-with-pipe.js index 30bcce46b9d232..70d32525d7c75b 100644 --- a/test/parallel/test-http2-respond-file-with-pipe.js +++ b/test/parallel/test-http2-respond-file-with-pipe.js @@ -24,10 +24,10 @@ if (mkfifo.error && mkfifo.error.code === 'ENOENT') { const server = http2.createServer(); server.on('stream', (stream) => { stream.respondWithFile(pipeName, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }, { onError: common.mustNotCall(), - statCheck: common.mustCall() + statCheck: common.mustCall(), }); }); diff --git a/test/parallel/test-http2-respond-file.js b/test/parallel/test-http2-respond-file.js index 1c10ceb4350723..af39f31db13aa4 100644 --- a/test/parallel/test-http2-respond-file.js +++ b/test/parallel/test-http2-respond-file.js @@ -11,7 +11,7 @@ const fs = require('fs'); const { HTTP2_HEADER_CONTENT_TYPE, HTTP2_HEADER_CONTENT_LENGTH, - HTTP2_HEADER_LAST_MODIFIED + HTTP2_HEADER_LAST_MODIFIED, } = http2.constants; const fname = fixtures.path('elipses.txt'); @@ -21,12 +21,12 @@ const stat = fs.statSync(fname); const server = http2.createServer(); server.on('stream', common.mustCall((stream) => { stream.respondWithFile(fname, { - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', }, { statCheck(stat, headers) { headers[HTTP2_HEADER_LAST_MODIFIED] = stat.mtime.toUTCString(); headers[HTTP2_HEADER_CONTENT_LENGTH] = stat.size; - } + }, }); })); diff --git a/test/parallel/test-http2-respond-nghttperrors.js b/test/parallel/test-http2-respond-nghttperrors.js index cce01ada928b9c..4ca8c498936384 100644 --- a/test/parallel/test-http2-respond-nghttperrors.js +++ b/test/parallel/test-http2-respond-nghttperrors.js @@ -9,7 +9,7 @@ const { internalBinding } = require('internal/test/binding'); const { constants, Http2Stream, - nghttp2ErrorString + nghttp2ErrorString, } = internalBinding('http2'); const { NghttpError } = require('internal/http2/util'); @@ -30,9 +30,9 @@ const genericTests = Object.getOwnPropertyNames(constants) code: 'ERR_HTTP2_ERROR', constructor: NghttpError, name: 'Error', - message: nghttp2ErrorString(constants[key]) + message: nghttp2ErrorString(constants[key]), }, - type: 'stream' + type: 'stream', })); @@ -73,7 +73,7 @@ function runTest(test) { ':path': '/', ':method': 'POST', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const client = http2.connect(url); @@ -81,7 +81,7 @@ function runTest(test) { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR' + message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR', })); currentError = test; diff --git a/test/parallel/test-http2-respond-with-fd-errors.js b/test/parallel/test-http2-respond-with-fd-errors.js index 03cda5d7e7d0a4..8ef0eaf51eb314 100644 --- a/test/parallel/test-http2-respond-with-fd-errors.js +++ b/test/parallel/test-http2-respond-with-fd-errors.js @@ -14,7 +14,7 @@ const { internalBinding } = require('internal/test/binding'); const { constants, Http2Stream, - nghttp2ErrorString + nghttp2ErrorString, } = internalBinding('http2'); const { NghttpError } = require('internal/http2/util'); @@ -37,9 +37,9 @@ const genericTests = Object.getOwnPropertyNames(constants) code: 'ERR_HTTP2_ERROR', constructor: NghttpError, name: 'Error', - message: nghttp2ErrorString(constants[key]) + message: nghttp2ErrorString(constants[key]), }, - type: 'stream' + type: 'stream', })); @@ -80,7 +80,7 @@ function runTest(test) { ':path': '/', ':method': 'POST', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const client = http2.connect(url); @@ -89,7 +89,7 @@ function runTest(test) { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR' + message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR', })); currentError = test; diff --git a/test/parallel/test-http2-respond-with-file-connection-abort.js b/test/parallel/test-http2-respond-with-file-connection-abort.js index ed200e5b391fe8..c990f3a54a87a6 100644 --- a/test/parallel/test-http2-respond-with-file-connection-abort.js +++ b/test/parallel/test-http2-respond-with-file-connection-abort.js @@ -8,14 +8,14 @@ const http2 = require('http2'); const net = require('net'); const { - HTTP2_HEADER_CONTENT_TYPE + HTTP2_HEADER_CONTENT_TYPE, } = http2.constants; const server = http2.createServer(); server.on('stream', common.mustCall((stream) => { stream.on('error', (err) => assert.strictEqual(err.code, 'ECONNRESET')); stream.respondWithFile(process.execPath, { - [HTTP2_HEADER_CONTENT_TYPE]: 'application/octet-stream' + [HTTP2_HEADER_CONTENT_TYPE]: 'application/octet-stream', }); })); diff --git a/test/parallel/test-http2-sensitive-headers.js b/test/parallel/test-http2-sensitive-headers.js index 7d4d775a55d4c2..243f25ea98b55a 100644 --- a/test/parallel/test-http2-sensitive-headers.js +++ b/test/parallel/test-http2-sensitive-headers.js @@ -17,7 +17,7 @@ const makeDuplexPair = require('../common/duplexpair'); 'not-sensitive': 'foo', 'sensitive': 'bar', // sensitiveHeaders entries are case-insensitive - [http2.sensitiveHeaders]: ['Sensitive'] + [http2.sensitiveHeaders]: ['Sensitive'], }); stream.end(testData); })); @@ -26,7 +26,7 @@ const makeDuplexPair = require('../common/duplexpair'); server.emit('connection', serverSide); const client = http2.connect('http://localhost:80', { - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }); const req = client.request({ ':path': '/' }); diff --git a/test/parallel/test-http2-serve-file.js b/test/parallel/test-http2-serve-file.js index 7b73fe639e0cc5..afb7d2f76d0870 100644 --- a/test/parallel/test-http2-serve-file.js +++ b/test/parallel/test-http2-serve-file.js @@ -15,7 +15,7 @@ const ajs_data = fixtures.readSync('a.js', 'utf8'); const { HTTP2_HEADER_PATH, - HTTP2_HEADER_STATUS + HTTP2_HEADER_STATUS, } = http2.constants; const key = fixtures.readKey('agent8-key.pem', 'binary'); diff --git a/test/parallel/test-http2-server-http1-client.js b/test/parallel/test-http2-server-http1-client.js index 40e97f04a4e888..10f2ecfa8fd10d 100644 --- a/test/parallel/test-http2-server-http1-client.js +++ b/test/parallel/test-http2-server-http1-client.js @@ -17,7 +17,7 @@ server.on('session', common.mustCall((session) => { session.on('error', common.expectsError({ code: 'ERR_HTTP2_ERROR', constructor: NghttpError, - message: 'Received bad client magic byte string' + message: 'Received bad client magic byte string', })); })); diff --git a/test/parallel/test-http2-server-push-disabled.js b/test/parallel/test-http2-server-push-disabled.js index 306c916497263f..70b77003a565bf 100644 --- a/test/parallel/test-http2-server-push-disabled.js +++ b/test/parallel/test-http2-server-push-disabled.js @@ -29,7 +29,7 @@ server.on('stream', common.mustCall((stream) => { }, common.mustNotCall()); }, { code: 'ERR_HTTP2_PUSH_DISABLED', - name: 'Error' + name: 'Error', }); stream.respond({ ':status': 200 }); diff --git a/test/parallel/test-http2-server-push-stream-errors-args.js b/test/parallel/test-http2-server-push-stream-errors-args.js index ba0aabcf5cf658..5641f1bc2e52ea 100644 --- a/test/parallel/test-http2-server-push-stream-errors-args.js +++ b/test/parallel/test-http2-server-push-stream-errors-args.js @@ -22,7 +22,7 @@ server.on('stream', common.mustCall((stream, headers) => { }, {}, 'callback'), { code: 'ERR_INVALID_CALLBACK', - message: "Callback must be a function. Received 'callback'" + message: "Callback must be a function. Received 'callback'", } ); @@ -32,7 +32,7 @@ server.on('stream', common.mustCall((stream, headers) => { { code: 'ERR_HTTP2_INVALID_CONNECTION_HEADERS', name: 'TypeError', - message: 'HTTP/1 Connection specific headers are forbidden: "connection"' + message: 'HTTP/1 Connection specific headers are forbidden: "connection"', } ); diff --git a/test/parallel/test-http2-server-push-stream-errors.js b/test/parallel/test-http2-server-push-stream-errors.js index dae037c04f28c9..b900f896e3b293 100644 --- a/test/parallel/test-http2-server-push-stream-errors.js +++ b/test/parallel/test-http2-server-push-stream-errors.js @@ -9,7 +9,7 @@ const { internalBinding } = require('internal/test/binding'); const { constants, Http2Stream, - nghttp2ErrorString + nghttp2ErrorString, } = internalBinding('http2'); const { NghttpError } = require('internal/http2/util'); @@ -30,17 +30,17 @@ const specificTests = [ code: 'ERR_HTTP2_OUT_OF_STREAMS', name: 'Error', message: 'No stream ID is available because ' + - 'maximum stream ID has been reached' + 'maximum stream ID has been reached', }, - type: 'stream' + type: 'stream', }, { ngError: constants.NGHTTP2_ERR_STREAM_CLOSED, error: { code: 'ERR_HTTP2_INVALID_STREAM', - name: 'Error' + name: 'Error', }, - type: 'stream' + type: 'stream', }, ]; @@ -54,9 +54,9 @@ const genericTests = Object.getOwnPropertyNames(constants) code: 'ERR_HTTP2_ERROR', constructor: NghttpError, name: 'Error', - message: nghttp2ErrorString(constants[key]) + message: nghttp2ErrorString(constants[key]), }, - type: 'stream' + type: 'stream', })); diff --git a/test/parallel/test-http2-server-push-stream-head.js b/test/parallel/test-http2-server-push-stream-head.js index b87efffa0ab30e..84a6be7f18e76f 100644 --- a/test/parallel/test-http2-server-push-stream-head.js +++ b/test/parallel/test-http2-server-push-stream-head.js @@ -25,7 +25,7 @@ server.on('stream', common.mustCall((stream, headers) => { push.on('error', common.expectsError({ name: 'Error', code: 'ERR_STREAM_WRITE_AFTER_END', - message: 'write after end' + message: 'write after end', })); assert(!push.write('test')); stream.end('test'); @@ -33,7 +33,7 @@ server.on('stream', common.mustCall((stream, headers) => { } stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); })); diff --git a/test/parallel/test-http2-server-push-stream.js b/test/parallel/test-http2-server-push-stream.js index 7c75f66aef5e7d..0168a5bd4727da 100644 --- a/test/parallel/test-http2-server-push-stream.js +++ b/test/parallel/test-http2-server-push-stream.js @@ -26,7 +26,7 @@ server.on('stream', common.mustCall((stream, headers) => { push.pushStream({}, common.mustNotCall()); }, { code: 'ERR_HTTP2_NESTED_PUSH', - name: 'Error' + name: 'Error', }); stream.end('test'); @@ -34,7 +34,7 @@ server.on('stream', common.mustCall((stream, headers) => { } stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); })); diff --git a/test/parallel/test-http2-server-rst-before-respond.js b/test/parallel/test-http2-server-rst-before-respond.js index d551c7121f5b7c..e6eba192120501 100644 --- a/test/parallel/test-http2-server-rst-before-respond.js +++ b/test/parallel/test-http2-server-rst-before-respond.js @@ -17,7 +17,7 @@ function onStream(stream, headers, flags) { assert.throws(() => { stream.additionalHeaders({ ':status': 123, - 'abc': 123 + 'abc': 123, }); }, { code: 'ERR_HTTP2_INVALID_STREAM' }); } diff --git a/test/parallel/test-http2-server-rst-stream.js b/test/parallel/test-http2-server-rst-stream.js index 9f37ce71472353..6fe2c7764fdfde 100644 --- a/test/parallel/test-http2-server-rst-stream.js +++ b/test/parallel/test-http2-server-rst-stream.js @@ -12,7 +12,7 @@ const { NGHTTP2_NO_ERROR, NGHTTP2_PROTOCOL_ERROR, NGHTTP2_REFUSED_STREAM, - NGHTTP2_INTERNAL_ERROR + NGHTTP2_INTERNAL_ERROR, } = http2.constants; const tests = [ @@ -31,7 +31,7 @@ server.on('stream', (stream, headers) => { stream.on('error', common.expectsError({ name: 'Error', code: 'ERR_HTTP2_STREAM_ERROR', - message: `Stream closed with error code ${test[2]}` + message: `Stream closed with error code ${test[2]}`, })); } stream.close(headers.rstcode | 0); @@ -48,7 +48,7 @@ server.listen(0, common.mustCall(() => { tests.forEach((test) => { const req = client.request({ ':method': 'POST', - 'rstcode': test[0] + 'rstcode': test[0], }); req.on('close', common.mustCall(() => { assert.strictEqual(req.rstCode, test[0]); diff --git a/test/parallel/test-http2-server-sessionerror.js b/test/parallel/test-http2-server-sessionerror.js index bbd180937e1cd6..d6dffe6bfe7a11 100644 --- a/test/parallel/test-http2-server-sessionerror.js +++ b/test/parallel/test-http2-server-sessionerror.js @@ -19,7 +19,7 @@ server.on('session', common.mustCall((session) => { server.on('error', common.mustNotCall()); session.on('error', common.expectsError({ name: 'Error', - message: 'test' + message: 'test', })); session[kSocket].emit('error', new Error('test')); break; diff --git a/test/parallel/test-http2-server-settimeout-no-callback.js b/test/parallel/test-http2-server-settimeout-no-callback.js index 31a64731f6dabc..027a63e89c3c95 100644 --- a/test/parallel/test-http2-server-settimeout-no-callback.js +++ b/test/parallel/test-http2-server-settimeout-no-callback.js @@ -19,7 +19,7 @@ const verifyCallbacks = (server) => { name: 'TypeError', code: 'ERR_INVALID_CALLBACK', message: 'Callback must be a function. ' + - `Received ${inspect(notFunction)}` + `Received ${inspect(notFunction)}`, } ); }); diff --git a/test/parallel/test-http2-server-shutdown-before-respond.js b/test/parallel/test-http2-server-shutdown-before-respond.js index 65dd853f8392c2..ef6d14e9df26b6 100644 --- a/test/parallel/test-http2-server-shutdown-before-respond.js +++ b/test/parallel/test-http2-server-shutdown-before-respond.js @@ -23,12 +23,12 @@ server.on('listening', common.mustCall(() => { client.on('goaway', common.mustCall()); client.on('error', common.expectsError({ - code: 'ERR_HTTP2_SESSION_ERROR' + code: 'ERR_HTTP2_SESSION_ERROR', })); const req = client.request(); req.on('error', common.expectsError({ - code: 'ERR_HTTP2_SESSION_ERROR' + code: 'ERR_HTTP2_SESSION_ERROR', })); req.resume(); req.on('data', common.mustNotCall()); diff --git a/test/parallel/test-http2-server-shutdown-options-errors.js b/test/parallel/test-http2-server-shutdown-options-errors.js index e6a69b54627e00..bc82519fba8268 100644 --- a/test/parallel/test-http2-server-shutdown-options-errors.js +++ b/test/parallel/test-http2-server-shutdown-options-errors.js @@ -27,7 +27,7 @@ server.on('stream', common.mustCall((stream) => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "code" argument must be of type number.' + - received + received, } ); assert.throws( @@ -36,7 +36,7 @@ server.on('stream', common.mustCall((stream) => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "lastStreamID" argument must be of type number.' + - received + received, } ); assert.throws( @@ -45,7 +45,7 @@ server.on('stream', common.mustCall((stream) => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "opaqueData" argument must be an instance of Buffer, ' + - `TypedArray, or DataView.${received}` + `TypedArray, or DataView.${received}`, } ); }); diff --git a/test/parallel/test-http2-server-shutdown-redundant.js b/test/parallel/test-http2-server-shutdown-redundant.js index 0f199bd68a1837..3c0d5c1f5bd8ea 100644 --- a/test/parallel/test-http2-server-shutdown-redundant.js +++ b/test/parallel/test-http2-server-shutdown-redundant.js @@ -17,7 +17,7 @@ server.on('stream', common.mustCall((stream) => { () => session.goaway(3), { code: 'ERR_HTTP2_INVALID_SESSION', - name: 'Error' + name: 'Error', } ); })); @@ -26,12 +26,12 @@ server.on('stream', common.mustCall((stream) => { server.listen(0, common.mustCall(() => { const client = http2.connect(`http://localhost:${server.address().port}`); client.on('error', common.expectsError({ - code: 'ERR_HTTP2_SESSION_ERROR' + code: 'ERR_HTTP2_SESSION_ERROR', })); const req = client.request(); req.on('error', common.expectsError({ - code: 'ERR_HTTP2_SESSION_ERROR' + code: 'ERR_HTTP2_SESSION_ERROR', })); req.resume(); req.on('close', common.mustCall(() => { diff --git a/test/parallel/test-http2-server-startup.js b/test/parallel/test-http2-server-startup.js index c94abd2c22eddb..13c8f0c59f33b9 100644 --- a/test/parallel/test-http2-server-startup.js +++ b/test/parallel/test-http2-server-startup.js @@ -17,7 +17,7 @@ const net = require('net'); const options = { key: commonFixtures.readKey('agent2-key.pem'), - cert: commonFixtures.readKey('agent2-cert.pem') + cert: commonFixtures.readKey('agent2-cert.pem'), }; // There should not be any throws. @@ -83,7 +83,7 @@ server.on('error', common.mustNotCall()); client = tls.connect({ port: port, rejectUnauthorized: false, - ALPNProtocols: ['h2'] + ALPNProtocols: ['h2'], }, common.mustCall()); })); } @@ -92,7 +92,7 @@ server.on('error', common.mustNotCall()); { const server = http2.createSecureServer({ allowHalfOpen: true, - ...options + ...options, }); server.on('secureConnection', common.mustCall((socket) => { @@ -108,7 +108,7 @@ server.on('error', common.mustNotCall()); const socket = tls.connect({ port: port, rejectUnauthorized: false, - ALPNProtocols: ['h2'] + ALPNProtocols: ['h2'], }, common.mustCall()); socket.resume(); })); diff --git a/test/parallel/test-http2-server-stream-session-destroy.js b/test/parallel/test-http2-server-stream-session-destroy.js index a03569cdee7825..aa8a5890ecbde5 100644 --- a/test/parallel/test-http2-server-stream-session-destroy.js +++ b/test/parallel/test-http2-server-stream-session-destroy.js @@ -22,7 +22,7 @@ server.on('stream', common.mustCall((stream) => { const invalidStreamError = { name: 'Error', code: 'ERR_HTTP2_INVALID_STREAM', - message: 'The stream has been destroyed' + message: 'The stream has been destroyed', }; assert.throws(() => stream.additionalHeaders(), invalidStreamError); assert.throws(() => stream.priority(), invalidStreamError); @@ -31,7 +31,7 @@ server.on('stream', common.mustCall((stream) => { () => stream.pushStream({}, common.mustNotCall()), { code: 'ERR_HTTP2_PUSH_DISABLED', - name: 'Error' + name: 'Error', } ); // When session is detroyed all streams are destroyed and no further @@ -40,7 +40,7 @@ server.on('stream', common.mustCall((stream) => { assert.strictEqual(stream.write('data', common.expectsError({ name: 'Error', code: 'ERR_STREAM_WRITE_AFTER_END', - message: 'write after end' + message: 'write after end', })), false); })); diff --git a/test/parallel/test-http2-server-unknown-protocol.js b/test/parallel/test-http2-server-unknown-protocol.js index 639bbe4f2d6ab4..060bce9963912a 100644 --- a/test/parallel/test-http2-server-unknown-protocol.js +++ b/test/parallel/test-http2-server-unknown-protocol.js @@ -15,7 +15,7 @@ const server = h2.createSecureServer({ key: fixtures.readKey('rsa_private.pem'), cert: fixtures.readKey('rsa_cert.crt'), unknownProtocolTimeout: 500, - allowHalfOpen: true + allowHalfOpen: true, }); server.on('connection', (socket) => { @@ -28,6 +28,6 @@ server.listen(0, function() { tls.connect({ port: server.address().port, rejectUnauthorized: false, - ALPNProtocols: ['bogus'] + ALPNProtocols: ['bogus'], }); }); diff --git a/test/parallel/test-http2-session-gc-while-write-scheduled.js b/test/parallel/test-http2-session-gc-while-write-scheduled.js index aef9d9571d5559..9c566fa492368e 100644 --- a/test/parallel/test-http2-session-gc-while-write-scheduled.js +++ b/test/parallel/test-http2-session-gc-while-write-scheduled.js @@ -14,7 +14,7 @@ const tick = require('../common/tick'); { // This creates a session and schedules a write (for the settings frame). let client = http2.connect('http://localhost:80', { - createConnection: common.mustCall(() => makeDuplexPair().clientSide) + createConnection: common.mustCall(() => makeDuplexPair().clientSide), }); // First, wait for any nextTicks() and their responses diff --git a/test/parallel/test-http2-session-settings.js b/test/parallel/test-http2-session-settings.js index 571ee87d93768c..4115804bfee2a3 100644 --- a/test/parallel/test-http2-session-settings.js +++ b/test/parallel/test-http2-session-settings.js @@ -33,7 +33,7 @@ server.on( stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end('hello world'); }) @@ -41,7 +41,7 @@ server.on( server.on('session', (session) => { session.settings({ - maxConcurrentStreams: 2 + maxConcurrentStreams: 2, }); }); @@ -51,8 +51,8 @@ server.listen( const client = h2.connect(`http://localhost:${server.address().port}`, { settings: { enablePush: false, - initialWindowSize: 123456 - } + initialWindowSize: 123456, + }, }); client.on( @@ -112,7 +112,7 @@ server.listen( { name: 'RangeError', code: 'ERR_HTTP2_INVALID_SETTING_VALUE', - message: `Invalid value for setting "${i[0]}": ${i[1]}` + message: `Invalid value for setting "${i[0]}": ${i[1]}`, } ); }); @@ -124,7 +124,7 @@ server.listen( { name: 'TypeError', code: 'ERR_HTTP2_INVALID_SETTING_VALUE', - message: `Invalid value for setting "enablePush": ${i}` + message: `Invalid value for setting "enablePush": ${i}`, } ); }); diff --git a/test/parallel/test-http2-session-stream-state.js b/test/parallel/test-http2-session-stream-state.js index 612feb8cf1e2ca..5f2154413579eb 100644 --- a/test/parallel/test-http2-session-stream-state.js +++ b/test/parallel/test-http2-session-stream-state.js @@ -41,7 +41,7 @@ function onStream(stream, headers, flags) { stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end('hello world'); } diff --git a/test/parallel/test-http2-session-unref.js b/test/parallel/test-http2-session-unref.js index 8afd659d33baa8..646f3f7144ef8c 100644 --- a/test/parallel/test-http2-session-unref.js +++ b/test/parallel/test-http2-session-unref.js @@ -46,7 +46,7 @@ server.listen(0, common.mustCall(() => { // Unref destroyed client { const client = http2.connect(`http://localhost:${port}`, { - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }); client.on('connect', common.mustCall(() => { diff --git a/test/parallel/test-http2-short-stream-client-server.js b/test/parallel/test-http2-short-stream-client-server.js index e632b8d96b9ea9..1ab19b590c554b 100644 --- a/test/parallel/test-http2-short-stream-client-server.js +++ b/test/parallel/test-http2-short-stream-client-server.js @@ -11,13 +11,13 @@ const server = http2.createServer(); server.on('stream', common.mustCall((stream) => { stream.respond({ ':status': 200, - 'content-type': 'text/html' + 'content-type': 'text/html', }); const input = new Readable({ read() { this.push('test'); this.push(null); - } + }, }); input.pipe(stream); })); diff --git a/test/parallel/test-http2-single-headers.js b/test/parallel/test-http2-single-headers.js index c10623b9be7bf0..879d91830d5096 100644 --- a/test/parallel/test-http2-single-headers.js +++ b/test/parallel/test-http2-single-headers.js @@ -33,7 +33,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_HTTP2_HEADER_SINGLE_VALUE', name: 'TypeError', - message: `Header field "${i}" must only have a single value` + message: `Header field "${i}" must only have a single value`, } ); @@ -42,7 +42,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_HTTP2_HEADER_SINGLE_VALUE', name: 'TypeError', - message: `Header field "${i}" must only have a single value` + message: `Header field "${i}" must only have a single value`, } ); }); diff --git a/test/parallel/test-http2-socket-proxy-handler-for-has.js b/test/parallel/test-http2-socket-proxy-handler-for-has.js index ccc63149ff1b12..007a203f787fb4 100644 --- a/test/parallel/test-http2-socket-proxy-handler-for-has.js +++ b/test/parallel/test-http2-socket-proxy-handler-for-has.js @@ -10,7 +10,7 @@ const http2 = require('http2'); const serverOptions = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = http2.createSecureServer(serverOptions, common.mustCall( (req, res) => { @@ -24,7 +24,7 @@ server.listen(common.mustCall(() => { const port = server.address().port; const client = http2.connect('https://localhost:' + port, { ca: fixtures.readKey('agent1-cert.pem'), - rejectUnauthorized: false + rejectUnauthorized: false, }); const req = client.request({}); req.on('response', common.mustCall((headers, flags) => { diff --git a/test/parallel/test-http2-socket-proxy.js b/test/parallel/test-http2-socket-proxy.js index 3294cf7ccb9011..40c35b39533987 100644 --- a/test/parallel/test-http2-socket-proxy.js +++ b/test/parallel/test-http2-socket-proxy.js @@ -18,7 +18,7 @@ const errMsg = { code: 'ERR_HTTP2_NO_SOCKET_MANIPULATION', name: 'Error', message: 'HTTP/2 sockets should not be directly manipulated ' + - '(e.g. read and written)' + '(e.g. read and written)', }; const server = h2.createServer(); diff --git a/test/parallel/test-http2-status-code-invalid.js b/test/parallel/test-http2-status-code-invalid.js index a906c706d7d7e5..cfdc903a938f9d 100644 --- a/test/parallel/test-http2-status-code-invalid.js +++ b/test/parallel/test-http2-status-code-invalid.js @@ -12,7 +12,7 @@ function expectsError(code) { return common.expectsError({ code: 'ERR_HTTP2_STATUS_INVALID', name: 'RangeError', - message: `Invalid status code: ${code}` + message: `Invalid status code: ${code}`, }); } diff --git a/test/parallel/test-http2-timeouts.js b/test/parallel/test-http2-timeouts.js index a67b7227154080..9a67e9773ba502 100644 --- a/test/parallel/test-http2-timeouts.js +++ b/test/parallel/test-http2-timeouts.js @@ -23,7 +23,7 @@ server.on('stream', common.mustCall((stream) => { name: 'TypeError', message: 'The "msecs" argument must be of type number. Received type string' + - " ('100')" + " ('100')", } ); assert.throws( @@ -31,7 +31,7 @@ server.on('stream', common.mustCall((stream) => { { code: 'ERR_INVALID_CALLBACK', name: 'TypeError', - message: 'Callback must be a function. Received Symbol(test)' + message: 'Callback must be a function. Received Symbol(test)', } ); assert.throws( @@ -39,7 +39,7 @@ server.on('stream', common.mustCall((stream) => { { code: 'ERR_INVALID_CALLBACK', name: 'TypeError', - message: 'Callback must be a function. Received {}' + message: 'Callback must be a function. Received {}', } ); })); diff --git a/test/parallel/test-http2-too-large-headers.js b/test/parallel/test-http2-too-large-headers.js index b123d84e72e8fe..36f897c8106dd5 100644 --- a/test/parallel/test-http2-too-large-headers.js +++ b/test/parallel/test-http2-too-large-headers.js @@ -6,7 +6,7 @@ if (!common.hasCrypto) const http2 = require('http2'); const assert = require('assert'); const { - NGHTTP2_ENHANCE_YOUR_CALM + NGHTTP2_ENHANCE_YOUR_CALM, } = http2.constants; for (const prototype of ['maxHeaderListSize', 'maxHeaderSize']) { @@ -21,7 +21,7 @@ for (const prototype of ['maxHeaderListSize', 'maxHeaderSize']) { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM' + message: 'Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM', })); req.on('close', common.mustCall(() => { assert.strictEqual(req.rstCode, NGHTTP2_ENHANCE_YOUR_CALM); diff --git a/test/parallel/test-http2-too-many-headers.js b/test/parallel/test-http2-too-many-headers.js index f77e7679d73fc6..a7df72b2fa4632 100644 --- a/test/parallel/test-http2-too-many-headers.js +++ b/test/parallel/test-http2-too-many-headers.js @@ -6,7 +6,7 @@ if (!common.hasCrypto) const http2 = require('http2'); const assert = require('assert'); const { - NGHTTP2_ENHANCE_YOUR_CALM + NGHTTP2_ENHANCE_YOUR_CALM, } = http2.constants; // By default, the maximum number of header fields allowed per @@ -23,7 +23,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM' + message: 'Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM', })); req.on('close', common.mustCall(() => { assert.strictEqual(req.rstCode, NGHTTP2_ENHANCE_YOUR_CALM); diff --git a/test/parallel/test-http2-too-many-settings.js b/test/parallel/test-http2-too-many-settings.js index b87e921a915e0e..76bae09f9a3c25 100644 --- a/test/parallel/test-http2-too-many-settings.js +++ b/test/parallel/test-http2-too-many-settings.js @@ -14,7 +14,7 @@ const maxOutstandingSettings = 2; function doTest(session) { session.on('error', common.expectsError({ code: 'ERR_HTTP2_MAX_PENDING_SETTINGS_ACK', - name: 'Error' + name: 'Error', })); for (let n = 0; n < maxOutstandingSettings; n++) { session.settings({ enablePush: false }); diff --git a/test/parallel/test-http2-trailers.js b/test/parallel/test-http2-trailers.js index dba9aac12df7c0..c56a47fdf2f25f 100644 --- a/test/parallel/test-http2-trailers.js +++ b/test/parallel/test-http2-trailers.js @@ -22,7 +22,7 @@ function onStream(stream, headers, flags) { })); stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }, { waitForTrailers: true }); stream.on('wantTrailers', () => { stream.sendTrailers({ [trailerKey]: trailerValue }); @@ -30,7 +30,7 @@ function onStream(stream, headers, flags) { () => stream.sendTrailers({}), { code: 'ERR_HTTP2_TRAILERS_ALREADY_SENT', - name: 'Error' + name: 'Error', } ); }); @@ -39,7 +39,7 @@ function onStream(stream, headers, flags) { () => stream.sendTrailers({}), { code: 'ERR_HTTP2_TRAILERS_NOT_READY', - name: 'Error' + name: 'Error', } ); } @@ -62,7 +62,7 @@ server.on('listening', common.mustCall(function() { () => req.sendTrailers({}), { code: 'ERR_HTTP2_INVALID_STREAM', - name: 'Error' + name: 'Error', } ); server.close(); diff --git a/test/parallel/test-http2-unbound-socket-proxy.js b/test/parallel/test-http2-unbound-socket-proxy.js index 74ca0169446afb..f5b7b59470b1cd 100644 --- a/test/parallel/test-http2-unbound-socket-proxy.js +++ b/test/parallel/test-http2-unbound-socket-proxy.js @@ -28,18 +28,18 @@ server.listen(0, common.mustCall(() => { assert.throws(() => { socket.example; // eslint-disable-line no-unused-expressions }, { - code: 'ERR_HTTP2_SOCKET_UNBOUND' + code: 'ERR_HTTP2_SOCKET_UNBOUND', }); assert.throws(() => { socket.example = 1; }, { - code: 'ERR_HTTP2_SOCKET_UNBOUND' + code: 'ERR_HTTP2_SOCKET_UNBOUND', }); assert.throws(() => { // eslint-disable-next-line no-unused-expressions socket instanceof net.Socket; }, { - code: 'ERR_HTTP2_SOCKET_UNBOUND' + code: 'ERR_HTTP2_SOCKET_UNBOUND', }); })); })); diff --git a/test/parallel/test-http2-update-settings.js b/test/parallel/test-http2-update-settings.js index e99ee2bcf150d8..04b7bb4a29ac1e 100644 --- a/test/parallel/test-http2-update-settings.js +++ b/test/parallel/test-http2-update-settings.js @@ -19,14 +19,14 @@ testUpdateSettingsWith({ 'maxHeaderListSize': 1, 'maxFrameSize': 16385, 'enablePush': false, - 'enableConnectProtocol': true - } + 'enableConnectProtocol': true, + }, }); testUpdateSettingsWith({ server: http2.createServer(), newServerSettings: { - 'enablePush': false - } + 'enablePush': false, + }, }); function testUpdateSettingsWith({ server, newServerSettings }) { @@ -40,14 +40,14 @@ function testUpdateSettingsWith({ server, newServerSettings }) { message: 'The "settings" argument must be of type object. ' + 'Received type string (\'\')', code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => server.updateSettings({ - 'maxHeaderListSize': 'foo' + 'maxHeaderListSize': 'foo', }), { message: 'Invalid value for setting "maxHeaderListSize": foo', code: 'ERR_HTTP2_INVALID_SETTING_VALUE', - name: 'RangeError' + name: 'RangeError', }); } diff --git a/test/parallel/test-http2-util-assert-valid-pseudoheader.js b/test/parallel/test-http2-util-assert-valid-pseudoheader.js index f86793c69efdf3..e289d0dc934469 100644 --- a/test/parallel/test-http2-util-assert-valid-pseudoheader.js +++ b/test/parallel/test-http2-util-assert-valid-pseudoheader.js @@ -20,5 +20,5 @@ mapToHeaders({ ':method': 'a' }); assert.throws(() => mapToHeaders({ ':foo': 'a' }), { code: 'ERR_HTTP2_INVALID_PSEUDOHEADER', name: 'TypeError', - message: '":foo" is an invalid pseudoheader or is used incorrectly' + message: '":foo" is an invalid pseudoheader or is used incorrectly', }); diff --git a/test/parallel/test-http2-util-asserts.js b/test/parallel/test-http2-util-asserts.js index 29ba8180494a3c..565bb52d23c39e 100644 --- a/test/parallel/test-http2-util-asserts.js +++ b/test/parallel/test-http2-util-asserts.js @@ -32,7 +32,7 @@ const { { code: 'ERR_INVALID_ARG_TYPE', message: 'The "foo" argument must be of type object.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), }); }); @@ -41,5 +41,5 @@ assertWithinRange('foo', 1, 0, 2); assert.throws(() => assertWithinRange('foo', 1, 2, 3), { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', - message: 'Invalid value for setting "foo": 1' + message: 'Invalid value for setting "foo": 1', }); diff --git a/test/parallel/test-http2-util-headers-list.js b/test/parallel/test-http2-util-headers-list.js index a25336ee7a8473..261389f48d6c55 100644 --- a/test/parallel/test-http2-util-headers-list.js +++ b/test/parallel/test-http2-util-headers-list.js @@ -11,7 +11,7 @@ const assert = require('assert'); const { getAuthority, mapToHeaders, - toHeaderObject + toHeaderObject, } = require('internal/http2/util'); const { sensitiveHeaders } = require('http2'); const { internalBinding } = require('internal/test/binding'); @@ -92,7 +92,7 @@ const { HTTP2_HEADER_TE, HTTP2_HEADER_TRANSFER_ENCODING, HTTP2_HEADER_KEEP_ALIVE, - HTTP2_HEADER_PROXY_CONNECTION + HTTP2_HEADER_PROXY_CONNECTION, } = internalBinding('http2').constants; { @@ -102,7 +102,7 @@ const { ':path': 'abc', 'xyz': [1, '2', { toString() { return '3'; } }, 4], 'foo': [], - 'BAR': [1] + 'BAR': [1], }; assert.deepStrictEqual( @@ -119,7 +119,7 @@ const { ':path': 'abc', ':status': [200], ':authority': [], - 'xyz': [1, 2, 3, 4] + 'xyz': [1, 2, 3, 4], }; assert.deepStrictEqual( @@ -136,7 +136,7 @@ const { 'xyz': [1, 2, 3, 4], '': 1, ':status': 200, - [Symbol('test')]: 1 // Symbol keys are ignored + [Symbol('test')]: 1, // Symbol keys are ignored }; assert.deepStrictEqual( @@ -166,7 +166,7 @@ const { // Arrays containing a single set-cookie value are handled correctly // (https://github.com/nodejs/node/issues/16452) const headers = { - 'set-cookie': ['foo=bar'] + 'set-cookie': ['foo=bar'], }; assert.deepStrictEqual( mapToHeaders(headers), @@ -184,7 +184,7 @@ const { assert.throws(() => mapToHeaders(headers), { code: 'ERR_HTTP2_HEADER_SINGLE_VALUE', name: 'TypeError', - message: 'Header field ":status" must only have a single value' + message: 'Header field ":status" must only have a single value', }); } @@ -195,7 +195,7 @@ const { ':status': [200], ':authority': [], 'xyz': [1, 2, 3, 4], - [sensitiveHeaders]: ['xyz'] + [sensitiveHeaders]: ['xyz'], }; assert.deepStrictEqual( @@ -250,7 +250,7 @@ const { const msg = `Header field "${name}" must only have a single value`; assert.throws(() => mapToHeaders({ [name]: [1, 2, 3] }), { code: 'ERR_HTTP2_HEADER_SINGLE_VALUE', - message: msg + message: msg, }); }); @@ -308,7 +308,7 @@ const { code: 'ERR_HTTP2_INVALID_CONNECTION_HEADERS', name: 'TypeError', message: 'HTTP/1 Connection specific headers are forbidden: ' + - `"${name.toLowerCase()}"` + `"${name.toLowerCase()}"`, }); }); @@ -316,7 +316,7 @@ assert.throws(() => mapToHeaders({ [HTTP2_HEADER_TE]: ['abc'] }), { code: 'ERR_HTTP2_INVALID_CONNECTION_HEADERS', name: 'TypeError', message: 'HTTP/1 Connection specific headers are forbidden: ' + - `"${HTTP2_HEADER_TE}"` + `"${HTTP2_HEADER_TE}"`, }); assert.throws( @@ -324,7 +324,7 @@ assert.throws( code: 'ERR_HTTP2_INVALID_CONNECTION_HEADERS', name: 'TypeError', message: 'HTTP/1 Connection specific headers are forbidden: ' + - `"${HTTP2_HEADER_TE}"` + `"${HTTP2_HEADER_TE}"`, }); // These should not throw @@ -339,7 +339,7 @@ mapToHeaders({ [HTTP2_HEADER_HOST]: 'abc' }); // If both are present, the latter has priority assert.strictEqual(getAuthority({ [HTTP2_HEADER_AUTHORITY]: 'abc', - [HTTP2_HEADER_HOST]: 'def' + [HTTP2_HEADER_HOST]: 'def', }), 'abc'); diff --git a/test/parallel/test-http2-util-nghttp2error.js b/test/parallel/test-http2-util-nghttp2error.js index ae561204bc6e54..2880c4e41cae3c 100644 --- a/test/parallel/test-http2-util-nghttp2error.js +++ b/test/parallel/test-http2-util-nghttp2error.js @@ -12,7 +12,7 @@ throws(() => { }, { code: 'ERR_HTTP2_ERROR', constructor: NghttpError, - message: 'Invalid argument' + message: 'Invalid argument', }); // Should convert the NghttpError object to string properly diff --git a/test/parallel/test-http2-util-update-options-buffer.js b/test/parallel/test-http2-util-update-options-buffer.js index 9587d93d3bcbc8..84a5dcf9efde6e 100644 --- a/test/parallel/test-http2-util-update-options-buffer.js +++ b/test/parallel/test-http2-util-update-options-buffer.js @@ -72,7 +72,7 @@ const IDX_OPTIONS_FLAGS = 10; maxReservedRemoteStreams: 2, peerMaxConcurrentStreams: 4, paddingStrategy: 5, - maxHeaderListPairs: 6 + maxHeaderListPairs: 6, }); strictEqual(optionsBuffer[IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE], 1); diff --git a/test/parallel/test-http2-window-size.js b/test/parallel/test-http2-window-size.js index b5940f29583a77..187640a4561575 100644 --- a/test/parallel/test-http2-window-size.js +++ b/test/parallel/test-http2-window-size.js @@ -48,15 +48,15 @@ function run(buffers, initialWindowSize) { h2.connect({ authority: 'localhost', protocol: 'http:', - port + port, }, { settings: { - initialWindowSize - } + initialWindowSize, + }, }).on('connect', common.mustCall(() => { const req = client.request({ ':method': 'GET', - ':path': '/' + ':path': '/', }); const responses = []; req.on('data', (data) => { diff --git a/test/parallel/test-http2-write-finishes-after-stream-destroy.js b/test/parallel/test-http2-write-finishes-after-stream-destroy.js index 3b2dd4bcd4e548..d0ffa091c11742 100644 --- a/test/parallel/test-http2-write-finishes-after-stream-destroy.js +++ b/test/parallel/test-http2-write-finishes-after-stream-destroy.js @@ -21,7 +21,7 @@ process.on('exit', global.gc); serverSideHttp2Stream = stream; stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); const originalWrite = serverSide._write; @@ -44,7 +44,7 @@ process.on('exit', global.gc); server.emit('connection', serverSide); const client = http2.connect('http://localhost:80', { - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }); const req = client.request({ ':path': '/' }); diff --git a/test/parallel/test-http2-zero-length-header.js b/test/parallel/test-http2-zero-length-header.js index 2e7876858aaace..b67122ecc1ee09 100644 --- a/test/parallel/test-http2-zero-length-header.js +++ b/test/parallel/test-http2-zero-length-header.js @@ -15,7 +15,7 @@ server.on('stream', (stream, headers) => { ':path': '/', 'bar': '', '__proto__': null, - [http2.sensitiveHeaders]: [] + [http2.sensitiveHeaders]: [], }); stream.session.destroy(); server.close(); diff --git a/test/parallel/test-http2-zero-length-write.js b/test/parallel/test-http2-zero-length-write.js index 0b50715330a1c4..a5cf47b629f799 100644 --- a/test/parallel/test-http2-zero-length-write.js +++ b/test/parallel/test-http2-zero-length-write.js @@ -17,7 +17,7 @@ function getSrc() { this.push(chunk); else this.push(null); - } + }, }); } diff --git a/test/parallel/test-https-abortcontroller.js b/test/parallel/test-https-abortcontroller.js index 420bf9217e8f5b..0c83f5e7e60d64 100644 --- a/test/parallel/test-https-abortcontroller.js +++ b/test/parallel/test-https-abortcontroller.js @@ -11,7 +11,7 @@ const { once, getEventListeners } = require('events'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; // Check async post-aborted diff --git a/test/parallel/test-https-agent-abort-controller.js b/test/parallel/test-https-agent-abort-controller.js index 14331e7036d66d..7c4f629bb12cc1 100644 --- a/test/parallel/test-https-agent-abort-controller.js +++ b/test/parallel/test-https-agent-abort-controller.js @@ -14,7 +14,7 @@ const agent = new Agent(); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = https.createServer(options); @@ -26,7 +26,7 @@ server.listen(0, common.mustCall(async () => { port: port, host: host, rejectUnauthorized: false, - _agentKey: agent.getName({ port, host }) + _agentKey: agent.getName({ port, host }), }; async function postCreateConnection() { diff --git a/test/parallel/test-https-agent-additional-options.js b/test/parallel/test-https-agent-additional-options.js index 543ee176fb6af3..796476223118ce 100644 --- a/test/parallel/test-https-agent-additional-options.js +++ b/test/parallel/test-https-agent-additional-options.js @@ -13,7 +13,7 @@ const options = { cert: fixtures.readKey('agent1-cert.pem'), ca: fixtures.readKey('ca1-cert.pem'), minVersion: 'TLSv1.1', - ciphers: 'ALL@SECLEVEL=0' + ciphers: 'ALL@SECLEVEL=0', }; const server = https.Server(options, (req, res) => { @@ -28,7 +28,7 @@ function getBaseOptions(port) { ca: options.ca, rejectUnauthorized: true, servername: 'agent1', - ciphers: 'ALL@SECLEVEL=0' + ciphers: 'ALL@SECLEVEL=0', }; } diff --git a/test/parallel/test-https-agent-create-connection.js b/test/parallel/test-https-agent-create-connection.js index d4840298aa6e08..9c08d730234bf3 100644 --- a/test/parallel/test-https-agent-create-connection.js +++ b/test/parallel/test-https-agent-create-connection.js @@ -51,7 +51,7 @@ function createServer() { port: port, host: host, rejectUnauthorized: false, - _agentKey: agent.getName({ port, host }) + _agentKey: agent.getName({ port, host }), }; const socket = agent.createConnection(options); @@ -67,7 +67,7 @@ function createServer() { const host = 'localhost'; const options = { rejectUnauthorized: false, - _agentKey: agent.getName({ port, host }) + _agentKey: agent.getName({ port, host }), }; const socket = agent.createConnection(port, options); checkRequest(socket, server); @@ -82,7 +82,7 @@ function createServer() { const host = 'localhost'; const options = { rejectUnauthorized: false, - _agentKey: agent.getName({ port, host }) + _agentKey: agent.getName({ port, host }), }; const socket = agent.createConnection(port, host, options); checkRequest(socket, server); @@ -141,7 +141,7 @@ function createServer() { const host = 'localhost'; const options = { port: 3000, - rejectUnauthorized: false + rejectUnauthorized: false, }; const socket = agent.createConnection(port, host, options); @@ -150,7 +150,7 @@ function createServer() { })); socket.on('end', common.mustCall(() => { assert.deepStrictEqual(options, { - port: 3000, rejectUnauthorized: false + port: 3000, rejectUnauthorized: false, }); server.close(); })); diff --git a/test/parallel/test-https-agent-disable-session-reuse.js b/test/parallel/test-https-agent-disable-session-reuse.js index b3d0327f59b1ad..e762d6a51e626c 100644 --- a/test/parallel/test-https-agent-disable-session-reuse.js +++ b/test/parallel/test-https-agent-disable-session-reuse.js @@ -13,14 +13,14 @@ const TOTAL_REQS = 2; const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const clientSessions = []; let serverRequests = 0; const agent = new https.Agent({ - maxCachedSessions: 0 + maxCachedSessions: 0, }); const server = https.createServer(options, function(req, res) { @@ -32,7 +32,7 @@ const server = https.createServer(options, function(req, res) { const options = { agent: agent, port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }; https.request(options, function(res) { diff --git a/test/parallel/test-https-agent-servername.js b/test/parallel/test-https-agent-servername.js index aa3f75894b8e64..725e08d640594b 100644 --- a/test/parallel/test-https-agent-servername.js +++ b/test/parallel/test-https-agent-servername.js @@ -11,7 +11,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), - ca: fixtures.readKey('ca1-cert.pem') + ca: fixtures.readKey('ca1-cert.pem'), }; @@ -27,7 +27,7 @@ server.listen(0, function() { port: this.address().port, rejectUnauthorized: true, servername: 'agent1', - ca: options.ca + ca: options.ca, }, (res) => { res.resume(); assert.strictEqual(res.statusCode, 200); diff --git a/test/parallel/test-https-agent-session-eviction.js b/test/parallel/test-https-agent-session-eviction.js index 940c43cc40bf15..b1d2f18e7f006d 100644 --- a/test/parallel/test-https-agent-session-eviction.js +++ b/test/parallel/test-https-agent-session-eviction.js @@ -14,7 +14,7 @@ const options = { key: readKey('agent1-key.pem'), cert: readKey('agent1-cert.pem'), secureOptions: SSL_OP_NO_TICKET, - ciphers: 'RSA@SECLEVEL=0' + ciphers: 'RSA@SECLEVEL=0', }; // Create TLS1.2 server @@ -29,7 +29,7 @@ function first(server) { const port = server.address().port; const req = https.request({ port: port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function(res) { res.resume(); @@ -54,7 +54,7 @@ function faultyServer(port) { function second(server, session) { const req = https.request({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function(res) { res.resume(); }); diff --git a/test/parallel/test-https-agent-session-injection.js b/test/parallel/test-https-agent-session-injection.js index cb9358b1b17009..c9b2eee46f7b78 100644 --- a/test/parallel/test-https-agent-session-injection.js +++ b/test/parallel/test-https-agent-session-injection.js @@ -17,7 +17,7 @@ const options = { // NOTE: TLS 1.3 creates new session ticket **after** handshake so // `getSession()` output will be different even if the session was reused // during the handshake. - secureProtocol: 'TLSv1_2_method' + secureProtocol: 'TLSv1_2_method', }; const ca = [ fixtures.readKey('ca1-cert.pem') ]; diff --git a/test/parallel/test-https-agent-session-reuse.js b/test/parallel/test-https-agent-session-reuse.js index 485f4b1ca308c9..c3407d716364de 100644 --- a/test/parallel/test-https-agent-session-reuse.js +++ b/test/parallel/test-https-agent-session-reuse.js @@ -11,7 +11,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const ca = fixtures.readKey('ca1-cert.pem'); @@ -20,7 +20,7 @@ const clientSessions = {}; let serverRequests = 0; const agent = new https.Agent({ - maxCachedSessions: 1 + maxCachedSessions: 1, }); const server = https.createServer(options, function(req, res) { @@ -38,7 +38,7 @@ const server = https.createServer(options, function(req, res) { path: '/', servername: 'agent1', ca: ca, - port: this.address().port + port: this.address().port, }, { name: 'first-reuse', @@ -47,7 +47,7 @@ const server = https.createServer(options, function(req, res) { path: '/', servername: 'agent1', ca: ca, - port: this.address().port + port: this.address().port, }, { name: 'cipher-change', @@ -59,7 +59,7 @@ const server = https.createServer(options, function(req, res) { // Choose different cipher to use different cache entry ciphers: 'AES256-SHA', ca: ca, - port: this.address().port + port: this.address().port, }, // Change the ticket key to ensure session is updated in cache { @@ -69,7 +69,7 @@ const server = https.createServer(options, function(req, res) { path: '/drop-key', servername: 'agent1', ca: ca, - port: this.address().port + port: this.address().port, }, // Ticket will be updated starting from this @@ -80,7 +80,7 @@ const server = https.createServer(options, function(req, res) { path: '/', servername: 'agent1', ca: ca, - port: this.address().port + port: this.address().port, }, { name: 'after-drop-reuse', @@ -89,7 +89,7 @@ const server = https.createServer(options, function(req, res) { path: '/', servername: 'agent1', ca: ca, - port: this.address().port + port: this.address().port, }, ]; diff --git a/test/parallel/test-https-agent-sni.js b/test/parallel/test-https-agent-sni.js index 1ddeff7ce205d9..0d7dd06fa17ef6 100644 --- a/test/parallel/test-https-agent-sni.js +++ b/test/parallel/test-https-agent-sni.js @@ -9,7 +9,7 @@ const https = require('https'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const TOTAL = 4; @@ -37,7 +37,7 @@ server.listen(0, function() { } const agent = new https.Agent({ - maxSockets: 1 + maxSockets: 1, }); for (let j = 0; j < TOTAL; j++) { https.get({ @@ -47,7 +47,7 @@ server.listen(0, function() { port: this.address().port, host: '127.0.0.1', servername: `sni.${j}`, - rejectUnauthorized: false + rejectUnauthorized: false, }, expectResponse(j)); } https.get({ @@ -57,6 +57,6 @@ server.listen(0, function() { port: this.address().port, host: '127.0.0.1', servername: '', - rejectUnauthorized: false + rejectUnauthorized: false, }, expectResponse(false)); }); diff --git a/test/parallel/test-https-agent-sockets-leak.js b/test/parallel/test-https-agent-sockets-leak.js index 15409d33dbd86a..d8c16880f8b0bd 100644 --- a/test/parallel/test-https-agent-sockets-leak.js +++ b/test/parallel/test-https-agent-sockets-leak.js @@ -11,7 +11,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), - ca: fixtures.readKey('ca1-cert.pem') + ca: fixtures.readKey('ca1-cert.pem'), }; const server = https.Server(options, common.mustCall((req, res) => { @@ -20,7 +20,7 @@ const server = https.Server(options, common.mustCall((req, res) => { })); const agent = new https.Agent({ - keepAlive: false + keepAlive: false, }); server.listen(0, common.mustCall(() => { @@ -30,7 +30,7 @@ server.listen(0, common.mustCall(() => { headers: { host: 'agent1' }, rejectUnauthorized: true, ca: options.ca, - agent: agent + agent: agent, }, common.mustCall((res) => { res.resume(); server.close(); diff --git a/test/parallel/test-https-agent.js b/test/parallel/test-https-agent.js index ce4bc6e5bdb86b..39717db5b95b2a 100644 --- a/test/parallel/test-https-agent.js +++ b/test/parallel/test-https-agent.js @@ -31,7 +31,7 @@ const https = require('https'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; @@ -53,7 +53,7 @@ server.listen(0, () => { https.get({ path: '/', port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function(res) { res.resume(); assert.strictEqual(res.statusCode, 200); diff --git a/test/parallel/test-https-byteswritten.js b/test/parallel/test-https-byteswritten.js index 8ce0f7d8225033..576534469a8182 100644 --- a/test/parallel/test-https-byteswritten.js +++ b/test/parallel/test-https-byteswritten.js @@ -30,7 +30,7 @@ const https = require('https'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const body = 'hello world\n'; @@ -49,6 +49,6 @@ const httpsServer = https.createServer(options, function(req, res) { httpsServer.listen(0, function() { https.get({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }); }); diff --git a/test/parallel/test-https-client-checkServerIdentity.js b/test/parallel/test-https-client-checkServerIdentity.js index 87c9ec8229f30a..9a908eba73be3c 100644 --- a/test/parallel/test-https-client-checkServerIdentity.js +++ b/test/parallel/test-https-client-checkServerIdentity.js @@ -30,7 +30,7 @@ const https = require('https'); const options = { key: fixtures.readKey('agent3-key.pem'), - cert: fixtures.readKey('agent3-cert.pem') + cert: fixtures.readKey('agent3-cert.pem'), }; const server = https.createServer(options, common.mustCall(function(req, res) { @@ -45,7 +45,7 @@ function authorized() { const req = https.request({ port: server.address().port, rejectUnauthorized: true, - ca: [fixtures.readKey('ca2-cert.pem')] + ca: [fixtures.readKey('ca2-cert.pem')], }, common.mustNotCall()); req.on('error', function(err) { override(); @@ -60,7 +60,7 @@ function override() { ca: [fixtures.readKey('ca2-cert.pem')], checkServerIdentity: function(host, cert) { return false; - } + }, }; options.agent = new https.Agent(options); const req = https.request(options, function(res) { diff --git a/test/parallel/test-https-client-get-url.js b/test/parallel/test-https-client-get-url.js index fb91a4f1e7cb8a..17b4f683d87818 100644 --- a/test/parallel/test-https-client-get-url.js +++ b/test/parallel/test-https-client-get-url.js @@ -34,7 +34,7 @@ const url = require('url'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = https.createServer(options, common.mustCall((req, res) => { diff --git a/test/parallel/test-https-client-override-global-agent.js b/test/parallel/test-https-client-override-global-agent.js index 8774e77bb95d37..21994b6f1cfbf2 100644 --- a/test/parallel/test-https-client-override-global-agent.js +++ b/test/parallel/test-https-client-override-global-agent.js @@ -11,7 +11,7 @@ process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = https.Server(options, common.mustCall((req, res) => { @@ -30,7 +30,7 @@ server.listen(0, common.mustCall(() => { function makeRequest() { const req = https.get({ - port: server.address().port + port: server.address().port, }); req.on('close', () => server.close()); diff --git a/test/parallel/test-https-client-reject.js b/test/parallel/test-https-client-reject.js index 113b56fda66fe4..b7327864755df5 100644 --- a/test/parallel/test-https-client-reject.js +++ b/test/parallel/test-https-client-reject.js @@ -31,7 +31,7 @@ const https = require('https'); const options = { key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const server = https.createServer(options, common.mustCall(function(req, res) { @@ -45,7 +45,7 @@ const server = https.createServer(options, common.mustCall(function(req, res) { function unauthorized() { const req = https.request({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function(res) { assert(!req.socket.authorized); res.resume(); @@ -59,7 +59,7 @@ function unauthorized() { function rejectUnauthorized() { const options = { - port: server.address().port + port: server.address().port, }; options.agent = new https.Agent(options); const req = https.request(options, common.mustNotCall()); @@ -72,7 +72,7 @@ function rejectUnauthorized() { function authorized() { const options = { port: server.address().port, - ca: [fixtures.readKey('rsa_cert.crt')] + ca: [fixtures.readKey('rsa_cert.crt')], }; options.agent = new https.Agent(options); const req = https.request(options, function(res) { diff --git a/test/parallel/test-https-client-resume.js b/test/parallel/test-https-client-resume.js index 8904e24180b329..d99079c3899ebb 100644 --- a/test/parallel/test-https-client-resume.js +++ b/test/parallel/test-https-client-resume.js @@ -34,7 +34,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }; // create server @@ -46,7 +46,7 @@ const server = https.createServer(options, common.mustCall((req, res) => { server.listen(0, common.mustCall(function() { const client1 = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { console.log('connect1'); assert.strictEqual(client1.isSessionReused(), false); diff --git a/test/parallel/test-https-close.js b/test/parallel/test-https-close.js index 29104bf2f92bd6..143f48b76f818d 100644 --- a/test/parallel/test-https-close.js +++ b/test/parallel/test-https-close.js @@ -8,7 +8,7 @@ const https = require('https'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const connections = {}; @@ -43,7 +43,7 @@ server.listen(0, () => { port: server.address().port, path: '/', method: 'GET', - rejectUnauthorized: false + rejectUnauthorized: false, }; const req = https.request(requestOptions, (res) => { diff --git a/test/parallel/test-https-connect-address-family.js b/test/parallel/test-https-connect-address-family.js index 65cd59313f109b..e7c9a347ef9660 100644 --- a/test/parallel/test-https-connect-address-family.js +++ b/test/parallel/test-https-connect-address-family.js @@ -33,7 +33,7 @@ const https = require('https'); assert.strictEqual(addr, HOSTNAME); assert.strictEqual(opt.family, 6); cb(null, hostAddrIPv6, opt.family); - }) + }), }; // Will fail with ECONNREFUSED if the address family is not honored. https.get(options, common.mustCall(function() { diff --git a/test/parallel/test-https-drain.js b/test/parallel/test-https-drain.js index 1c8a29258f26f6..640a88ab4ff486 100644 --- a/test/parallel/test-https-drain.js +++ b/test/parallel/test-https-drain.js @@ -30,7 +30,7 @@ const https = require('https'); const options = { key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const bufSize = 1024 * 1024; @@ -47,7 +47,7 @@ server.listen(0, function() { const req = https.request({ method: 'POST', port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function(res) { let timer; res.pause(); diff --git a/test/parallel/test-https-eof-for-eom.js b/test/parallel/test-https-eof-for-eom.js index b2f178654f6de9..dd7d07d389a941 100644 --- a/test/parallel/test-https-eof-for-eom.js +++ b/test/parallel/test-https-eof-for-eom.js @@ -39,7 +39,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; @@ -68,7 +68,7 @@ server.listen(0, common.mustCall(function() { console.log('1) Making Request'); https.get({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function(res) { let bodyBuffer = ''; diff --git a/test/parallel/test-https-foafssl.js b/test/parallel/test-https-foafssl.js index ff2c7d4387ee1b..d4eecf5a14d936 100644 --- a/test/parallel/test-https-foafssl.js +++ b/test/parallel/test-https-foafssl.js @@ -36,7 +36,7 @@ const options = { key: fixtures.readKey('rsa_private.pem'), cert: fixtures.readKey('rsa_cert.crt'), requestCert: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; const webIdUrl = 'URI:http://example.com/#me'; diff --git a/test/parallel/test-https-hwm.js b/test/parallel/test-https-hwm.js index 71ee33b7086861..4ac279e3b47652 100644 --- a/test/parallel/test-https-hwm.js +++ b/test/parallel/test-https-hwm.js @@ -29,7 +29,7 @@ function loadCallback(highWaterMark) { // create server const httpsServer = https.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, common.mustCall(function(req, res) { res.writeHead(200, {}); res.end('ok'); diff --git a/test/parallel/test-https-localaddress-bind-error.js b/test/parallel/test-https-localaddress-bind-error.js index 57e4dd054d78ce..0c2d14cecd71d3 100644 --- a/test/parallel/test-https-localaddress-bind-error.js +++ b/test/parallel/test-https-localaddress-bind-error.js @@ -31,7 +31,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const invalidLocalAddress = '1.2.3.4'; @@ -52,7 +52,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { port: this.address().port, path: '/', method: 'GET', - localAddress: invalidLocalAddress + localAddress: invalidLocalAddress, }, function(res) { assert.fail('unexpectedly got response from server'); }).on('error', common.mustCall(function(e) { diff --git a/test/parallel/test-https-localaddress.js b/test/parallel/test-https-localaddress.js index 0ac8414b2d4b35..19704a3030a608 100644 --- a/test/parallel/test-https-localaddress.js +++ b/test/parallel/test-https-localaddress.js @@ -34,7 +34,7 @@ const https = require('https'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = https.createServer(options, function(req, res) { @@ -55,7 +55,7 @@ server.listen(0, '127.0.0.1', function() { path: '/', method: 'GET', localAddress: '127.0.0.2', - rejectUnauthorized: false + rejectUnauthorized: false, }; const req = https.request(options, function(res) { diff --git a/test/parallel/test-https-max-headers-count.js b/test/parallel/test-https-max-headers-count.js index f8e4e64bfb94dd..eaed387d663439 100644 --- a/test/parallel/test-https-max-headers-count.js +++ b/test/parallel/test-https-max-headers-count.js @@ -10,7 +10,7 @@ const https = require('https'); const serverOptions = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; let requests = 0; @@ -54,7 +54,7 @@ server.listen(0, common.mustCall(() => { const req = https.request({ port: server.address().port, headers: headers, - rejectUnauthorized: false + rejectUnauthorized: false, }, (res) => { assert.strictEqual(Object.keys(res.headers).length, expected); res.on('end', () => { diff --git a/test/parallel/test-https-options-boolean-check.js b/test/parallel/test-https-options-boolean-check.js index 9740704e169f1e..40420cc052a50d 100644 --- a/test/parallel/test-https-options-boolean-check.js +++ b/test/parallel/test-https-options-boolean-check.js @@ -90,7 +90,7 @@ const caArrDataView = toDataView(caCert); name: 'TypeError', message: 'The "options.key" property must be of type string or an ' + 'instance of Buffer, TypedArray, or DataView.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), }); }); @@ -116,7 +116,7 @@ const caArrDataView = toDataView(caCert); name: 'TypeError', message: 'The "options.cert" property must be of type string or an ' + 'instance of Buffer, TypedArray, or DataView.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), }); }); @@ -151,6 +151,6 @@ const caArrDataView = toDataView(caCert); name: 'TypeError', message: 'The "options.ca" property must be of type string or an instance' + ' of Buffer, TypedArray, or DataView.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), }); }); diff --git a/test/parallel/test-https-pfx.js b/test/parallel/test-https-pfx.js index 4246913a037ec1..79b3154742533b 100644 --- a/test/parallel/test-https-pfx.js +++ b/test/parallel/test-https-pfx.js @@ -39,7 +39,7 @@ const options = { pfx: pfx, passphrase: 'sample', requestCert: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; const server = https.createServer(options, function(req, res) { diff --git a/test/parallel/test-https-request-arguments.js b/test/parallel/test-https-request-arguments.js index 9dc80094be0d2c..1aeba83374eff6 100644 --- a/test/parallel/test-https-request-arguments.js +++ b/test/parallel/test-https-request-arguments.js @@ -10,7 +10,7 @@ const https = require('https'); const options = { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), - ca: fixtures.readKey('ca1-cert.pem') + ca: fixtures.readKey('ca1-cert.pem'), }; // Test providing both a url and options, with the options partially @@ -34,7 +34,7 @@ const options = { { hostname: 'localhost', port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall((res) => { diff --git a/test/parallel/test-https-resume-after-renew.js b/test/parallel/test-https-resume-after-renew.js index 939975adfa6efb..b6232e44a978d6 100644 --- a/test/parallel/test-https-resume-after-renew.js +++ b/test/parallel/test-https-resume-after-renew.js @@ -10,7 +10,7 @@ const crypto = require('crypto'); const options = { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), - ca: fixtures.readKey('ca1-cert.pem') + ca: fixtures.readKey('ca1-cert.pem'), }; const server = https.createServer(options, function(req, res) { @@ -39,7 +39,7 @@ server.listen(0, function() { method: 'GET', port: addr.port, servername: 'agent1', - ca: options.ca + ca: options.ca, }, function(res) { res.resume(); res.once('end', callback); diff --git a/test/parallel/test-https-selfsigned-no-keycertsign-no-crash.js b/test/parallel/test-https-selfsigned-no-keycertsign-no-crash.js index 2dd46ac878c5b0..d47e36cf3ba65a 100644 --- a/test/parallel/test-https-selfsigned-no-keycertsign-no-crash.js +++ b/test/parallel/test-https-selfsigned-no-keycertsign-no-crash.js @@ -35,7 +35,7 @@ const cert = const serverOptions = { key: key, - cert: cert + cert: cert, }; // Start the server @@ -51,7 +51,7 @@ httpsServer.on('listening', () => { const clientOptions = { hostname: '127.0.0.1', port: httpsServer.address().port, - ca: cert + ca: cert, }; // Try to connect const req = https.request(clientOptions, common.mustCall((res) => { diff --git a/test/parallel/test-https-server-options-incoming-message.js b/test/parallel/test-https-server-options-incoming-message.js index 102ee56751b800..d6c3d6909721e8 100644 --- a/test/parallel/test-https-server-options-incoming-message.js +++ b/test/parallel/test-https-server-options-incoming-message.js @@ -26,7 +26,7 @@ const server = https.createServer({ key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), ca: fixtures.readKey('ca1-cert.pem'), - IncomingMessage: MyIncomingMessage + IncomingMessage: MyIncomingMessage, }, common.mustCall(function(req, res) { assert.strictEqual(req.getUserAgent(), 'node-test'); res.statusCode = 200; @@ -39,8 +39,8 @@ server.on('listening', function makeRequest() { port: this.address().port, rejectUnauthorized: false, headers: { - 'User-Agent': 'node-test' - } + 'User-Agent': 'node-test', + }, }, (res) => { assert.strictEqual(res.statusCode, 200); res.on('end', () => { diff --git a/test/parallel/test-https-server-options-server-response.js b/test/parallel/test-https-server-options-server-response.js index 8745415f8b6596..debfdd6b94f66a 100644 --- a/test/parallel/test-https-server-options-server-response.js +++ b/test/parallel/test-https-server-options-server-response.js @@ -26,7 +26,7 @@ const server = https.createServer({ key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), ca: fixtures.readKey('ca1-cert.pem'), - ServerResponse: MyServerResponse + ServerResponse: MyServerResponse, }, common.mustCall(function(req, res) { res.status(200); res.end(); @@ -36,7 +36,7 @@ server.listen(); server.on('listening', function makeRequest() { https.get({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, (res) => { assert.strictEqual(res.statusCode, 200); res.on('end', () => { diff --git a/test/parallel/test-https-server-request-timeout.js b/test/parallel/test-https-server-request-timeout.js index 66a1cb9f25f82e..e593249c1fdcc5 100644 --- a/test/parallel/test-https-server-request-timeout.js +++ b/test/parallel/test-https-server-request-timeout.js @@ -9,7 +9,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = createServer(options); diff --git a/test/parallel/test-https-set-timeout-server.js b/test/parallel/test-https-set-timeout-server.js index c67155e9d53143..c790411a97f6d2 100644 --- a/test/parallel/test-https-set-timeout-server.js +++ b/test/parallel/test-https-set-timeout-server.js @@ -35,7 +35,7 @@ const tests = []; const serverOptions = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; function test(fn) { @@ -62,7 +62,7 @@ test(function serverTimeout(cb) { assert.ok(s instanceof https.Server); https.get({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }).on('error', common.mustCall()); })); }); @@ -83,7 +83,7 @@ test(function serverRequestTimeout(cb) { const req = https.request({ port: server.address().port, method: 'POST', - rejectUnauthorized: false + rejectUnauthorized: false, }); req.on('error', common.mustCall()); req.write('Hello'); @@ -106,7 +106,7 @@ test(function serverResponseTimeout(cb) { server.listen(common.mustCall(() => { https.get({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }).on('error', common.mustCall()); })); }); @@ -128,7 +128,7 @@ test(function serverRequestNotTimeoutAfterEnd(cb) { server.listen(common.mustCall(() => { https.get({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }).on('error', common.mustCall()); })); }); @@ -162,7 +162,7 @@ test(function serverResponseTimeoutWithPipeline(cb) { const options = { port: server.address().port, allowHalfOpen: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; const c = tls.connect(options, () => { c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); @@ -185,7 +185,7 @@ test(function idleTimeout(cb) { const options = { port: server.address().port, allowHalfOpen: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; const c = tls.connect(options, () => { // ECONNRESET could happen on a heavily-loaded server. @@ -231,7 +231,7 @@ test(function fastTimeout(cb) { const options = { port: server.address().port, allowHalfOpen: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; const c = tls.connect(options, () => { c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); diff --git a/test/parallel/test-https-simple.js b/test/parallel/test-https-simple.js index 89707cc6468d68..6276291b8f1b7d 100644 --- a/test/parallel/test-https-simple.js +++ b/test/parallel/test-https-simple.js @@ -34,7 +34,7 @@ process.on('warning', common.mustNotCall()); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const body = 'hello world\n'; @@ -62,7 +62,7 @@ server.listen(0, common.mustCall(() => { port: port, path: '/', method: 'GET', - rejectUnauthorized: false + rejectUnauthorized: false, }; tests++; const req = https.request(options, common.mustCall((res) => { diff --git a/test/parallel/test-https-slow-headers.js b/test/parallel/test-https-slow-headers.js index 95f0caa9878c5e..22da740459d2e2 100644 --- a/test/parallel/test-https-slow-headers.js +++ b/test/parallel/test-https-slow-headers.js @@ -45,7 +45,7 @@ server.once('timeout', common.mustCall((socket) => { server.listen(0, common.mustCall(() => { const client = connect({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }); client.write(headers); client.write('X-CRASH: '); diff --git a/test/parallel/test-https-socket-options.js b/test/parallel/test-https-socket-options.js index b41054d5aa0824..3307fdc9480e9d 100644 --- a/test/parallel/test-https-socket-options.js +++ b/test/parallel/test-https-socket-options.js @@ -31,7 +31,7 @@ const http = require('http'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const body = 'hello world\n'; @@ -48,7 +48,7 @@ const server_http = http.createServer(function(req, res) { server_http.listen(0, function() { const req = http.request({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function(res) { server_http.close(); res.resume(); @@ -72,7 +72,7 @@ const server_https = https.createServer(options, function(req, res) { server_https.listen(0, function() { const req = https.request({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function(res) { server_https.close(); res.resume(); diff --git a/test/parallel/test-https-strict.js b/test/parallel/test-https-strict.js index a72168289d54bb..ba0e0201a65d39 100644 --- a/test/parallel/test-https-strict.js +++ b/test/parallel/test-https-strict.js @@ -66,17 +66,17 @@ const agent3 = new https.Agent({ ca: [ca1, ca2] }); const options1 = { key: key1, - cert: cert1 + cert: cert1, }; const options2 = { key: key2, - cert: cert2 + cert: cert2, }; const options3 = { key: key3, - cert: cert3 + cert: cert3, }; const server1 = server(options1); diff --git a/test/parallel/test-https-timeout-server-2.js b/test/parallel/test-https-timeout-server-2.js index f4c423ec4a5b72..9a798f718de8ad 100644 --- a/test/parallel/test-https-timeout-server-2.js +++ b/test/parallel/test-https-timeout-server-2.js @@ -32,7 +32,7 @@ const tls = require('tls'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = https.createServer(options, common.mustNotCall()); @@ -49,6 +49,6 @@ server.listen(0, function() { tls.connect({ host: '127.0.0.1', port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }); }); diff --git a/test/parallel/test-https-timeout-server.js b/test/parallel/test-https-timeout-server.js index ecc564192a03ba..389b78d572979d 100644 --- a/test/parallel/test-https-timeout-server.js +++ b/test/parallel/test-https-timeout-server.js @@ -35,7 +35,7 @@ const net = require('net'); const options = { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), - handshakeTimeout: 50 + handshakeTimeout: 50, }; const server = https.createServer(options, common.mustNotCall()); diff --git a/test/parallel/test-https-timeout.js b/test/parallel/test-https-timeout.js index d8f128db7253b3..8a194e6000010c 100644 --- a/test/parallel/test-https-timeout.js +++ b/test/parallel/test-https-timeout.js @@ -30,7 +30,7 @@ const https = require('https'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; // A server that never replies @@ -42,7 +42,7 @@ const server = https.createServer(options, function() { port: this.address().port, path: '/', method: 'GET', - rejectUnauthorized: false + rejectUnauthorized: false, }); req.setTimeout(10); req.end(); @@ -54,7 +54,7 @@ const server = https.createServer(options, function() { req.on('error', common.expectsError({ message: 'socket hang up', code: 'ECONNRESET', - name: 'Error' + name: 'Error', })); req.on('timeout', common.mustCall(function() { diff --git a/test/parallel/test-https-unix-socket-self-signed.js b/test/parallel/test-https-unix-socket-self-signed.js index 9db92ac2aed44a..c45fd209ad1b36 100644 --- a/test/parallel/test-https-unix-socket-self-signed.js +++ b/test/parallel/test-https-unix-socket-self-signed.js @@ -11,7 +11,7 @@ const fixtures = require('../common/fixtures'); const https = require('https'); const options = { cert: fixtures.readKey('rsa_cert.crt'), - key: fixtures.readKey('rsa_private.pem') + key: fixtures.readKey('rsa_private.pem'), }; const server = https.createServer(options, common.mustCall((req, res) => { @@ -22,6 +22,6 @@ const server = https.createServer(options, common.mustCall((req, res) => { server.listen(common.PIPE, common.mustCall(() => { https.get({ socketPath: common.PIPE, - rejectUnauthorized: false + rejectUnauthorized: false, }); })); diff --git a/test/parallel/test-icu-punycode.js b/test/parallel/test-icu-punycode.js index 29e88f9b9a6262..57f431a8f3faab 100644 --- a/test/parallel/test-icu-punycode.js +++ b/test/parallel/test-icu-punycode.js @@ -43,7 +43,7 @@ const fixtures = require('../fixtures/icu-punycode-toascii.json'); { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: 'Cannot convert name to ASCII' + message: 'Cannot convert name to ASCII', } ); icu.toASCII(input, true); // Should not throw. diff --git a/test/parallel/test-icu-transcode.js b/test/parallel/test-icu-transcode.js index e9aced128eec21..270dbb01bfb7e5 100644 --- a/test/parallel/test-icu-transcode.js +++ b/test/parallel/test-icu-transcode.js @@ -15,7 +15,7 @@ const tests = { 'ascii': [0x74, 0x3f, 0x73, 0x74, 0x20, 0x3f], 'ucs2': [0x74, 0x00, 0x1b, 0x01, 0x73, 0x00, 0x74, 0x00, 0x20, 0x00, - 0x15, 0x26] + 0x15, 0x26], }; for (const test in tests) { @@ -47,7 +47,7 @@ assert.throws( name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "source" argument must be an instance of Buffer ' + - 'or Uint8Array. Received null' + 'or Uint8Array. Received null', } ); diff --git a/test/parallel/test-inspector-already-activated-cli.js b/test/parallel/test-inspector-already-activated-cli.js index ba76d5168c14b9..9314ab3f54e05d 100644 --- a/test/parallel/test-inspector-already-activated-cli.js +++ b/test/parallel/test-inspector-already-activated-cli.js @@ -12,7 +12,7 @@ assert(wsUrl.startsWith('ws://')); assert.throws(() => { inspector.open(0, undefined, false); }, { - code: 'ERR_INSPECTOR_ALREADY_ACTIVATED' + code: 'ERR_INSPECTOR_ALREADY_ACTIVATED', }); assert.strictEqual(inspector.url(), wsUrl); inspector.close(); diff --git a/test/parallel/test-inspector-async-hook-after-done.js b/test/parallel/test-inspector-async-hook-after-done.js index 9f96fdb7b0da84..ae1d9a6c5c71fc 100644 --- a/test/parallel/test-inspector-async-hook-after-done.js +++ b/test/parallel/test-inspector-async-hook-after-done.js @@ -18,7 +18,7 @@ function onAttachToWorker({ params: { sessionId } }) { function postToWorkerInspector(method, params) { session.post('NodeWorker.sendMessageToWorker', { sessionId, - message: JSON.stringify({ id: id++, method, params }) + message: JSON.stringify({ id: id++, method, params }), }, () => console.log(`Message ${method} received the response`)); } diff --git a/test/parallel/test-inspector-bindings.js b/test/parallel/test-inspector-bindings.js index 3e88c858f8de9e..984e33d5ac77a4 100644 --- a/test/parallel/test-inspector-bindings.js +++ b/test/parallel/test-inspector-bindings.js @@ -23,7 +23,7 @@ function checkScope(session, scopeId) { 'objectId': scopeId, 'ownProperties': false, 'accessorPropertiesOnly': false, - 'generatePreview': true + 'generatePreview': true, }, scopeCallback); } @@ -61,7 +61,7 @@ function testSampleDebugSession() { const failures = []; const expects = { i: [0, 1, 2, 3, 4], - accum: [0, 0, 1, 3, 6] + accum: [0, 0, 1, 3, 6], }; scopeCallback = function(error, result) { const i = cur++; @@ -88,7 +88,7 @@ function testSampleDebugSession() { 'lineNumber': 13, 'url': pathToFileURL(path.resolve(__dirname, __filename)).toString(), 'columnNumber': 0, - 'condition': '' + 'condition': '', }); debuggedFunction(); diff --git a/test/parallel/test-inspector-connect-main-thread.js b/test/parallel/test-inspector-connect-main-thread.js index 86ff6866bc064e..527665d272fc90 100644 --- a/test/parallel/test-inspector-connect-main-thread.js +++ b/test/parallel/test-inspector-connect-main-thread.js @@ -44,7 +44,7 @@ async function waitForNotification(session, notification) { function startWorker(skipChild, sharedBuffer) { return new Promise((resolve) => { const worker = new Worker(__filename, { - workerData: { skipChild, sharedBuffer } + workerData: { skipChild, sharedBuffer }, }); worker.on('error', (e) => { console.error(e); @@ -127,7 +127,7 @@ async function childMain() { 'lineNumber': 18, 'url': pathToFileURL(path.resolve(__dirname, __filename)).toString(), 'columnNumber': 0, - 'condition': '' + 'condition': '', }); const pausedPromise = waitForNotification(session, 'Debugger.paused'); parentPort.postMessage('Ready'); diff --git a/test/parallel/test-inspector-esm.js b/test/parallel/test-inspector-esm.js index 590432ad9ac31d..225e4d7f832ac9 100644 --- a/test/parallel/test-inspector-esm.js +++ b/test/parallel/test-inspector-esm.js @@ -70,8 +70,8 @@ async function testBreakpoint(session) { 'objectId': scopeId, 'ownProperties': false, 'accessorPropertiesOnly': false, - 'generatePreview': true - } + 'generatePreview': true, + }, }); assertScopeValues(response, { t: 1001, k: 1, message: 'A message' }); @@ -83,16 +83,16 @@ async function testBreakpoint(session) { 'includeCommandLineAPI': true, 'silent': false, 'returnByValue': false, - 'generatePreview': true - } + 'generatePreview': true, + }, }); assert.strictEqual(result.value, 1002); result = (await session.send({ 'method': 'Runtime.evaluate', 'params': { - 'expression': '5 * 5' - } + 'expression': '5 * 5', + }, })).result; assert.strictEqual(result.value, 25); } diff --git a/test/parallel/test-inspector-module.js b/test/parallel/test-inspector-module.js index 5f5efe4cb80061..7b649dc52bb564 100644 --- a/test/parallel/test-inspector-module.js +++ b/test/parallel/test-inspector-module.js @@ -15,7 +15,7 @@ assert.throws( { code: 'ERR_INSPECTOR_NOT_CONNECTED', name: 'Error', - message: 'Session is not connected' + message: 'Session is not connected', } ); @@ -30,7 +30,7 @@ session.post('Runtime.evaluate', { expression: '2 + 2' }); name: 'TypeError', message: 'The "method" argument must be of type string.' + - common.invalidArgTypeHelper(i) + common.invalidArgTypeHelper(i), } ); }); @@ -43,7 +43,7 @@ session.post('Runtime.evaluate', { expression: '2 + 2' }); name: 'TypeError', message: 'The "params" argument must be of type object.' + - common.invalidArgTypeHelper(i) + common.invalidArgTypeHelper(i), } ); }); @@ -54,7 +54,7 @@ session.post('Runtime.evaluate', { expression: '2 + 2' }); { code: 'ERR_INVALID_CALLBACK', name: 'TypeError', - message: `Callback must be a function. Received ${inspect(i)}` + message: `Callback must be a function. Received ${inspect(i)}`, } ); }); @@ -64,7 +64,7 @@ assert.throws( { code: 'ERR_INSPECTOR_ALREADY_CONNECTED', name: 'Error', - message: 'The inspector session is already connected' + message: 'The inspector session is already connected', } ); diff --git a/test/parallel/test-inspector-multisession-js.js b/test/parallel/test-inspector-multisession-js.js index 31aa0c5f569854..8222c0254663d1 100644 --- a/test/parallel/test-inspector-multisession-js.js +++ b/test/parallel/test-inspector-multisession-js.js @@ -37,7 +37,7 @@ async function test() { 'lineNumber': 12, 'url': pathToFileURL(path.resolve(__dirname, __filename)).toString(), 'columnNumber': 0, - 'condition': '' + 'condition': '', }, (error, result) => { return error ? reject(error) : resolve(result); }); diff --git a/test/parallel/test-inspector-vm-global-accessors-getter-sideeffect.js b/test/parallel/test-inspector-vm-global-accessors-getter-sideeffect.js index 5dc9c9bb2dff3a..81adcad2d9b65a 100644 --- a/test/parallel/test-inspector-vm-global-accessors-getter-sideeffect.js +++ b/test/parallel/test-inspector-vm-global-accessors-getter-sideeffect.js @@ -16,13 +16,13 @@ const context = vm.createContext({ get a() { global.foo = '1'; return 100; - } + }, }); session.post('Runtime.evaluate', { expression: 'a', throwOnSideEffect: true, - contextId: 2 // context's id + contextId: 2, // context's id }, (error, res) => { assert.ifError(error); const { exception } = res.exceptionDetails; diff --git a/test/parallel/test-inspector-vm-global-accessors-sideeffects.js b/test/parallel/test-inspector-vm-global-accessors-sideeffects.js index b07ce182232fba..b2fb52c402181c 100644 --- a/test/parallel/test-inspector-vm-global-accessors-sideeffects.js +++ b/test/parallel/test-inspector-vm-global-accessors-sideeffects.js @@ -12,19 +12,19 @@ const session = new inspector.Session(); session.connect(); const context = vm.createContext({ - a: 100 + a: 100, }); session.post('Runtime.evaluate', { expression: 'a', throwOnSideEffect: true, - contextId: 2 // context's id + contextId: 2, // context's id }, common.mustSucceed((res) => { assert.deepStrictEqual(res, { result: { type: 'number', value: context.a, - description: '100' - } + description: '100', + }, }); })); diff --git a/test/parallel/test-inspector-wait-for-connection.js b/test/parallel/test-inspector-wait-for-connection.js index 0f562faede1e55..7d42142c111558 100644 --- a/test/parallel/test-inspector-wait-for-connection.js +++ b/test/parallel/test-inspector-wait-for-connection.js @@ -20,8 +20,8 @@ async function runTests() { method: 'Runtime.evaluate', params: { expression: 'process._ws', - includeCommandLineAPI: true - } + includeCommandLineAPI: true, + }, }); assert.ok(value.startsWith('ws://')); session.send({ method: 'Runtime.runIfWaitingForDebugger' }); diff --git a/test/parallel/test-inspector-waiting-for-disconnect.js b/test/parallel/test-inspector-waiting-for-disconnect.js index e9d39978d7aaf0..1f7103d04d416e 100644 --- a/test/parallel/test-inspector-waiting-for-disconnect.js +++ b/test/parallel/test-inspector-waiting-for-disconnect.js @@ -32,7 +32,7 @@ async function runTest() { 'Runtime.executionContextDestroyed should not be sent'); } const { result: { value } } = await session.send({ - method: 'Runtime.evaluate', params: { expression: '42' } + method: 'Runtime.evaluate', params: { expression: '42' }, }); assert.strictEqual(value, 42); await session.disconnect(); diff --git a/test/parallel/test-internal-dtrace.js b/test/parallel/test-internal-dtrace.js index 68991d739a8bf4..47ec5d332ec00c 100644 --- a/test/parallel/test-internal-dtrace.js +++ b/test/parallel/test-internal-dtrace.js @@ -10,7 +10,7 @@ const { DTRACE_HTTP_SERVER_REQUEST, DTRACE_HTTP_SERVER_RESPONSE, DTRACE_NET_SERVER_CONNECTION, - DTRACE_NET_STREAM_END + DTRACE_NET_STREAM_END, } = require('internal/dtrace'); // We're just testing to make sure these are always defined and diff --git a/test/parallel/test-internal-errors.js b/test/parallel/test-internal-errors.js index 7bcc7dcc330c2c..35c93fd7a16042 100644 --- a/test/parallel/test-internal-errors.js +++ b/test/parallel/test-internal-errors.js @@ -55,7 +55,7 @@ errors.E('TEST_ERROR_2', (a, b) => `${a} ${b}`, Error); { message: /^Code: TEST_ERROR_1; The provided arguments length \(0\) does not match the required ones \(1\)\./, name: 'Error', - code: 'ERR_INTERNAL_ASSERTION' + code: 'ERR_INTERNAL_ASSERTION', } ); } @@ -77,7 +77,7 @@ assert.throws(() => { }, { code: 'TEST_ERROR_1', name: 'TypeError', - message: 'Error for testing purposes: a' + message: 'Error for testing purposes: a', }); // Test that `code` property is mutable and that changing it does not change the diff --git a/test/parallel/test-internal-module-map-asserts.js b/test/parallel/test-internal-module-map-asserts.js index 6f985faccd92bb..2e16cbbdf0146d 100644 --- a/test/parallel/test-internal-module-map-asserts.js +++ b/test/parallel/test-internal-module-map-asserts.js @@ -11,7 +11,7 @@ const ModuleMap = require('internal/modules/esm/module_map'); const errorObj = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "url" argument must be of type string/ + message: /^The "url" argument must be of type string/, }; const moduleMap = new ModuleMap(); @@ -36,7 +36,7 @@ const ModuleMap = require('internal/modules/esm/module_map'); assert.throws(() => moduleMap.set('', value), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "job" argument must be an instance of ModuleJob/ + message: /^The "job" argument must be an instance of ModuleJob/, }); }); } diff --git a/test/parallel/test-internal-module-require.js b/test/parallel/test-internal-module-require.js index c6e2057d3da1ee..dec1ecfe224766 100644 --- a/test/parallel/test-internal-module-require.js +++ b/test/parallel/test-internal-module-require.js @@ -83,7 +83,7 @@ if (process.argv[2] === 'child') { require(id); }, { code: 'MODULE_NOT_FOUND', - message: `Cannot find module '${id}'` + message: `Cannot find module '${id}'`, }); } else { require(id); @@ -102,7 +102,7 @@ if (process.argv[2] === 'child') { } else { assert(process.execArgv.includes('--expose-internals')); const child = fork(__filename, ['child'], { - execArgv: [] + execArgv: [], }); const { builtinModules } = require('module'); // When --expose-internals is on, require('module').builtinModules diff --git a/test/parallel/test-internal-socket-list-receive.js b/test/parallel/test-internal-socket-list-receive.js index e7e64887600f59..524e6cb4425e29 100644 --- a/test/parallel/test-internal-socket-list-receive.js +++ b/test/parallel/test-internal-socket-list-receive.js @@ -12,7 +12,7 @@ const key = 'test-key'; { const child = Object.assign(new EventEmitter(), { connected: false, - _send: common.mustNotCall() + _send: common.mustNotCall(), }); const list = new SocketListReceive(child, key); @@ -27,7 +27,7 @@ const key = 'test-key'; _send: common.mustCall((msg) => { assert.strictEqual(msg.cmd, 'NODE_SOCKET_ALL_CLOSED'); assert.strictEqual(msg.key, key); - }) + }), }); const list = new SocketListReceive(child, key); @@ -42,7 +42,7 @@ const key = 'test-key'; assert.strictEqual(msg.cmd, 'NODE_SOCKET_COUNT'); assert.strictEqual(msg.key, key); assert.strictEqual(msg.count, 0); - }) + }), }); const list = new SocketListReceive(child, key); diff --git a/test/parallel/test-internal-socket-list-send.js b/test/parallel/test-internal-socket-list-send.js index a4012c7cc3e293..c35be902ede2cd 100644 --- a/test/parallel/test-internal-socket-list-send.js +++ b/test/parallel/test-internal-socket-list-send.js @@ -20,7 +20,7 @@ const key = 'test-key'; common.expectsError({ code: 'ERR_CHILD_CLOSED_BEFORE_REPLY', name: 'Error', - message: 'Child closed before reply received' + message: 'Child closed before reply received', })(err); assert.strictEqual(child.listenerCount('internalMessage'), 0); })); @@ -34,7 +34,7 @@ const key = 'test-key'; process.nextTick(() => this.emit('internalMessage', { key, cmd: 'cmd' }) ); - } + }, }); const list = new SocketListSend(child, key); @@ -53,7 +53,7 @@ const key = 'test-key'; { const child = Object.assign(new EventEmitter(), { connected: true, - _send: function(msg) { process.nextTick(() => this.emit('disconnect')); } + _send: function(msg) { process.nextTick(() => this.emit('disconnect')); }, }); const list = new SocketListSend(child, key); @@ -62,7 +62,7 @@ const key = 'test-key'; common.expectsError({ code: 'ERR_CHILD_CLOSED_BEFORE_REPLY', name: 'Error', - message: 'Child closed before reply received' + message: 'Child closed before reply received', })(err); assert.strictEqual(child.listenerCount('internalMessage'), 0); })); @@ -79,7 +79,7 @@ const key = 'test-key'; process.nextTick(() => this.emit('internalMessage', { key, cmd: 'NODE_SOCKET_ALL_CLOSED' }) ); - } + }, }); const list = new SocketListSend(child, key); @@ -105,10 +105,10 @@ const key = 'test-key'; this.emit('internalMessage', { key, count, - cmd: 'NODE_SOCKET_COUNT' + cmd: 'NODE_SOCKET_COUNT', }) ); - } + }, }); const list = new SocketListSend(child, key); @@ -132,7 +132,7 @@ const key = 'test-key'; this.emit('disconnect'); this.emit('internalMessage', { key, count, cmd: 'NODE_SOCKET_COUNT' }); }); - } + }, }); const list = new SocketListSend(child, key); @@ -141,7 +141,7 @@ const key = 'test-key'; common.expectsError({ code: 'ERR_CHILD_CLOSED_BEFORE_REPLY', name: 'Error', - message: 'Child closed before reply received' + message: 'Child closed before reply received', })(err); assert.strictEqual(child.listenerCount('internalMessage'), 0); })); diff --git a/test/parallel/test-internal-util-assertCrypto.js b/test/parallel/test-internal-util-assertCrypto.js index a6a1610d456a52..7306990745f9a7 100644 --- a/test/parallel/test-internal-util-assertCrypto.js +++ b/test/parallel/test-internal-util-assertCrypto.js @@ -7,7 +7,7 @@ const util = require('internal/util'); if (!process.versions.openssl) { const expectedError = common.expectsError({ code: 'ERR_NO_CRYPTO', - name: 'Error' + name: 'Error', }); assert.throws(() => util.assertCrypto(), expectedError); } else { diff --git a/test/parallel/test-internal-validators-validateoneof.js b/test/parallel/test-internal-validators-validateoneof.js index 5c5a62ef893726..f847ba7547e995 100644 --- a/test/parallel/test-internal-validators-validateoneof.js +++ b/test/parallel/test-internal-validators-validateoneof.js @@ -11,7 +11,7 @@ const { validateOneOf } = require('internal/validators'); assert.throws(() => validateOneOf(1, 'name', allowed), { code: 'ERR_INVALID_ARG_VALUE', // eslint-disable-next-line quotes - message: `The argument 'name' must be one of: 2, 3. Received 1` + message: `The argument 'name' must be one of: 2, 3. Received 1`, }); } @@ -26,7 +26,7 @@ const { validateOneOf } = require('internal/validators'); assert.throws(() => validateOneOf('a', 'name', allowed), { code: 'ERR_INVALID_ARG_VALUE', // eslint-disable-next-line quotes - message: `The argument 'name' must be one of: 'b', 'c'. Received 'a'` + message: `The argument 'name' must be one of: 'b', 'c'. Received 'a'`, }); } @@ -42,7 +42,7 @@ const { validateOneOf } = require('internal/validators'); code: 'ERR_INVALID_ARG_VALUE', // eslint-disable-next-line quotes message: `The argument 'name' must be one of: Symbol(b), Symbol(c). ` + - 'Received Symbol(a)' + 'Received Symbol(a)', }); } diff --git a/test/parallel/test-internal-validators-validateport.js b/test/parallel/test-internal-validators-validateport.js index a4c92b8dbca929..a086908f394031 100644 --- a/test/parallel/test-internal-validators-validateport.js +++ b/test/parallel/test-internal-validators-validateport.js @@ -19,5 +19,5 @@ for (let n = 0; n <= 0xFFFF; n++) { undefined, null, '', ' ', 1.1, '0x', '-0x1', '-0o1', '-0b1', '0o', '0b', ].forEach((i) => assert.throws(() => validatePort(i), { - code: 'ERR_SOCKET_BAD_PORT' + code: 'ERR_SOCKET_BAD_PORT', })); diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index ba803973829b8a..84ca866496cee9 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -69,7 +69,7 @@ if (!common.hasIntl) { const dtf = new Intl.DateTimeFormat(['en'], { timeZone: GMT, month: 'short', - year: '2-digit' + year: '2-digit', }); // If list is specified and doesn't contain 'en' then return. diff --git a/test/parallel/test-listen-fd-cluster.js b/test/parallel/test-listen-fd-cluster.js index ea46b037a233d4..10e3cae34a97f5 100644 --- a/test/parallel/test-listen-fd-cluster.js +++ b/test/parallel/test-listen-fd-cluster.js @@ -90,7 +90,7 @@ function test(cb) { const spawn = require('child_process').spawn; const primary = spawn(process.execPath, [__filename, 'primary'], { stdio: [ 0, 'pipe', 2, server._handle, 'ipc' ], - detached: true + detached: true, }); // Now close the parent, so that the primary is the only thing @@ -117,7 +117,7 @@ function test(cb) { function primary() { console.error('in primary, spawning worker'); cluster.setupPrimary({ - args: [ 'worker' ] + args: [ 'worker' ], }); const worker = cluster.fork(); worker.on('message', function(msg) { diff --git a/test/parallel/test-listen-fd-detached-inherit.js b/test/parallel/test-listen-fd-detached-inherit.js index 81c07d1263e964..4e448145f199fa 100644 --- a/test/parallel/test-listen-fd-detached-inherit.js +++ b/test/parallel/test-listen-fd-detached-inherit.js @@ -43,7 +43,7 @@ switch (process.argv[2]) { // a more low-level approach, use child process IPC manually. function test() { const parent = spawn(process.execPath, [__filename, 'parent'], { - stdio: [ 0, 'pipe', 2 ] + stdio: [ 0, 'pipe', 2 ], }); let json = ''; parent.stdout.on('data', function(c) { @@ -89,7 +89,7 @@ function parent() { const child = spawn(process.execPath, [__filename, 'child'], { stdio: [ 0, 1, 2, server._handle ], - detached: true + detached: true, }); console.log('%j\n', { pid: child.pid, port: this.address().port }); diff --git a/test/parallel/test-listen-fd-detached.js b/test/parallel/test-listen-fd-detached.js index efa08323047358..231cececa08e1c 100644 --- a/test/parallel/test-listen-fd-detached.js +++ b/test/parallel/test-listen-fd-detached.js @@ -43,7 +43,7 @@ switch (process.argv[2]) { // a more low-level approach, use child process IPC manually. function test() { const parent = spawn(process.execPath, [__filename, 'parent'], { - stdio: [ 0, 'pipe', 2 ] + stdio: [ 0, 'pipe', 2 ], }); let json = ''; parent.stdout.on('data', function(c) { @@ -87,7 +87,7 @@ function parent() { const child = spawn(process.execPath, [__filename, 'child'], { stdio: [ 'ignore', 'ignore', 'ignore', server._handle ], - detached: true + detached: true, }); console.log('%j\n', { pid: child.pid, port: this.address().port }); diff --git a/test/parallel/test-listen-fd-server.js b/test/parallel/test-listen-fd-server.js index 3b6a0a0fac7abd..d4d5408d75f009 100644 --- a/test/parallel/test-listen-fd-server.js +++ b/test/parallel/test-listen-fd-server.js @@ -95,7 +95,7 @@ function test(cb) { const spawn = require('child_process').spawn; const child = spawn(process.execPath, [__filename, 'child'], { - stdio: [ 0, 1, 2, server._handle, 'ipc' ] + stdio: [ 0, 1, 2, server._handle, 'ipc' ], }); console.log('%j\n', { pid: child.pid }); diff --git a/test/parallel/test-loaders-hidden-from-users.js b/test/parallel/test-loaders-hidden-from-users.js index 96d1c44154883e..c83d59015f98b9 100644 --- a/test/parallel/test-loaders-hidden-from-users.js +++ b/test/parallel/test-loaders-hidden-from-users.js @@ -10,7 +10,7 @@ assert.throws( require('internal/bootstrap/loaders'); }, { code: 'MODULE_NOT_FOUND', - message: /Cannot find module 'internal\/bootstrap\/loaders'/ + message: /Cannot find module 'internal\/bootstrap\/loaders'/, } ); @@ -22,6 +22,6 @@ assert.throws( require('owo'); }, { code: 'MODULE_NOT_FOUND', - message: /Cannot find module 'owo'/ + message: /Cannot find module 'owo'/, } ); diff --git a/test/parallel/test-loaders-unknown-builtin-module.mjs b/test/parallel/test-loaders-unknown-builtin-module.mjs index 85181a2b73b54c..c97e52d1e63d50 100644 --- a/test/parallel/test-loaders-unknown-builtin-module.mjs +++ b/test/parallel/test-loaders-unknown-builtin-module.mjs @@ -7,6 +7,6 @@ const unknownBuiltinModule = 'node:unknown-builtin-module'; import(unknownBuiltinModule) .then(assert.fail, expectsError({ code: 'ERR_UNKNOWN_BUILTIN_MODULE', - message: `No such built-in module: ${unknownBuiltinModule}` + message: `No such built-in module: ${unknownBuiltinModule}`, })) .then(mustCall()); diff --git a/test/parallel/test-module-circular-dependency-warning.js b/test/parallel/test-module-circular-dependency-warning.js index 35ec16762b89e4..e94a58e322c162 100644 --- a/test/parallel/test-module-circular-dependency-warning.js +++ b/test/parallel/test-module-circular-dependency-warning.js @@ -12,7 +12,7 @@ common.expectWarning({ 'of module exports inside circular dependency'], ["Accessing non-existent property 'missingPropModuleExportsB' " + 'of module exports inside circular dependency'], - ] + ], }); const required = require(fixtures.path('cycles', 'warning-a.js')); assert.strictEqual(Object.getPrototypeOf(required), Object.prototype); diff --git a/test/parallel/test-module-create-require.js b/test/parallel/test-module-create-require.js index e0e34e9f127bd3..b098f5ddeb352e 100644 --- a/test/parallel/test-module-create-require.js +++ b/test/parallel/test-module-create-require.js @@ -15,13 +15,13 @@ assert.deepStrictEqual(reqToo('./experimental'), { ofLife: 42 }); assert.throws(() => { createRequire('https://github.com/nodejs/node/pull/27405/'); }, { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); assert.throws(() => { createRequire('../'); }, { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); assert.throws(() => { @@ -29,5 +29,5 @@ assert.throws(() => { }, { code: 'ERR_INVALID_ARG_VALUE', message: 'The argument \'filename\' must be a file URL object, file URL ' + - 'string, or absolute path string. Received {}' + 'string, or absolute path string. Received {}', }); diff --git a/test/parallel/test-module-loading-deprecated.js b/test/parallel/test-module-loading-deprecated.js index 3b43284aec762d..dc9ba4829f5538 100644 --- a/test/parallel/test-module-loading-deprecated.js +++ b/test/parallel/test-module-loading-deprecated.js @@ -4,7 +4,7 @@ const common = require('../common'); const assert = require('assert'); common.expectWarning('DeprecationWarning', { - DEP0128: /^Invalid 'main' field in '.+main[/\\]package\.json' of 'doesnotexist\.js'\..+module author/ + DEP0128: /^Invalid 'main' field in '.+main[/\\]package\.json' of 'doesnotexist\.js'\..+module author/, }); assert.strictEqual(require('../fixtures/packages/missing-main').ok, 'ok'); diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js index 5bc01ce52d7279..b443e0203453bd 100644 --- a/test/parallel/test-module-loading-error.js +++ b/test/parallel/test-module-loading-error.js @@ -71,7 +71,7 @@ const re = /^The "id" argument must be of type string\. Received /; { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', - message: re + message: re, }); }); @@ -81,13 +81,13 @@ assert.throws( { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', - message: 'The argument \'id\' must be a non-empty string. Received \'\'' + message: 'The argument \'id\' must be a non-empty string. Received \'\'', }); assert.throws( () => { require('../fixtures/packages/is-dir'); }, { code: 'MODULE_NOT_FOUND', - message: /Cannot find module '\.\.\/fixtures\/packages\/is-dir'/ + message: /Cannot find module '\.\.\/fixtures\/packages\/is-dir'/, } ); diff --git a/test/parallel/test-module-nodemodulepaths.js b/test/parallel/test-module-nodemodulepaths.js index 1e355882e0f3d7..8d87b4a1ee0a17 100644 --- a/test/parallel/test-module-nodemodulepaths.js +++ b/test/parallel/test-module-nodemodulepaths.js @@ -40,7 +40,7 @@ const cases = { 'C:\\Users\\hefangshi\\node_modules', 'C:\\Users\\node_modules', 'C:\\node_modules', - ] + ], }, { file: 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo', expect: [ @@ -49,7 +49,7 @@ const cases = { 'C:\\Users\\Rocko Artischocko\\node_modules', 'C:\\Users\\node_modules', 'C:\\node_modules', - ] + ], }, { file: 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo_node_modules', expect: [ @@ -59,17 +59,17 @@ Artischocko\\node_stuff\\foo_node_modules\\node_modules', 'C:\\Users\\Rocko Artischocko\\node_modules', 'C:\\Users\\node_modules', 'C:\\node_modules', - ] + ], }, { file: 'C:\\node_modules', expect: [ 'C:\\node_modules', - ] + ], }, { file: 'C:\\', expect: [ 'C:\\node_modules', - ] + ], }], 'POSIX': [{ file: '/usr/lib/node_modules/npm/node_modules/\ @@ -84,7 +84,7 @@ node-gyp/node_modules/glob/node_modules', '/usr/lib/node_modules', '/usr/node_modules', '/node_modules', - ] + ], }, { file: '/usr/test/lib/node_modules/npm/foo', expect: [ @@ -94,7 +94,7 @@ node-gyp/node_modules/glob/node_modules', '/usr/test/node_modules', '/usr/node_modules', '/node_modules', - ] + ], }, { file: '/usr/test/lib/node_modules/npm/foo_node_modules', expect: [ @@ -104,18 +104,18 @@ node-gyp/node_modules/glob/node_modules', '/usr/test/node_modules', '/usr/node_modules', '/node_modules', - ] + ], }, { file: '/node_modules', expect: [ '/node_modules', - ] + ], }, { file: '/', expect: [ '/node_modules', - ] - }] + ], + }], }; const platformCases = common.isWindows ? cases.WIN : cases.POSIX; diff --git a/test/parallel/test-net-better-error-messages-path.js b/test/parallel/test-net-better-error-messages-path.js index 93a5e38fac2085..83c5f589118b2c 100644 --- a/test/parallel/test-net-better-error-messages-path.js +++ b/test/parallel/test-net-better-error-messages-path.js @@ -10,7 +10,7 @@ const net = require('net'); c.on('connect', common.mustNotCall()); c.on('error', common.expectsError({ code: 'ENOENT', - message: `connect ENOENT ${fp}` + message: `connect ENOENT ${fp}`, })); } diff --git a/test/parallel/test-net-better-error-messages-port-hostname.js b/test/parallel/test-net-better-error-messages-port-hostname.js index 3cc9e589873927..b88110d5cf0c0d 100644 --- a/test/parallel/test-net-better-error-messages-port-hostname.js +++ b/test/parallel/test-net-better-error-messages-port-hostname.js @@ -11,14 +11,14 @@ const net = require('net'); const { addresses } = require('../common/internet'); const { errorLookupMock, - mockedErrorCode + mockedErrorCode, } = require('../common/dns'); // Using port 0 as hostname used is already invalid. const c = net.createConnection({ port: 0, host: addresses.INVALID_HOST, - lookup: common.mustCall(errorLookupMock()) + lookup: common.mustCall(errorLookupMock()), }); c.on('connect', common.mustNotCall()); @@ -32,6 +32,6 @@ c.on('error', common.mustCall((error) => { name: 'Error', message: 'getaddrinfo ENOTFOUND something.invalid', hostname: addresses.INVALID_HOST, - syscall: 'getaddrinfo' + syscall: 'getaddrinfo', }); })); diff --git a/test/parallel/test-net-binary.js b/test/parallel/test-net-binary.js index cf8715411d0f7f..3e82848eff7cda 100644 --- a/test/parallel/test-net-binary.js +++ b/test/parallel/test-net-binary.js @@ -50,7 +50,7 @@ let recv = ''; echoServer.on('listening', function() { let j = 0; const c = net.createConnection({ - port: this.address().port + port: this.address().port, }); c.setEncoding('latin1'); diff --git a/test/parallel/test-net-client-bind-twice.js b/test/parallel/test-net-client-bind-twice.js index ca7eb502d85ba5..3581bc16404362 100644 --- a/test/parallel/test-net-client-bind-twice.js +++ b/test/parallel/test-net-client-bind-twice.js @@ -14,7 +14,7 @@ server1.listen(0, common.localhostIPv4, common.mustCall(() => { host: common.localhostIPv4, port: server1.address().port, localAddress: common.localhostIPv4, - localPort: server2.address().port + localPort: server2.address().port, }, common.mustNotCall()); client.on('error', common.mustCall((err) => { diff --git a/test/parallel/test-net-connect-immediate-finish.js b/test/parallel/test-net-connect-immediate-finish.js index 1cc4fa4f4ee7d4..5eca6745bb5dcc 100644 --- a/test/parallel/test-net-connect-immediate-finish.js +++ b/test/parallel/test-net-connect-immediate-finish.js @@ -33,13 +33,13 @@ const { addresses } = require('../common/internet'); const { errorLookupMock, mockedErrorCode, - mockedSysCall + mockedSysCall, } = require('../common/dns'); const client = net.connect({ host: addresses.INVALID_HOST, port: 80, // Port number doesn't matter because host name is invalid - lookup: common.mustCall(errorLookupMock()) + lookup: common.mustCall(errorLookupMock()), }, common.mustNotCall()); client.once('error', common.mustCall((error) => { @@ -52,7 +52,7 @@ client.once('error', common.mustCall((error) => { errno: mockedErrorCode, syscall: mockedSysCall, hostname: addresses.INVALID_HOST, - message: 'getaddrinfo ENOTFOUND something.invalid' + message: 'getaddrinfo ENOTFOUND something.invalid', }); })); diff --git a/test/parallel/test-net-connect-options-fd.js b/test/parallel/test-net-connect-options-fd.js index e9b35c0bfeadf4..60d67eba823461 100644 --- a/test/parallel/test-net-connect-options-fd.js +++ b/test/parallel/test-net-connect-options-fd.js @@ -83,7 +83,7 @@ const forAllClients = (cb) => common.mustCall(cb, CLIENT_VARIANTS); return { fd: handle.fd, readable: true, writable: true }; }; const getConnectOpt = () => ({ - path: serverPath + path: serverPath, }); const getConnectCb = (index) => common.mustCall(function clientOnConnect() { // Test if it's wrapping an existing fd diff --git a/test/parallel/test-net-connect-options-ipv6.js b/test/parallel/test-net-connect-options-ipv6.js index 13381074ba46b7..ae14d4a75c16a7 100644 --- a/test/parallel/test-net-connect-options-ipv6.js +++ b/test/parallel/test-net-connect-options-ipv6.js @@ -48,7 +48,7 @@ function tryConnect() { assert.strictEqual(addr, HOSTNAME); assert.strictEqual(opt.family, 6); cb(null, hostAddrIPv6, opt.family); - }) + }), }; // No `mustCall`, since test could skip, and it's the only path to `close`. const client = net.connect(connectOpt, () => { diff --git a/test/parallel/test-net-connect-options-port.js b/test/parallel/test-net-connect-options-port.js index d9f310afc7549e..0003b3676ac1b3 100644 --- a/test/parallel/test-net-connect-options-port.js +++ b/test/parallel/test-net-connect-options-port.js @@ -29,7 +29,7 @@ const net = require('net'); { const portTypeError = { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }; syncFailToConnect(true, portTypeError); @@ -43,7 +43,7 @@ const net = require('net'); { const portRangeError = { code: 'ERR_SOCKET_BAD_PORT', - name: 'RangeError' + name: 'RangeError', }; syncFailToConnect('', portRangeError); @@ -66,7 +66,7 @@ const net = require('net'); assert.throws(fn, { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: /The argument 'hints' is invalid\. Received \d+/ + message: /The argument 'hints' is invalid\. Received \d+/, }); } } diff --git a/test/parallel/test-net-deprecated-setsimultaneousaccepts.js b/test/parallel/test-net-deprecated-setsimultaneousaccepts.js index 3778a9650fcc8d..9c2b8bdb8d300f 100644 --- a/test/parallel/test-net-deprecated-setsimultaneousaccepts.js +++ b/test/parallel/test-net-deprecated-setsimultaneousaccepts.js @@ -2,10 +2,10 @@ 'use strict'; const { - expectWarning + expectWarning, } = require('../common'); const { - _setSimultaneousAccepts + _setSimultaneousAccepts, } = require('net'); expectWarning( diff --git a/test/parallel/test-net-dns-custom-lookup.js b/test/parallel/test-net-dns-custom-lookup.js index a7c05c82b95419..9d5c157d1bd6e7 100644 --- a/test/parallel/test-net-dns-custom-lookup.js +++ b/test/parallel/test-net-dns-custom-lookup.js @@ -16,7 +16,7 @@ function check(addressType, cb) { port: this.address().port, host: 'localhost', family: addressType, - lookup: lookup + lookup: lookup, }).on('lookup', common.mustCall(function(err, ip, type) { assert.strictEqual(err, null); assert.strictEqual(address, ip); @@ -49,6 +49,6 @@ check(4, function() { port: 80, lookup(host, dnsopts, cb) { cb(null, undefined, 4); - } + }, }).on('error', common.expectsError({ code: 'ERR_INVALID_IP_ADDRESS' })); } diff --git a/test/parallel/test-net-end-close.js b/test/parallel/test-net-end-close.js index b488f16510f7cf..d5d7ef4b9cc0fc 100644 --- a/test/parallel/test-net-end-close.js +++ b/test/parallel/test-net-end-close.js @@ -16,9 +16,9 @@ const s = new net.Socket({ this.onread(); }); }, - close: (cb) => setImmediate(cb) + close: (cb) => setImmediate(cb), }, - writable: false + writable: false, }); assert.strictEqual(s, s.resume()); diff --git a/test/parallel/test-net-end-destroyed.js b/test/parallel/test-net-end-destroyed.js index 1670c1b92b21fb..6600189ec0ca7b 100644 --- a/test/parallel/test-net-end-destroyed.js +++ b/test/parallel/test-net-end-destroyed.js @@ -12,7 +12,7 @@ server.on('connection', common.mustCall()); server.listen(common.mustCall(function() { const socket = net.createConnection({ - port: server.address().port + port: server.address().port, }); socket.on('connect', common.mustCall(function() { diff --git a/test/parallel/test-net-isip.js b/test/parallel/test-net-isip.js index 840ffe76af9a30..db290761d4f249 100644 --- a/test/parallel/test-net-isip.js +++ b/test/parallel/test-net-isip.js @@ -75,7 +75,7 @@ assert.strictEqual(net.isIPv4(123), false); assert.strictEqual(net.isIPv4(true), false); assert.strictEqual(net.isIPv4({}), false); assert.strictEqual(net.isIPv4({ - toString: () => '::2001:252:1:255.255.255.255' + toString: () => '::2001:252:1:255.255.255.255', }), false); assert.strictEqual(net.isIPv4({ toString: () => '127.0.0.1' }), true); assert.strictEqual(net.isIPv4({ toString: () => 'bla' }), false); @@ -90,7 +90,7 @@ assert.strictEqual(net.isIPv6(123), false); assert.strictEqual(net.isIPv6(true), false); assert.strictEqual(net.isIPv6({}), false); assert.strictEqual(net.isIPv6({ - toString: () => '::2001:252:1:255.255.255.255' + toString: () => '::2001:252:1:255.255.255.255', }), true); assert.strictEqual(net.isIPv6({ toString: () => '127.0.0.1' }), false); assert.strictEqual(net.isIPv6({ toString: () => 'bla' }), false); diff --git a/test/parallel/test-net-listen-exclusive-random-ports.js b/test/parallel/test-net-listen-exclusive-random-ports.js index 66dfb598204e7b..2a037fbf93992f 100644 --- a/test/parallel/test-net-listen-exclusive-random-ports.js +++ b/test/parallel/test-net-listen-exclusive-random-ports.js @@ -30,7 +30,7 @@ if (cluster.isPrimary) { server.listen({ port: 0, - exclusive: true + exclusive: true, }, function() { process.send(server.address().port); }); diff --git a/test/parallel/test-net-listen-invalid-port.js b/test/parallel/test-net-listen-invalid-port.js index 844878036646dd..9efd235e33e7ad 100644 --- a/test/parallel/test-net-listen-invalid-port.js +++ b/test/parallel/test-net-listen-invalid-port.js @@ -23,7 +23,7 @@ assert.throws(() => { net.Server().listen({ port: invalidPort }, common.mustNotCall()); }, { code: 'ERR_SOCKET_BAD_PORT', - name: 'RangeError' + name: 'RangeError', }); // The first argument is the port, no IP given. @@ -31,7 +31,7 @@ assert.throws(() => { net.Server().listen(invalidPort, common.mustNotCall()); }, { code: 'ERR_SOCKET_BAD_PORT', - name: 'RangeError' + name: 'RangeError', }); // The first argument is the port, the second an IP. @@ -39,5 +39,5 @@ assert.throws(() => { net.Server().listen(invalidPort, '0.0.0.0', common.mustNotCall()); }, { code: 'ERR_SOCKET_BAD_PORT', - name: 'RangeError' + name: 'RangeError', }); diff --git a/test/parallel/test-net-normalize-args.js b/test/parallel/test-net-normalize-args.js index 65d569d5d5fd12..81d0f291e367b3 100644 --- a/test/parallel/test-net-normalize-args.js +++ b/test/parallel/test-net-normalize-args.js @@ -32,7 +32,7 @@ validateNormalizedArgs([{ port: 1234 }, assert.fail], res); assert.throws(() => { socket.connect([{ port }, assert.fail]); }, { - code: 'ERR_MISSING_ARGS' + code: 'ERR_MISSING_ARGS', }); server.close(); })); diff --git a/test/parallel/test-net-onread-static-buffer.js b/test/parallel/test-net-onread-static-buffer.js index ce722f69cd7fa3..0603edb331d4f4 100644 --- a/test/parallel/test-net-onread-static-buffer.js +++ b/test/parallel/test-net-onread-static-buffer.js @@ -21,8 +21,8 @@ net.createServer(common.mustCall(function(socket) { assert.strictEqual(buf, sockBuf); received += nread; buffers.push(Buffer.from(buf.slice(0, nread))); - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, message.length); assert.deepStrictEqual(Buffer.concat(buffers), message); @@ -48,8 +48,8 @@ net.createServer(common.mustCall(function(socket) { newIncoming.set(incoming); newIncoming.set(buf.slice(0, nread), incoming.length); incoming = newIncoming; - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, message.length); assert.deepStrictEqual(incoming, new Uint8Array(message)); @@ -78,8 +78,8 @@ net.createServer(common.mustCall(function(socket) { assert.strictEqual(buf, bufPool[bufPoolIdx]); received += nread; incoming.push(Buffer.from(buf.slice(0, nread))); - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, message.length); assert.deepStrictEqual(Buffer.concat(incoming), message); @@ -112,8 +112,8 @@ net.createServer(common.mustCall(function(socket) { newIncoming.set(incoming); newIncoming.set(buf.slice(0, nread), incoming.length); incoming = newIncoming; - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, message.length); assert.deepStrictEqual(incoming, new Uint8Array(message)); @@ -145,8 +145,8 @@ net.createServer(common.mustCall(function(socket) { paused = false; this.resume(); }, 100); - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, message.length); assert.deepStrictEqual(Buffer.concat(buffers), message); @@ -177,8 +177,8 @@ net.createServer(common.mustCall(function(socket) { this.resume(); }, 100); return false; - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, message.length); assert.deepStrictEqual(Buffer.concat(buffers), message); diff --git a/test/parallel/test-net-options-lookup.js b/test/parallel/test-net-options-lookup.js index 0341a9f8d546b5..a79b57ce051429 100644 --- a/test/parallel/test-net-options-lookup.js +++ b/test/parallel/test-net-options-lookup.js @@ -10,14 +10,14 @@ function connectThrows(input) { const opts = { host: 'localhost', port: 0, - lookup: input + lookup: input, }; assert.throws(() => { net.connect(opts); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); } @@ -27,7 +27,7 @@ function connectDoesNotThrow(input) { const opts = { host: 'localhost', port: 0, - lookup: input + lookup: input, }; return net.connect(opts); @@ -43,6 +43,6 @@ function connectDoesNotThrow(input) { code: 'ERR_INVALID_ADDRESS_FAMILY', host: 'localhost', port: 0, - message: 'Invalid address family: 100 localhost:0' + message: 'Invalid address family: 100 localhost:0', })); } diff --git a/test/parallel/test-net-server-call-listen-multiple-times.js b/test/parallel/test-net-server-call-listen-multiple-times.js index e757c6c247c45b..463f3f8d19ba5d 100644 --- a/test/parallel/test-net-server-call-listen-multiple-times.js +++ b/test/parallel/test-net-server-call-listen-multiple-times.js @@ -31,7 +31,7 @@ const net = require('net'); assert.throws(() => server.listen(), { code: 'ERR_SERVER_ALREADY_LISTEN', - name: 'Error' + name: 'Error', }); } diff --git a/test/parallel/test-net-server-listen-options-signal.js b/test/parallel/test-net-server-listen-options-signal.js index 60e78fa00c5080..1a4591f349adc1 100644 --- a/test/parallel/test-net-server-listen-options-signal.js +++ b/test/parallel/test-net-server-listen-options-signal.js @@ -10,7 +10,7 @@ const net = require('net'); () => server.listen({ port: 0, signal: 'INVALID_SIGNAL' }), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); } diff --git a/test/parallel/test-net-server-listen-options.js b/test/parallel/test-net-server-listen-options.js index 7e306af8ab082f..40294084912154 100644 --- a/test/parallel/test-net-server-listen-options.js +++ b/test/parallel/test-net-server-listen-options.js @@ -27,7 +27,7 @@ const listenOnPort = [ const assertPort = () => { return common.expectsError({ code: 'ERR_SOCKET_BAD_PORT', - name: 'RangeError' + name: 'RangeError', }); }; diff --git a/test/parallel/test-net-server-listen-path.js b/test/parallel/test-net-server-listen-path.js index 99144ceb494a64..86b4202de3bfdd 100644 --- a/test/parallel/test-net-server-listen-path.js +++ b/test/parallel/test-net-server-listen-path.js @@ -59,7 +59,7 @@ function randomPipePath() { .listen({ path: handlePath, readableAll: true, - writableAll: true + writableAll: true, }, common.mustCall(() => { if (process.platform !== 'win32') { const mode = fs.statSync(handlePath).mode; diff --git a/test/parallel/test-net-server-options.js b/test/parallel/test-net-server-options.js index 8d2181171d81ca..61b82d25e4edbd 100644 --- a/test/parallel/test-net-server-options.js +++ b/test/parallel/test-net-server-options.js @@ -6,11 +6,11 @@ const net = require('net'); assert.throws(() => net.createServer('path'), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => net.createServer(0), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); diff --git a/test/parallel/test-net-socket-constructor.js b/test/parallel/test-net-socket-constructor.js index 47010aa3b3e0e6..36c3d27e321fa1 100644 --- a/test/parallel/test-net-socket-constructor.js +++ b/test/parallel/test-net-socket-constructor.js @@ -49,7 +49,7 @@ if (cluster.isPrimary) { })); cluster.setupPrimary({ - stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe', 'pipe', 'pipe'] + stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe', 'pipe', 'pipe'], }); const worker = cluster.fork(); diff --git a/test/parallel/test-net-socket-destroy-send.js b/test/parallel/test-net-socket-destroy-send.js index db792ad6d3b921..3d1b676fc7a869 100644 --- a/test/parallel/test-net-socket-destroy-send.js +++ b/test/parallel/test-net-socket-destroy-send.js @@ -17,7 +17,7 @@ server.listen(0, common.mustCall(function() { conn.write(Buffer.from('kaboom'), common.expectsError({ code: 'ERR_STREAM_DESTROYED', message: 'Cannot call write after a stream was destroyed', - name: 'Error' + name: 'Error', })); server.close(); })); diff --git a/test/parallel/test-net-socket-setnodelay.js b/test/parallel/test-net-socket-setnodelay.js index da1d9a4a314882..5a70337b01aa02 100644 --- a/test/parallel/test-net-socket-setnodelay.js +++ b/test/parallel/test-net-socket-setnodelay.js @@ -14,32 +14,32 @@ const genSetNoDelay = (desiredArg) => (enable) => { let socket = new net.Socket({ handle: { setNoDelay: common.mustCall(genSetNoDelay(true)), - readStart() {} - } + readStart() {}, + }, }); socket.setNoDelay(); socket = new net.Socket({ handle: { setNoDelay: common.mustCall(genSetNoDelay(true), 1), - readStart() {} - } + readStart() {}, + }, }); truthyValues.forEach((testVal) => socket.setNoDelay(testVal)); socket = new net.Socket({ handle: { setNoDelay: common.mustNotCall(), - readStart() {} - } + readStart() {}, + }, }); falseyValues.forEach((testVal) => socket.setNoDelay(testVal)); socket = new net.Socket({ handle: { setNoDelay: common.mustCall(() => {}, 3), - readStart() {} - } + readStart() {}, + }, }); truthyValues.concat(falseyValues).concat(truthyValues) .forEach((testVal) => socket.setNoDelay(testVal)); @@ -49,8 +49,8 @@ truthyValues.concat(falseyValues).concat(truthyValues) socket = new net.Socket({ handle: { setNoDelay: null, - readStart() {} - } + readStart() {}, + }, }); const returned = socket.setNoDelay(true); assert.ok(returned instanceof net.Socket); diff --git a/test/parallel/test-net-socket-timeout.js b/test/parallel/test-net-socket-timeout.js index 209359fda60810..19d0479677c363 100644 --- a/test/parallel/test-net-socket-timeout.js +++ b/test/parallel/test-net-socket-timeout.js @@ -61,7 +61,7 @@ for (let i = 0; i < invalidCallbacks.length; i++) { code: 'ERR_INVALID_CALLBACK', name: 'TypeError', message: 'Callback must be a function. ' + - `Received ${inspect(invalidCallbacks[i])}` + `Received ${inspect(invalidCallbacks[i])}`, } ) ); diff --git a/test/parallel/test-net-socket-write-after-close.js b/test/parallel/test-net-socket-write-after-close.js index 207f735fffdef1..45c51bb71eec6d 100644 --- a/test/parallel/test-net-socket-write-after-close.js +++ b/test/parallel/test-net-socket-write-after-close.js @@ -29,7 +29,7 @@ const net = require('net'); client.on('error', common.expectsError({ code: 'ERR_SOCKET_CLOSED', message: 'Socket is closed', - name: 'Error' + name: 'Error', })); server.close(); diff --git a/test/parallel/test-net-socket-write-error.js b/test/parallel/test-net-socket-write-error.js index e68db68c0d4939..1d3b5a6c1c373d 100644 --- a/test/parallel/test-net-socket-write-error.js +++ b/test/parallel/test-net-socket-write-error.js @@ -13,7 +13,7 @@ function connectToServer() { client.write(1337); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); client.destroy(); diff --git a/test/parallel/test-net-write-after-end-nt.js b/test/parallel/test-net-write-after-end-nt.js index 99edc1d72beb95..382de979a2928d 100644 --- a/test/parallel/test-net-write-after-end-nt.js +++ b/test/parallel/test-net-write-after-end-nt.js @@ -21,7 +21,7 @@ const server = net.createServer(mustCall((socket) => { const ret = client.write('hello', expectsError({ code: 'EPIPE', message: 'This socket has been ended by the other party', - name: 'Error' + name: 'Error', })); assert.strictEqual(ret, false); diff --git a/test/parallel/test-net-write-arguments.js b/test/parallel/test-net-write-arguments.js index 289c3c0f36bcf3..df37db681d2d0f 100644 --- a/test/parallel/test-net-write-arguments.js +++ b/test/parallel/test-net-write-arguments.js @@ -11,7 +11,7 @@ assert.throws(() => { }, { code: 'ERR_STREAM_NULL_VALUES', name: 'TypeError', - message: 'May not write null values to stream' + message: 'May not write null values to stream', }); [ @@ -34,6 +34,6 @@ assert.throws(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "chunk" argument must be of type string or an instance of ' + - `Buffer or Uint8Array.${common.invalidArgTypeHelper(value)}` + `Buffer or Uint8Array.${common.invalidArgTypeHelper(value)}`, }); }); diff --git a/test/parallel/test-next-tick-errors.js b/test/parallel/test-next-tick-errors.js index 56480adcf53c27..db62a33b997619 100644 --- a/test/parallel/test-next-tick-errors.js +++ b/test/parallel/test-next-tick-errors.js @@ -46,7 +46,7 @@ function testNextTickWith(val) { process.nextTick(val); }, { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }); } diff --git a/test/parallel/test-nodeeventtarget.js b/test/parallel/test-nodeeventtarget.js index 6643584a6fc1d0..464d2fb3c958f0 100644 --- a/test/parallel/test-nodeeventtarget.js +++ b/test/parallel/test-nodeeventtarget.js @@ -27,7 +27,7 @@ const { on } = require('events'); handleEvent: common.mustCall(function(event) { strictEqual(event.type, 'foo'); strictEqual(this, ev2); - }) + }), }; eventTarget.addEventListener('foo', ev1); @@ -54,7 +54,7 @@ const { on } = require('events'); const ev2 = { handleEvent: common.mustCall((event) => { strictEqual(event.type, 'foo'); - }) + }), }; strictEqual(eventTarget.on('foo', ev1), eventTarget); @@ -81,7 +81,7 @@ const { on } = require('events'); const ev2 = { handleEvent: common.mustCall((event) => { strictEqual(event.type, 'foo'); - }) + }), }; eventTarget.addListener('foo', ev1); diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js index d3ba8ab8b55561..70f7cad30ebb09 100644 --- a/test/parallel/test-npm-install.js +++ b/test/parallel/test-npm-install.js @@ -30,8 +30,8 @@ const npmPath = path.join( const pkgContent = JSON.stringify({ dependencies: { - 'package-name': fixtures.path('packages/main') - } + 'package-name': fixtures.path('packages/main'), + }, }); const pkgPath = path.join(installDir, 'package.json'); @@ -48,7 +48,7 @@ const env = { ...process.env, exec(`${process.execPath} ${npmPath} install`, { cwd: installDir, - env: env + env: env, }, common.mustCall(handleExit)); function handleExit(error, stdout, stderr) { diff --git a/test/parallel/test-os-checked-function.js b/test/parallel/test-os-checked-function.js index 819cdf1794155f..06722ddb625d75 100644 --- a/test/parallel/test-os-checked-function.js +++ b/test/parallel/test-os-checked-function.js @@ -16,5 +16,5 @@ internalBinding('os').getHomeDirectory = function(ctx) { const os = require('os'); assert.throws(os.homedir, { - message: /^A system error occurred: foo returned bar \(baz\)$/ + message: /^A system error occurred: foo returned bar \(baz\)$/, }); diff --git a/test/parallel/test-os-eol.js b/test/parallel/test-os-eol.js index 412751a151b9a2..a72450cb9ae4b7 100644 --- a/test/parallel/test-os-eol.js +++ b/test/parallel/test-os-eol.js @@ -18,7 +18,7 @@ Object.defineProperties(os, { configurable: true, enumerable: true, writable: false, - value: foo - } + value: foo, + }, }); assert.strictEqual(os.EOL, foo); diff --git a/test/parallel/test-os-homedir-no-envvar.js b/test/parallel/test-os-homedir-no-envvar.js index 2f9b1b47a70477..dd95d91f3549c0 100644 --- a/test/parallel/test-os-homedir-no-envvar.js +++ b/test/parallel/test-os-homedir-no-envvar.js @@ -23,7 +23,7 @@ if (process.argv[2] === 'child') { delete process.env.HOME; const child = cp.spawnSync(process.execPath, [__filename, 'child'], { - env: process.env + env: process.env, }); assert.strictEqual(child.status, 0); diff --git a/test/parallel/test-os-process-priority.js b/test/parallel/test-os-process-priority.js index c6fdbff9e554d9..5aba477e000762 100644 --- a/test/parallel/test-os-process-priority.js +++ b/test/parallel/test-os-process-priority.js @@ -12,7 +12,7 @@ const { PRIORITY_NORMAL, PRIORITY_ABOVE_NORMAL, PRIORITY_HIGH, - PRIORITY_HIGHEST + PRIORITY_HIGHEST, } = os.constants.priority; // Validate priority constants. @@ -27,7 +27,7 @@ assert.strictEqual(typeof PRIORITY_HIGHEST, 'number'); [null, true, false, 'foo', {}, [], /x/].forEach((pid) => { const errObj = { code: 'ERR_INVALID_ARG_TYPE', - message: /The "pid" argument must be of type number\./ + message: /The "pid" argument must be of type number\./, }; assert.throws(() => { @@ -43,7 +43,7 @@ assert.strictEqual(typeof PRIORITY_HIGHEST, 'number'); [NaN, Infinity, -Infinity, 3.14, 2 ** 32].forEach((pid) => { const errObj = { code: 'ERR_OUT_OF_RANGE', - message: /The value of "pid" is out of range\./ + message: /The value of "pid" is out of range\./, }; assert.throws(() => { @@ -61,7 +61,7 @@ assert.strictEqual(typeof PRIORITY_HIGHEST, 'number'); os.setPriority(0, priority); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /The "priority" argument must be of type number\./ + message: /The "priority" argument must be of type number\./, }); }); @@ -79,7 +79,7 @@ assert.strictEqual(typeof PRIORITY_HIGHEST, 'number'); os.setPriority(0, priority); }, { code: 'ERR_OUT_OF_RANGE', - message: /The value of "priority" is out of range\./ + message: /The value of "priority" is out of range\./, }); }); diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index 6a5b43368249db..eef56b2857e264 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -36,7 +36,7 @@ const is = { object: (value) => { assert.strictEqual(typeof value, 'object'); assert.notStrictEqual(value, null); - } + }, }; const flatten = (arr) => @@ -145,7 +145,7 @@ switch (platform) { family: 'IPv4', mac: '00:00:00:00:00:00', internal: true, - cidr: '127.0.0.1/8' + cidr: '127.0.0.1/8', }]; assert.deepStrictEqual(actual, expected); break; @@ -161,7 +161,7 @@ switch (platform) { family: 'IPv4', mac: '00:00:00:00:00:00', internal: true, - cidr: '127.0.0.1/8' + cidr: '127.0.0.1/8', }]; assert.deepStrictEqual(actual, expected); break; @@ -171,7 +171,7 @@ const netmaskToCIDRSuffixMap = new Map(Object.entries({ '255.0.0.0': 8, '255.255.255.0': 24, 'ffff:ffff:ffff:ffff::': 64, - 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff': 128 + 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff': 128, })); flatten(Object.values(interfaces)) diff --git a/test/parallel/test-outgoing-message-pipe.js b/test/parallel/test-outgoing-message-pipe.js index 049b41c9aaa903..06872ba76fe70f 100644 --- a/test/parallel/test-outgoing-message-pipe.js +++ b/test/parallel/test-outgoing-message-pipe.js @@ -10,6 +10,6 @@ assert.throws( () => { outgoingMessage.pipe(outgoingMessage); }, { code: 'ERR_STREAM_CANNOT_PIPE', - name: 'Error' + name: 'Error', } ); diff --git a/test/parallel/test-path-parse-format.js b/test/parallel/test-path-parse-format.js index e60a0cedae4259..020e2bd91da5be 100644 --- a/test/parallel/test-path-parse-format.js +++ b/test/parallel/test-path-parse-format.js @@ -180,7 +180,7 @@ function checkErrors(path) { path[method].apply(path, input); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); } @@ -220,7 +220,7 @@ function checkFormat(path, testCases) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "pathObject" argument must be of type object.' + - common.invalidArgTypeHelper(pathObject) + common.invalidArgTypeHelper(pathObject), }); }); } diff --git a/test/parallel/test-pending-deprecation.js b/test/parallel/test-pending-deprecation.js index c94c75560df695..9587272a8b6411 100644 --- a/test/parallel/test-pending-deprecation.js +++ b/test/parallel/test-pending-deprecation.js @@ -40,7 +40,7 @@ switch (process.argv[2]) { // Test the --pending-deprecation command line switch. fork(__filename, ['switch'], { execArgv: ['--pending-deprecation', '--expose-internals'], - silent: true + silent: true, }).on('exit', common.mustCall((code) => { assert.strictEqual(code, 0, message('--pending-deprecation')); })); @@ -48,7 +48,7 @@ switch (process.argv[2]) { // Test the --pending_deprecation command line switch. fork(__filename, ['switch'], { execArgv: ['--pending_deprecation', '--expose-internals'], - silent: true + silent: true, }).on('exit', common.mustCall((code) => { assert.strictEqual(code, 0, message('--pending_deprecation')); })); @@ -57,7 +57,7 @@ switch (process.argv[2]) { fork(__filename, ['env'], { env: { ...process.env, NODE_PENDING_DEPRECATION: 1 }, execArgv: ['--expose-internals'], - silent: true + silent: true, }).on('exit', common.mustCall((code) => { assert.strictEqual(code, 0, message('NODE_PENDING_DEPRECATION')); })); diff --git a/test/parallel/test-perf-hooks-histogram.js b/test/parallel/test-perf-hooks-histogram.js index 323dbeb153633a..2766cb439dd1a0 100644 --- a/test/parallel/test-perf-hooks-histogram.js +++ b/test/parallel/test-perf-hooks-histogram.js @@ -21,11 +21,11 @@ const { inspect } = require('util'); [false, '', {}, undefined, null].forEach((i) => { assert.throws(() => h.record(i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); assert.throws(() => h.record(0, Number.MAX_SAFE_INTEGER + 1), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.strictEqual(h.min, 1); diff --git a/test/parallel/test-perf-hooks-usertiming.js b/test/parallel/test-perf-hooks-usertiming.js index 401d0a6816481a..087007a02b9f3b 100644 --- a/test/parallel/test-perf-hooks-usertiming.js +++ b/test/parallel/test-perf-hooks-usertiming.js @@ -35,7 +35,7 @@ assert(measure); clearMarks(); assert.throws(() => mark(Symbol('a')), { - message: /Cannot convert a Symbol value to a string/ + message: /Cannot convert a Symbol value to a string/, }); [undefined, null, 1, 'any', {}, []].forEach((detail) => { @@ -53,7 +53,7 @@ clearMarks(); } assert.throws(() => mark('a', { startTime: 'a' }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); clearMarks(); @@ -61,7 +61,7 @@ clearMarks(1); clearMarks(null); assert.throws(() => clearMarks(Symbol('foo')), { - message: /Cannot convert a Symbol value to a string/ + message: /Cannot convert a Symbol value to a string/, }); { diff --git a/test/parallel/test-performance-function-async.js b/test/parallel/test-performance-function-async.js index 82ff6612c5bf86..875627f9b40710 100644 --- a/test/parallel/test-performance-function-async.js +++ b/test/parallel/test-performance-function-async.js @@ -12,7 +12,7 @@ const { const assert = require('assert'); const { - setTimeout: sleep + setTimeout: sleep, } = require('timers/promises'); let check = false; diff --git a/test/parallel/test-performance-function.js b/test/parallel/test-performance-function.js index ea928028208e47..f55730d26c6279 100644 --- a/test/parallel/test-performance-function.js +++ b/test/parallel/test-performance-function.js @@ -6,11 +6,11 @@ const assert = require('assert'); const { createHistogram, performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const { - setTimeout: sleep + setTimeout: sleep, } = require('timers/promises'); { @@ -70,7 +70,7 @@ const { { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /The "fn" argument must be of type function/ + message: /The "fn" argument must be of type function/, }); }); } @@ -99,7 +99,7 @@ const { assert.notStrictEqual(histogram.max, 0); [1, '', {}, [], false].forEach((histogram) => { assert.throws(() => performance.timerify(m, { histogram }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); })().then(common.mustCall()); @@ -117,7 +117,7 @@ const { assert.notStrictEqual(histogram.max, 0); [1, '', {}, [], false].forEach((histogram) => { assert.throws(() => performance.timerify(m, { histogram }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); })().then(common.mustCall()); diff --git a/test/parallel/test-performance-gc.js b/test/parallel/test-performance-gc.js index 1561bc5fb78572..f1c9fcf3509044 100644 --- a/test/parallel/test-performance-gc.js +++ b/test/parallel/test-performance-gc.js @@ -5,7 +5,7 @@ const common = require('../common'); const assert = require('assert'); const { PerformanceObserver, - constants + constants, } = require('perf_hooks'); const { @@ -13,7 +13,7 @@ const { NODE_PERFORMANCE_GC_MINOR, NODE_PERFORMANCE_GC_INCREMENTAL, NODE_PERFORMANCE_GC_WEAKCB, - NODE_PERFORMANCE_GC_FLAGS_FORCED + NODE_PERFORMANCE_GC_FLAGS_FORCED, } = constants; const kinds = [ diff --git a/test/parallel/test-performance-global.js b/test/parallel/test-performance-global.js index 416d017117e9f0..1a9b5fc818169c 100644 --- a/test/parallel/test-performance-global.js +++ b/test/parallel/test-performance-global.js @@ -5,7 +5,7 @@ require('../common'); const perf_hooks = require('perf_hooks'); const { - strictEqual + strictEqual, } = require('assert'); const perf = performance; diff --git a/test/parallel/test-performanceobserver.js b/test/parallel/test-performanceobserver.js index 4862f5fbf02f25..a1f10f603451fd 100644 --- a/test/parallel/test-performanceobserver.js +++ b/test/parallel/test-performanceobserver.js @@ -6,12 +6,12 @@ const assert = require('assert'); const { inspect } = require('util'); const { internalBinding } = require('internal/test/binding'); const { - observerCounts: counts + observerCounts: counts, } = internalBinding('performance'); const { performance, PerformanceObserver, - constants + constants, } = require('perf_hooks'); const { @@ -29,7 +29,7 @@ assert.strictEqual(counts[NODE_PERFORMANCE_ENTRY_TYPE_HTTP2], 0); { code: 'ERR_INVALID_CALLBACK', name: 'TypeError', - message: `Callback must be a function. Received ${inspect(i)}` + message: `Callback must be a function. Received ${inspect(i)}`, } ); }); @@ -42,7 +42,7 @@ assert.strictEqual(counts[NODE_PERFORMANCE_ENTRY_TYPE_HTTP2], 0); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), }); }); @@ -50,7 +50,7 @@ assert.strictEqual(counts[NODE_PERFORMANCE_ENTRY_TYPE_HTTP2], 0); assert.throws(() => observer.observe({ entryTypes: i }), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); diff --git a/test/parallel/test-pipe-file-to-http.js b/test/parallel/test-pipe-file-to-http.js index 99f18e74d318f8..aab852910a67e2 100644 --- a/test/parallel/test-pipe-file-to-http.js +++ b/test/parallel/test-pipe-file-to-http.js @@ -64,7 +64,7 @@ function makeRequest() { const req = http.request({ port: server.address().port, path: '/', - method: 'POST' + method: 'POST', }); const s = fs.ReadStream(filename); diff --git a/test/parallel/test-pipe-outgoing-message-data-emitted-after-ended.js b/test/parallel/test-pipe-outgoing-message-data-emitted-after-ended.js index efd3d271e746ea..7138d124d16f02 100644 --- a/test/parallel/test-pipe-outgoing-message-data-emitted-after-ended.js +++ b/test/parallel/test-pipe-outgoing-message-data-emitted-after-ended.js @@ -18,7 +18,7 @@ const server = http.createServer(common.mustCall(function(req, res) { myStream.emit('data', 'some data'); res.on('error', common.expectsError({ code: 'ERR_STREAM_WRITE_AFTER_END', - name: 'Error' + name: 'Error', })); process.nextTick(common.mustCall(() => server.close())); @@ -31,6 +31,6 @@ server.on('listening', common.mustCall(function() { http.request({ port: server.address().port, method: 'GET', - path: '/' + path: '/', }).end(); })); diff --git a/test/parallel/test-policy-dependency-conditions.js b/test/parallel/test-policy-dependency-conditions.js index dec17aa22984b0..b2720e3733470c 100644 --- a/test/parallel/test-policy-dependency-conditions.js +++ b/test/parallel/test-policy-dependency-conditions.js @@ -66,7 +66,7 @@ for (const totalDepth of [1, 2, 3]) { offsets.map( (conditionOffset, depth) => tree[depth][conditionOffset] ) - ) + ), }); } else { target = {}; @@ -80,10 +80,10 @@ for (const totalDepth of [1, 2, 3]) { resources: { 'test:_': { dependencies: { - _: root - } - } - } + _: root, + }, + }, + }, }); const redirector = manifest.getDependencyMapper('test:_'); for (const { target, conditions } of order) { diff --git a/test/parallel/test-policy-parse-integrity.js b/test/parallel/test-policy-parse-integrity.js index 7c48eeb01426c8..e0c74904139204 100644 --- a/test/parallel/test-policy-parse-integrity.js +++ b/test/parallel/test-policy-parse-integrity.js @@ -50,12 +50,12 @@ function test({ shouldFail, integrity, manifest = {} }) { const resources = { [packageURL]: { body: packageBody, - integrity: `sha256-${hash('sha256', packageBody)}` + integrity: `sha256-${hash('sha256', packageBody)}`, }, [depURL]: { body: depBody, - integrity - } + integrity, + }, }; for (const [url, { body, integrity }] of Object.entries(resources)) { manifest.resources[url] = { @@ -99,13 +99,13 @@ test({ shouldFail: true, integrity: `sha256-${hash('sha256', 'file:///')}`, manifest: { - onerror: 'exit' - } + onerror: 'exit', + }, }); test({ shouldFail: false, integrity: `sha256-${hash('sha256', 'file:///')}`, manifest: { - onerror: 'log' - } + onerror: 'log', + }, }); diff --git a/test/parallel/test-policy-scopes-dependencies.js b/test/parallel/test-policy-scopes-dependencies.js index 53c44886146bfe..15767ec4e3b804 100644 --- a/test/parallel/test-policy-scopes-dependencies.js +++ b/test/parallel/test-policy-scopes-dependencies.js @@ -26,9 +26,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'file:///': { - dependencies: true - } - } + dependencies: true, + }, + }, }); for (const href of baseURLs) { @@ -42,9 +42,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'file:': { - dependencies: true - } - } + dependencies: true, + }, + }, }); for (const href of baseURLs) { @@ -66,23 +66,23 @@ const assert = require('assert'); resources: { 'file:///root/dir1': { dependencies: { - fs: 'test:fs1' - } + fs: 'test:fs1', + }, }, 'file:///root/dir1/isolated': {}, 'file:///root/dir1/cascade': { - cascade: true - } + cascade: true, + }, }, scopes: { 'file:///root/dir1/': { dependencies: { - fs: 'test:fs2' - } + fs: 'test:fs2', + }, }, 'file:///root/dir1/censor/': { }, - } + }, }); for (const href of baseURLs) { @@ -135,10 +135,10 @@ const assert = require('assert'); scopes: { 'data:text/': { dependencies: { - fs: true - } - } - } + fs: true, + }, + }, + }, }); for (const href of baseURLs) { @@ -152,10 +152,10 @@ const assert = require('assert'); scopes: { 'data:/': { dependencies: { - fs: true - } - } - } + fs: true, + }, + }, + }, }); for (const href of baseURLs) { @@ -168,9 +168,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'data:': { - dependencies: true - } - } + dependencies: true, + }, + }, }); for (const href of baseURLs) { @@ -185,10 +185,10 @@ const assert = require('assert'); scopes: { 'data:text/javascript,0/': { dependencies: { - fs: 'test:fs1' - } + fs: 'test:fs1', + }, }, - } + }, }); for (const href of baseURLs) { @@ -205,9 +205,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'https://example.com/': { - dependencies: true - } - } + dependencies: true, + }, + }, }); assert.strictEqual( @@ -221,9 +221,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'https://example.com': { - dependencies: true - } - } + dependencies: true, + }, + }, }); assert.strictEqual( @@ -236,7 +236,7 @@ const assert = require('assert'); { const manifest = new Manifest({ scopes: { - } + }, }); assert.strictEqual( @@ -249,9 +249,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'blob:https://example.com/has-origin': { - cascade: true - } - } + cascade: true, + }, + }, }); assert.strictEqual( @@ -265,12 +265,12 @@ const assert = require('assert'); scopes: { // FIXME 'https://example.com/': { - dependencies: true + dependencies: true, }, 'blob:https://example.com/has-origin': { - cascade: true - } - } + cascade: true, + }, + }, }); assert.strictEqual( @@ -284,12 +284,12 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'blob:': { - dependencies: true + dependencies: true, }, 'blob:https://example.com/has-origin': { - cascade: true - } - } + cascade: true, + }, + }, }); assert.strictEqual( diff --git a/test/parallel/test-policy-scopes-integrity.js b/test/parallel/test-policy-scopes-integrity.js index 16d9eb04eb7347..544bb771e65041 100644 --- a/test/parallel/test-policy-scopes-integrity.js +++ b/test/parallel/test-policy-scopes-integrity.js @@ -26,9 +26,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'file:///': { - integrity: true - } - } + integrity: true, + }, + }, }); for (const href of baseURLs) { @@ -50,9 +50,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'file:': { - integrity: true - } - } + integrity: true, + }, + }, }); for (const href of baseURLs) { @@ -75,8 +75,8 @@ const assert = require('assert'); resources: { 'file:///root/dir1/isolated': {}, 'file:///root/dir1/cascade': { - cascade: true - } + cascade: true, + }, }, scopes: { 'file:///root/dir1/': { @@ -87,7 +87,7 @@ const assert = require('assert'); }, 'file:///root/dir1/censor/': { }, - } + }, }); assert.throws( () => { @@ -127,9 +127,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'data:text/': { - integrity: true - } - } + integrity: true, + }, + }, }); for (const href of baseURLs) { @@ -145,9 +145,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'data:/': { - integrity: true - } - } + integrity: true, + }, + }, }); for (const href of baseURLs) { @@ -163,9 +163,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'data:': { - integrity: true - } - } + integrity: true, + }, + }, }); for (const href of baseURLs) { @@ -176,9 +176,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'data:text/javascript,0/': { - integrity: true + integrity: true, }, - } + }, }); for (const href of baseURLs) { @@ -198,9 +198,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'https://example.com/': { - integrity: true - } - } + integrity: true, + }, + }, }); assert.strictEqual( @@ -211,7 +211,7 @@ const assert = require('assert'); { const manifest = new Manifest({ scopes: { - } + }, }); assert.throws( @@ -225,9 +225,9 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'blob:https://example.com/has-origin': { - cascade: true - } - } + cascade: true, + }, + }, }); assert.throws( @@ -241,14 +241,14 @@ const assert = require('assert'); const manifest = new Manifest({ resources: { 'blob:https://example.com/has-origin': { - cascade: true - } + cascade: true, + }, }, scopes: { 'https://example.com': { - integrity: true - } - } + integrity: true, + }, + }, }); assert.strictEqual( @@ -260,12 +260,12 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'blob:': { - integrity: true + integrity: true, }, 'https://example.com': { - cascade: true - } - } + cascade: true, + }, + }, }); assert.throws( @@ -286,10 +286,10 @@ const assert = require('assert'); const manifest = new Manifest({ scopes: { 'file:///': { - integrity: true - } + integrity: true, + }, }, - onerror: 'throw' + onerror: 'throw', }); assert.throws( () => { @@ -304,10 +304,10 @@ const assert = require('assert'); new Manifest({ scopes: { 'file:///': { - integrity: true - } + integrity: true, + }, }, - onerror: 'unknown' + onerror: 'unknown', }); }, /ERR_MANIFEST_UNKNOWN_ONERROR/ diff --git a/test/parallel/test-process-argv-0.js b/test/parallel/test-process-argv-0.js index 21b406873f09b1..30d582b40df02f 100644 --- a/test/parallel/test-process-argv-0.js +++ b/test/parallel/test-process-argv-0.js @@ -27,7 +27,7 @@ const spawn = require('child_process').spawn; if (process.argv[2] !== 'child') { const child = spawn(process.execPath, [__filename, 'child'], { - cwd: path.dirname(process.execPath) + cwd: path.dirname(process.execPath), }); let childArgv0 = ''; diff --git a/test/parallel/test-process-assert.js b/test/parallel/test-process-assert.js index 2f0c3fc9430ce0..ecfcff49ac9eb6 100644 --- a/test/parallel/test-process-assert.js +++ b/test/parallel/test-process-assert.js @@ -14,12 +14,12 @@ assert.throws(() => { }, { code: 'ERR_ASSERTION', name: 'Error', - message: 'errorMessage' + message: 'errorMessage', }); assert.throws(() => { process.assert(false); }, { code: 'ERR_ASSERTION', name: 'Error', - message: 'assertion error' + message: 'assertion error', }); diff --git a/test/parallel/test-process-chdir-errormessage.js b/test/parallel/test-process-chdir-errormessage.js index 0ed368287b377e..0408427acb7b95 100644 --- a/test/parallel/test-process-chdir-errormessage.js +++ b/test/parallel/test-process-chdir-errormessage.js @@ -15,6 +15,6 @@ assert.throws( message: /ENOENT: no such file or directory, chdir .+ -> 'does-not-exist'/, path: process.cwd(), syscall: 'chdir', - dest: 'does-not-exist' + dest: 'does-not-exist', } ); diff --git a/test/parallel/test-process-chdir.js b/test/parallel/test-process-chdir.js index 8340f772044c4a..91fa4056eb90c3 100644 --- a/test/parallel/test-process-chdir.js +++ b/test/parallel/test-process-chdir.js @@ -38,7 +38,7 @@ assert.strictEqual(process.cwd().normalize(), const err = { code: 'ERR_INVALID_ARG_TYPE', - message: /The "directory" argument must be of type string/ + message: /The "directory" argument must be of type string/, }; assert.throws(function() { process.chdir({}); }, err); assert.throws(function() { process.chdir(); }, err); diff --git a/test/parallel/test-process-cpuUsage.js b/test/parallel/test-process-cpuUsage.js index f1580d5f092b72..bc8780b66e6667 100644 --- a/test/parallel/test-process-cpuUsage.js +++ b/test/parallel/test-process-cpuUsage.js @@ -39,7 +39,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "prevValue" argument must be of type object. ' + - 'Received type number (1)' + 'Received type number (1)', } ); @@ -55,7 +55,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "prevValue.user" property must be of type number.' + - common.invalidArgTypeHelper(value.user) + common.invalidArgTypeHelper(value.user), } ); }); @@ -70,7 +70,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "prevValue.system" property must be of type number.' + - common.invalidArgTypeHelper(value.system) + common.invalidArgTypeHelper(value.system), } ); }); diff --git a/test/parallel/test-process-emit-warning-from-native.js b/test/parallel/test-process-emit-warning-from-native.js index 80b1e71a08c58e..6894e04f8e2ee1 100644 --- a/test/parallel/test-process-emit-warning-from-native.js +++ b/test/parallel/test-process-emit-warning-from-native.js @@ -17,7 +17,7 @@ const key = '0123456789'; ], Warning: [ ['Use Cipheriv for counter mode of aes-256-gcm'], - ] + ], }); // Emits regular warning expected by expectWarning() @@ -37,7 +37,7 @@ const realEmitWarning = process.emitWarning; { Object.defineProperty(process, 'emitWarning', { get() { throw new Error('bar'); }, - configurable: true + configurable: true, }); assert.throws(() => { crypto.createCipher('aes-256-gcm', key); @@ -48,5 +48,5 @@ const realEmitWarning = process.emitWarning; Object.defineProperty(process, 'emitWarning', { value: realEmitWarning, configurable: true, - writable: true + writable: true, }); diff --git a/test/parallel/test-process-env-allowed-flags-are-documented.js b/test/parallel/test-process-env-allowed-flags-are-documented.js index 493017130167ab..e0bf8a881db8ee 100644 --- a/test/parallel/test-process-env-allowed-flags-are-documented.js +++ b/test/parallel/test-process-env-allowed-flags-are-documented.js @@ -54,13 +54,13 @@ const conditionalOpts = [ '--enable-fips', '--force-fips', ].includes(opt); - } + }, }, { include: common.hasIntl, - filter: (opt) => opt === '--icu-data-dir' + filter: (opt) => opt === '--icu-data-dir', }, { include: process.features.inspector, - filter: (opt) => opt.startsWith('--inspect') || opt === '--debug-port' + filter: (opt) => opt.startsWith('--inspect') || opt === '--debug-port', }, ]; documented.forEach((opt) => { diff --git a/test/parallel/test-process-env-sideeffects.js b/test/parallel/test-process-env-sideeffects.js index ee05e40e579c80..27d6258676bda4 100644 --- a/test/parallel/test-process-env-sideeffects.js +++ b/test/parallel/test-process-env-sideeffects.js @@ -15,10 +15,10 @@ process.env.TESTVAR = 'foobar'; session.post('Runtime.evaluate', { expression: 'process.env.TESTVAR', - throwOnSideEffect: true + throwOnSideEffect: true, }, (error, res) => { assert.ifError(error); assert.deepStrictEqual(res, { - result: { type: 'string', value: 'foobar' } + result: { type: 'string', value: 'foobar' }, }); }); diff --git a/test/parallel/test-process-euid-egid.js b/test/parallel/test-process-euid-egid.js index 11a8cfa0ed2b3c..4d47ca9a49c167 100644 --- a/test/parallel/test-process-euid-egid.js +++ b/test/parallel/test-process-euid-egid.js @@ -19,14 +19,14 @@ assert.throws(() => { }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "id" argument must be one of type number or string. ' + - 'Received an instance of Object' + 'Received an instance of Object', }); assert.throws(() => { process.seteuid('fhqwhgadshgnsdhjsdbkhsdabkfabkveyb'); }, { code: 'ERR_UNKNOWN_CREDENTIAL', - message: 'User identifier does not exist: fhqwhgadshgnsdhjsdbkhsdabkfabkveyb' + message: 'User identifier does not exist: fhqwhgadshgnsdhjsdbkhsdabkfabkveyb', }); // IBMi does not support below operations. diff --git a/test/parallel/test-process-exception-capture-errors.js b/test/parallel/test-process-exception-capture-errors.js index 8eb825267cf336..4d091e98b474b2 100644 --- a/test/parallel/test-process-exception-capture-errors.js +++ b/test/parallel/test-process-exception-capture-errors.js @@ -8,7 +8,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "fn" argument must be of type function or null. ' + - 'Received type number (42)' + 'Received type number (42)', } ); @@ -19,6 +19,6 @@ assert.throws( { code: 'ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET', name: 'Error', - message: /setupUncaughtExceptionCapture.*called while a capture callback/ + message: /setupUncaughtExceptionCapture.*called while a capture callback/, } ); diff --git a/test/parallel/test-process-exec-argv.js b/test/parallel/test-process-exec-argv.js index 6321f151774665..c1c1177c41a6db 100644 --- a/test/parallel/test-process-exec-argv.js +++ b/test/parallel/test-process-exec-argv.js @@ -43,7 +43,7 @@ if (process.argv[2] === 'child' || !isMainThread) { case 'worker': child = new Worker(__filename, { execArgv: [...execArgv, ...extra], - stdout: true + stdout: true, }); break; case 'cp+worker': diff --git a/test/parallel/test-process-external-stdio-close-spawn.js b/test/parallel/test-process-external-stdio-close-spawn.js index f7ee37c44629cd..5b2c4b82db52b3 100644 --- a/test/parallel/test-process-external-stdio-close-spawn.js +++ b/test/parallel/test-process-external-stdio-close-spawn.js @@ -18,7 +18,7 @@ if (process.argv[2] === 'child') { // the debugger. This test was added to help debug the fork-based // test with the same name. const child = cp.spawn(process.execPath, [__filename, 'child'], { - stdio: ['pipe', 'pipe', 'pipe', 'ipc'] + stdio: ['pipe', 'pipe', 'pipe', 'ipc'], }); child.on('close', common.mustCall((exitCode, signal) => { diff --git a/test/parallel/test-process-hrtime.js b/test/parallel/test-process-hrtime.js index 34ef514aac309b..0b73598575b213 100644 --- a/test/parallel/test-process-hrtime.js +++ b/test/parallel/test-process-hrtime.js @@ -39,28 +39,28 @@ assert.throws(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "time" argument must be an instance of Array. Received type ' + - 'number (1)' + 'number (1)', }); assert.throws(() => { process.hrtime([]); }, { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', - message: 'The value of "time" is out of range. It must be 2. Received 0' + message: 'The value of "time" is out of range. It must be 2. Received 0', }); assert.throws(() => { process.hrtime([1]); }, { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', - message: 'The value of "time" is out of range. It must be 2. Received 1' + message: 'The value of "time" is out of range. It must be 2. Received 1', }); assert.throws(() => { process.hrtime([1, 2, 3]); }, { code: 'ERR_OUT_OF_RANGE', name: 'RangeError', - message: 'The value of "time" is out of range. It must be 2. Received 3' + message: 'The value of "time" is out of range. It must be 2. Received 3', }); function validateTuple(tuple) { diff --git a/test/parallel/test-process-initgroups.js b/test/parallel/test-process-initgroups.js index 6b4e3bdf1470b4..cc3b20ca3d91f7 100644 --- a/test/parallel/test-process-initgroups.js +++ b/test/parallel/test-process-initgroups.js @@ -21,7 +21,7 @@ if (!common.isMainThread) message: 'The "user" argument must be ' + 'one of type number or string.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), } ); }); @@ -37,7 +37,7 @@ if (!common.isMainThread) message: 'The "extraGroup" argument must be ' + 'one of type number or string.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), } ); }); @@ -52,6 +52,6 @@ assert.throws( { code: 'ERR_UNKNOWN_CREDENTIAL', message: - 'Group identifier does not exist: fhqwhgadshgnsdhjsdbkhsdabkfabkveyb' + 'Group identifier does not exist: fhqwhgadshgnsdhjsdbkhsdabkfabkveyb', } ); diff --git a/test/parallel/test-process-kill-pid.js b/test/parallel/test-process-kill-pid.js index c4f172e61d6e6d..978c1fa1fe2fa0 100644 --- a/test/parallel/test-process-kill-pid.js +++ b/test/parallel/test-process-kill-pid.js @@ -43,7 +43,7 @@ const assert = require('assert'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "pid" argument must be of type number.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), }); }); @@ -51,14 +51,14 @@ const assert = require('assert'); assert.throws(() => process.kill(0, 'test'), { code: 'ERR_UNKNOWN_SIGNAL', name: 'TypeError', - message: 'Unknown signal: test' + message: 'Unknown signal: test', }); // Test that kill throws an error for invalid signal numbers assert.throws(() => process.kill(0, 987), { code: 'EINVAL', name: 'Error', - message: 'kill EINVAL' + message: 'kill EINVAL', }); // Test kill argument processing in valid cases. diff --git a/test/parallel/test-process-next-tick.js b/test/parallel/test-process-next-tick.js index 691bf57b3751c5..029a1af257bff7 100644 --- a/test/parallel/test-process-next-tick.js +++ b/test/parallel/test-process-next-tick.js @@ -45,7 +45,7 @@ process.on('exit', function() { { code: 'ERR_INVALID_CALLBACK', name: 'TypeError', - message: `Callback must be a function. Received ${inspect(i)}` + message: `Callback must be a function. Received ${inspect(i)}`, } ); }); diff --git a/test/parallel/test-process-setgroups.js b/test/parallel/test-process-setgroups.js index 2e04c8a1756383..1c4a0ab41628b5 100644 --- a/test/parallel/test-process-setgroups.js +++ b/test/parallel/test-process-setgroups.js @@ -18,7 +18,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "groups" argument must be an instance of Array. ' + - 'Received undefined' + 'Received undefined', } ); @@ -30,7 +30,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "groups[1]" is out of range. ' + - 'It must be >= 0 && < 4294967296. Received -1' + 'It must be >= 0 && < 4294967296. Received -1', } ); @@ -44,7 +44,7 @@ assert.throws( name: 'TypeError', message: 'The "groups[0]" argument must be ' + 'one of type number or string.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), } ); }); @@ -53,5 +53,6 @@ assert.throws(() => { process.setgroups([1, 'fhqwhgadshgnsdhjsdbkhsdabkfabkveyb']); }, { code: 'ERR_UNKNOWN_CREDENTIAL', - message: 'Group identifier does not exist: fhqwhgadshgnsdhjsdbkhsdabkfabkveyb' + message: 'Group identifier does not exist:' + + 'fhqwhgadshgnsdhjsdbkhsdabkfabkveyb', }); diff --git a/test/parallel/test-process-uid-gid.js b/test/parallel/test-process-uid-gid.js index 0e170620b7f237..be2316713e730c 100644 --- a/test/parallel/test-process-uid-gid.js +++ b/test/parallel/test-process-uid-gid.js @@ -41,14 +41,14 @@ assert.throws(() => { }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "id" argument must be one of type ' + - 'number or string. Received an instance of Object' + 'number or string. Received an instance of Object', }); assert.throws(() => { process.setuid('fhqwhgadshgnsdhjsdbkhsdabkfabkveyb'); }, { code: 'ERR_UNKNOWN_CREDENTIAL', - message: 'User identifier does not exist: fhqwhgadshgnsdhjsdbkhsdabkfabkveyb' + message: 'User identifier does not exist: fhqwhgadshgnsdhjsdbkhsdabkfabkveyb', }); // Passing -0 shouldn't crash the process diff --git a/test/parallel/test-process-warning.js b/test/parallel/test-process-warning.js index c1fbbf775fb45e..4b32281c4d76a9 100644 --- a/test/parallel/test-process-warning.js +++ b/test/parallel/test-process-warning.js @@ -3,7 +3,7 @@ const common = require('../common'); const { hijackStderr, - restoreStderr + restoreStderr, } = require('../common/hijackstdio'); const assert = require('assert'); diff --git a/test/parallel/test-process-wrap.js b/test/parallel/test-process-wrap.js index 997e3e43908010..dbf5c3adf495fe 100644 --- a/test/parallel/test-process-wrap.js +++ b/test/parallel/test-process-wrap.js @@ -61,7 +61,7 @@ p.spawn({ { type: 'ignore' }, { type: 'pipe', handle: pipe }, { type: 'ignore' }, - ] + ], }); // 'this' safety @@ -75,7 +75,7 @@ assert.throws(function() { { type: 'ignore' }, { type: 'pipe', handle: pipe }, { type: 'ignore' }, - ] + ], }); }, TypeError); diff --git a/test/parallel/test-promise-unhandled-default.js b/test/parallel/test-promise-unhandled-default.js index f69a039bed21da..83b6ca47a96b8f 100644 --- a/test/parallel/test-promise-unhandled-default.js +++ b/test/parallel/test-promise-unhandled-default.js @@ -18,7 +18,7 @@ err2.code = 'ERR_UNHANDLED_REJECTION'; Object.defineProperty(err2, 'name', { value: 'UnhandledPromiseRejection', writable: true, - configurable: true + configurable: true, }); const errors = [err1, err2]; diff --git a/test/parallel/test-promise-unhandled-error.js b/test/parallel/test-promise-unhandled-error.js index 67607dd5ebfa2b..5ee4c3e3a57a10 100644 --- a/test/parallel/test-promise-unhandled-error.js +++ b/test/parallel/test-promise-unhandled-error.js @@ -19,7 +19,7 @@ err2.code = 'ERR_UNHANDLED_REJECTION'; Object.defineProperty(err2, 'name', { value: 'UnhandledPromiseRejection', writable: true, - configurable: true + configurable: true, }); const errors = [err1, err2]; diff --git a/test/parallel/test-promise-unhandled-throw.js b/test/parallel/test-promise-unhandled-throw.js index b9e57fb8bff412..d68de5e176a31f 100644 --- a/test/parallel/test-promise-unhandled-throw.js +++ b/test/parallel/test-promise-unhandled-throw.js @@ -19,7 +19,7 @@ err2.code = 'ERR_UNHANDLED_REJECTION'; Object.defineProperty(err2, 'name', { value: 'UnhandledPromiseRejection', writable: true, - configurable: true + configurable: true, }); const errors = [err1, err2]; diff --git a/test/parallel/test-promises-unhandled-proxy-rejections.js b/test/parallel/test-promises-unhandled-proxy-rejections.js index 77f2bb653b3baa..2d463b02151fbd 100644 --- a/test/parallel/test-promises-unhandled-proxy-rejections.js +++ b/test/parallel/test-promises-unhandled-proxy-rejections.js @@ -19,7 +19,7 @@ const thorny = new Proxy({}, { deleteProperty: throwErr, ownKeys: throwErr, apply: throwErr, - construct: throwErr + construct: throwErr, }); process.on('warning', common.mustNotCall()); diff --git a/test/parallel/test-promises-unhandled-rejections.js b/test/parallel/test-promises-unhandled-rejections.js index 761923c5cc30c6..0befa9b5f2fc90 100644 --- a/test/parallel/test-promises-unhandled-rejections.js +++ b/test/parallel/test-promises-unhandled-rejections.js @@ -47,7 +47,7 @@ const asyncTest = (function() { asyncTestQueue.push({ action: fn, stack, - description + description, }); if (!asyncTestsEnabled) { asyncTestsEnabled = true; diff --git a/test/parallel/test-punycode.js b/test/parallel/test-punycode.js index efd3b92a6e7e50..61fa197cbe6462 100644 --- a/test/parallel/test-punycode.js +++ b/test/parallel/test-punycode.js @@ -71,33 +71,35 @@ const tests = [ { encoded: 'egbpdaj6bu4bxfgehfvwxn', decoded: '\u0644\u064A\u0647\u0645\u0627\u0628\u062A\u0643\u0644\u0645' + - '\u0648\u0634\u0639\u0631\u0628\u064A\u061F' + '\u0648\u0634\u0639\u0631\u0628\u064A\u061F', }, // (B) Chinese (simplified) { encoded: 'ihqwcrb4cv8a8dqg056pqjye', - decoded: '\u4ED6\u4EEC\u4E3A\u4EC0\u4E48\u4E0D\u8BF4\u4E2D\u6587' + decoded: '\u4ED6\u4EEC\u4E3A\u4EC0\u4E48\u4E0D\u8BF4\u4E2D\u6587', }, // (C) Chinese (traditional) { encoded: 'ihqwctvzc91f659drss3x8bo0yb', - decoded: '\u4ED6\u5011\u7232\u4EC0\u9EBD\u4E0D\u8AAA\u4E2D\u6587' + decoded: '\u4ED6\u5011\u7232\u4EC0\u9EBD\u4E0D\u8AAA\u4E2D\u6587', }, // (D) Czech: Proprostnemluvesky { encoded: 'Proprostnemluvesky-uyb24dma41a', decoded: '\u0050\u0072\u006F\u010D\u0070\u0072\u006F\u0073\u0074\u011B' + - '\u006E\u0065\u006D\u006C\u0075\u0076\u00ED\u010D\u0065\u0073\u006B\u0079' + '\u006E\u0065\u006D\u006C\u0075\u0076\u00ED\u010D\u0065\u0073\u006B' + + '\u0079', }, // (E) Hebrew { encoded: '4dbcagdahymbxekheh6e0a7fei0b', decoded: '\u05DC\u05DE\u05D4\u05D4\u05DD\u05E4\u05E9\u05D5\u05D8\u05DC' + - '\u05D0\u05DE\u05D3\u05D1\u05E8\u05D9\u05DD\u05E2\u05D1\u05E8\u05D9\u05EA' + '\u05D0\u05DE\u05D3\u05D1\u05E8\u05D9\u05DD\u05E2\u05D1\u05E8\u05D9' + + '\u05EA', }, // (F) Hindi (Devanagari) @@ -105,14 +107,14 @@ const tests = [ encoded: 'i1baa7eci9glrd9b2ae1bj0hfcgg6iyaf8o0a1dig0cd', decoded: '\u092F\u0939\u0932\u094B\u0917\u0939\u093F\u0928\u094D\u0926' + '\u0940\u0915\u094D\u092F\u094B\u0902\u0928\u0939\u0940\u0902\u092C' + - '\u094B\u0932\u0938\u0915\u0924\u0947\u0939\u0948\u0902' + '\u094B\u0932\u0938\u0915\u0924\u0947\u0939\u0948\u0902', }, // (G) Japanese (kanji and hiragana) { encoded: 'n8jok5ay5dzabd5bym9f0cm5685rrjetr6pdxa', decoded: '\u306A\u305C\u307F\u3093\u306A\u65E5\u672C\u8A9E\u3092\u8A71' + - '\u3057\u3066\u304F\u308C\u306A\u3044\u306E\u304B' + '\u3057\u3066\u304F\u308C\u306A\u3044\u306E\u304B', }, // (H) Korean (Hangul syllables) @@ -121,7 +123,7 @@ const tests = [ 'ccm6fea98c', decoded: '\uC138\uACC4\uC758\uBAA8\uB4E0\uC0AC\uB78C\uB4E4\uC774\uD55C' + '\uAD6D\uC5B4\uB97C\uC774\uD574\uD55C\uB2E4\uBA74\uC5BC\uB9C8\uB098' + - '\uC88B\uC744\uAE4C' + '\uC88B\uC744\uAE4C', }, // (I) Russian (Cyrillic) @@ -129,7 +131,7 @@ const tests = [ encoded: 'b1abfaaepdrnnbgefbadotcwatmq2g4l', decoded: '\u043F\u043E\u0447\u0435\u043C\u0443\u0436\u0435\u043E\u043D' + '\u0438\u043D\u0435\u0433\u043E\u0432\u043E\u0440\u044F\u0442\u043F' + - '\u043E\u0440\u0443\u0441\u0441\u043A\u0438' + '\u043E\u0440\u0443\u0441\u0441\u043A\u0438', }, // (J) Spanish: PorqunopuedensimplementehablarenEspaol @@ -138,7 +140,7 @@ const tests = [ decoded: '\u0050\u006F\u0072\u0071\u0075\u00E9\u006E\u006F\u0070\u0075' + '\u0065\u0064\u0065\u006E\u0073\u0069\u006D\u0070\u006C\u0065\u006D' + '\u0065\u006E\u0074\u0065\u0068\u0061\u0062\u006C\u0061\u0072\u0065' + - '\u006E\u0045\u0073\u0070\u0061\u00F1\u006F\u006C' + '\u006E\u0045\u0073\u0070\u0061\u00F1\u006F\u006C', }, // (K) Vietnamese: Tisaohkhngth @@ -147,13 +149,13 @@ const tests = [ encoded: 'TisaohkhngthchnitingVit-kjcr8268qyxafd2f1b9g', decoded: '\u0054\u1EA1\u0069\u0073\u0061\u006F\u0068\u1ECD\u006B\u0068' + '\u00F4\u006E\u0067\u0074\u0068\u1EC3\u0063\u0068\u1EC9\u006E\u00F3' + - '\u0069\u0074\u0069\u1EBF\u006E\u0067\u0056\u0069\u1EC7\u0074' + '\u0069\u0074\u0069\u1EBF\u006E\u0067\u0056\u0069\u1EC7\u0074', }, // (L) 3B { encoded: '3B-ww4c5e180e575a65lsy2b', - decoded: '\u0033\u5E74\u0042\u7D44\u91D1\u516B\u5148\u751F' + decoded: '\u0033\u5E74\u0042\u7D44\u91D1\u516B\u5148\u751F', }, // (M) -with-SUPER-MONKEYS @@ -161,7 +163,7 @@ const tests = [ encoded: '-with-SUPER-MONKEYS-pc58ag80a8qai00g7n9n', decoded: '\u5B89\u5BA4\u5948\u7F8E\u6075\u002D\u0077\u0069\u0074\u0068' + '\u002D\u0053\u0055\u0050\u0045\u0052\u002D\u004D\u004F\u004E\u004B' + - '\u0045\u0059\u0053' + '\u0045\u0059\u0053', }, // (N) Hello-Another-Way- @@ -169,39 +171,39 @@ const tests = [ encoded: 'Hello-Another-Way--fc4qua05auwb3674vfr0b', decoded: '\u0048\u0065\u006C\u006C\u006F\u002D\u0041\u006E\u006F\u0074' + '\u0068\u0065\u0072\u002D\u0057\u0061\u0079\u002D\u305D\u308C\u305E' + - '\u308C\u306E\u5834\u6240' + '\u308C\u306E\u5834\u6240', }, // (O) 2 { encoded: '2-u9tlzr9756bt3uc0v', - decoded: '\u3072\u3068\u3064\u5C4B\u6839\u306E\u4E0B\u0032' + decoded: '\u3072\u3068\u3064\u5C4B\u6839\u306E\u4E0B\u0032', }, // (P) MajiKoi5 { encoded: 'MajiKoi5-783gue6qz075azm5e', decoded: '\u004D\u0061\u006A\u0069\u3067\u004B\u006F\u0069\u3059\u308B' + - '\u0035\u79D2\u524D' + '\u0035\u79D2\u524D', }, // (Q) de { encoded: 'de-jg4avhby1noc0d', - decoded: '\u30D1\u30D5\u30A3\u30FC\u0064\u0065\u30EB\u30F3\u30D0' + decoded: '\u30D1\u30D5\u30A3\u30FC\u0064\u0065\u30EB\u30F3\u30D0', }, // (R) { encoded: 'd9juau41awczczp', - decoded: '\u305D\u306E\u30B9\u30D4\u30FC\u30C9\u3067' + decoded: '\u305D\u306E\u30B9\u30D4\u30FC\u30C9\u3067', }, // (S) -> $1.00 <- { encoded: '-> $1.00 <--', decoded: '\u002D\u003E\u0020\u0024\u0031\u002E\u0030\u0030\u0020\u003C' + - '\u002D' + '\u002D', }, ]; @@ -238,7 +240,7 @@ const testBattery = { regexNonASCII.test(test.decoded) ? test.decoded.toLowerCase() : test.decoded - ) + ), }; tests.forEach((testCase) => { diff --git a/test/parallel/test-querystring-escape.js b/test/parallel/test-querystring-escape.js index fdc62c7cdb5a3a..4c92d48851d42c 100644 --- a/test/parallel/test-querystring-escape.js +++ b/test/parallel/test-querystring-escape.js @@ -18,7 +18,7 @@ assert.throws( { code: 'ERR_INVALID_URI', name: 'URIError', - message: 'URI malformed' + message: 'URI malformed', } ); diff --git a/test/parallel/test-querystring-maxKeys-non-finite.js b/test/parallel/test-querystring-maxKeys-non-finite.js index 610c30c7a363a4..027b9b39928753 100644 --- a/test/parallel/test-querystring-maxKeys-non-finite.js +++ b/test/parallel/test-querystring-maxKeys-non-finite.js @@ -37,16 +37,16 @@ const params = createManyParams(count); // this test confirms that the output of parse is the expected length // when passed Infinity as the argument for maxKeys const resultInfinity = parse(params, undefined, undefined, { - maxKeys: Infinity + maxKeys: Infinity, }); const resultNaN = parse(params, undefined, undefined, { - maxKeys: NaN + maxKeys: NaN, }); const resultInfinityString = parse(params, undefined, undefined, { - maxKeys: 'Infinity' + maxKeys: 'Infinity', }); const resultNaNString = parse(params, undefined, undefined, { - maxKeys: 'NaN' + maxKeys: 'NaN', }); // Non Finite maxKeys should return the length of input diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js index eda94bf8df9164..4e3ec5d3ba7afa 100644 --- a/test/parallel/test-querystring.js +++ b/test/parallel/test-querystring.js @@ -297,7 +297,7 @@ assert.throws( { code: 'ERR_INVALID_URI', name: 'URIError', - message: 'URI malformed' + message: 'URI malformed', } ); @@ -316,8 +316,8 @@ assert.strictEqual(qs.stringify({ foo: Infinity }), 'foo='); a: 'b', q: qs.stringify({ x: 'y', - y: 'z' - }) + y: 'z', + }), }); assert.strictEqual(f, 'a=b&q=x%3Dy%26y%3Dz'); } @@ -330,8 +330,8 @@ qs.parse(undefined); // Should not throw. a: 'b', q: qs.stringify({ x: 'y', - y: 'z' - }, ';', ':') + y: 'z', + }, ';', ':'), }, ';', ':'); assert.strictEqual(f, 'a:b;q:x%3Ay%3By%3Az'); } diff --git a/test/parallel/test-queue-microtask-uncaught-asynchooks.js b/test/parallel/test-queue-microtask-uncaught-asynchooks.js index ee64c6e68ab7ab..41fce4fbc90485 100644 --- a/test/parallel/test-queue-microtask-uncaught-asynchooks.js +++ b/test/parallel/test-queue-microtask-uncaught-asynchooks.js @@ -25,7 +25,7 @@ async_hooks.createHook({ }, destroy(id) { if (id === µtaskId) events.push('destroy'); - } + }, }).enable(); queueMicrotask(() => { throw new Error(); }); diff --git a/test/parallel/test-readable-from.js b/test/parallel/test-readable-from.js index 24dee0dce20050..5e4b5961f75ad7 100644 --- a/test/parallel/test-readable-from.js +++ b/test/parallel/test-readable-from.js @@ -154,7 +154,7 @@ async function asTransformStream() { this.push('b'); this.push('c'); this.push(null); - } + }, }); const stream = Readable.from(generate(source)); diff --git a/test/parallel/test-readable-large-hwm.js b/test/parallel/test-readable-large-hwm.js index d5bf25bc0e61c1..6866d79e5c6c96 100644 --- a/test/parallel/test-readable-large-hwm.js +++ b/test/parallel/test-readable-large-hwm.js @@ -14,7 +14,7 @@ const r = new Readable({ if (n++ > 10) { r.push(null); } - } + }, }); r.on('readable', () => { diff --git a/test/parallel/test-readline-async-iterators-backpressure.js b/test/parallel/test-readline-async-iterators-backpressure.js index 2ca124dde5b890..fb7f0ef53c9fbe 100644 --- a/test/parallel/test-readline-async-iterators-backpressure.js +++ b/test/parallel/test-readline-async-iterators-backpressure.js @@ -14,7 +14,7 @@ const TOTAL_LINES = 18; const rli = readline.createInterface({ input: readable, - crlfDelay: Infinity + crlfDelay: Infinity, }); const it = rli[Symbol.asyncIterator](); diff --git a/test/parallel/test-readline-async-iterators-destroy.js b/test/parallel/test-readline-async-iterators-destroy.js index 8641b0a2acde75..3229c51d23ead5 100644 --- a/test/parallel/test-readline-async-iterators-destroy.js +++ b/test/parallel/test-readline-async-iterators-destroy.js @@ -27,7 +27,7 @@ async function testSimpleDestroy() { const readable = fs.createReadStream(filename); const rli = readline.createInterface({ input: readable, - crlfDelay: Infinity + crlfDelay: Infinity, }); const iteratedLines = []; @@ -58,7 +58,7 @@ async function testMutualDestroy() { const readable = fs.createReadStream(filename); const rli = readline.createInterface({ input: readable, - crlfDelay: Infinity + crlfDelay: Infinity, }); const expectedLines = fileContent.split('\n'); diff --git a/test/parallel/test-readline-async-iterators.js b/test/parallel/test-readline-async-iterators.js index 2aa557a3363486..e323630841575a 100644 --- a/test/parallel/test-readline-async-iterators.js +++ b/test/parallel/test-readline-async-iterators.js @@ -26,7 +26,7 @@ async function testSimple() { const readable = fs.createReadStream(filename); const rli = readline.createInterface({ input: readable, - crlfDelay: Infinity + crlfDelay: Infinity, }); const iteratedLines = []; @@ -50,7 +50,7 @@ async function testMutual() { const readable = fs.createReadStream(filename); const rli = readline.createInterface({ input: readable, - crlfDelay: Infinity + crlfDelay: Infinity, }); const expectedLines = fileContent.split('\n'); diff --git a/test/parallel/test-readline-csi.js b/test/parallel/test-readline-csi.js index 13dbbfa30f6fa2..8282266a992002 100644 --- a/test/parallel/test-readline-csi.js +++ b/test/parallel/test-readline-csi.js @@ -133,7 +133,7 @@ assert.throws( { name: 'TypeError', code: 'ERR_INVALID_CURSOR_POS', - message: 'Cannot set cursor row without setting its column' + message: 'Cannot set cursor row without setting its column', }); assert.strictEqual(writable.data, ''); diff --git a/test/parallel/test-readline-input-onerror.js b/test/parallel/test-readline-input-onerror.js index eebfbafdfde58f..c6ce4ef53089f5 100644 --- a/test/parallel/test-readline-input-onerror.js +++ b/test/parallel/test-readline-input-onerror.js @@ -8,7 +8,7 @@ async function processLineByLine_SymbolAsyncError(filename) { const fileStream = fs.createReadStream(filename); const rl = readline.createInterface({ input: fileStream, - crlfDelay: Infinity + crlfDelay: Infinity, }); // eslint-disable-next-line no-unused-vars for await (const line of rl) { @@ -21,18 +21,18 @@ const f = path.join(__dirname, 'file.txt'); // catch-able SymbolAsyncIterator `errorListener` error processLineByLine_SymbolAsyncError(f).catch(common.expectsError({ code: 'ENOENT', - message: `ENOENT: no such file or directory, open '${f}'` + message: `ENOENT: no such file or directory, open '${f}'`, })); async function processLineByLine_InterfaceErrorEvent(filename) { const fileStream = fs.createReadStream(filename); const rl = readline.createInterface({ input: fileStream, - crlfDelay: Infinity + crlfDelay: Infinity, }); rl.on('error', common.expectsError({ code: 'ENOENT', - message: `ENOENT: no such file or directory, open '${f}'` + message: `ENOENT: no such file or directory, open '${f}'`, })); } diff --git a/test/parallel/test-readline-interface-escapecodetimeout.js b/test/parallel/test-readline-interface-escapecodetimeout.js index a0c0e77cb8da35..f2afd3cc406a21 100644 --- a/test/parallel/test-readline-interface-escapecodetimeout.js +++ b/test/parallel/test-readline-interface-escapecodetimeout.js @@ -19,7 +19,7 @@ class FakeInput extends EventEmitter { const rli = new readline.Interface({ input: fi, output: fi, - escapeCodeTimeout: 50 + escapeCodeTimeout: 50, }); assert.strictEqual(rli.escapeCodeTimeout, 50); rli.close(); @@ -36,11 +36,11 @@ class FakeInput extends EventEmitter { const rli = new readline.Interface({ input: fi, output: fi, - escapeCodeTimeout: invalidInput + escapeCodeTimeout: invalidInput, }); rli.close(); }, { name: 'TypeError', - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); }); diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index 5e05610aeae8f4..a7fb088369fc23 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -29,7 +29,7 @@ const readline = require('readline'); const util = require('util'); const { getStringWidth, - stripVTControlCharacters + stripVTControlCharacters, } = require('internal/util/inspect'); const { EventEmitter, getEventListeners } = require('events'); const { Writable, Readable } = require('stream'); @@ -91,11 +91,11 @@ function assertCursorRowsAndCols(rli, rows, cols) { assert.throws(() => { readline.createInterface({ input, - completer: invalid + completer: invalid, }); }, { name: 'TypeError', - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); }); @@ -108,7 +108,7 @@ function assertCursorRowsAndCols(rli, rows, cols) { }); }, { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); @@ -121,7 +121,7 @@ function assertCursorRowsAndCols(rli, rows, cols) { }); }, { name: 'RangeError', - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); }); @@ -129,19 +129,19 @@ function assertCursorRowsAndCols(rli, rows, cols) { assert.throws( () => new readline.Interface({ input, - tabSize: 0 + tabSize: 0, }), { message: 'The value of "tabSize" is out of range. ' + 'It must be >= 1 && < 4294967296. Received 0', - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', } ); assert.throws( () => new readline.Interface({ input, - tabSize: '4' + tabSize: '4', }), { code: 'ERR_INVALID_ARG_TYPE' } ); @@ -149,12 +149,12 @@ function assertCursorRowsAndCols(rli, rows, cols) { assert.throws( () => new readline.Interface({ input, - tabSize: 4.5 + tabSize: 4.5, }), { code: 'ERR_OUT_OF_RANGE', message: 'The value of "tabSize" is out of range. ' + - 'It must be an integer. Received 4.5' + 'It must be an integer. Received 4.5', } ); } @@ -254,7 +254,7 @@ function assertCursorRowsAndCols(rli, rows, cols) { { const [rli, fi] = getInterface({ terminal: true, - removeHistoryDuplicates: true + removeHistoryDuplicates: true, }); const expectedLines = ['foo', 'bar', 'baz', 'bar', 'bat', 'bat']; // ['foo', 'baz', 'bar', bat']; @@ -331,7 +331,7 @@ function assertCursorRowsAndCols(rli, rows, cols) { { const [rli, fi] = getInterface({ terminal: true, - removeHistoryDuplicates: false + removeHistoryDuplicates: false, }); const expectedLines = ['foo', 'bar', 'baz', 'bar', 'bat', 'bat']; let callCount = 0; @@ -713,7 +713,7 @@ function assertCursorRowsAndCols(rli, rows, cols) { { const [rli, fi] = getInterface({ terminal: true, - prompt: '\nfilledline\nwraping text\n> ' + prompt: '\nfilledline\nwraping text\n> ', }); fi.columns = 10; fi.emit('data', 't'); @@ -770,7 +770,7 @@ assert.strictEqual(getStringWidth('> '), 2); for (let i = 0; i < 12; i++) { const rl = readline.createInterface({ input: process.stdin, - output: process.stdout + output: process.stdout, }); rl.close(); assert.strictEqual(isWarned(process.stdin._events), false); @@ -1012,14 +1012,14 @@ for (let i = 0; i < 12; i++) { assert.strictEqual(chunk.toString(), expected.shift()); cb(); rl.close(); - }, expected.length) + }, expected.length), }); const rl = readline.createInterface({ input: new Readable({ read: common.mustCall() }), output, prompt: '$ ', - terminal + terminal, }); rl.prompt(); @@ -1191,6 +1191,6 @@ for (let i = 0; i < 12; i++) { }); }, { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); } diff --git a/test/parallel/test-readline-position.js b/test/parallel/test-readline-position.js index 3603a42ecedc68..f07908eab37c20 100644 --- a/test/parallel/test-readline-position.js +++ b/test/parallel/test-readline-position.js @@ -14,7 +14,7 @@ common.skipIfDumbTerminal(); const rl = readline.createInterface({ terminal: true, input: input, - prompt: '' + prompt: '', }); const tests = [ diff --git a/test/parallel/test-readline-reopen.js b/test/parallel/test-readline-reopen.js index fd305fee3e88c7..d1ca05e3759ae4 100644 --- a/test/parallel/test-readline-reopen.js +++ b/test/parallel/test-readline-reopen.js @@ -14,7 +14,7 @@ const output = new PassThrough(); const rl1 = readline.createInterface({ input, output, - terminal: true + terminal: true, }); rl1.on('line', common.mustCall(rl1OnLine)); @@ -32,7 +32,7 @@ function rl1OnLine(line) { const rl2 = readline.createInterface({ input, output, - terminal: true + terminal: true, }); rl2.on('line', common.mustCall((line) => { diff --git a/test/parallel/test-readline-set-raw-mode.js b/test/parallel/test-readline-set-raw-mode.js index de47d14b03de8a..2acecc91a3c7f6 100644 --- a/test/parallel/test-readline-set-raw-mode.js +++ b/test/parallel/test-readline-set-raw-mode.js @@ -47,7 +47,7 @@ stream.pause = function() { const rli = readline.createInterface({ input: stream, output: stream, - terminal: true + terminal: true, }); assert(rli.terminal); assert(rawModeCalled); diff --git a/test/parallel/test-readline-undefined-columns.js b/test/parallel/test-readline-undefined-columns.js index f1ef7b5bba2eee..eac02324be767e 100644 --- a/test/parallel/test-readline-undefined-columns.js +++ b/test/parallel/test-readline-undefined-columns.js @@ -19,7 +19,7 @@ readline.createInterface({ output: oStream, completer: function(line, cb) { cb(null, [['process.stdout', 'process.stdin', 'process.stderr'], line]); - } + }, }); let output = ''; diff --git a/test/parallel/test-readline.js b/test/parallel/test-readline.js index 77799fc14cf75f..3351ad9c672a7c 100644 --- a/test/parallel/test-readline.js +++ b/test/parallel/test-readline.js @@ -10,7 +10,7 @@ common.skipIfDumbTerminal(); const input = new PassThrough(); const rl = readline.createInterface({ terminal: true, - input: input + input: input, }); rl.on('line', common.mustCall((data) => { @@ -24,7 +24,7 @@ common.skipIfDumbTerminal(); const input = new PassThrough(); const rl = readline.createInterface({ terminal: true, - input: input + input: input, }); rl.on('line', common.mustNotCall('must not be called before newline')); @@ -36,7 +36,7 @@ common.skipIfDumbTerminal(); const input = new PassThrough(); const rl = readline.createInterface({ terminal: true, - input: input + input: input, }); rl.on('line', common.mustCall((data) => { @@ -50,7 +50,7 @@ common.skipIfDumbTerminal(); const input = new PassThrough(); const rl = readline.createInterface({ terminal: true, - input: input + input: input, }); rl.write('foo'); @@ -63,16 +63,16 @@ common.skipIfDumbTerminal(); }, gnome: { home: ['\x1bOH', { ctrl: true, name: 'a' }], - end: ['\x1bOF', { ctrl: true, name: 'e' }] + end: ['\x1bOF', { ctrl: true, name: 'e' }], }, rxvt: { home: ['\x1b[7', { ctrl: true, name: 'a' }], - end: ['\x1b[8', { ctrl: true, name: 'e' }] + end: ['\x1b[8', { ctrl: true, name: 'e' }], }, putty: { home: ['\x1b[1~', { ctrl: true, name: 'a' }], - end: ['\x1b[>~', { ctrl: true, name: 'e' }] - } + end: ['\x1b[>~', { ctrl: true, name: 'e' }], + }, }; [key.xterm, key.gnome, key.rxvt, key.putty].forEach(function(key) { @@ -88,7 +88,7 @@ common.skipIfDumbTerminal(); const input = new PassThrough(); const rl = readline.createInterface({ terminal: true, - input: input + input: input, }); const key = { @@ -96,7 +96,7 @@ common.skipIfDumbTerminal(); home: ['\x1b[H', { ctrl: true, name: 'a' }], metab: ['\x1bb', { meta: true, name: 'b' }], metaf: ['\x1bf', { meta: true, name: 'f' }], - } + }, }; rl.write('foo bar.hop/zoo'); @@ -124,14 +124,14 @@ common.skipIfDumbTerminal(); const input = new PassThrough(); const rl = readline.createInterface({ terminal: true, - input: input + input: input, }); const key = { xterm: { home: ['\x1b[H', { ctrl: true, name: 'a' }], - metad: ['\x1bd', { meta: true, name: 'd' }] - } + metad: ['\x1bd', { meta: true, name: 'd' }], + }, }; rl.write('foo bar.hop/zoo'); diff --git a/test/parallel/test-repl-autocomplete.js b/test/parallel/test-repl-autocomplete.js index b107053183080a..dde440975c042f 100644 --- a/test/parallel/test-repl-autocomplete.js +++ b/test/parallel/test-repl-autocomplete.js @@ -116,7 +116,7 @@ const tests = [ yield ENTER; })(), expected: [], - clean: false + clean: false, }, ]; const numtests = tests.length; @@ -167,7 +167,7 @@ function runTest() { } catch (e) { console.error(`Failed test # ${numtests - tests.length}`); console.error('Last outputs: ' + inspect(lastChunks, { - breakLength: 5, colors: true + breakLength: 5, colors: true, })); throw e; } @@ -176,14 +176,14 @@ function runTest() { } next(); - } + }, }), allowBlockingCompletions: true, completer: opts.completer, prompt, useColors: false, preview: opts.preview, - terminal: true + terminal: true, }, function(err, repl) { if (err) { console.error(`Failed test # ${numtests - tests.length}`); @@ -207,7 +207,7 @@ function runTest() { if (opts.columns) { Object.defineProperty(repl, 'columns', { value: opts.columns, - enumerable: true + enumerable: true, }); } repl.input.run(opts.test); diff --git a/test/parallel/test-repl-cli-eval.js b/test/parallel/test-repl-cli-eval.js index 6069a20957bd25..60f17c98e79d05 100644 --- a/test/parallel/test-repl-cli-eval.js +++ b/test/parallel/test-repl-cli-eval.js @@ -9,7 +9,7 @@ const assert = require('assert'); for (const extraFlags of [[], ['-e', '42']]) { const flags = ['--interactive', ...extraFlags]; const proc = child_process.spawn(process.execPath, flags, { - stdio: ['pipe', 'pipe', 'inherit'] + stdio: ['pipe', 'pipe', 'inherit'], }); proc.stdin.write('module.id\n.exit\n'); diff --git a/test/parallel/test-repl-context.js b/test/parallel/test-repl-context.js index 88bd47a9281a9c..ac8cdc957bc243 100644 --- a/test/parallel/test-repl-context.js +++ b/test/parallel/test-repl-context.js @@ -13,7 +13,7 @@ const stream = new ArrayStream(); const r = repl.start({ input: stream, output: stream, - useGlobal: false + useGlobal: false, }); let output = ''; diff --git a/test/parallel/test-repl-definecommand.js b/test/parallel/test-repl-definecommand.js index efa22ed56f740f..8b7c28b89599dc 100644 --- a/test/parallel/test-repl-definecommand.js +++ b/test/parallel/test-repl-definecommand.js @@ -16,7 +16,7 @@ outputStream.on('data', function(d) { const r = repl.start({ input: inputStream, output: outputStream, - terminal: true + terminal: true, }); r.defineCommand('say1', { @@ -25,7 +25,7 @@ r.defineCommand('say1', { output = ''; this.output.write(`hello ${thing}\n`); this.displayPrompt(); - } + }, }); r.defineCommand('say2', function() { diff --git a/test/parallel/test-repl-dynamic-import.js b/test/parallel/test-repl-dynamic-import.js index a043e31bf5b2d0..43937174a1cd41 100644 --- a/test/parallel/test-repl-dynamic-import.js +++ b/test/parallel/test-repl-dynamic-import.js @@ -6,7 +6,7 @@ const child = child_process.spawn(process.execPath, [ '--interactive', '--expose-gc', ], { - stdio: 'pipe' + stdio: 'pipe', }); child.stdin.write('\nimport("fs");\n_.then(gc);\n'); // Wait for concurrent GC to finish diff --git a/test/parallel/test-repl-editor.js b/test/parallel/test-repl-editor.js index e260f5e89174a8..721aec6e79fce8 100644 --- a/test/parallel/test-repl-editor.js +++ b/test/parallel/test-repl-editor.js @@ -29,7 +29,7 @@ function run({ input, output, event, checkTerminalCodes = true }) { terminal: true, input: stream, output: stream, - useColors: false + useColors: false, }); stream.emit('data', '.editor\n'); @@ -49,22 +49,22 @@ const tests = [ { input: '', output: '\n(To exit, press Ctrl+C again or Ctrl+D or type .exit)', - event: { ctrl: true, name: 'c' } + event: { ctrl: true, name: 'c' }, }, { input: 'let i = 1;', output: '', - event: { ctrl: true, name: 'c' } + event: { ctrl: true, name: 'c' }, }, { input: 'let i = 1;\ni + 3', output: '\n4', - event: { ctrl: true, name: 'd' } + event: { ctrl: true, name: 'd' }, }, { input: ' let i = 1;\ni + 3', output: '\n4', - event: { ctrl: true, name: 'd' } + event: { ctrl: true, name: 'd' }, }, { input: '', @@ -88,7 +88,7 @@ function testCodeAlignment({ input, cursor = 0, line = '' }) { terminal: true, input: stream, output: outputStream, - useColors: false + useColors: false, }); stream.emit('data', '.editor\n'); @@ -105,22 +105,22 @@ function testCodeAlignment({ input, cursor = 0, line = '' }) { const codeAlignmentTests = [ { - input: 'let i = 1;\n' + input: 'let i = 1;\n', }, { input: ' let i = 1;\n', cursor: 2, - line: ' ' + line: ' ', }, { input: ' let i = 1;\n', cursor: 5, - line: ' ' + line: ' ', }, { input: ' let i = 1;\n let j = 2\n', cursor: 2, - line: ' ' + line: ' ', }, ]; diff --git a/test/parallel/test-repl-empty.js b/test/parallel/test-repl-empty.js index 44281f117f0bba..07f07751225d82 100644 --- a/test/parallel/test-repl-empty.js +++ b/test/parallel/test-repl-empty.js @@ -11,7 +11,7 @@ const repl = require('repl'); // Assertions here will not cause the test to exit with an error code // so set a boolean that is checked later instead. evalCalledWithExpectedArgs = (cmd === '\n'); - }) + }), }; const r = repl.start(options); diff --git a/test/parallel/test-repl-end-emits-exit.js b/test/parallel/test-repl-end-emits-exit.js index 4e1f3d84f5e056..f57a6f35d0a14a 100644 --- a/test/parallel/test-repl-end-emits-exit.js +++ b/test/parallel/test-repl-end-emits-exit.js @@ -34,7 +34,7 @@ function testTerminalMode() { const r1 = repl.start({ input: stream, output: stream, - terminal: true + terminal: true, }); process.nextTick(function() { @@ -53,7 +53,7 @@ function testRegularMode() { const r2 = repl.start({ input: stream, output: stream, - terminal: false + terminal: false, }); process.nextTick(function() { diff --git a/test/parallel/test-repl-envvars.js b/test/parallel/test-repl-envvars.js index b9216bc4aa0303..cfc5c52397ae9b 100644 --- a/test/parallel/test-repl-envvars.js +++ b/test/parallel/test-repl-envvars.js @@ -12,35 +12,35 @@ const { REPL_MODE_SLOPPY, REPL_MODE_STRICT } = require('repl'); const tests = [ { env: {}, - expected: { terminal: true, useColors: true } + expected: { terminal: true, useColors: true }, }, { env: { NODE_DISABLE_COLORS: '1' }, - expected: { terminal: true, useColors: false } + expected: { terminal: true, useColors: false }, }, { env: { NODE_NO_READLINE: '1' }, - expected: { terminal: false, useColors: false } + expected: { terminal: false, useColors: false }, }, { env: { TERM: 'dumb' }, - expected: { terminal: true, useColors: false } + expected: { terminal: true, useColors: false }, }, { env: { NODE_NO_READLINE: '1', NODE_DISABLE_COLORS: '1' }, - expected: { terminal: false, useColors: false } + expected: { terminal: false, useColors: false }, }, { env: { NODE_NO_READLINE: '0' }, - expected: { terminal: true, useColors: true } + expected: { terminal: true, useColors: true }, }, { env: { NODE_REPL_MODE: 'sloppy' }, - expected: { terminal: true, useColors: true, replMode: REPL_MODE_SLOPPY } + expected: { terminal: true, useColors: true, replMode: REPL_MODE_SLOPPY }, }, { env: { NODE_REPL_MODE: 'strict' }, - expected: { terminal: true, useColors: true, replMode: REPL_MODE_STRICT } + expected: { terminal: true, useColors: true, replMode: REPL_MODE_STRICT }, }, ]; @@ -51,7 +51,7 @@ function run(test) { const opts = { terminal: true, input: new stream.Readable({ read() {} }), - output: new stream.Writable({ write() {} }) + output: new stream.Writable({ write() {} }), }; Object.assign(process.env, env); diff --git a/test/parallel/test-repl-eval.js b/test/parallel/test-repl-eval.js index d775423fb74a52..24d020ccd85283 100644 --- a/test/parallel/test-repl-eval.js +++ b/test/parallel/test-repl-eval.js @@ -12,7 +12,7 @@ const repl = require('repl'); // so set a boolean that is checked later instead. evalCalledWithExpectedArgs = (cmd === 'function f() {}\n' && context.foo === 'bar'); - }) + }), }; const r = repl.start(options); diff --git a/test/parallel/test-repl-function-definition-edge-case.js b/test/parallel/test-repl-function-definition-edge-case.js index 952fba4103cc26..b6982c960e2d33 100644 --- a/test/parallel/test-repl-function-definition-edge-case.js +++ b/test/parallel/test-repl-function-definition-edge-case.js @@ -31,6 +31,6 @@ function initRepl() { output, useColors: false, terminal: false, - prompt: '' + prompt: '', }); } diff --git a/test/parallel/test-repl-history-navigation.js b/test/parallel/test-repl-history-navigation.js index 527cf235bddd21..27034a86c9b884 100644 --- a/test/parallel/test-repl-history-navigation.js +++ b/test/parallel/test-repl-history-navigation.js @@ -78,7 +78,7 @@ const tests = [ 'Array(100).fill(1).map((e, i) => i ** i)', LEFT, LEFT, DELETE, '2', ENTER], expected: [], - clean: false + clean: false, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -108,7 +108,7 @@ const tests = [ '1225, 1296, 1369, 1444, 1521, 1600, 1681, 1764, 1849, 1936,' + ' 2025, 2116, 2209,...', prompt].filter((e) => typeof e === 'string'), - clean: false + clean: false, }, { // Creates more history entries to navigate through. env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -120,7 +120,7 @@ const tests = [ '55 - 13 === 42', ENTER, ], expected: [], - clean: false + clean: false, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -153,7 +153,7 @@ const tests = [ '> ', '\x1B[3G', '\r\n', ], - clean: true + clean: true, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -193,7 +193,7 @@ const tests = [ ENTER, ], expected: [], - clean: false + clean: false, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -318,7 +318,7 @@ const tests = [ '> ', '\x1B[3G', '\r\n', ], - clean: true + clean: true, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -423,7 +423,7 @@ const tests = [ '... ', '\x1B[5G', '\r\n', ], - clean: true + clean: true, }, { // Check changed inspection defaults. @@ -434,7 +434,7 @@ const tests = [ ENTER, ], expected: [], - clean: false + clean: false, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -463,7 +463,7 @@ const tests = [ '[ [length]: 0 ]\n', '> ', ], - clean: true + clean: true, }, { // Check that the completer ignores completions that are outdated. @@ -504,7 +504,7 @@ const tests = [ ' // Always visible', prompt, ], - clean: true + clean: true, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -553,7 +553,7 @@ const tests = [ yield ENTER; })(), expected: [], - clean: false + clean: false, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -567,7 +567,7 @@ const tests = [ '{}\n', prompt, ], - clean: false + clean: false, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -589,7 +589,7 @@ const tests = [ 'true\n', prompt, ], - clean: false + clean: false, }, ]; const numtests = tests.length; @@ -640,7 +640,7 @@ function runTest() { } catch (e) { console.error(`Failed test # ${numtests - tests.length}`); console.error('Last outputs: ' + inspect(lastChunks, { - breakLength: 5, colors: true + breakLength: 5, colors: true, })); throw e; } @@ -649,13 +649,13 @@ function runTest() { } next(); - } + }, }), completer: opts.completer, prompt, useColors: false, preview: opts.preview, - terminal: true + terminal: true, }, function(err, repl) { if (err) { console.error(`Failed test # ${numtests - tests.length}`); @@ -679,7 +679,7 @@ function runTest() { if (opts.columns) { Object.defineProperty(repl, 'columns', { value: opts.columns, - enumerable: true + enumerable: true, }); } repl.input.run(opts.test); diff --git a/test/parallel/test-repl-history-perm.js b/test/parallel/test-repl-history-perm.js index aeca832d430978..6c955d5e84c3d4 100644 --- a/test/parallel/test-repl-history-perm.js +++ b/test/parallel/test-repl-history-perm.js @@ -52,7 +52,7 @@ repl.createInternalRepl( { terminal: true, input: stream, - output: stream + output: stream, }, checkResults ); diff --git a/test/parallel/test-repl-load-multiline.js b/test/parallel/test-repl-load-multiline.js index 4fcf206bef1be1..692c37fda59bd5 100644 --- a/test/parallel/test-repl-load-multiline.js +++ b/test/parallel/test-repl-load-multiline.js @@ -34,7 +34,7 @@ const r = repl.start({ input: inputStream, output: outputStream, terminal: true, - useColors: false + useColors: false, }); r.write(`${command}\n`); diff --git a/test/parallel/test-repl-mode.js b/test/parallel/test-repl-mode.js index d8131d34f93b44..9e1dd7696492f0 100644 --- a/test/parallel/test-repl-mode.js +++ b/test/parallel/test-repl-mode.js @@ -45,7 +45,7 @@ function testStrictModeTerminal() { } // Verify that ReferenceErrors are reported in strict mode previews. const cli = initRepl(repl.REPL_MODE_STRICT, { - terminal: true + terminal: true, }); cli.input.emit('data', 'xyz '); @@ -83,6 +83,6 @@ function initRepl(mode, options) { useColors: false, terminal: false, replMode: mode, - ...options + ...options, }); } diff --git a/test/parallel/test-repl-multiline.js b/test/parallel/test-repl-multiline.js index e458555cd87f76..f8759ec35ea0f3 100644 --- a/test/parallel/test-repl-multiline.js +++ b/test/parallel/test-repl-multiline.js @@ -17,7 +17,7 @@ function run({ useColors }) { input: inputStream, output: outputStream, terminal: true, - useColors + useColors, }); r.on('exit', common.mustCall(() => { diff --git a/test/parallel/test-repl-null-thrown.js b/test/parallel/test-repl-null-thrown.js index 0ed4a05fd5de55..ada25b12bae500 100644 --- a/test/parallel/test-repl-null-thrown.js +++ b/test/parallel/test-repl-null-thrown.js @@ -12,7 +12,7 @@ output.write = output.pause = output.resume = function(buf) { const replserver = repl.start({ output: output, - input: process.stdin + input: process.stdin, }); replserver.emit('line', 'process.nextTick(() => { throw null; })'); diff --git a/test/parallel/test-repl-options.js b/test/parallel/test-repl-options.js index 953255319cf9eb..2a287edaa90706 100644 --- a/test/parallel/test-repl-options.js +++ b/test/parallel/test-repl-options.js @@ -37,7 +37,7 @@ common.expectWarning({ 'repl._builtinLibs is deprecated. Check module.builtinModules instead', DEP0141: 'repl.inputStream and repl.outputStream are deprecated. ' + 'Use repl.input and repl.output instead', - } + }, }); // Create a dummy stream that does nothing @@ -47,7 +47,7 @@ const stream = new ArrayStream(); const r1 = repl.start({ input: stream, output: stream, - terminal: true + terminal: true, }); assert.strictEqual(r1.input, stream); @@ -75,7 +75,7 @@ const r2 = repl.start({ eval: evaler, writer: writer, replMode: repl.REPL_MODE_STRICT, - historySize: 50 + historySize: 50, }); assert.strictEqual(r2.input, stream); assert.strictEqual(r2.output, stream); @@ -92,13 +92,13 @@ assert.strictEqual(r2.historySize, 50); // 3, breakEvalOnSigint and eval supplied together should cause a throw const r3 = () => repl.start({ breakEvalOnSigint: true, - eval: true + eval: true, }); assert.throws(r3, { code: 'ERR_INVALID_REPL_EVAL_CONFIG', name: 'TypeError', - message: 'Cannot specify both "breakEvalOnSigint" and "eval" for REPL' + message: 'Cannot specify both "breakEvalOnSigint" and "eval" for REPL', }); // 4, Verify that defaults are used when no arguments are provided diff --git a/test/parallel/test-repl-persistent-history.js b/test/parallel/test-repl-persistent-history.js index b0cddf0a2bd020..7efe853fb59c4f 100644 --- a/test/parallel/test-repl-persistent-history.js +++ b/test/parallel/test-repl-persistent-history.js @@ -80,17 +80,17 @@ const tests = [ { env: { NODE_REPL_HISTORY: '' }, test: [UP], - expected: [prompt, replDisabled, prompt] + expected: [prompt, replDisabled, prompt], }, { env: { NODE_REPL_HISTORY: ' ' }, test: [UP], - expected: [prompt, replDisabled, prompt] + expected: [prompt, replDisabled, prompt], }, { env: { NODE_REPL_HISTORY: historyPath }, test: [UP, CLEAR], - expected: [prompt, `${prompt}'you look fabulous today'`, prompt] + expected: [prompt, `${prompt}'you look fabulous today'`, prompt], }, { env: {}, @@ -100,7 +100,7 @@ const tests = [ '2', '1', '21\n', prompt, prompt, "'", '4', '2', "'", "'42'\n", prompt, prompt, ], - clean: false + clean: false, }, { // Requires the above test case env: {}, @@ -117,7 +117,7 @@ const tests = [ `${prompt}21`, '21\n', prompt, - ] + ], }, { env: { NODE_REPL_HISTORY: historyPath, @@ -129,13 +129,13 @@ const tests = [ prompt, `${prompt}'you look fabulous today'`, prompt, - ] + ], }, { env: { NODE_REPL_HISTORY: historyPathFail, NODE_REPL_HISTORY_SIZE: 1 }, test: [UP], - expected: [prompt, replFailedRead, prompt, replDisabled, prompt] + expected: [prompt, replFailedRead, prompt, replDisabled, prompt], }, { before: function before() { @@ -148,7 +148,7 @@ const tests = [ }, env: { NODE_REPL_HISTORY: emptyHiddenHistoryPath }, test: [UP], - expected: [prompt] + expected: [prompt], }, { before: function before() { @@ -157,7 +157,7 @@ const tests = [ }, env: { NODE_REPL_HISTORY: devNullHistoryPath }, test: [UP], - expected: [prompt] + expected: [prompt], }, { // Make sure this is always the last test, since we change os.homedir() before: function before() { @@ -168,7 +168,7 @@ const tests = [ }, env: {}, test: [UP], - expected: [prompt, homedirErr, prompt, replDisabled, prompt] + expected: [prompt, homedirErr, prompt, replDisabled, prompt], }, ]; const numtests = tests.length; @@ -234,11 +234,11 @@ function runTest(assertCleaned) { throw err; } next(); - } + }, }), prompt, useColors: false, - terminal: true + terminal: true, }, function(err, repl) { if (err) { console.error(`Failed test # ${numtests - tests.length}`); diff --git a/test/parallel/test-repl-pretty-custom-stack.js b/test/parallel/test-repl-pretty-custom-stack.js index aef34f1b4f6329..7dec50fca4cc43 100644 --- a/test/parallel/test-repl-pretty-custom-stack.js +++ b/test/parallel/test-repl-pretty-custom-stack.js @@ -20,7 +20,7 @@ function run({ command, expected }) { input: inputStream, output: outputStream, terminal: false, - useColors: false + useColors: false, }); r.write(`${command}\n`); @@ -49,25 +49,25 @@ const tests = [ // test .load for a file that throws command: `.load ${fixtures.path('repl-pretty-stack.js')}`, expected: 'Uncaught Error: Whoops!--->\nREPL1:*:*--->\nd (REPL1:*:*)' + - '--->\nc (REPL1:*:*)--->\nb (REPL1:*:*)--->\na (REPL1:*:*)\n' + '--->\nc (REPL1:*:*)--->\nb (REPL1:*:*)--->\na (REPL1:*:*)\n', }, { command: 'let x y;', expected: 'let x y;\n ^\n\n' + - 'Uncaught SyntaxError: Unexpected identifier\n' + 'Uncaught SyntaxError: Unexpected identifier\n', }, { command: 'throw new Error(\'Whoops!\')', - expected: 'Uncaught Error: Whoops!\n' + expected: 'Uncaught Error: Whoops!\n', }, { command: 'foo = bar;', - expected: 'Uncaught ReferenceError: bar is not defined\n' + expected: 'Uncaught ReferenceError: bar is not defined\n', }, // test anonymous IIFE { command: '(function() { throw new Error(\'Whoops!\'); })()', - expected: 'Uncaught Error: Whoops!--->\nREPL5:*:*\n' + expected: 'Uncaught Error: Whoops!--->\nREPL5:*:*\n', }, ]; diff --git a/test/parallel/test-repl-pretty-stack-custom-writer.js b/test/parallel/test-repl-pretty-stack-custom-writer.js index 877f8cb8077597..269158882f2870 100644 --- a/test/parallel/test-repl-pretty-stack-custom-writer.js +++ b/test/parallel/test-repl-pretty-stack-custom-writer.js @@ -14,7 +14,7 @@ const repl = require('repl'); output, writer: String, terminal: false, - useColors: false + useColors: false, }); r.write('throw new Error("foo[a]")\n'); diff --git a/test/parallel/test-repl-pretty-stack.js b/test/parallel/test-repl-pretty-stack.js index c785bf75a15ba6..95857c4a1e58aa 100644 --- a/test/parallel/test-repl-pretty-stack.js +++ b/test/parallel/test-repl-pretty-stack.js @@ -21,7 +21,7 @@ function run({ command, expected, ...extraREPLOptions }, i) { output: outputStream, terminal: false, useColors: false, - ...extraREPLOptions + ...extraREPLOptions, }); r.write(`${command}\n`); @@ -39,16 +39,16 @@ const tests = [ command: `.load ${fixtures.path('repl-pretty-stack.js')}`, expected: 'Uncaught Error: Whoops!\n at REPL1:*:*\n' + ' at d (REPL1:*:*)\n at c (REPL1:*:*)\n' + - ' at b (REPL1:*:*)\n at a (REPL1:*:*)\n' + ' at b (REPL1:*:*)\n at a (REPL1:*:*)\n', }, { command: 'let x y;', expected: 'let x y;\n ^\n\n' + - 'Uncaught SyntaxError: Unexpected identifier\n' + 'Uncaught SyntaxError: Unexpected identifier\n', }, { command: 'throw new Error(\'Whoops!\')', - expected: 'Uncaught Error: Whoops!\n' + expected: 'Uncaught Error: Whoops!\n', }, { command: '(() => { const err = Error(\'Whoops!\'); ' + @@ -60,16 +60,16 @@ const tests = [ 'err.foo = \'bar\'; throw err; })()', expected: 'Uncaught Error: Whoops!\n at REPL5:*:* {\n foo: ' + "\u001b[32m'bar'\u001b[39m\n}\n", - useColors: true + useColors: true, }, { command: 'foo = bar;', - expected: 'Uncaught ReferenceError: bar is not defined\n' + expected: 'Uncaught ReferenceError: bar is not defined\n', }, // Test anonymous IIFE. { command: '(function() { throw new Error(\'Whoops!\'); })()', - expected: 'Uncaught Error: Whoops!\n at REPL7:*:*\n' + expected: 'Uncaught Error: Whoops!\n at REPL7:*:*\n', }, ]; diff --git a/test/parallel/test-repl-preview.js b/test/parallel/test-repl-preview.js index 620f41296e91f0..3648d06ebb539d 100644 --- a/test/parallel/test-repl-preview.js +++ b/test/parallel/test-repl-preview.js @@ -71,7 +71,7 @@ async function tests(options) { stream: new REPLStream(), ignoreUndefined: true, useColors: true, - ...options + ...options, }); repl.inputStream.run([ @@ -87,7 +87,7 @@ async function tests(options) { 'foo', '\x1B[90m[Function: foo]\x1B[39m\x1B[11G\x1B[1A\x1B[1B\x1B[2K\x1B[1A\r', '\x1B[36m[Function: foo]\x1B[39m', - ] + ], }, { input: 'koo', noPreview: '[Function: koo]', @@ -99,11 +99,11 @@ async function tests(options) { '\x1B[0Ko', '\x1B[90m[Function: koo]\x1B[39m\x1B[11G\x1B[1A\x1B[1B\x1B[2K\x1B[1A\r', '\x1B[36m[Function: koo]\x1B[39m', - ] + ], }, { input: 'a', noPreview: 'repl > ', // No "undefined" output. - preview: ['a\r'] // No "undefined" preview. + preview: ['a\r'], // No "undefined" preview. }, { input: " { b: 1 }['b'] === 1", noPreview: '\x1B[33mtrue\x1B[39m', @@ -113,7 +113,7 @@ async function tests(options) { '\x1B[90m1\x1B[39m\x1B[23G\x1B[1A\x1B[1B\x1B[2K\x1B[1A=== 1', '\x1B[90mtrue\x1B[39m\x1B[28G\x1B[1A\x1B[1B\x1B[2K\x1B[1A\r', '\x1B[33mtrue\x1B[39m', - ] + ], }, { input: "{ b: 1 }['b'] === 1;", noPreview: '\x1B[33mfalse\x1B[39m', @@ -124,14 +124,14 @@ async function tests(options) { '\x1B[90mtrue\x1B[39m\x1B[27G\x1B[1A\x1B[1B\x1B[2K\x1B[1A;', '\x1B[90mfalse\x1B[39m\x1B[28G\x1B[1A\x1B[1B\x1B[2K\x1B[1A\r', '\x1B[33mfalse\x1B[39m', - ] + ], }, { input: '{ a: true }', noPreview: '{ a: \x1B[33mtrue\x1B[39m }', preview: [ '{ a: tru\x1B[90me\x1B[39m\x1B[16G\x1B[0Ke }\r', '{ a: \x1B[33mtrue\x1B[39m }', - ] + ], }, { input: '{ a: true };', noPreview: '\x1B[33mtrue\x1B[39m', @@ -139,7 +139,7 @@ async function tests(options) { '{ a: tru\x1B[90me\x1B[39m\x1B[16G\x1B[0Ke };', '\x1B[90mtrue\x1B[39m\x1B[20G\x1B[1A\x1B[1B\x1B[2K\x1B[1A\r', '\x1B[33mtrue\x1B[39m', - ] + ], }, { input: ' \t { a: true};', noPreview: '\x1B[33mtrue\x1B[39m', @@ -148,7 +148,7 @@ async function tests(options) { '\x1B[90m{ a: true }\x1B[39m\x1B[20G\x1B[1A\x1B[1B\x1B[2K\x1B[1A;', '\x1B[90mtrue\x1B[39m\x1B[21G\x1B[1A\x1B[1B\x1B[2K\x1B[1A\r', '\x1B[33mtrue\x1B[39m', - ] + ], }, { input: '1n + 2n', noPreview: '\x1B[33m3n\x1B[39m', @@ -157,7 +157,7 @@ async function tests(options) { '\x1B[90mType[39m\x1B[14G\x1B[1A\x1B[1B\x1B[2K\x1B[1An', '\x1B[90m3n\x1B[39m\x1B[15G\x1B[1A\x1B[1B\x1B[2K\x1B[1A\r', '\x1B[33m3n\x1B[39m', - ] + ], }, { input: '{};1', noPreview: '\x1B[33m1\x1B[39m', @@ -165,7 +165,7 @@ async function tests(options) { '{};1', '\x1B[90m1\x1B[39m\x1B[12G\x1B[1A\x1B[1B\x1B[2K\x1B[1A\r', '\x1B[33m1\x1B[39m', - ] + ], }]; const hasPreview = repl.terminal && diff --git a/test/parallel/test-repl-programmatic-history.js b/test/parallel/test-repl-programmatic-history.js index e2ad2cc66fd44d..749fb97b0ab15e 100644 --- a/test/parallel/test-repl-programmatic-history.js +++ b/test/parallel/test-repl-programmatic-history.js @@ -78,17 +78,17 @@ const tests = [ { env: { NODE_REPL_HISTORY: '' }, test: [UP], - expected: [prompt, replDisabled, prompt] + expected: [prompt, replDisabled, prompt], }, { env: { NODE_REPL_HISTORY: ' ' }, test: [UP], - expected: [prompt, replDisabled, prompt] + expected: [prompt, replDisabled, prompt], }, { env: { NODE_REPL_HISTORY: historyPath }, test: [UP, CLEAR], - expected: [prompt, `${prompt}'you look fabulous today'`, prompt] + expected: [prompt, `${prompt}'you look fabulous today'`, prompt], }, { env: {}, @@ -100,7 +100,7 @@ const tests = [ '2', '1', '21\n', prompt, prompt, "'", '4', '2', "'", "'42'\n", prompt, prompt, ], - clean: false + clean: false, }, { // Requires the above test case env: {}, @@ -113,7 +113,7 @@ const tests = [ `${prompt}21`, '21\n', prompt, - ] + ], }, { env: { NODE_REPL_HISTORY: historyPath, @@ -125,13 +125,13 @@ const tests = [ prompt, `${prompt}'you look fabulous today'`, prompt, - ] + ], }, { env: { NODE_REPL_HISTORY: historyPathFail, NODE_REPL_HISTORY_SIZE: 1 }, test: [UP], - expected: [prompt, replFailedRead, prompt, replDisabled, prompt] + expected: [prompt, replFailedRead, prompt, replDisabled, prompt], }, { before: function before() { @@ -144,7 +144,7 @@ const tests = [ }, env: { NODE_REPL_HISTORY: emptyHiddenHistoryPath }, test: [UP], - expected: [prompt] + expected: [prompt], }, { before: function before() { @@ -153,7 +153,7 @@ const tests = [ }, env: { NODE_REPL_HISTORY: devNullHistoryPath }, test: [UP], - expected: [prompt] + expected: [prompt], }, { // Make sure this is always the last test, since we change os.homedir() before: function before() { @@ -164,7 +164,7 @@ const tests = [ }, env: {}, test: [UP], - expected: [prompt, homedirErr, prompt, replDisabled, prompt] + expected: [prompt, homedirErr, prompt, replDisabled, prompt], }, ]; const numtests = tests.length; @@ -231,12 +231,12 @@ function runTest(assertCleaned) { throw err; } next(); - } + }, }), prompt: prompt, useColors: false, terminal: true, - historySize: historySize + historySize: historySize, }); repl.setupHistory(historyFile, function(err, repl) { diff --git a/test/parallel/test-repl-reset-event.js b/test/parallel/test-repl-reset-event.js index 1f1347547e95f8..80c002140e2042 100644 --- a/test/parallel/test-repl-reset-event.js +++ b/test/parallel/test-repl-reset-event.js @@ -35,7 +35,7 @@ function testReset(cb) { const r = repl.start({ input: dummy, output: dummy, - useGlobal: false + useGlobal: false, }); r.context.foo = 42; r.on('reset', common.mustCall(function(context) { @@ -58,7 +58,7 @@ function testResetGlobal() { const r = repl.start({ input: dummy, output: dummy, - useGlobal: true + useGlobal: true, }); r.context.foo = 42; r.on('reset', common.mustCall(function(context) { diff --git a/test/parallel/test-repl-reverse-search.js b/test/parallel/test-repl-reverse-search.js index 5165dc2820d2d6..bd7855e7aa7de4 100644 --- a/test/parallel/test-repl-reverse-search.js +++ b/test/parallel/test-repl-reverse-search.js @@ -74,7 +74,7 @@ const tests = [ 'Array(100).fill(1)', ENTER, ], expected: [], - clean: false + clean: false, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -181,7 +181,7 @@ const tests = [ '\x1B[3G', '\r\n', ], - clean: false + clean: false, }, { env: { NODE_REPL_HISTORY: defaultHistoryPath }, @@ -264,7 +264,7 @@ const tests = [ prompt, '\x1B[3G', '\r\n', ], - clean: false + clean: false, }, ]; const numtests = tests.length; @@ -316,7 +316,7 @@ function runTest() { } catch (e) { console.error(`Failed test # ${numtests - tests.length}`); console.error('Last outputs: ' + inspect(lastChunks, { - breakLength: 5, colors: true + breakLength: 5, colors: true, })); throw e; } @@ -324,12 +324,12 @@ function runTest() { } next(); - } + }, }), completer: opts.completer, prompt, useColors: opts.useColors || false, - terminal: true + terminal: true, }, function(err, repl) { if (err) { console.error(`Failed test # ${numtests - tests.length}`); @@ -353,7 +353,7 @@ function runTest() { if (opts.columns) { Object.defineProperty(repl, 'columns', { value: opts.columns, - enumerable: true + enumerable: true, }); } repl.inputStream.run(opts.test); diff --git a/test/parallel/test-repl-sigint-nested-eval.js b/test/parallel/test-repl-sigint-nested-eval.js index 28e4d44b235cde..28efb1929ae08f 100644 --- a/test/parallel/test-repl-sigint-nested-eval.js +++ b/test/parallel/test-repl-sigint-nested-eval.js @@ -12,7 +12,7 @@ const spawn = require('child_process').spawn; process.env.REPL_TEST_PPID = process.pid; const child = spawn(process.execPath, [ '-i' ], { - stdio: [null, null, 2] + stdio: [null, null, 2], }); let stdout = ''; diff --git a/test/parallel/test-repl-sigint.js b/test/parallel/test-repl-sigint.js index 8ad0b2f5c2c853..ea4679e78f6455 100644 --- a/test/parallel/test-repl-sigint.js +++ b/test/parallel/test-repl-sigint.js @@ -12,7 +12,7 @@ const spawn = require('child_process').spawn; process.env.REPL_TEST_PPID = process.pid; const child = spawn(process.execPath, [ '-i' ], { - stdio: [null, null, 2] + stdio: [null, null, 2], }); let stdout = ''; diff --git a/test/parallel/test-repl-strict-mode-previews.js b/test/parallel/test-repl-strict-mode-previews.js index 8da4029e186b3c..96adc6b58f35a2 100644 --- a/test/parallel/test-repl-strict-mode-previews.js +++ b/test/parallel/test-repl-strict-mode-previews.js @@ -25,10 +25,10 @@ if (process.argv[2] === 'child') { write(chunk, _, next) { console.log(chunk.toString()); next(); - } + }, }), useColors: false, - terminal: true + terminal: true, }).inputStream.run('xyz'); } else { const assert = require('assert'); diff --git a/test/parallel/test-repl-tab-complete-import.js b/test/parallel/test-repl-tab-complete-import.js index 414b5cc4eac103..b6223a9ae76742 100644 --- a/test/parallel/test-repl-tab-complete-import.js +++ b/test/parallel/test-repl-tab-complete-import.js @@ -24,7 +24,7 @@ const testMe = repl.start({ prompt: '', input: putIn, output: process.stdout, - allowBlockingCompletions: true + allowBlockingCompletions: true, }); // Some errors are passed to the domain, but do not callback diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index da0ebfba9f965a..a1f49f68651ef0 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -25,7 +25,7 @@ const common = require('../common'); const ArrayStream = require('../common/arraystream'); const { hijackStderr, - restoreStderr + restoreStderr, } = require('../common/hijackstdio'); const assert = require('assert'); const path = require('path'); @@ -59,7 +59,7 @@ const testMe = repl.start({ prompt: '', input: putIn, output: process.stdout, - allowBlockingCompletions: true + allowBlockingCompletions: true, }); // Some errors are passed to the domain, but do not callback @@ -551,7 +551,7 @@ testMe.complete('Buffer.prototype.', common.mustCall()); const testNonGlobal = repl.start({ input: putIn, output: putIn, - useGlobal: false + useGlobal: false, }); const builtins = [['Infinity', 'Int16Array', 'Int32Array', @@ -575,7 +575,7 @@ const testCustomCompleterSyncMode = repl.start({ const hits = customCompletions.filter((c) => c.startsWith(line)); // Show all completions if none found. return [hits.length ? hits : customCompletions, line]; - } + }, }); // On empty line should output all the custom completions @@ -605,7 +605,7 @@ const testCustomCompleterAsyncMode = repl.start({ const hits = customCompletions.filter((c) => c.startsWith(line)); // Show all completions if none found. callback(null, [hits.length ? hits : customCompletions, line]); - } + }, }); // On empty line should output all the custom completions @@ -630,7 +630,7 @@ const editorStream = new ArrayStream(); const editor = repl.start({ stream: editorStream, terminal: true, - useColors: false + useColors: false, }); editorStream.run(['.clear']); diff --git a/test/parallel/test-repl-top-level-await.js b/test/parallel/test-repl-top-level-await.js index 39227d4f8bad29..0edd4a19369610 100644 --- a/test/parallel/test-repl-top-level-await.js +++ b/test/parallel/test-repl-top-level-await.js @@ -61,7 +61,7 @@ const testMe = repl.start({ stream: putIn, terminal: true, useColors: true, - breakEvalOnSigint: true + breakEvalOnSigint: true, }); function runAndWait(cmds) { diff --git a/test/parallel/test-repl-uncaught-exception-async.js b/test/parallel/test-repl-uncaught-exception-async.js index 7b14ebd5d94caa..808c537336132b 100644 --- a/test/parallel/test-repl-uncaught-exception-async.js +++ b/test/parallel/test-repl-uncaught-exception-async.js @@ -20,7 +20,7 @@ const r = repl.start({ output, terminal: false, useColors: false, - global: false + global: false, }); r.write( diff --git a/test/parallel/test-repl-uncaught-exception-evalcallback.js b/test/parallel/test-repl-uncaught-exception-evalcallback.js index a6f6e341049d6c..c4a7bbd29ad9da 100644 --- a/test/parallel/test-repl-uncaught-exception-evalcallback.js +++ b/test/parallel/test-repl-uncaught-exception-evalcallback.js @@ -11,7 +11,7 @@ const r = repl.start({ eval: common.mustCall((code, context, filename, cb) => { r.setPrompt('prompt! '); cb(new Error('err')); - }) + }), }); input.end('foo\n'); diff --git a/test/parallel/test-repl-uncaught-exception.js b/test/parallel/test-repl-uncaught-exception.js index 9d443b4e2ca553..e822ff89089892 100644 --- a/test/parallel/test-repl-uncaught-exception.js +++ b/test/parallel/test-repl-uncaught-exception.js @@ -17,7 +17,7 @@ function run({ command, expected, useColors = false }) { input: new ArrayStream(), output, terminal: false, - useColors + useColors, }); r.write(`${command}\n`); @@ -40,30 +40,30 @@ const tests = [ { useColors: true, command: 'x', - expected: 'Uncaught ReferenceError: x is not defined\n' + expected: 'Uncaught ReferenceError: x is not defined\n', }, { useColors: true, command: 'throw { foo: "test" }', - expected: "Uncaught { foo: \x1B[32m'test'\x1B[39m }\n" + expected: "Uncaught { foo: \x1B[32m'test'\x1B[39m }\n", }, { command: 'process.on("uncaughtException", () => console.log("Foobar"));\n', - expected: /^Uncaught:\nTypeError \[ERR_INVALID_REPL_INPUT]: Listeners for `/ + expected: /^Uncaught:\nTypeError \[ERR_INVALID_REPL_INPUT]: Listeners for `/, }, { command: 'x;\n', - expected: 'Uncaught ReferenceError: x is not defined\n' + expected: 'Uncaught ReferenceError: x is not defined\n', }, { command: 'process.on("uncaughtException", () => console.log("Foobar"));' + 'console.log("Baz");\n', - expected: /^Uncaught:\nTypeError \[ERR_INVALID_REPL_INPUT]: Listeners for `/ + expected: /^Uncaught:\nTypeError \[ERR_INVALID_REPL_INPUT]: Listeners for `/, }, { command: 'console.log("Baz");' + 'process.on("uncaughtException", () => console.log("Foobar"));\n', - expected: /^Baz\nUncaught:\nTypeError \[ERR_INVALID_REPL_INPUT]:.*uncaughtException/ + expected: /^Baz\nUncaught:\nTypeError \[ERR_INVALID_REPL_INPUT]:.*uncaughtException/, }, ]; diff --git a/test/parallel/test-repl-underscore.js b/test/parallel/test-repl-underscore.js index 1802f8b8ff1e86..b6eae25d96373f 100644 --- a/test/parallel/test-repl-underscore.js +++ b/test/parallel/test-repl-underscore.js @@ -237,7 +237,7 @@ function initRepl(mode, useGlobal) { terminal: false, prompt: '', replMode: mode, - useGlobal: useGlobal + useGlobal: useGlobal, }); } diff --git a/test/parallel/test-repl-use-global.js b/test/parallel/test-repl-use-global.js index 3457d0c5ba7210..2b2639010207ae 100644 --- a/test/parallel/test-repl-use-global.js +++ b/test/parallel/test-repl-use-global.js @@ -71,7 +71,7 @@ function runRepl(useGlobal, testFunc, cb) { useGlobal: useGlobal, useColors: false, terminal: false, - prompt: '' + prompt: '', }; repl.createInternalRepl( diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index bbb95f3fa39f68..32ba0f0d22fc84 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -103,30 +103,30 @@ async function runReplTests(socket, prompt, tests) { const unixTests = [ { send: '', - expect: '' + expect: '', }, { send: 'message', - expect: `'${message}'` + expect: `'${message}'`, }, { send: 'invoke_me(987)', - expect: '\'invoked 987\'' + expect: '\'invoked 987\'', }, { send: 'a = 12345', - expect: '12345' + expect: '12345', }, { send: '{a:1}', - expect: '{ a: 1 }' + expect: '{ a: 1 }', }, ]; const strictModeTests = [ { send: 'ref = 1', - expect: [/^Uncaught ReferenceError:\s/] + expect: [/^Uncaught ReferenceError:\s/], }, ]; @@ -134,106 +134,106 @@ const errorTests = [ // Uncaught error throws and prints out { send: 'throw new Error(\'test error\');', - expect: ['Uncaught Error: test error'] + expect: ['Uncaught Error: test error'], }, { send: "throw { foo: 'bar' };", - expect: "Uncaught { foo: 'bar' }" + expect: "Uncaught { foo: 'bar' }", }, // Common syntax error is treated as multiline command { send: 'function test_func() {', - expect: '... ' + expect: '... ', }, // You can recover with the .break command { send: '.break', - expect: '' + expect: '', }, // But passing the same string to eval() should throw { send: 'eval("function test_func() {")', - expect: [/^Uncaught SyntaxError: /] + expect: [/^Uncaught SyntaxError: /], }, // Can handle multiline template literals { send: '`io.js', - expect: '... ' + expect: '... ', }, // Special REPL commands still available { send: '.break', - expect: '' + expect: '', }, // Template expressions { send: '`io.js ${"1.0"', - expect: '... ' + expect: '... ', }, { send: '+ ".2"}`', - expect: '\'io.js 1.0.2\'' + expect: '\'io.js 1.0.2\'', }, { send: '`io.js ${', - expect: '... ' + expect: '... ', }, { send: '"1.0" + ".2"}`', - expect: '\'io.js 1.0.2\'' + expect: '\'io.js 1.0.2\'', }, // Dot prefix in multiline commands aren't treated as commands { send: '("a"', - expect: '... ' + expect: '... ', }, { send: '.charAt(0))', - expect: '\'a\'' + expect: '\'a\'', }, // Floating point numbers are not interpreted as REPL commands. { send: '.1234', - expect: '0.1234' + expect: '0.1234', }, // Floating point expressions are not interpreted as REPL commands { send: '.1+.1', - expect: '0.2' + expect: '0.2', }, // Can parse valid JSON { send: 'JSON.parse(\'{"valid": "json"}\');', - expect: '{ valid: \'json\' }' + expect: '{ valid: \'json\' }', }, // Invalid input to JSON.parse error is special case of syntax error, // should throw { send: 'JSON.parse(\'{invalid: \\\'json\\\'}\');', - expect: [/^Uncaught SyntaxError: /] + expect: [/^Uncaught SyntaxError: /], }, // End of input to JSON.parse error is special case of syntax error, // should throw { send: 'JSON.parse(\'066\');', - expect: [/^Uncaught SyntaxError: /] + expect: [/^Uncaught SyntaxError: /], }, // should throw { send: 'JSON.parse(\'{\');', - expect: [/^Uncaught SyntaxError: /] + expect: [/^Uncaught SyntaxError: /], }, // invalid RegExps are a special case of syntax error, // should throw { send: '/(/;', - expect: [/^Uncaught SyntaxError: /] + expect: [/^Uncaught SyntaxError: /], }, // invalid RegExp modifiers are a special case of syntax error, // should throw (GH-4012) { send: 'new RegExp("foo", "wrong modifier");', - expect: [/^Uncaught SyntaxError: /] + expect: [/^Uncaught SyntaxError: /], }, // Strict mode syntax errors should be caught (GH-5178) { @@ -243,7 +243,7 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, { send: '(function(a, a, b) { "use strict"; return a + b + c; })()', @@ -252,7 +252,7 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, { send: '(function() { "use strict"; with (this) {} })()', @@ -261,7 +261,7 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, { send: '(function() { "use strict"; var x; delete x; })()', @@ -270,7 +270,7 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, { send: '(function() { "use strict"; eval = 17; })()', @@ -279,7 +279,7 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, { send: '(function() { "use strict"; if (true) function f() { } })()', @@ -289,84 +289,84 @@ const errorTests = [ '', 'Uncaught:', /^SyntaxError: /, - ] + ], }, // Named functions can be used: { send: 'function blah() { return 1; }', - expect: 'undefined' + expect: 'undefined', }, { send: 'blah()', - expect: '1' + expect: '1', }, // Functions should not evaluate twice (#2773) { send: 'var I = [1,2,3,function() {}]; I.pop()', - expect: '[Function (anonymous)]' + expect: '[Function (anonymous)]', }, // Multiline object { send: '{ a: ', - expect: '... ' + expect: '... ', }, { send: '1 }', - expect: '{ a: 1 }' + expect: '{ a: 1 }', }, // Multiline string-keyed object (e.g. JSON) { send: '{ "a": ', - expect: '... ' + expect: '... ', }, { send: '1 }', - expect: '{ a: 1 }' + expect: '{ a: 1 }', }, // Multiline class with private member. { send: 'class Foo { #private = true ', - expect: '... ' + expect: '... ', }, // Class field with bigint. { send: 'num = 123456789n', - expect: '... ' + expect: '... ', }, // Static class features. { send: 'static foo = "bar" }', - expect: 'undefined' + expect: 'undefined', }, // Multiline anonymous function with comment { send: '(function() {', - expect: '... ' + expect: '... ', }, { send: '// blah', - expect: '... ' + expect: '... ', }, { send: 'return 1n;', - expect: '... ' + expect: '... ', }, { send: '})()', - expect: '1n' + expect: '1n', }, // Multiline function call { send: 'function f(){}; f(f(1,', - expect: '... ' + expect: '... ', }, { send: '2)', - expect: '... ' + expect: '... ', }, { send: ')', - expect: 'undefined' + expect: 'undefined', }, // `npm` prompt error message. { @@ -374,35 +374,35 @@ const errorTests = [ expect: [ 'npm should be run outside of the Node.js REPL, in your normal shell.', '(Press Ctrl+D to exit.)', - ] + ], }, { send: '(function() {\n\nreturn 1;\n})()', - expect: '... ... ... 1' + expect: '... ... ... 1', }, { send: '{\n\na: 1\n}', - expect: '... ... ... { a: 1 }' + expect: '... ... ... { a: 1 }', }, { send: 'url.format("http://google.com")', - expect: '\'http://google.com/\'' + expect: '\'http://google.com/\'', }, { send: 'var path = 42; path', - expect: '42' + expect: '42', }, // This makes sure that we don't print `undefined` when we actually print // the error message { send: '.invalid_repl_command', - expect: 'Invalid REPL keyword' + expect: 'Invalid REPL keyword', }, // This makes sure that we don't crash when we use an inherited property as // a REPL command { send: '.toString', - expect: 'Invalid REPL keyword' + expect: 'Invalid REPL keyword', }, // Fail when we are not inside a String and a line continuation is used { @@ -412,12 +412,12 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, // Do not fail when a String is created with line continuation { send: '\'the\\\nfourth\\\neye\'', - expect: ['... ... \'thefourtheye\''] + expect: ['... ... \'thefourtheye\''], }, // Don't fail when a partial String is created and line continuation is used // with whitespace characters at the end of the string. We are to ignore it. @@ -425,22 +425,22 @@ const errorTests = [ // characters at the end of line, unlike the buggy `trimWhitespace` function { send: ' \t .break \t ', - expect: '' + expect: '', }, // Multiline strings preserve whitespace characters in them { send: '\'the \\\n fourth\t\t\\\n eye \'', - expect: '... ... \'the fourth\\t\\t eye \'' + expect: '... ... \'the fourth\\t\\t eye \'', }, // More than one multiline strings also should preserve whitespace chars { send: '\'the \\\n fourth\' + \'\t\t\\\n eye \'', - expect: '... ... \'the fourth\\t\\t eye \'' + expect: '... ... \'the fourth\\t\\t eye \'', }, // using REPL commands within a string literal should still work { send: '\'\\\n.break', - expect: '... ' + prompt_unix + expect: '... ' + prompt_unix, }, // Using REPL command "help" within a string literal should still work { @@ -455,12 +455,12 @@ const errorTests = [ '', 'Press Ctrl+C to abort current expression, Ctrl+D to exit the REPL', /'thefourtheye'/, - ] + ], }, // Check for wrapped objects. { send: '{ a: 1 }.a', // ({ a: 1 }.a); - expect: '1' + expect: '1', }, { send: '{ a: 1 }.a;', // { a: 1 }.a; @@ -469,95 +469,95 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, { send: '{ a: 1 }["a"] === 1', // ({ a: 1 }['a'] === 1); - expect: 'true' + expect: 'true', }, { send: '{ a: 1 }["a"] === 1;', // { a: 1 }; ['a'] === 1; - expect: 'false' + expect: 'false', }, // Empty lines in the REPL should be allowed { send: '\n\r\n\r\n', - expect: '' + expect: '', }, // Empty lines in the string literals should not affect the string { send: '\'the\\\n\\\nfourtheye\'\n', - expect: '... ... \'thefourtheye\'' + expect: '... ... \'thefourtheye\'', }, // Regression test for https://github.com/nodejs/node/issues/597 { send: '/(.)(.)(.)(.)(.)(.)(.)(.)(.)/.test(\'123456789\')\n', - expect: 'true' + expect: 'true', }, // The following test's result depends on the RegExp's match from the above { send: 'RegExp.$1\nRegExp.$2\nRegExp.$3\nRegExp.$4\nRegExp.$5\n' + 'RegExp.$6\nRegExp.$7\nRegExp.$8\nRegExp.$9\n', expect: ['\'1\'', '\'2\'', '\'3\'', '\'4\'', '\'5\'', '\'6\'', - '\'7\'', '\'8\'', '\'9\''] + '\'7\'', '\'8\'', '\'9\''], }, // Regression tests for https://github.com/nodejs/node/issues/2749 { send: 'function x() {\nreturn \'\\n\';\n }', - expect: '... ... undefined' + expect: '... ... undefined', }, { send: 'function x() {\nreturn \'\\\\\';\n }', - expect: '... ... undefined' + expect: '... ... undefined', }, // Regression tests for https://github.com/nodejs/node/issues/3421 { send: 'function x() {\n//\'\n }', - expect: '... ... undefined' + expect: '... ... undefined', }, { send: 'function x() {\n//"\n }', - expect: '... ... undefined' + expect: '... ... undefined', }, { send: 'function x() {//\'\n }', - expect: '... undefined' + expect: '... undefined', }, { send: 'function x() {//"\n }', - expect: '... undefined' + expect: '... undefined', }, { send: 'function x() {\nvar i = "\'";\n }', - expect: '... ... undefined' + expect: '... ... undefined', }, { send: 'function x(/*optional*/) {}', - expect: 'undefined' + expect: 'undefined', }, { send: 'function x(/* // 5 */) {}', - expect: 'undefined' + expect: 'undefined', }, { send: '// /* 5 */', - expect: 'undefined' + expect: 'undefined', }, { send: '"//"', - expect: '\'//\'' + expect: '\'//\'', }, { send: '"data /*with*/ comment"', - expect: '\'data /*with*/ comment\'' + expect: '\'data /*with*/ comment\'', }, { send: 'function x(/*fn\'s optional params*/) {}', - expect: 'undefined' + expect: 'undefined', }, { send: '/* \'\n"\n\'"\'\n*/', - expect: '... ... ... undefined' + expect: '... ... ... undefined', }, // REPL should get a normal require() function, not one that allows // access to internal modules without the --expose-internals flag. @@ -574,28 +574,28 @@ const errorTests = [ " code: 'MODULE_NOT_FOUND',", " requireStack: [ '' ]", '}', - ] + ], }, // REPL should handle quotes within regexp literal in multiline mode { send: "function x(s) {\nreturn s.replace(/'/,'');\n}", - expect: '... ... undefined' + expect: '... ... undefined', }, { send: "function x(s) {\nreturn s.replace(/'/,'');\n}", - expect: '... ... undefined' + expect: '... ... undefined', }, { send: 'function x(s) {\nreturn s.replace(/"/,"");\n}', - expect: '... ... undefined' + expect: '... ... undefined', }, { send: 'function x(s) {\nreturn s.replace(/.*/,"");\n}', - expect: '... ... undefined' + expect: '... ... undefined', }, { send: '{ var x = 4; }', - expect: 'undefined' + expect: 'undefined', }, // Illegal token is not recoverable outside string literal, RegExp literal, // or block comment. https://github.com/nodejs/node/issues/3611 @@ -606,16 +606,16 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, // Mitigate https://github.com/nodejs/node/issues/548 { send: 'function name(){ return "node"; };name()', - expect: '\'node\'' + expect: '\'node\'', }, { send: 'function name(){ return "nodejs"; };name()', - expect: '\'nodejs\'' + expect: '\'nodejs\'', }, // Avoid emitting repl:line-number for SyntaxError { @@ -625,7 +625,7 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, // Avoid emitting stack trace { @@ -635,65 +635,65 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, // https://github.com/nodejs/node/issues/9850 { send: 'function* foo() {}; foo().next();', - expect: '{ value: undefined, done: true }' + expect: '{ value: undefined, done: true }', }, { send: 'function *foo() {}; foo().next();', - expect: '{ value: undefined, done: true }' + expect: '{ value: undefined, done: true }', }, { send: 'function*foo() {}; foo().next();', - expect: '{ value: undefined, done: true }' + expect: '{ value: undefined, done: true }', }, { send: 'function * foo() {}; foo().next()', - expect: '{ value: undefined, done: true }' + expect: '{ value: undefined, done: true }', }, // https://github.com/nodejs/node/issues/9300 { send: 'function foo() {\nvar bar = 1 / 1; // "/"\n}', - expect: '... ... undefined' + expect: '... ... undefined', }, { send: '(function() {\nreturn /foo/ / /bar/;\n}())', - expect: '... ... NaN' + expect: '... ... NaN', }, { send: '(function() {\nif (false) {} /bar"/;\n}())', - expect: '... ... undefined' + expect: '... ... undefined', }, // https://github.com/nodejs/node/issues/16483 { send: 'new Proxy({x:42}, {get(){throw null}});', - expect: 'Proxy [ { x: 42 }, { get: [Function: get] } ]' + expect: 'Proxy [ { x: 42 }, { get: [Function: get] } ]', }, { send: 'repl.writer.options.showProxy = false, new Proxy({x:42}, {});', - expect: '{ x: 42 }' + expect: '{ x: 42 }', }, // Newline within template string maintains whitespace. { send: '`foo \n`', - expect: '... \'foo \\n\'' + expect: '... \'foo \\n\'', }, // Whitespace is not evaluated. { send: ' \t \n', - expect: 'undefined' + expect: 'undefined', }, // Do not parse `...[]` as a REPL keyword { @@ -703,12 +703,12 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, // Bring back the repl to prompt { send: '.break', - expect: '' + expect: '', }, { send: 'console.log("Missing comma in arg list" process.version)', @@ -717,7 +717,7 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, { send: 'x = {\nfield\n{', @@ -726,7 +726,7 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, { send: '(2 + 3))', @@ -735,15 +735,15 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, { send: 'if (typeof process === "object"); {', - expect: '... ' + expect: '... ', }, { send: 'console.log("process is defined");', - expect: '... ' + expect: '... ', }, { send: '} else {', @@ -752,7 +752,7 @@ const errorTests = [ kArrow, '', /^Uncaught SyntaxError: /, - ] + ], }, { send: 'console', @@ -785,26 +785,26 @@ const errorTests = [ ' context: [Function: context]', ] : [], '}', - ] + ], }, ]; const tcpTests = [ { send: '', - expect: '' + expect: '', }, { send: 'invoke_me(333)', - expect: '\'invoked 333\'' + expect: '\'invoked 333\'', }, { send: 'a += 1', - expect: '12346' + expect: '12346', }, { send: `require(${JSON.stringify(moduleFilename)}).number`, - expect: '42' + expect: '42', }, { send: 'import comeOn from \'fhqwhgads\'', @@ -814,7 +814,7 @@ const tcpTests = [ '', 'Uncaught:', /^SyntaxError: .* dynamic import/, - ] + ], }, ]; @@ -889,7 +889,7 @@ function startUnixRepl() { prompt: prompt_unix, input: socket, output: socket, - useGlobal: true + useGlobal: true, }); replServer.context.message = message; resolveReplServer(replServer); diff --git a/test/parallel/test-require-dot.js b/test/parallel/test-require-dot.js index 7145e688d4759f..fd4f92d6bcd5d1 100644 --- a/test/parallel/test-require-dot.js +++ b/test/parallel/test-require-dot.js @@ -18,6 +18,6 @@ assert.throws( () => require('.'), { message: /Cannot find module '\.'/, - code: 'MODULE_NOT_FOUND' + code: 'MODULE_NOT_FOUND', } ); diff --git a/test/parallel/test-require-mjs.js b/test/parallel/test-require-mjs.js index 69f8527555db71..66efceb9193d50 100644 --- a/test/parallel/test-require-mjs.js +++ b/test/parallel/test-require-mjs.js @@ -6,6 +6,6 @@ assert.throws( () => require('../fixtures/es-modules/test-esm-ok.mjs'), { message: /Must use import to load ES Module/, - code: 'ERR_REQUIRE_ESM' + code: 'ERR_REQUIRE_ESM', } ); diff --git a/test/parallel/test-require-resolve.js b/test/parallel/test-require-resolve.js index e7125e39faf7c3..c57e0d3b61da6e 100644 --- a/test/parallel/test-require-resolve.js +++ b/test/parallel/test-require-resolve.js @@ -45,14 +45,14 @@ require(fixtures.path('resolve-paths', 'default', 'verify-paths.js')); () => { require.resolve(value); }, { code: 'ERR_INVALID_ARG_TYPE', - message + message, }); assert.throws( () => { require.resolve.paths(value); }, { code: 'ERR_INVALID_ARG_TYPE', - message + message, }); }); diff --git a/test/parallel/test-require-symlink.js b/test/parallel/test-require-symlink.js index 14eefcd60d32dc..0d705fe8a26c4b 100644 --- a/test/parallel/test-require-symlink.js +++ b/test/parallel/test-require-symlink.js @@ -79,7 +79,7 @@ function test() { // Also verify that symlinks works for setting preserve via env variables const childEnv = spawn(node, [linkScript], { - env: { ...process.env, NODE_PRESERVE_SYMLINKS: '1' } + env: { ...process.env, NODE_PRESERVE_SYMLINKS: '1' }, }); childEnv.on('close', function(code, signal) { assert.strictEqual(code, 0); @@ -89,7 +89,7 @@ function test() { // Also verify that symlinks works for setting preserve via env variables in // Workers. const worker = new Worker(linkScript, { - env: { ...process.env, NODE_PRESERVE_SYMLINKS: '1' } + env: { ...process.env, NODE_PRESERVE_SYMLINKS: '1' }, }); worker.on('error', (err) => { console.log('Worker failed'); @@ -103,7 +103,7 @@ function test() { // Workers with explicit execArgv. const workerArgv = new Worker(linkScript, { execArgv: [], - env: { ...process.env, NODE_PRESERVE_SYMLINKS: '1' } + env: { ...process.env, NODE_PRESERVE_SYMLINKS: '1' }, }); workerArgv.on('error', (err) => { console.log('Worker with execArgv failed'); diff --git a/test/parallel/test-set-http-max-http-headers.js b/test/parallel/test-set-http-max-http-headers.js index c4df779d2bd4fa..da7ca58e7ffe3c 100644 --- a/test/parallel/test-set-http-max-http-headers.js +++ b/test/parallel/test-set-http-max-http-headers.js @@ -34,7 +34,7 @@ test(function(cb) { console.log('running subtest expecting success'); const env = Object.assign({}, process.env, { - NODE_DEBUG: 'http' + NODE_DEBUG: 'http', }); // Validate that the test now passes if the same limit is large enough. @@ -44,7 +44,7 @@ test(function(cb) { '1024']; const cp = spawn(process.execPath, args, { env, - stdio: 'inherit' + stdio: 'inherit', }); cp.on('close', common.mustCall((code, signal) => { @@ -57,7 +57,7 @@ test(function(cb) { // Next, repeat the same checks using NODE_OPTIONS if it is supported. if (!process.config.variables.node_without_node_options) { const env = Object.assign({}, process.env, { - NODE_OPTIONS: '--max-http-header-size=1024' + NODE_OPTIONS: '--max-http-header-size=1024', }); test(function(cb) { diff --git a/test/parallel/test-socket-write-after-fin.js b/test/parallel/test-socket-write-after-fin.js index 2551d3f54f651f..5aec2512d903de 100644 --- a/test/parallel/test-socket-write-after-fin.js +++ b/test/parallel/test-socket-write-after-fin.js @@ -5,7 +5,7 @@ const net = require('net'); const expected = 'hello1hello2hello3\nbye'; const server = net.createServer({ - allowHalfOpen: true + allowHalfOpen: true, }, common.mustCall(function(sock) { let serverData = ''; diff --git a/test/parallel/test-socketaddress.js b/test/parallel/test-socketaddress.js index 4caf46dd3ee9ad..8badc372423d22 100644 --- a/test/parallel/test-socketaddress.js +++ b/test/parallel/test-socketaddress.js @@ -52,7 +52,7 @@ const { { const sa = new SocketAddress({ address: '123.123.123.123', - port: 80 + port: 80, }); strictEqual(sa.address, '123.123.123.123'); strictEqual(sa.port, 80); @@ -62,7 +62,7 @@ const { { const sa = new SocketAddress({ - family: 'ipv6' + family: 'ipv6', }); strictEqual(sa.address, '::'); strictEqual(sa.port, 0); @@ -83,28 +83,28 @@ const { [1, false, 'hello'].forEach((i) => { throws(() => new SocketAddress(i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); [1, false, {}, [], 'test'].forEach((family) => { throws(() => new SocketAddress({ family }), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); }); [1, false, {}, []].forEach((address) => { throws(() => new SocketAddress({ address }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); [-1, false, {}, []].forEach((port) => { throws(() => new SocketAddress({ port }), { - code: 'ERR_SOCKET_BAD_PORT' + code: 'ERR_SOCKET_BAD_PORT', }); }); throws(() => new SocketAddress({ flowlabel: -1 }), { - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); diff --git a/test/parallel/test-source-map-api.js b/test/parallel/test-source-map-api.js index b8ff59e365e2e9..9710a3c67cf5ee 100644 --- a/test/parallel/test-source-map-api.js +++ b/test/parallel/test-source-map-api.js @@ -15,7 +15,7 @@ const { readFileSync } = require('fs'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "payload" argument must be of type object.' + - common.invalidArgTypeHelper(invalidArg) + common.invalidArgTypeHelper(invalidArg), } ) ); @@ -31,7 +31,7 @@ const { readFileSync } = require('fs'); const { originalLine, originalColumn, - originalSource + originalSource, } = sourceMap.findEntry(0, 29); assert.strictEqual(originalLine, 2); assert.strictEqual(originalColumn, 4); @@ -64,7 +64,7 @@ const { readFileSync } = require('fs'); generatedColumn, originalLine, originalColumn, - originalSource + originalSource, } = sourceMap.findEntry( callSite.getLineNumber() - 1, callSite.getColumnNumber() - 1 @@ -87,7 +87,7 @@ const { readFileSync } = require('fs'); const { originalLine, originalColumn, - originalSource + originalSource, } = sourceMap.findEntry(0, 29); assert.strictEqual(originalLine, 2); assert.strictEqual(originalColumn, 4); @@ -150,7 +150,7 @@ const { readFileSync } = require('fs'); // Mapping from the 0th line, ${g}th column of the output file to the 0th // source file, 0th line, ${column}th column. mappings: generatedColumns.map((g, i) => `${g}AA${originalColumns[i]}`) - .join(',') + .join(','), }; } // U = 10 diff --git a/test/parallel/test-stdin-script-child.js b/test/parallel/test-stdin-script-child.js index cf83b278acd6d3..835cb0ba4c1802 100644 --- a/test/parallel/test-stdin-script-child.js +++ b/test/parallel/test-stdin-script-child.js @@ -6,7 +6,7 @@ const { spawn } = require('child_process'); for (const args of [[], ['-']]) { const child = spawn(process.execPath, args, { env: { ...process.env, - NODE_DEBUG: process.argv[2] } + NODE_DEBUG: process.argv[2] }, }); const wanted = `${child.pid}\n`; let found = ''; diff --git a/test/parallel/test-stdio-pipe-stderr.js b/test/parallel/test-stdio-pipe-stderr.js index 9dc5c758cf6c50..f6df53bb46487d 100644 --- a/test/parallel/test-stdio-pipe-stderr.js +++ b/test/parallel/test-stdio-pipe-stderr.js @@ -23,7 +23,7 @@ fs.writeFileSync(fakeModulePath, '', 'utf8'); stream.on('open', () => { spawn(process.execPath, { input: `require("${fakeModulePath.replace(/\\/g, '/')}")`, - stdio: ['pipe', 'pipe', stream] + stdio: ['pipe', 'pipe', stream], }); const stderr = fs.readFileSync(stderrOutputPath, 'utf8').trim(); assert.strictEqual( diff --git a/test/parallel/test-stdout-pipeline-destroy.js b/test/parallel/test-stdout-pipeline-destroy.js index 291579cf69d3d4..2cc03f3a3698d8 100644 --- a/test/parallel/test-stdout-pipeline-destroy.js +++ b/test/parallel/test-stdout-pipeline-destroy.js @@ -5,7 +5,7 @@ const { Transform, Readable, pipeline } = require('stream'); const assert = require('assert'); const reader = new Readable({ - read(size) { this.push('foo'); } + read(size) { this.push('foo'); }, }); let count = 0; @@ -18,7 +18,7 @@ const transform = new Transform({ this.emit('error', err); else cb(null, count.toString() + '\n'); - } + }, }); pipeline( diff --git a/test/parallel/test-stream-auto-destroy.js b/test/parallel/test-stream-auto-destroy.js index 2a1a5190debb57..2a8cbf9fdb9e07 100644 --- a/test/parallel/test-stream-auto-destroy.js +++ b/test/parallel/test-stream-auto-destroy.js @@ -11,7 +11,7 @@ const assert = require('assert'); this.push('world'); this.push(null); }, - destroy: common.mustCall((err, cb) => cb()) + destroy: common.mustCall((err, cb) => cb()), }); let ended = false; @@ -33,7 +33,7 @@ const assert = require('assert'); write(data, enc, cb) { cb(null); }, - destroy: common.mustCall((err, cb) => cb()) + destroy: common.mustCall((err, cb) => cb()), }); let finished = false; @@ -57,7 +57,7 @@ const assert = require('assert'); transform(data, enc, cb) { cb(null, data); }, - destroy: common.mustCall((err, cb) => cb()) + destroy: common.mustCall((err, cb) => cb()), }); let ended = false; @@ -87,11 +87,11 @@ const assert = require('assert'); const r = new stream.Readable({ read() { r2.emit('error', new Error('fail')); - } + }, }); const r2 = new stream.Readable({ autoDestroy: true, - destroy: common.mustCall((err, cb) => cb()) + destroy: common.mustCall((err, cb) => cb()), }); r.pipe(r2); @@ -101,11 +101,11 @@ const assert = require('assert'); const r = new stream.Readable({ read() { w.emit('error', new Error('fail')); - } + }, }); const w = new stream.Writable({ autoDestroy: true, - destroy: common.mustCall((err, cb) => cb()) + destroy: common.mustCall((err, cb) => cb()), }); r.pipe(w); diff --git a/test/parallel/test-stream-await-drain-writers-in-synchronously-recursion-write.js b/test/parallel/test-stream-await-drain-writers-in-synchronously-recursion-write.js index 110d46bb9f23cc..b159ce6b906a2d 100644 --- a/test/parallel/test-stream-await-drain-writers-in-synchronously-recursion-write.js +++ b/test/parallel/test-stream-await-drain-writers-in-synchronously-recursion-write.js @@ -3,11 +3,11 @@ const common = require('../common'); const { PassThrough } = require('stream'); const encode = new PassThrough({ - highWaterMark: 1 + highWaterMark: 1, }); const decode = new PassThrough({ - highWaterMark: 1 + highWaterMark: 1, }); const send = common.mustCall((buf) => { diff --git a/test/parallel/test-stream-backpressure.js b/test/parallel/test-stream-backpressure.js index 03bcc233c87cf0..aa485e5feea567 100644 --- a/test/parallel/test-stream-backpressure.js +++ b/test/parallel/test-stream-backpressure.js @@ -27,13 +27,13 @@ const rs = new stream.Readable({ // We will be over highWaterMark at this point // but a new call to _read is scheduled anyway. - }, 11) + }, 11), }); const ws = stream.Writable({ write: common.mustCall(function(data, enc, cb) { setImmediate(cb); - }, 41 * 10) + }, 41 * 10), }); rs.pipe(ws); diff --git a/test/parallel/test-stream-base-typechecking.js b/test/parallel/test-stream-base-typechecking.js index ae8582642344ee..4c8ebe4a7bc9e0 100644 --- a/test/parallel/test-stream-base-typechecking.js +++ b/test/parallel/test-stream-base-typechecking.js @@ -10,7 +10,7 @@ const server = net.createServer().listen(0, common.mustCall(() => { }, { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', - message: 'Second argument must be a buffer' + message: 'Second argument must be a buffer', }); client.destroy(); server.close(); diff --git a/test/parallel/test-stream-big-packet.js b/test/parallel/test-stream-big-packet.js index fdbe3cd21145ee..c24b8ccd70da57 100644 --- a/test/parallel/test-stream-big-packet.js +++ b/test/parallel/test-stream-big-packet.js @@ -39,7 +39,7 @@ class TestStream extends stream.Transform { const s1 = new stream.Transform({ transform(chunk, encoding, cb) { process.nextTick(cb, null, chunk); - } + }, }); const s2 = new stream.PassThrough(); const s3 = new TestStream(); diff --git a/test/parallel/test-stream-big-push.js b/test/parallel/test-stream-big-push.js index f9e75edd3f89d1..a7342f8a1b92b1 100644 --- a/test/parallel/test-stream-big-push.js +++ b/test/parallel/test-stream-big-push.js @@ -27,7 +27,7 @@ const str = 'asdfasdfasdfasdfasdf'; const r = new stream.Readable({ highWaterMark: 5, - encoding: 'utf8' + encoding: 'utf8', }); let reads = 0; diff --git a/test/parallel/test-stream-catch-rejections.js b/test/parallel/test-stream-catch-rejections.js index 81427c35757ca8..848ab7769370bf 100644 --- a/test/parallel/test-stream-catch-rejections.js +++ b/test/parallel/test-stream-catch-rejections.js @@ -8,7 +8,7 @@ const assert = require('assert'); const r = new stream.Readable({ captureRejections: true, read() { - } + }, }); r.push('hello'); r.push('world'); @@ -31,7 +31,7 @@ const assert = require('assert'); highWaterMark: 1, write(chunk, enc, cb) { process.nextTick(cb); - } + }, }); const err = new Error('kaboom'); diff --git a/test/parallel/test-stream-construct-async-error.js b/test/parallel/test-stream-construct-async-error.js index 34e450c853a850..f7668494d5cbd5 100644 --- a/test/parallel/test-stream-construct-async-error.js +++ b/test/parallel/test-stream-construct-async-error.js @@ -21,7 +21,7 @@ const assert = require('assert'); const foo = new Foo(); foo.on('error', common.expectsError({ - message: 'boom' + message: 'boom', })); foo.on('close', common.mustCall(() => { assert(foo._writableState.constructed); @@ -41,7 +41,7 @@ const assert = require('assert'); const foo = new Foo(); foo.destroy(); foo.on('error', common.expectsError({ - message: 'boom' + message: 'boom', })); foo.on('close', common.mustCall(() => { assert(foo.destroyed); @@ -151,7 +151,7 @@ const assert = require('assert'); const foo = new Foo(); foo.end('hello'); foo.on('error', common.expectsError({ - message: 'boom' + message: 'boom', })); foo.on('close', common.mustCall()); } @@ -209,7 +209,7 @@ const assert = require('assert'); foo.end('hello'); foo.on('data', common.mustCall()); foo.on('error', common.expectsError({ - message: 'boom' + message: 'boom', })); foo.on('close', common.mustCall()); } @@ -252,7 +252,7 @@ const assert = require('assert'); const foo = new Foo(); foo.end('hello'); foo.on('error', common.expectsError({ - message: 'boom' + message: 'boom', })); foo.on('close', common.mustCall()); } diff --git a/test/parallel/test-stream-construct.js b/test/parallel/test-stream-construct.js index 907b9aa0e3e296..07fa3f501fd077 100644 --- a/test/parallel/test-stream-construct.js +++ b/test/parallel/test-stream-construct.js @@ -10,10 +10,10 @@ const assert = require('assert'); construct: common.mustCall((callback) => { callback(); callback(); - }) + }), }).on('error', common.expectsError({ name: 'Error', - code: 'ERR_MULTIPLE_CALLBACK' + code: 'ERR_MULTIPLE_CALLBACK', })); } @@ -23,10 +23,10 @@ const assert = require('assert'); construct: common.mustCall((callback) => { callback(); callback(); - }) + }), }).on('error', common.expectsError({ name: 'Error', - code: 'ERR_MULTIPLE_CALLBACK' + code: 'ERR_MULTIPLE_CALLBACK', })); } @@ -36,10 +36,10 @@ const assert = require('assert'); new Writable({ construct: common.mustCall((callback) => { callback(new Error('test')); - }) + }), }).on('error', common.expectsError({ name: 'Error', - message: 'test' + message: 'test', })); } @@ -49,10 +49,10 @@ const assert = require('assert'); new Readable({ construct: common.mustCall((callback) => { callback(new Error('test')); - }) + }), }).on('error', common.expectsError({ name: 'Error', - message: 'test' + message: 'test', })); } @@ -62,10 +62,10 @@ const assert = require('assert'); new Writable({ construct: common.mustCall((callback) => { process.nextTick(callback, new Error('test')); - }) + }), }).on('error', common.expectsError({ name: 'Error', - message: 'test' + message: 'test', })); } @@ -75,10 +75,10 @@ const assert = require('assert'); new Readable({ construct: common.mustCall((callback) => { process.nextTick(callback, new Error('test')); - }) + }), }).on('error', common.expectsError({ name: 'Error', - message: 'test' + message: 'test', })); } @@ -89,7 +89,7 @@ function testDestroy(factory) { construct: common.mustCall((cb) => { constructed = true; process.nextTick(cb); - }) + }), }); s.on('close', common.mustCall(() => { assert.strictEqual(constructed, true); @@ -103,7 +103,7 @@ function testDestroy(factory) { construct: common.mustCall((cb) => { constructed = true; process.nextTick(cb); - }) + }), }); s.on('close', common.mustCall(() => { assert.strictEqual(constructed, true); @@ -119,7 +119,7 @@ function testDestroy(factory) { construct: common.mustCall((cb) => { constructed = true; process.nextTick(cb); - }) + }), }); s.on('close', common.mustCall(() => { assert.strictEqual(constructed, true); @@ -134,7 +134,7 @@ function testDestroy(factory) { construct: common.mustCall((cb) => { constructed = true; process.nextTick(cb); - }) + }), }); s.on('close', common.mustCall(() => { assert.strictEqual(constructed, true); @@ -154,7 +154,7 @@ function testDestroy(factory) { construct: common.mustCall((cb) => { constructed = true; process.nextTick(cb); - }) + }), }); s.on('error', common.mustCall(() => { assert.strictEqual(constructed, true); @@ -167,12 +167,12 @@ function testDestroy(factory) { } testDestroy((opts) => new Readable({ read: common.mustNotCall(), - ...opts + ...opts, })); testDestroy((opts) => new Writable({ write: common.mustNotCall(), final: common.mustNotCall(), - ...opts + ...opts, })); { @@ -186,7 +186,7 @@ testDestroy((opts) => new Writable({ read: common.mustCall(() => { assert.strictEqual(constructed, true); r.push(null); - }) + }), }); r.on('close', common.mustCall(() => { assert.strictEqual(constructed, true); @@ -209,7 +209,7 @@ testDestroy((opts) => new Writable({ final: common.mustCall((cb) => { assert.strictEqual(constructed, true); process.nextTick(cb); - }) + }), }); w.on('close', common.mustCall(() => { assert.strictEqual(constructed, true); @@ -229,7 +229,7 @@ testDestroy((opts) => new Writable({ final: common.mustCall((cb) => { assert.strictEqual(constructed, true); process.nextTick(cb); - }) + }), }); w.on('close', common.mustCall(() => { assert.strictEqual(constructed, true); @@ -239,7 +239,7 @@ testDestroy((opts) => new Writable({ { new Duplex({ - construct: common.mustCall() + construct: common.mustCall(), }); } @@ -260,7 +260,7 @@ testDestroy((opts) => new Writable({ }, read() { this.push(null); - } + }, }); d.resume(); d.end('foo'); @@ -275,6 +275,6 @@ testDestroy((opts) => new Writable({ construct: common.mustCall((callback) => { callback(); }), - read: common.mustNotCall() + read: common.mustNotCall(), }); } diff --git a/test/parallel/test-stream-decoder-objectmode.js b/test/parallel/test-stream-decoder-objectmode.js index 4c572fed6b665b..7f51d39f9b4757 100644 --- a/test/parallel/test-stream-decoder-objectmode.js +++ b/test/parallel/test-stream-decoder-objectmode.js @@ -7,7 +7,7 @@ const assert = require('assert'); const readable = new stream.Readable({ read: () => {}, encoding: 'utf16le', - objectMode: true + objectMode: true, }); readable.push(Buffer.from('abc', 'utf16le')); diff --git a/test/parallel/test-stream-destroy-event-order.js b/test/parallel/test-stream-destroy-event-order.js index a88fff820dedb9..9f2e6da0520148 100644 --- a/test/parallel/test-stream-destroy-event-order.js +++ b/test/parallel/test-stream-destroy-event-order.js @@ -5,7 +5,7 @@ const assert = require('assert'); const { Readable } = require('stream'); const rs = new Readable({ - read() {} + read() {}, }); let closed = false; diff --git a/test/parallel/test-stream-duplex-destroy.js b/test/parallel/test-stream-duplex-destroy.js index 1894bb7ad67617..122491756fbcb8 100644 --- a/test/parallel/test-stream-duplex-destroy.js +++ b/test/parallel/test-stream-duplex-destroy.js @@ -7,7 +7,7 @@ const assert = require('assert'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); duplex.resume(); @@ -23,7 +23,7 @@ const assert = require('assert'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); duplex.resume(); @@ -42,7 +42,7 @@ const assert = require('assert'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); duplex._destroy = common.mustCall(function(err, cb) { @@ -69,7 +69,7 @@ const assert = require('assert'); destroy: common.mustCall(function(err, cb) { assert.strictEqual(err, expected); cb(); - }) + }), }); duplex.resume(); @@ -87,7 +87,7 @@ const assert = require('assert'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); duplex._destroy = common.mustCall(function(err, cb) { @@ -102,7 +102,7 @@ const assert = require('assert'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); duplex.resume(); @@ -132,7 +132,7 @@ const assert = require('assert'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); const expected = new Error('kaboom'); @@ -156,7 +156,7 @@ const assert = require('assert'); const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, read() {}, - allowHalfOpen: true + allowHalfOpen: true, }); duplex.resume(); diff --git a/test/parallel/test-stream-duplex-end.js b/test/parallel/test-stream-duplex-end.js index 2c7706146eb882..5673330d289e6b 100644 --- a/test/parallel/test-stream-duplex-end.js +++ b/test/parallel/test-stream-duplex-end.js @@ -6,7 +6,7 @@ const Duplex = require('stream').Duplex; { const stream = new Duplex({ - read() {} + read() {}, }); assert.strictEqual(stream.allowHalfOpen, true); stream.on('finish', common.mustNotCall()); @@ -18,7 +18,7 @@ const Duplex = require('stream').Duplex; { const stream = new Duplex({ read() {}, - allowHalfOpen: false + allowHalfOpen: false, }); assert.strictEqual(stream.allowHalfOpen, false); stream.on('finish', common.mustCall()); @@ -30,7 +30,7 @@ const Duplex = require('stream').Duplex; { const stream = new Duplex({ read() {}, - allowHalfOpen: false + allowHalfOpen: false, }); assert.strictEqual(stream.allowHalfOpen, false); stream._writableState.ended = true; diff --git a/test/parallel/test-stream-duplex-props.js b/test/parallel/test-stream-duplex-props.js index aa6b23125a9d9d..0b2e6dff72ad98 100644 --- a/test/parallel/test-stream-duplex-props.js +++ b/test/parallel/test-stream-duplex-props.js @@ -7,7 +7,7 @@ const { Duplex } = require('stream'); { const d = new Duplex({ objectMode: true, - highWaterMark: 100 + highWaterMark: 100, }); assert.strictEqual(d.writableObjectMode, true); @@ -21,7 +21,7 @@ const { Duplex } = require('stream'); readableObjectMode: false, readableHighWaterMark: 10, writableObjectMode: true, - writableHighWaterMark: 100 + writableHighWaterMark: 100, }); assert.strictEqual(d.writableObjectMode, true); diff --git a/test/parallel/test-stream-duplex-readable-end.js b/test/parallel/test-stream-duplex-readable-end.js index 0e3e62aacb14bc..27729568ee7c6e 100644 --- a/test/parallel/test-stream-duplex-readable-end.js +++ b/test/parallel/test-stream-duplex-readable-end.js @@ -10,14 +10,14 @@ const src = new stream.Readable({ read() { if (loops--) this.push(Buffer.alloc(20000)); - } + }, }); const dst = new stream.Transform({ transform(chunk, output, fn) { this.push(null); fn(); - } + }, }); src.pipe(dst); diff --git a/test/parallel/test-stream-finished.js b/test/parallel/test-stream-finished.js index 43b1e36a547402..d45fde7b338171 100644 --- a/test/parallel/test-stream-finished.js +++ b/test/parallel/test-stream-finished.js @@ -7,7 +7,7 @@ const { Transform, finished, Duplex, - PassThrough + PassThrough, } = require('stream'); const assert = require('assert'); const EE = require('events'); @@ -17,7 +17,7 @@ const http = require('http'); { const rs = new Readable({ - read() {} + read() {}, }); finished(rs, common.mustSucceed()); @@ -30,7 +30,7 @@ const http = require('http'); const ws = new Writable({ write(data, enc, cb) { cb(); - } + }, }); finished(ws, common.mustSucceed()); @@ -42,7 +42,7 @@ const http = require('http'); const tr = new Transform({ transform(data, enc, cb) { cb(); - } + }, }); let finish = false; @@ -173,7 +173,7 @@ const http = require('http'); const rs = fs.createReadStream('file-does-not-exist'); finished(rs, common.expectsError({ - code: 'ENOENT' + code: 'ENOENT', })); } @@ -202,28 +202,28 @@ const http = require('http'); // Test faulty input values and options. { const rs = new Readable({ - read() {} + read() {}, }); assert.throws( () => finished(rs, 'foo'), { code: 'ERR_INVALID_ARG_TYPE', - message: /callback/ + message: /callback/, } ); assert.throws( () => finished(rs, 'foo', () => {}), { code: 'ERR_INVALID_ARG_TYPE', - message: /options/ + message: /options/, } ); assert.throws( () => finished(rs, {}, 'foo'), { code: 'ERR_INVALID_ARG_TYPE', - message: /callback/ + message: /callback/, } ); @@ -238,7 +238,7 @@ const http = require('http'); const ws = new Writable({ write(data, env, cb) { cb(); - } + }, }); const removeListener = finished(ws, common.mustNotCall()); removeListener(); @@ -285,7 +285,7 @@ const http = require('http'); const w = new Writable({ write(chunk, encoding, callback) { setImmediate(callback); - } + }, }); finished(w, common.mustCall((err) => { assert.strictEqual(err.code, 'ERR_STREAM_PREMATURE_CLOSE'); @@ -323,7 +323,7 @@ function testClosed(factory) { destroyed = true; cb(); }); - } + }, }); s.destroy(); finished(s, common.mustCall(() => { @@ -339,7 +339,7 @@ function testClosed(factory) { destroy(err, cb) { cb(); finished(s, common.mustCall()); - } + }, }); s.destroy(); } @@ -355,7 +355,7 @@ function testClosed(factory) { finished(s, common.mustCall()); }); }); - } + }, }); s.destroy(); } @@ -369,7 +369,7 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); write(chunk, encoding, cb) { cb(); }, - autoDestroy: false + autoDestroy: false, }); w.end('asd'); process.nextTick(() => { @@ -382,7 +382,7 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); write(chunk, encoding, cb) { cb(new Error()); }, - autoDestroy: false + autoDestroy: false, }); w.write('asd'); w.on('error', common.mustCall(() => { @@ -392,7 +392,7 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); { const r = new Readable({ - autoDestroy: false + autoDestroy: false, }); r.push(null); r.resume(); @@ -436,7 +436,7 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); final(cb) { }, // Never close writable side for test purpose read() { this.push(null); - } + }, }); d.on('end', common.mustCall()); @@ -452,7 +452,7 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); final(cb) { }, // Never close writable side for test purpose read() { this.push(null); - } + }, }); d.on('end', common.mustCall()); @@ -482,7 +482,7 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); class HelloWorld extends Duplex { constructor(response) { super({ - autoDestroy: false + autoDestroy: false, }); this.response = response; @@ -564,7 +564,7 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); .listen(0, function() { http.request({ method: 'GET', - port: this.address().port + port: this.address().port, }).end() .on('response', common.mustCall()); }); @@ -581,7 +581,7 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); })).listen(0, function() { http.request({ method: 'GET', - port: this.address().port + port: this.address().port, }).end().on('error', common.mustCall()); }); } @@ -591,7 +591,7 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); const w = new Writable({ write(chunk, encoding, callback) { process.nextTick(callback); - } + }, }); w.aborted = false; w.end(); diff --git a/test/parallel/test-stream-inheritance.js b/test/parallel/test-stream-inheritance.js index 658bd2be338f78..c5c8fdcd073752 100644 --- a/test/parallel/test-stream-inheritance.js +++ b/test/parallel/test-stream-inheritance.js @@ -53,7 +53,7 @@ assert.throws( { code: 'ERR_ASSERTION', constructor: assert.AssertionError, - message: 'undefined does not inherit from CustomWritable' + message: 'undefined does not inherit from CustomWritable', } ); diff --git a/test/parallel/test-stream-objectmode-undefined.js b/test/parallel/test-stream-objectmode-undefined.js index 64b960f92b4995..8e02f42912a698 100644 --- a/test/parallel/test-stream-objectmode-undefined.js +++ b/test/parallel/test-stream-objectmode-undefined.js @@ -9,7 +9,7 @@ const { Readable, Writable, Transform } = require('stream'); read: common.mustCall(() => { stream.push(undefined); stream.push(null); - }) + }), }); stream.on('data', common.mustCall((chunk) => { @@ -22,7 +22,7 @@ const { Readable, Writable, Transform } = require('stream'); objectMode: true, write: common.mustCall((chunk) => { assert.strictEqual(chunk, undefined); - }) + }), }); stream.write(undefined); @@ -33,7 +33,7 @@ const { Readable, Writable, Transform } = require('stream'); objectMode: true, transform: common.mustCall((chunk) => { stream.push(chunk); - }) + }), }); stream.on('data', common.mustCall((chunk) => { diff --git a/test/parallel/test-stream-pipe-await-drain-manual-resume.js b/test/parallel/test-stream-pipe-await-drain-manual-resume.js index a95a5e05aea9ef..58d1579bde71a8 100644 --- a/test/parallel/test-stream-pipe-await-drain-manual-resume.js +++ b/test/parallel/test-stream-pipe-await-drain-manual-resume.js @@ -7,7 +7,7 @@ const assert = require('assert'); // where it buffers the chunk it receives rather than indicating that they // have been consumed. const writable = new stream.Writable({ - highWaterMark: 5 + highWaterMark: 5, }); let isCurrentlyBufferingWrites = true; @@ -21,7 +21,7 @@ writable._write = (chunk, encoding, cb) => { }; const readable = new stream.Readable({ - read() {} + read() {}, }); readable.pipe(writable); diff --git a/test/parallel/test-stream-pipe-await-drain-push-while-write.js b/test/parallel/test-stream-pipe-await-drain-push-while-write.js index a717291cda2b03..dbe7bcc5549cd4 100644 --- a/test/parallel/test-stream-pipe-await-drain-push-while-write.js +++ b/test/parallel/test-stream-pipe-await-drain-push-while-write.js @@ -20,7 +20,7 @@ const writable = new stream.Writable({ } process.nextTick(cb); - }, 3) + }, 3), }); // A readable stream which produces two buffers. @@ -30,7 +30,7 @@ const readable = new stream.Readable({ while (bufs.length > 0) { this.push(bufs.shift()); } - } + }, }); readable.pipe(writable); diff --git a/test/parallel/test-stream-pipe-error-unhandled.js b/test/parallel/test-stream-pipe-error-unhandled.js index 42c1ce77fe4878..5497380eae241c 100644 --- a/test/parallel/test-stream-pipe-error-unhandled.js +++ b/test/parallel/test-stream-pipe-error-unhandled.js @@ -10,11 +10,11 @@ process.on('uncaughtException', common.mustCall((err) => { const r = new Readable({ read() { this.push('asd'); - } + }, }); const w = new Writable({ autoDestroy: true, - write() {} + write() {}, }); r.pipe(w); diff --git a/test/parallel/test-stream-pipe-flow-after-unpipe.js b/test/parallel/test-stream-pipe-flow-after-unpipe.js index 048b7ea5e53163..58b0a8c87becb3 100644 --- a/test/parallel/test-stream-pipe-flow-after-unpipe.js +++ b/test/parallel/test-stream-pipe-flow-after-unpipe.js @@ -8,7 +8,7 @@ const { Readable, Writable } = require('stream'); const rs = new Readable({ highWaterMark: 1, // That this gets called at least 20 times is the real test here. - read: common.mustCallAtLeast(() => rs.push('foo'), 20) + read: common.mustCallAtLeast(() => rs.push('foo'), 20), }); const ws = new Writable({ @@ -16,7 +16,7 @@ const ws = new Writable({ write: common.mustCall(() => { // Ignore the callback, this write() simply never finishes. setImmediate(() => rs.unpipe(ws)); - }) + }), }); let chunks = 0; diff --git a/test/parallel/test-stream-pipe-flow.js b/test/parallel/test-stream-pipe-flow.js index 1f2e8f54cec409..836c7070af8c7f 100644 --- a/test/parallel/test-stream-pipe-flow.js +++ b/test/parallel/test-stream-pipe-flow.js @@ -13,13 +13,13 @@ const { Readable, Writable, PassThrough } = require('stream'); return process.nextTick(() => rs.push({})); rs.push({}); rs.push(null); - } + }, }); const ws = new Writable({ highWaterMark: 0, objectMode: true, - write: (data, end, cb) => setImmediate(cb) + write: (data, end, cb) => setImmediate(cb), }); rs.on('end', common.mustCall()); @@ -35,7 +35,7 @@ const { Readable, Writable, PassThrough } = require('stream'); read: () => { if (missing--) rs.push({}); else rs.push(null); - } + }, }); const pt = rs @@ -60,7 +60,7 @@ const { Readable, Writable, PassThrough } = require('stream'); wrapper.push(data); } }); - } + }, }); wrapper.resume(); diff --git a/test/parallel/test-stream-pipe-manual-resume.js b/test/parallel/test-stream-pipe-manual-resume.js index 08269acfd3b015..53cc611524bb84 100644 --- a/test/parallel/test-stream-pipe-manual-resume.js +++ b/test/parallel/test-stream-pipe-manual-resume.js @@ -15,14 +15,14 @@ function test(throwCodeInbetween) { rs.push({ counter }); else rs.push(null); - }, n) + }, n), }); const ws = stream.Writable({ objectMode: true, write: common.mustCall((data, enc, cb) => { setImmediate(cb); - }, n) + }, n), }); setImmediate(() => throwCodeInbetween(rs, ws)); diff --git a/test/parallel/test-stream-pipe-multiple-pipes.js b/test/parallel/test-stream-pipe-multiple-pipes.js index 890c274b9d9f51..00272f8ad17fc7 100644 --- a/test/parallel/test-stream-pipe-multiple-pipes.js +++ b/test/parallel/test-stream-pipe-multiple-pipes.js @@ -4,7 +4,7 @@ const stream = require('stream'); const assert = require('assert'); const readable = new stream.Readable({ - read: () => {} + read: () => {}, }); const writables = []; @@ -14,7 +14,7 @@ for (let i = 0; i < 5; i++) { write: common.mustCall((chunk, encoding, callback) => { target.output.push(chunk); callback(); - }, 1) + }, 1), }); target.output = []; diff --git a/test/parallel/test-stream-pipe-needDrain.js b/test/parallel/test-stream-pipe-needDrain.js index 7faf45417a5f4a..7208ceaa521c6b 100644 --- a/test/parallel/test-stream-pipe-needDrain.js +++ b/test/parallel/test-stream-pipe-needDrain.js @@ -10,7 +10,7 @@ const { Readable, Writable } = require('stream'); write(buf, encoding, callback) { process.nextTick(callback); }, - highWaterMark: 1 + highWaterMark: 1, }); while (w.write('asd')); @@ -21,7 +21,7 @@ const { Readable, Writable } = require('stream'); read() { this.push('asd'); this.push(null); - } + }, }); r.on('pause', common.mustCall(2)); diff --git a/test/parallel/test-stream-pipe-same-destination-twice.js b/test/parallel/test-stream-pipe-same-destination-twice.js index ff71639588ea49..8dc015dcebfde9 100644 --- a/test/parallel/test-stream-pipe-same-destination-twice.js +++ b/test/parallel/test-stream-pipe-same-destination-twice.js @@ -13,7 +13,7 @@ const { PassThrough, Writable } = require('stream'); write: common.mustCall((chunk, encoding, cb) => { assert.strictEqual(`${chunk}`, 'foobar'); cb(); - }) + }), }); passThrough.pipe(dest); @@ -40,7 +40,7 @@ const { PassThrough, Writable } = require('stream'); write: common.mustCall((chunk, encoding, cb) => { assert.strictEqual(`${chunk}`, 'foobar'); cb(); - }, 2) + }, 2), }); passThrough.pipe(dest); @@ -57,7 +57,7 @@ const { PassThrough, Writable } = require('stream'); { const passThrough = new PassThrough(); const dest = new Writable({ - write: common.mustNotCall() + write: common.mustNotCall(), }); passThrough.pipe(dest); diff --git a/test/parallel/test-stream-pipeline-async-iterator.js b/test/parallel/test-stream-pipeline-async-iterator.js index 06a2ed6ca877f8..29611c6cca5367 100644 --- a/test/parallel/test-stream-pipeline-async-iterator.js +++ b/test/parallel/test-stream-pipeline-async-iterator.js @@ -9,7 +9,7 @@ const _err = new Error('kaboom'); async function run() { const source = new Readable({ read() { - } + }, }); source.push('hello'); source.push('world'); diff --git a/test/parallel/test-stream-pipeline-http2.js b/test/parallel/test-stream-pipeline-http2.js index d7ff08888afb8a..ae70a2e2429553 100644 --- a/test/parallel/test-stream-pipeline-http2.js +++ b/test/parallel/test-stream-pipeline-http2.js @@ -19,7 +19,7 @@ const http2 = require('http2'); const rs = new Readable({ read() { rs.push('hello'); - } + }, }); pipeline(rs, req, common.mustCall((err) => { diff --git a/test/parallel/test-stream-pipeline-queued-end-in-destroy.js b/test/parallel/test-stream-pipeline-queued-end-in-destroy.js index d5e399ddda531b..ae319f814f3679 100644 --- a/test/parallel/test-stream-pipeline-queued-end-in-destroy.js +++ b/test/parallel/test-stream-pipeline-queued-end-in-destroy.js @@ -9,7 +9,7 @@ const { Readable, Duplex, pipeline } = require('stream'); // Refs: https://github.com/nodejs/node/issues/24456 const readable = new Readable({ - read: common.mustCall(() => {}) + read: common.mustCall(() => {}), }); const duplex = new Duplex({ @@ -22,7 +22,7 @@ const duplex = new Duplex({ // do at the time of writing. this.end(); cb(err); - } + }, }); duplex.on('finished', common.mustNotCall()); diff --git a/test/parallel/test-stream-pipeline-uncaught.js b/test/parallel/test-stream-pipeline-uncaught.js index bfac4f1fee8d0b..d3d5e3358a2f9d 100644 --- a/test/parallel/test-stream-pipeline-uncaught.js +++ b/test/parallel/test-stream-pipeline-uncaught.js @@ -3,7 +3,7 @@ const common = require('../common'); const { pipeline, - PassThrough + PassThrough, } = require('stream'); const assert = require('assert'); diff --git a/test/parallel/test-stream-pipeline.js b/test/parallel/test-stream-pipeline.js index e2e5fe2e0d561a..114c3634718011 100644 --- a/test/parallel/test-stream-pipeline.js +++ b/test/parallel/test-stream-pipeline.js @@ -26,14 +26,14 @@ const net = require('net'); ]; const read = new Readable({ - read() {} + read() {}, }); const write = new Writable({ write(data, enc, cb) { processed.push(data); cb(); - } + }, }); write.on('finish', () => { @@ -53,7 +53,7 @@ const net = require('net'); { const read = new Readable({ - read() {} + read() {}, }); assert.throws(() => { @@ -69,13 +69,13 @@ const net = require('net'); { const read = new Readable({ - read() {} + read() {}, }); const write = new Writable({ write(data, enc, cb) { cb(); - } + }, }); read.push('data'); @@ -88,13 +88,13 @@ const net = require('net'); { const read = new Readable({ - read() {} + read() {}, }); const write = new Writable({ write(data, enc, cb) { cb(); - } + }, }); read.push('data'); @@ -109,19 +109,19 @@ const net = require('net'); { const read = new Readable({ - read() {} + read() {}, }); const transform = new Transform({ transform(data, enc, cb) { cb(new Error('kaboom')); - } + }, }); const write = new Writable({ write(data, enc, cb) { cb(); - } + }, }); read.on('close', common.mustCall()); @@ -149,7 +149,7 @@ const net = require('net'); read() { rs.push('hello'); rs.push(null); - } + }, }); pipeline(rs, res, () => {}); @@ -157,7 +157,7 @@ const net = require('net'); server.listen(0, () => { const req = http.request({ - port: server.address().port + port: server.address().port, }); req.end(); @@ -189,7 +189,7 @@ const net = require('net'); destroy: common.mustCall((err, cb) => { // Prevents fd leaks by destroying http pipelines cb(); - }) + }), }); pipeline(rs, res, () => {}); @@ -197,7 +197,7 @@ const net = require('net'); server.listen(0, () => { const req = http.request({ - port: server.address().port + port: server.address().port, }); req.end(); @@ -222,7 +222,7 @@ const net = require('net'); }, destroy: common.mustCall((err, cb) => { cb(); - }) + }), }); pipeline(rs, res, () => {}); @@ -235,12 +235,12 @@ const net = require('net'); cnt--; if (cnt === 0) cb(new Error('kaboom')); else cb(); - } + }, }); server.listen(0, () => { const req = http.request({ - port: server.address().port + port: server.address().port, }); req.end(); @@ -260,7 +260,7 @@ const net = require('net'); server.listen(0, () => { const req = http.request({ - port: server.address().port + port: server.address().port, }); let sent = 0; @@ -270,7 +270,7 @@ const net = require('net'); return; } rs.push('hello'); - } + }, }); pipeline(rs, req, common.mustCall(() => { @@ -292,7 +292,7 @@ const net = require('net'); const tr = new Transform({ transform(data, enc, cb) { cb(null, data); - } + }, }); tr.on('close', common.mustCall()); @@ -302,7 +302,7 @@ const net = require('net'); const rs = new Readable({ read() { rs.push('hello'); - } + }, }); let cnt = 10; @@ -312,7 +312,7 @@ const net = require('net'); cnt--; if (cnt === 0) return cb(new Error('kaboom')); cb(); - } + }, }); rs.on('close', common.mustCall()); @@ -356,14 +356,14 @@ const net = require('net'); rs.push(expected[i]); } rs.push(null); - } + }, }); const ws = new Writable({ write(data, enc, cb) { assert.deepStrictEqual(data, expected.shift()); cb(); - } + }, }); let finished = false; @@ -411,13 +411,13 @@ const net = require('net'); const rs = new Readable({ read() { rs.destroy(new Error('stop')); - } + }, }); const ws = new Writable({ write(data, enc, cb) { cb(); - } + }, }); let finished = false; @@ -443,13 +443,13 @@ const net = require('net'); async function run() { const read = new Readable({ - read() {} + read() {}, }); const write = new Writable({ write(data, enc, cb) { cb(); - } + }, }); read.push('data'); @@ -484,7 +484,7 @@ const net = require('net'); const w = new Writable({ write(chunk, encoding, callback) { callback(); - } + }, }); await pipelinePromise(producer, w, { signal }); } @@ -509,7 +509,7 @@ const net = require('net'); const w = new Writable({ write(chunk, encoding, callback) { callback(); - } + }, }); await pipelinePromise(producer, w, { signal }); } @@ -531,7 +531,7 @@ const net = require('net'); const w = new Writable({ write(chunk, encoding, callback) { callback(); - } + }, }); await pipelinePromise(producer, w, { signal }); } @@ -541,19 +541,19 @@ const net = require('net'); { const read = new Readable({ - read() {} + read() {}, }); const transform = new Transform({ transform(data, enc, cb) { cb(new Error('kaboom')); - } + }, }); const write = new Writable({ write(data, enc, cb) { cb(); - } + }, }); assert.throws( @@ -592,7 +592,7 @@ const net = require('net'); write(chunk, encoding, callback) { res += chunk; callback(); - } + }, }); pipeline(function*() { yield 'hello'; @@ -608,7 +608,7 @@ const net = require('net'); write(chunk, encoding, callback) { res += chunk; callback(); - } + }, }); pipeline(async function*() { await Promise.resolve(); @@ -625,7 +625,7 @@ const net = require('net'); write(chunk, encoding, callback) { res += chunk; callback(); - } + }, }); pipeline(function*() { yield 'hello'; @@ -641,7 +641,7 @@ const net = require('net'); write(chunk, encoding, callback) { res += chunk; callback(); - } + }, }); pipeline(async function*() { await Promise.resolve(); @@ -906,7 +906,7 @@ const net = require('net'); }, new Transform({ transform(chunk, encoding, cb) { cb(new Error('kaboom')); - } + }, }), async function(source) { for await (const chunk of source) { res += chunk; @@ -926,7 +926,7 @@ const net = require('net'); }, new Transform({ transform(chunk, encoding, cb) { process.nextTick(cb, new Error('kaboom')); - } + }, }), async function(source) { for await (const chunk of source) { res += chunk; @@ -947,7 +947,7 @@ const net = require('net'); decodeStrings: false, transform(chunk, encoding, cb) { cb(null, chunk.toUpperCase()); - } + }, }), async function(source) { for await (const chunk of source) { res += chunk; @@ -987,7 +987,7 @@ const net = require('net'); const w = new Writable({ write(chunk, encoding, cb) { cb(); - } + }, }); pipeline(r, w, (err) => { assert.strictEqual(err, undefined); @@ -1003,7 +1003,7 @@ const net = require('net'); server.listen(0, () => { const req = http.request({ - port: server.address().port + port: server.address().port, }); const body = new PassThrough(); @@ -1047,10 +1047,10 @@ const net = require('net'); setImmediate(() => { rs.push('hello'); }); - } + }, }); const ws = new Writable({ - write: common.mustNotCall() + write: common.mustNotCall(), }); pipeline(rs, async function*(stream) { /* eslint no-unused-vars: off */ @@ -1080,7 +1080,7 @@ const net = require('net'); server.listen(0, () => { const req = http.request({ method: 'PUT', - port: server.address().port + port: server.address().port, }); req.end('asd123'); req.on('response', common.mustCall()); @@ -1137,12 +1137,12 @@ const net = require('net'); read() {}, destroy(err, cb) { process.nextTick(cb); - } + }, }); const dst = new Writable({ write(chunk, encoding, callback) { callback(); - } + }, }); src.on('close', () => { closed = true; @@ -1159,7 +1159,7 @@ const net = require('net'); read() {}, destroy(err, cb) { process.nextTick(cb); - } + }, }); const dst = new Duplex({}); src.on('close', common.mustCall(() => { @@ -1201,13 +1201,13 @@ const net = require('net'); cb(); }, 1000); }), - destroy: common.mustNotCall() + destroy: common.mustNotCall(), }); const sink = new Writable({ write: common.mustCall((data, enc, cb) => { cb(); - }) + }), }); pipeline(d, sink, common.mustSucceed()); @@ -1248,13 +1248,13 @@ const net = require('net'); // `destroy()` won't be invoked by pipeline since // the writable side has not completed when // the pipeline has completed. - destroy: common.mustNotCall() + destroy: common.mustNotCall(), }); const sink = new Writable({ write: common.mustCall((data, enc, cb) => { cb(); - }) + }), }); pipeline(d, sink, common.mustSucceed()); @@ -1265,7 +1265,7 @@ const net = require('net'); { const r = new Readable({ - read() {} + read() {}, }); r.push('hello'); r.push('world'); @@ -1275,7 +1275,7 @@ const net = require('net'); write(chunk, encoding, callback) { res += chunk; callback(); - } + }, }); pipeline([r, w], common.mustSucceed(() => { assert.strictEqual(res, 'helloworld'); @@ -1344,7 +1344,7 @@ const net = require('net'); write(chunk, encoding, callback) { res += chunk; callback(); - } + }, }); const cb = common.mustCall((err) => { assert.strictEqual(err.name, 'AbortError'); diff --git a/test/parallel/test-stream-promises.js b/test/parallel/test-stream-promises.js index 33bfa292720da1..7221f5848574d8 100644 --- a/test/parallel/test-stream-promises.js +++ b/test/parallel/test-stream-promises.js @@ -31,14 +31,14 @@ assert.strictEqual(finished, promisify(stream.finished)); ]; const read = new Readable({ - read() { } + read() { }, }); const write = new Writable({ write(data, enc, cb) { processed.push(data); cb(); - } + }, }); write.on('finish', () => { @@ -59,13 +59,13 @@ assert.strictEqual(finished, promisify(stream.finished)); // pipeline error { const read = new Readable({ - read() { } + read() { }, }); const write = new Writable({ write(data, enc, cb) { cb(); - } + }, }); read.push('data'); @@ -98,6 +98,6 @@ assert.strictEqual(finished, promisify(stream.finished)); const rs = fs.createReadStream('file-does-not-exist'); assert.rejects(finished(rs), { - code: 'ENOENT' + code: 'ENOENT', }).then(common.mustCall()); } diff --git a/test/parallel/test-stream-push-order.js b/test/parallel/test-stream-push-order.js index ce4f336b0254d5..9d757483f6d9ad 100644 --- a/test/parallel/test-stream-push-order.js +++ b/test/parallel/test-stream-push-order.js @@ -26,7 +26,7 @@ const assert = require('assert'); const s = new Readable({ highWaterMark: 20, - encoding: 'ascii' + encoding: 'ascii', }); const list = ['1', '2', '3', '4', '5', '6']; diff --git a/test/parallel/test-stream-readable-async-iterators.js b/test/parallel/test-stream-readable-async-iterators.js index 7c457fdc3da24b..bf0db6a7a87fbb 100644 --- a/test/parallel/test-stream-readable-async-iterators.js +++ b/test/parallel/test-stream-readable-async-iterators.js @@ -6,7 +6,7 @@ const { Readable, Transform, PassThrough, - pipeline + pipeline, } = require('stream'); const assert = require('assert'); const http = require('http'); @@ -86,7 +86,7 @@ async function tests() { const max = 5; const readable = new Readable({ objectMode: true, - read() {} + read() {}, }); const iter = readable[Symbol.asyncIterator](); @@ -115,7 +115,7 @@ async function tests() { console.log('read without for..await deferred'); const readable = new Readable({ objectMode: true, - read() {} + read() {}, }); const iter = readable[Symbol.asyncIterator](); @@ -156,7 +156,7 @@ async function tests() { const max = 3; const readable = new Readable({ objectMode: true, - read() {} + read() {}, }); const iter = readable[Symbol.asyncIterator](); @@ -199,7 +199,7 @@ async function tests() { { console.log('call next() after error'); const readable = new Readable({ - read() {} + read() {}, }); const iterator = readable[Symbol.asyncIterator](); @@ -220,7 +220,7 @@ async function tests() { if (++readed === max) { this.push(null); } - } + }, }); for await (const k of readable) { @@ -237,7 +237,7 @@ async function tests() { objectMode: true, read() { this.destroy(new Error('kaboom from read')); - } + }, }); let err; @@ -263,7 +263,7 @@ async function tests() { this.destroy(new Error('kaboom')); }); } - } + }, }); let received = 0; @@ -288,7 +288,7 @@ async function tests() { objectMode: true, read() { this.push('hello'); - } + }, }); let err = null; @@ -312,7 +312,7 @@ async function tests() { read() { this.push('hello'); this.destroy(new Error('kaboom')); - } + }, }); let received = 0; @@ -361,7 +361,7 @@ async function tests() { this.push(null); } }); - } + }, }); for await (const k of readable) { @@ -384,7 +384,7 @@ async function tests() { this.push(null); } }); - } + }, }); let expected = ''; @@ -407,7 +407,7 @@ async function tests() { const readable = new Readable({ read() { // no-op - } + }, }); readable.destroy(); @@ -421,7 +421,7 @@ async function tests() { const readable = new Readable({ read() { // no-op - } + }, }); const passthrough = new PassThrough(); @@ -447,7 +447,7 @@ async function tests() { this.push('asdf'); this.push('hehe'); this.push(null); - } + }, }); // eslint-disable-next-line no-unused-vars for await (const a of r) { @@ -464,7 +464,7 @@ async function tests() { read() { this.push('asdf'); this.push('hehe'); - } + }, }); // eslint-disable-next-line no-unused-vars @@ -477,7 +477,7 @@ async function tests() { console.log('readable side of a transform stream pushes null'); const transform = new Transform({ objectMode: true, - transform: (chunk, enc, cb) => { cb(null, chunk); } + transform: (chunk, enc, cb) => { cb(null, chunk); }, }); transform.push(0); transform.push(1); @@ -502,7 +502,7 @@ async function tests() { const r = new Readable({ objectMode: true, read() { - } + }, }); const b = r[Symbol.asyncIterator](); @@ -518,7 +518,7 @@ async function tests() { const r = new Readable({ objectMode: true, read() { - } + }, }); const b = r[Symbol.asyncIterator](); @@ -534,7 +534,7 @@ async function tests() { const r = new Readable({ objectMode: true, read() { - } + }, }); const b = r[Symbol.asyncIterator](); @@ -572,7 +572,7 @@ async function tests() { }, destroy(err, callback) { setTimeout(() => callback(_err), 1); - } + }, }); r.destroy(); @@ -591,7 +591,7 @@ async function tests() { read() { this.push('asd'); this.push(null); - } + }, }); for await (const chunk of r) {} // eslint-disable-line no-unused-vars @@ -606,7 +606,7 @@ async function tests() { autoDestroy: false, read() { this.push('asd'); - } + }, }); for await (const chunk of r) { // eslint-disable-line no-unused-vars @@ -622,7 +622,7 @@ async function tests() { read() { this.push('asd'); this.push(null); - } + }, }).on('end', () => { assert.strictEqual(r.destroyed, false); }); @@ -640,7 +640,7 @@ async function tests() { const r = new Readable({ objectMode: true, read() { - } + }, }); const originalDestroy = r.destroy; @@ -661,7 +661,7 @@ async function tests() { const r = new Readable({ objectMode: true, read() { - } + }, }); const originalDestroy = r.destroy; @@ -680,7 +680,7 @@ async function tests() { const r = new Readable({ objectMode: true, read() { - } + }, }); r.destroy(); diff --git a/test/parallel/test-stream-readable-data.js b/test/parallel/test-stream-readable-data.js index 277adddde63584..f8e642776c2b83 100644 --- a/test/parallel/test-stream-readable-data.js +++ b/test/parallel/test-stream-readable-data.js @@ -4,7 +4,7 @@ const common = require('../common'); const { Readable } = require('stream'); const readable = new Readable({ - read() {} + read() {}, }); function read() {} diff --git a/test/parallel/test-stream-readable-destroy.js b/test/parallel/test-stream-readable-destroy.js index 9ba3f9cd3653d6..690380ea9f7cd1 100644 --- a/test/parallel/test-stream-readable-destroy.js +++ b/test/parallel/test-stream-readable-destroy.js @@ -6,7 +6,7 @@ const assert = require('assert'); { const read = new Readable({ - read() {} + read() {}, }); read.resume(); @@ -18,7 +18,7 @@ const assert = require('assert'); { const read = new Readable({ - read() {} + read() {}, }); read.resume(); @@ -36,7 +36,7 @@ const assert = require('assert'); { const read = new Readable({ - read() {} + read() {}, }); read._destroy = common.mustCall(function(err, cb) { @@ -62,7 +62,7 @@ const assert = require('assert'); destroy: common.mustCall(function(err, cb) { assert.strictEqual(err, expected); cb(); - }) + }), }); const expected = new Error('kaboom'); @@ -79,7 +79,7 @@ const assert = require('assert'); { const read = new Readable({ - read() {} + read() {}, }); read._destroy = common.mustCall(function(err, cb) { @@ -93,7 +93,7 @@ const assert = require('assert'); { const read = new Readable({ - read() {} + read() {}, }); read.resume(); @@ -119,7 +119,7 @@ const assert = require('assert'); { const read = new Readable({ - read() {} + read() {}, }); const expected = new Error('kaboom'); @@ -147,7 +147,7 @@ const assert = require('assert'); { const read = new Readable({ - read() {} + read() {}, }); read.resume(); @@ -175,7 +175,7 @@ const assert = require('assert'); { // Destroy and destroy callback const read = new Readable({ - read() {} + read() {}, }); read.resume(); @@ -207,7 +207,7 @@ const assert = require('assert'); destroy: common.mustCall(function(err, cb) { process.nextTick(cb, new Error('kaboom 1')); }), - read() {} + read() {}, }); let ticked = false; @@ -237,7 +237,7 @@ const assert = require('assert'); { const read = new Readable({ - read() {} + read() {}, }); read.destroy(); @@ -247,7 +247,7 @@ const assert = require('assert'); { const read = new Readable({ - read: common.mustNotCall(function() {}) + read: common.mustNotCall(function() {}), }); read.destroy(); assert.strictEqual(read.destroyed, true); @@ -260,7 +260,7 @@ const assert = require('assert'); read() { this.push(null); this.push('asd'); - } + }, }); read.on('error', common.mustCall(() => { @@ -306,7 +306,7 @@ const assert = require('assert'); objectMode: true, read() { return false; - } + }, })); read.push('asd'); diff --git a/test/parallel/test-stream-readable-emit-readable-short-stream.js b/test/parallel/test-stream-readable-emit-readable-short-stream.js index d8b84bfbe71d6e..0ed9774db9f5b5 100644 --- a/test/parallel/test-stream-readable-emit-readable-short-stream.js +++ b/test/parallel/test-stream-readable-emit-readable-short-stream.js @@ -9,7 +9,7 @@ const assert = require('assert'); read: common.mustCall(function() { this.push('content'); this.push(null); - }) + }), }); const t = new stream.Transform({ @@ -19,7 +19,7 @@ const assert = require('assert'); }), flush: common.mustCall(function(callback) { return callback(); - }) + }), }); r.pipe(t); @@ -42,7 +42,7 @@ const assert = require('assert'); }), flush: common.mustCall(function(callback) { return callback(); - }) + }), }); t.end('content'); @@ -65,7 +65,7 @@ const assert = require('assert'); }), flush: common.mustCall(function(callback) { return callback(); - }) + }), }); t.write('content'); @@ -84,7 +84,7 @@ const assert = require('assert'); { const t = new stream.Readable({ read() { - } + }, }); t.on('readable', common.mustCall(function() { @@ -103,7 +103,7 @@ const assert = require('assert'); { const t = new stream.Readable({ read() { - } + }, }); t.on('readable', common.mustCall(function() { @@ -129,7 +129,7 @@ const assert = require('assert'); }), flush: common.mustCall(function(callback) { return callback(); - }) + }), }); t.on('readable', common.mustCall(function() { diff --git a/test/parallel/test-stream-readable-emittedReadable.js b/test/parallel/test-stream-readable-emittedReadable.js index ba613f9e9ff19d..46912f60ae91eb 100644 --- a/test/parallel/test-stream-readable-emittedReadable.js +++ b/test/parallel/test-stream-readable-emittedReadable.js @@ -4,7 +4,7 @@ const assert = require('assert'); const Readable = require('stream').Readable; const readable = new Readable({ - read: () => {} + read: () => {}, }); // Initialized to false. @@ -40,7 +40,7 @@ setImmediate(common.mustCall(() => { })); const noRead = new Readable({ - read: () => {} + read: () => {}, }); noRead.on('readable', common.mustCall(() => { @@ -55,7 +55,7 @@ noRead.push('foo'); noRead.push(null); const flowing = new Readable({ - read: () => {} + read: () => {}, }); flowing.on('data', common.mustCall(() => { diff --git a/test/parallel/test-stream-readable-event.js b/test/parallel/test-stream-readable-event.js index 4f2383508aa61c..b042384c56517b 100644 --- a/test/parallel/test-stream-readable-event.js +++ b/test/parallel/test-stream-readable-event.js @@ -29,7 +29,7 @@ const Readable = require('stream').Readable; // First test, not reading when the readable is added. // make sure that on('readable', ...) triggers a readable event. const r = new Readable({ - highWaterMark: 3 + highWaterMark: 3, }); r._read = common.mustNotCall(); @@ -49,7 +49,7 @@ const Readable = require('stream').Readable; // already a length, while it IS reading. const r = new Readable({ - highWaterMark: 3 + highWaterMark: 3, }); r._read = common.mustCall(); @@ -68,7 +68,7 @@ const Readable = require('stream').Readable; // Third test, not reading when the stream has not passed // the highWaterMark but *has* reached EOF. const r = new Readable({ - highWaterMark: 30 + highWaterMark: 30, }); r._read = common.mustNotCall(); diff --git a/test/parallel/test-stream-readable-infinite-read.js b/test/parallel/test-stream-readable-infinite-read.js index 3df3e39a73ec36..939c21ea6863f0 100644 --- a/test/parallel/test-stream-readable-infinite-read.js +++ b/test/parallel/test-stream-readable-infinite-read.js @@ -9,7 +9,7 @@ const buf = Buffer.alloc(8192); const readable = new Readable({ read: common.mustCall(function() { this.push(buf); - }, 31) + }, 31), }); let i = 0; diff --git a/test/parallel/test-stream-readable-invalid-chunk.js b/test/parallel/test-stream-readable-invalid-chunk.js index 0fcc76ae73fae3..31f4fc9e9c9592 100644 --- a/test/parallel/test-stream-readable-invalid-chunk.js +++ b/test/parallel/test-stream-readable-invalid-chunk.js @@ -5,11 +5,11 @@ const stream = require('stream'); function testPushArg(val) { const readable = new stream.Readable({ - read: () => {} + read: () => {}, }); readable.on('error', common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', })); readable.push(val); } @@ -20,11 +20,11 @@ testPushArg(0); function testUnshiftArg(val) { const readable = new stream.Readable({ - read: () => {} + read: () => {}, }); readable.on('error', common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', })); readable.unshift(val); } diff --git a/test/parallel/test-stream-readable-needReadable.js b/test/parallel/test-stream-readable-needReadable.js index c4bc90bb19d3e2..1ed8bdb2feaf48 100644 --- a/test/parallel/test-stream-readable-needReadable.js +++ b/test/parallel/test-stream-readable-needReadable.js @@ -4,7 +4,7 @@ const assert = require('assert'); const Readable = require('stream').Readable; const readable = new Readable({ - read: () => {} + read: () => {}, }); // Initialized to false. @@ -28,7 +28,7 @@ readable.on('end', common.mustCall(() => { })); const asyncReadable = new Readable({ - read: () => {} + read: () => {}, }); asyncReadable.on('readable', common.mustCall(() => { @@ -52,7 +52,7 @@ setImmediate(common.mustCall(() => { })); const flowing = new Readable({ - read: () => {} + read: () => {}, }); // Notice this must be above the on('data') call. @@ -70,7 +70,7 @@ flowing.on('data', common.mustCall(function(data) { }, 3)); const slowProducer = new Readable({ - read: () => {} + read: () => {}, }); slowProducer.on('readable', common.mustCall(() => { diff --git a/test/parallel/test-stream-readable-next-no-null.js b/test/parallel/test-stream-readable-next-no-null.js index 64ca40be11ed03..d77039f7d20574 100644 --- a/test/parallel/test-stream-readable-next-no-null.js +++ b/test/parallel/test-stream-readable-next-no-null.js @@ -11,7 +11,7 @@ const stream = Readable.from(generate()); stream.on('error', expectsError({ code: 'ERR_STREAM_NULL_VALUES', name: 'TypeError', - message: 'May not write null values to stream' + message: 'May not write null values to stream', })); stream.on('data', mustNotCall((chunk) => {})); diff --git a/test/parallel/test-stream-readable-no-unneeded-readable.js b/test/parallel/test-stream-readable-no-unneeded-readable.js index 20092b57d95871..680ce6d3ea8b73 100644 --- a/test/parallel/test-stream-readable-no-unneeded-readable.js +++ b/test/parallel/test-stream-readable-no-unneeded-readable.js @@ -32,7 +32,7 @@ function test(r) { { const source = new Readable({ - read: () => {} + read: () => {}, }); source.push('foo'); source.push('bar'); diff --git a/test/parallel/test-stream-readable-object-multi-push-async.js b/test/parallel/test-stream-readable-object-multi-push-async.js index 17c84c7310e053..7105d56ca43cb4 100644 --- a/test/parallel/test-stream-readable-object-multi-push-async.js +++ b/test/parallel/test-stream-readable-object-multi-push-async.js @@ -27,7 +27,7 @@ const BATCH = 10; console.log('pushing'); data.forEach((d) => this.push(d)); }); - }, Math.floor(MAX / BATCH) + 2) + }, Math.floor(MAX / BATCH) + 2), }); let i = 0; @@ -77,7 +77,7 @@ const BATCH = 10; console.log('pushing'); data.forEach((d) => this.push(d)); }); - }, Math.floor(MAX / BATCH) + 2) + }, Math.floor(MAX / BATCH) + 2), }); let i = 0; @@ -122,7 +122,7 @@ const BATCH = 10; this.push(null); } }); - }, Math.floor(MAX / BATCH) + 1) + }, Math.floor(MAX / BATCH) + 1), }); let i = 0; @@ -147,7 +147,7 @@ const BATCH = 10; { const readable = new Readable({ objectMode: true, - read: common.mustNotCall() + read: common.mustNotCall(), }); readable.on('data', common.mustNotCall()); @@ -167,7 +167,7 @@ const BATCH = 10; { const readable = new Readable({ objectMode: true, - read: common.mustCall() + read: common.mustCall(), }); readable.on('data', (data) => { diff --git a/test/parallel/test-stream-readable-pause-and-resume.js b/test/parallel/test-stream-readable-pause-and-resume.js index 294ef2c35d4608..2b43941594f73d 100644 --- a/test/parallel/test-stream-readable-pause-and-resume.js +++ b/test/parallel/test-stream-readable-pause-and-resume.js @@ -14,7 +14,7 @@ const rs = new Readable({ return process.nextTick(() => rs.push({})); rs.push({}); rs.push(null); - } + }, }); rs.on('end', common.mustCall()); @@ -42,7 +42,7 @@ function readAndPause() { { const readable = new Readable({ - read() {} + read() {}, }); function read() {} diff --git a/test/parallel/test-stream-readable-readable-then-resume.js b/test/parallel/test-stream-readable-readable-then-resume.js index 63dbc306e739f2..9dd72a245281fa 100644 --- a/test/parallel/test-stream-readable-readable-then-resume.js +++ b/test/parallel/test-stream-readable-readable-then-resume.js @@ -18,7 +18,7 @@ check(new Readable({ } this.push(null); - } + }, })); function check(s) { diff --git a/test/parallel/test-stream-readable-readable.js b/test/parallel/test-stream-readable-readable.js index 6e1a7fb32e3080..2373487eac88b8 100644 --- a/test/parallel/test-stream-readable-readable.js +++ b/test/parallel/test-stream-readable-readable.js @@ -6,7 +6,7 @@ const { Readable } = require('stream'); { const r = new Readable({ - read() {} + read() {}, }); assert.strictEqual(r.readable, true); r.destroy(); @@ -16,7 +16,7 @@ const { Readable } = require('stream'); { const mustNotCall = common.mustNotCall(); const r = new Readable({ - read() {} + read() {}, }); assert.strictEqual(r.readable, true); r.on('end', mustNotCall); @@ -36,7 +36,7 @@ const { Readable } = require('stream'); r.destroy(new Error()); assert.strictEqual(r.readable, false); }); - }) + }), }); r.resume(); r.on('error', common.mustCall(() => { diff --git a/test/parallel/test-stream-readable-reading-readingMore.js b/test/parallel/test-stream-readable-reading-readingMore.js index f616b460488e75..537c9fd272baf6 100644 --- a/test/parallel/test-stream-readable-reading-readingMore.js +++ b/test/parallel/test-stream-readable-reading-readingMore.js @@ -5,7 +5,7 @@ const Readable = require('stream').Readable; { const readable = new Readable({ - read(size) {} + read(size) {}, }); const state = readable._readableState; @@ -65,7 +65,7 @@ const Readable = require('stream').Readable; { const readable = new Readable({ - read(size) {} + read(size) {}, }); const state = readable._readableState; @@ -115,7 +115,7 @@ const Readable = require('stream').Readable; { const readable = new Readable({ - read(size) {} + read(size) {}, }); const state = readable._readableState; diff --git a/test/parallel/test-stream-readable-resume-hwm.js b/test/parallel/test-stream-readable-resume-hwm.js index 3f0bbad243b0a2..0332807cf5b831 100644 --- a/test/parallel/test-stream-readable-resume-hwm.js +++ b/test/parallel/test-stream-readable-resume-hwm.js @@ -7,7 +7,7 @@ const { Readable } = require('stream'); const readable = new Readable({ read: common.mustNotCall(), - highWaterMark: 100 + highWaterMark: 100, }); // Fill up the internal buffer so that we definitely exceed the HWM: diff --git a/test/parallel/test-stream-readable-unpipe-resume.js b/test/parallel/test-stream-readable-unpipe-resume.js index b40f724bccfc83..f2daf98d695aa8 100644 --- a/test/parallel/test-stream-readable-unpipe-resume.js +++ b/test/parallel/test-stream-readable-unpipe-resume.js @@ -10,7 +10,7 @@ const transformStream = new stream.Transform({ transform: common.mustCall(() => { readStream.unpipe(); readStream.resume(); - }) + }), }); readStream.on('end', common.mustCall()); diff --git a/test/parallel/test-stream-readable-with-unimplemented-_read.js b/test/parallel/test-stream-readable-with-unimplemented-_read.js index 16ec2ac8cd8852..c7e626b1c1db0f 100644 --- a/test/parallel/test-stream-readable-with-unimplemented-_read.js +++ b/test/parallel/test-stream-readable-with-unimplemented-_read.js @@ -13,6 +13,6 @@ assert.throws( { code: 'ERR_METHOD_NOT_IMPLEMENTED', name: 'Error', - message: 'The _read() method is not implemented' + message: 'The _read() method is not implemented', } ); diff --git a/test/parallel/test-stream-readableListening-state.js b/test/parallel/test-stream-readableListening-state.js index 5e3071faf370e5..550572c50feccd 100644 --- a/test/parallel/test-stream-readableListening-state.js +++ b/test/parallel/test-stream-readableListening-state.js @@ -5,7 +5,7 @@ const assert = require('assert'); const stream = require('stream'); const r = new stream.Readable({ - read: () => {} + read: () => {}, }); // readableListening state should start in `false`. @@ -19,7 +19,7 @@ r.on('readable', common.mustCall(() => { r.push(Buffer.from('Testing readableListening state')); const r2 = new stream.Readable({ - read: () => {} + read: () => {}, }); // readableListening state should start in `false`. diff --git a/test/parallel/test-stream-transform-callback-twice.js b/test/parallel/test-stream-transform-callback-twice.js index bf2ccdcde45b9e..03e099b02bc894 100644 --- a/test/parallel/test-stream-transform-callback-twice.js +++ b/test/parallel/test-stream-transform-callback-twice.js @@ -2,13 +2,13 @@ const common = require('../common'); const { Transform } = require('stream'); const stream = new Transform({ - transform(chunk, enc, cb) { cb(); cb(); } + transform(chunk, enc, cb) { cb(); cb(); }, }); stream.on('error', common.expectsError({ name: 'Error', message: 'Callback called multiple times', - code: 'ERR_MULTIPLE_CALLBACK' + code: 'ERR_MULTIPLE_CALLBACK', })); stream.write('foo'); diff --git a/test/parallel/test-stream-transform-constructor-set-methods.js b/test/parallel/test-stream-transform-constructor-set-methods.js index a20a1a07cffee8..4def63c63c91f9 100644 --- a/test/parallel/test-stream-transform-constructor-set-methods.js +++ b/test/parallel/test-stream-transform-constructor-set-methods.js @@ -13,7 +13,7 @@ assert.throws( { name: 'Error', code: 'ERR_METHOD_NOT_IMPLEMENTED', - message: 'The _transform() method is not implemented' + message: 'The _transform() method is not implemented', } ); @@ -32,7 +32,7 @@ const _flush = common.mustCall((next) => { const t2 = new Transform({ transform: _transform, flush: _flush, - final: _final + final: _final, }); assert.strictEqual(t2._transform, _transform); diff --git a/test/parallel/test-stream-transform-destroy.js b/test/parallel/test-stream-transform-destroy.js index c594d9989ae4de..6313e3a82456e0 100644 --- a/test/parallel/test-stream-transform-destroy.js +++ b/test/parallel/test-stream-transform-destroy.js @@ -6,7 +6,7 @@ const assert = require('assert'); { const transform = new Transform({ - transform(chunk, enc, cb) {} + transform(chunk, enc, cb) {}, }); transform.resume(); @@ -20,7 +20,7 @@ const assert = require('assert'); { const transform = new Transform({ - transform(chunk, enc, cb) {} + transform(chunk, enc, cb) {}, }); transform.resume(); @@ -38,7 +38,7 @@ const assert = require('assert'); { const transform = new Transform({ - transform(chunk, enc, cb) {} + transform(chunk, enc, cb) {}, }); transform._destroy = common.mustCall(function(err, cb) { @@ -64,7 +64,7 @@ const assert = require('assert'); destroy: common.mustCall(function(err, cb) { assert.strictEqual(err, expected); cb(); - }, 1) + }, 1), }); transform.resume(); @@ -80,7 +80,7 @@ const assert = require('assert'); { const transform = new Transform({ - transform(chunk, enc, cb) {} + transform(chunk, enc, cb) {}, }); transform._destroy = common.mustCall(function(err, cb) { @@ -93,7 +93,7 @@ const assert = require('assert'); { const transform = new Transform({ - transform(chunk, enc, cb) {} + transform(chunk, enc, cb) {}, }); transform.resume(); @@ -122,7 +122,7 @@ const assert = require('assert'); { const transform = new Transform({ - transform(chunk, enc, cb) {} + transform(chunk, enc, cb) {}, }); const expected = new Error('kaboom'); diff --git a/test/parallel/test-stream-transform-final-sync.js b/test/parallel/test-stream-transform-final-sync.js index 5cc80703ee76c1..cd61571df161fa 100644 --- a/test/parallel/test-stream-transform-final-sync.js +++ b/test/parallel/test-stream-transform-final-sync.js @@ -85,7 +85,7 @@ const t = new stream.Transform({ assert.strictEqual(state, 13); done(); }); - }, 1) + }, 1), }); t.on('finish', common.mustCall(function() { state++; diff --git a/test/parallel/test-stream-transform-final.js b/test/parallel/test-stream-transform-final.js index e0b2b7e40f7610..d9085fa60c6c51 100644 --- a/test/parallel/test-stream-transform-final.js +++ b/test/parallel/test-stream-transform-final.js @@ -87,7 +87,7 @@ const t = new stream.Transform({ assert.strictEqual(state, 13); done(); }); - }, 1) + }, 1), }); t.on('finish', common.mustCall(function() { state++; diff --git a/test/parallel/test-stream-transform-flush-data.js b/test/parallel/test-stream-transform-flush-data.js index 51e2c8bc5254e3..f762a83174a381 100644 --- a/test/parallel/test-stream-transform-flush-data.js +++ b/test/parallel/test-stream-transform-flush-data.js @@ -19,7 +19,7 @@ function _flush(n) { const t = new Transform({ transform: _transform, - flush: _flush + flush: _flush, }); t.end(Buffer.from('blerg')); diff --git a/test/parallel/test-stream-transform-split-highwatermark.js b/test/parallel/test-stream-transform-split-highwatermark.js index 22d13fd3c3b0e3..8cee6f0f2ec1fa 100644 --- a/test/parallel/test-stream-transform-split-highwatermark.js +++ b/test/parallel/test-stream-transform-split-highwatermark.js @@ -70,7 +70,7 @@ testTransform(0, 0, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.readableHighWaterMark' is invalid. " + - 'Received NaN' + 'Received NaN', }); assert.throws(() => { @@ -79,7 +79,7 @@ testTransform(0, 0, { name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.writableHighWaterMark' is invalid. " + - 'Received NaN' + 'Received NaN', }); } diff --git a/test/parallel/test-stream-uint8array.js b/test/parallel/test-stream-uint8array.js index 38a45d54048967..36f26799930f8b 100644 --- a/test/parallel/test-stream-uint8array.js +++ b/test/parallel/test-stream-uint8array.js @@ -22,7 +22,7 @@ const GHI = new Uint8Array([0x47, 0x48, 0x49]); } cb(); - }, 2) + }, 2), }); writable.write(ABC); @@ -40,7 +40,7 @@ const GHI = new Uint8Array([0x47, 0x48, 0x49]); assert.strictEqual(chunk, ABC); assert.strictEqual(encoding, 'utf8'); cb(); - }) + }), }); writable.end(ABC); @@ -62,7 +62,7 @@ const GHI = new Uint8Array([0x47, 0x48, 0x49]); assert.strictEqual(chunks[0].encoding, 'buffer'); assert.strictEqual(chunks[1].encoding, 'buffer'); assert.strictEqual(chunks[0].chunk + chunks[1].chunk, 'DEFGHI'); - }) + }), }); writable.write(ABC); @@ -74,7 +74,7 @@ const GHI = new Uint8Array([0x47, 0x48, 0x49]); { // Simple Readable test. const readable = new Readable({ - read() {} + read() {}, }); readable.push(DEF); @@ -88,7 +88,7 @@ const GHI = new Uint8Array([0x47, 0x48, 0x49]); { // Readable test, setEncoding. const readable = new Readable({ - read() {} + read() {}, }); readable.setEncoding('utf8'); diff --git a/test/parallel/test-stream-unshift-read-race.js b/test/parallel/test-stream-unshift-read-race.js index fe110ea285521e..2f937c2d2cf143 100644 --- a/test/parallel/test-stream-unshift-read-race.js +++ b/test/parallel/test-stream-unshift-read-race.js @@ -76,7 +76,7 @@ function pushError() { }, { code: 'ERR_STREAM_PUSH_AFTER_EOF', name: 'Error', - message: 'stream.push() after EOF' + message: 'stream.push() after EOF', }); } diff --git a/test/parallel/test-stream-wrap-encoding.js b/test/parallel/test-stream-wrap-encoding.js index 6678aeb62671be..7316b8b3eaa761 100644 --- a/test/parallel/test-stream-wrap-encoding.js +++ b/test/parallel/test-stream-wrap-encoding.js @@ -8,7 +8,7 @@ const Duplex = require('stream').Duplex; { const stream = new Duplex({ read() {}, - write() {} + write() {}, }); stream.setEncoding('ascii'); @@ -18,7 +18,7 @@ const Duplex = require('stream').Duplex; wrap.on('error', common.expectsError({ name: 'Error', code: 'ERR_STREAM_WRAP', - message: 'Stream has StringDecoder set or is in objectMode' + message: 'Stream has StringDecoder set or is in objectMode', })); stream.push('ohai'); @@ -28,7 +28,7 @@ const Duplex = require('stream').Duplex; const stream = new Duplex({ read() {}, write() {}, - objectMode: true + objectMode: true, }); const wrap = new StreamWrap(stream); @@ -36,7 +36,7 @@ const Duplex = require('stream').Duplex; wrap.on('error', common.expectsError({ name: 'Error', code: 'ERR_STREAM_WRAP', - message: 'Stream has StringDecoder set or is in objectMode' + message: 'Stream has StringDecoder set or is in objectMode', })); stream.push(new Error('foo')); diff --git a/test/parallel/test-stream-wrap.js b/test/parallel/test-stream-wrap.js index 670c05fe3f0307..ee9dbf71cfbd44 100644 --- a/test/parallel/test-stream-wrap.js +++ b/test/parallel/test-stream-wrap.js @@ -13,7 +13,7 @@ function testShutdown(callback) { read: function() { }, write: function() { - } + }, }); const wrap = new StreamWrap(stream); diff --git a/test/parallel/test-stream-writable-callback-twice.js b/test/parallel/test-stream-writable-callback-twice.js index 25e7579a2d4737..bc8c59c74896f1 100644 --- a/test/parallel/test-stream-writable-callback-twice.js +++ b/test/parallel/test-stream-writable-callback-twice.js @@ -2,13 +2,13 @@ const common = require('../common'); const { Writable } = require('stream'); const stream = new Writable({ - write(chunk, enc, cb) { cb(); cb(); } + write(chunk, enc, cb) { cb(); cb(); }, }); stream.on('error', common.expectsError({ name: 'Error', message: 'Callback called multiple times', - code: 'ERR_MULTIPLE_CALLBACK' + code: 'ERR_MULTIPLE_CALLBACK', })); stream.write('foo'); diff --git a/test/parallel/test-stream-writable-change-default-encoding.js b/test/parallel/test-stream-writable-change-default-encoding.js index 3fb9796251c16d..9efec6b9b627f8 100644 --- a/test/parallel/test-stream-writable-change-default-encoding.js +++ b/test/parallel/test-stream-writable-change-default-encoding.js @@ -65,7 +65,7 @@ assert.throws(() => { }, { name: 'TypeError', code: 'ERR_UNKNOWN_ENCODING', - message: 'Unknown encoding: {}' + message: 'Unknown encoding: {}', }); (function checkVairableCaseEncoding() { diff --git a/test/parallel/test-stream-writable-constructor-set-methods.js b/test/parallel/test-stream-writable-constructor-set-methods.js index 34fda8edda9fc1..1ffeaae5d4820b 100644 --- a/test/parallel/test-stream-writable-constructor-set-methods.js +++ b/test/parallel/test-stream-writable-constructor-set-methods.js @@ -14,7 +14,7 @@ assert.throws( { name: 'Error', code: 'ERR_METHOD_NOT_IMPLEMENTED', - message: 'The _write() method is not implemented' + message: 'The _write() method is not implemented', } ); diff --git a/test/parallel/test-stream-writable-destroy.js b/test/parallel/test-stream-writable-destroy.js index 2e6e1f975a2be1..835af970962370 100644 --- a/test/parallel/test-stream-writable-destroy.js +++ b/test/parallel/test-stream-writable-destroy.js @@ -6,7 +6,7 @@ const assert = require('assert'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.on('finish', common.mustNotCall()); @@ -21,7 +21,7 @@ const assert = require('assert'); write(chunk, enc, cb) { this.destroy(new Error('asd')); cb(); - } + }, }); write.on('error', common.mustCall()); @@ -32,7 +32,7 @@ const assert = require('assert'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); const expected = new Error('kaboom'); @@ -49,7 +49,7 @@ const assert = require('assert'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write._destroy = function(err, cb) { @@ -75,7 +75,7 @@ const assert = require('assert'); destroy: common.mustCall(function(err, cb) { assert.strictEqual(err, expected); cb(); - }) + }), }); const expected = new Error('kaboom'); @@ -92,7 +92,7 @@ const assert = require('assert'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write._destroy = common.mustCall(function(err, cb) { @@ -106,7 +106,7 @@ const assert = require('assert'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write._destroy = common.mustCall(function(err, cb) { @@ -131,7 +131,7 @@ const assert = require('assert'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); const expected = new Error('kaboom'); @@ -154,7 +154,7 @@ const assert = require('assert'); { // double error case const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); let ticked = false; @@ -183,7 +183,7 @@ const assert = require('assert'); }), write(chunk, enc, cb) { cb(); - } + }, }); let ticked = false; @@ -215,7 +215,7 @@ const assert = require('assert'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.destroyed = true; @@ -242,7 +242,7 @@ const assert = require('assert'); { // Destroy and destroy callback const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.destroy(); @@ -260,7 +260,7 @@ const assert = require('assert'); const write = new Writable({ write: common.mustNotCall(), final: common.mustCall((cb) => cb(), 2), - autoDestroy: true + autoDestroy: true, }); write.end(); @@ -278,13 +278,13 @@ const assert = require('assert'); write.write('asd', common.expectsError({ name: 'Error', code: 'ERR_STREAM_DESTROYED', - message: 'Cannot call write after a stream was destroyed' + message: 'Cannot call write after a stream was destroyed', })); } { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.on('error', common.mustNotCall()); @@ -297,13 +297,13 @@ const assert = require('assert'); write.write('asd', common.expectsError({ name: 'Error', code: 'ERR_STREAM_DESTROYED', - message: 'Cannot call write after a stream was destroyed' + message: 'Cannot call write after a stream was destroyed', })); write.destroy(); write.write('asd', common.expectsError({ name: 'Error', code: 'ERR_STREAM_DESTROYED', - message: 'Cannot call write after a stream was destroyed' + message: 'Cannot call write after a stream was destroyed', })); write.uncork(); } @@ -312,7 +312,7 @@ const assert = require('assert'); // Call end(cb) after error & destroy const write = new Writable({ - write(chunk, enc, cb) { cb(new Error('asd')); } + write(chunk, enc, cb) { cb(new Error('asd')); }, }); write.on('error', common.mustCall(() => { write.destroy(); @@ -330,7 +330,7 @@ const assert = require('assert'); // Call end(cb) after finish & destroy const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.on('finish', common.mustCall(() => { write.destroy(); @@ -349,7 +349,7 @@ const assert = require('assert'); // unhandled exception. const write = new Writable({ - write(chunk, enc, cb) { process.nextTick(cb); } + write(chunk, enc, cb) { process.nextTick(cb); }, }); write.once('error', common.mustCall((err) => { assert.strictEqual(err.message, 'asd'); @@ -367,7 +367,7 @@ const assert = require('assert'); write(chunk, enc, cb) { process.nextTick(cb, new Error('asd')); }, - autoDestroy: false + autoDestroy: false, }); write.cork(); write.write('asd', common.mustCall((err) => { @@ -391,7 +391,7 @@ const assert = require('assert'); // `setImmediate()` is used on purpose to ensure the callback is called // after `process.nextTick()` callbacks. setImmediate(cb); - } + }, }); write.write('asd', common.mustCall(() => { assert.strictEqual(state++, 0); @@ -409,7 +409,7 @@ const assert = require('assert'); write(chunk, enc, cb) { cb(); cb(); - } + }, }); write.on('error', common.mustCall(() => { @@ -421,7 +421,7 @@ const assert = require('assert'); { const ac = new AbortController(); const write = addAbortSignal(ac.signal, new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, })); write.on('error', common.mustCall((e) => { @@ -436,7 +436,7 @@ const assert = require('assert'); const ac = new AbortController(); const write = new Writable({ signal: ac.signal, - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.on('error', common.mustCall((e) => { @@ -452,7 +452,7 @@ const assert = require('assert'); const write = new Writable({ signal, - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.on('error', common.mustCall((e) => { @@ -464,7 +464,7 @@ const assert = require('assert'); { // Destroy twice const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.end(common.mustCall()); diff --git a/test/parallel/test-stream-writable-end-cb-error.js b/test/parallel/test-stream-writable-end-cb-error.js index 20428f1777fd17..587d11ad35ac61 100644 --- a/test/parallel/test-stream-writable-end-cb-error.js +++ b/test/parallel/test-stream-writable-end-cb-error.js @@ -54,7 +54,7 @@ const stream = require('stream'); }, finish(callback) { setImmediate(callback); - } + }, }); w.end('testing ended state', common.mustCall((err) => { // This errors since .destroy(err), which is invoked by errors diff --git a/test/parallel/test-stream-writable-finish-destroyed.js b/test/parallel/test-stream-writable-finish-destroyed.js index 207b4aa11abfae..0d61227e169db1 100644 --- a/test/parallel/test-stream-writable-finish-destroyed.js +++ b/test/parallel/test-stream-writable-finish-destroyed.js @@ -9,7 +9,7 @@ const { Writable } = require('stream'); w.on('close', common.mustCall(() => { cb(); })); - }) + }), }); w.on('finish', common.mustNotCall()); @@ -24,7 +24,7 @@ const { Writable } = require('stream'); cb(); w.end(); })); - }) + }), }); w.on('finish', common.mustNotCall()); diff --git a/test/parallel/test-stream-writable-finished.js b/test/parallel/test-stream-writable-finished.js index 862587784a4430..1bfc78be1f7c8f 100644 --- a/test/parallel/test-stream-writable-finished.js +++ b/test/parallel/test-stream-writable-finished.js @@ -35,7 +35,7 @@ const assert = require('assert'); const w = new Writable({ write(chunk, encoding, cb) { cb(); - } + }, }); w.end(); @@ -48,7 +48,7 @@ const assert = require('assert'); const w = new Writable({ write(chunk, encoding, cb) { cb(); - } + }, }); let sync = true; @@ -68,7 +68,7 @@ const assert = require('assert'); }, final(cb) { cb(); - } + }, }); let sync = true; @@ -91,7 +91,7 @@ const assert = require('assert'); final: common.mustCall((cb) => { assert.strictEqual(sync, true); cb(); - }) + }), }); w.end(); diff --git a/test/parallel/test-stream-writable-invalid-chunk.js b/test/parallel/test-stream-writable-invalid-chunk.js index 09032c07c59255..beafa73cc52f39 100644 --- a/test/parallel/test-stream-writable-invalid-chunk.js +++ b/test/parallel/test-stream-writable-invalid-chunk.js @@ -7,7 +7,7 @@ const assert = require('assert'); function testWriteType(val, objectMode, code) { const writable = new stream.Writable({ objectMode, - write: () => {} + write: () => {}, }); writable.on('error', common.mustNotCall()); if (code) { diff --git a/test/parallel/test-stream-writable-needdrain-state.js b/test/parallel/test-stream-writable-needdrain-state.js index 0e72d832bc3ff0..fa92246cdf22b8 100644 --- a/test/parallel/test-stream-writable-needdrain-state.js +++ b/test/parallel/test-stream-writable-needdrain-state.js @@ -6,7 +6,7 @@ const assert = require('assert'); const transform = new stream.Transform({ transform: _transform, - highWaterMark: 1 + highWaterMark: 1, }); function _transform(chunk, encoding, cb) { diff --git a/test/parallel/test-stream-writable-null.js b/test/parallel/test-stream-writable-null.js index 99419f1cf9a066..8d4f587a555d35 100644 --- a/test/parallel/test-stream-writable-null.js +++ b/test/parallel/test-stream-writable-null.js @@ -20,7 +20,7 @@ class MyWritable extends stream.Writable { assert.throws(() => { m.write(null); }, { - code: 'ERR_STREAM_NULL_VALUES' + code: 'ERR_STREAM_NULL_VALUES', }); } @@ -30,7 +30,7 @@ class MyWritable extends stream.Writable { assert.throws(() => { m.write(false); }, { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); } diff --git a/test/parallel/test-stream-writable-samecb-singletick.js b/test/parallel/test-stream-writable-samecb-singletick.js index e7dfa648797821..9e664e8e5bc22d 100644 --- a/test/parallel/test-stream-writable-samecb-singletick.js +++ b/test/parallel/test-stream-writable-samecb-singletick.js @@ -17,13 +17,13 @@ const checkTickCreated = common.mustCall(); async_hooks.createHook({ init(id, type, triggerId, resoure) { if (type === 'TickObject') checkTickCreated(); - } + }, }).enable(); const console = new Console(new Writable({ write: common.mustCall((chunk, encoding, cb) => { cb(); - }, 100) + }, 100), })); for (let i = 0; i < 100; i++) diff --git a/test/parallel/test-stream-writable-writable.js b/test/parallel/test-stream-writable-writable.js index ef5454dc52ef35..bb12d37a938833 100644 --- a/test/parallel/test-stream-writable-writable.js +++ b/test/parallel/test-stream-writable-writable.js @@ -6,7 +6,7 @@ const { Writable } = require('stream'); { const w = new Writable({ - write() {} + write() {}, }); assert.strictEqual(w.writable, true); w.destroy(); @@ -17,7 +17,7 @@ const { Writable } = require('stream'); const w = new Writable({ write: common.mustCall((chunk, encoding, callback) => { callback(new Error()); - }) + }), }); assert.strictEqual(w.writable, true); w.write('asd'); @@ -32,7 +32,7 @@ const { Writable } = require('stream'); callback(new Error()); assert.strictEqual(w.writable, false); }); - }) + }), }); w.write('asd'); w.on('error', common.mustCall()); @@ -40,7 +40,7 @@ const { Writable } = require('stream'); { const w = new Writable({ - write: common.mustNotCall() + write: common.mustNotCall(), }); assert.strictEqual(w.writable, true); w.end(); diff --git a/test/parallel/test-stream-writable-write-cb-error.js b/test/parallel/test-stream-writable-write-cb-error.js index 72db1b7e3ffe70..e3a73941d6dba8 100644 --- a/test/parallel/test-stream-writable-write-cb-error.js +++ b/test/parallel/test-stream-writable-write-cb-error.js @@ -13,7 +13,7 @@ const assert = require('assert'); const writable = new Writable({ write: common.mustCall((buf, enc, cb) => { cb(new Error()); - }) + }), }); writable.on('error', common.mustCall(() => { assert.strictEqual(callbackCalled, true); @@ -29,7 +29,7 @@ const assert = require('assert'); const writable = new Writable({ write: common.mustCall((buf, enc, cb) => { process.nextTick(cb, new Error()); - }) + }), }); writable.on('error', common.mustCall(() => { assert.strictEqual(callbackCalled, true); @@ -44,7 +44,7 @@ const assert = require('assert'); const writable = new Writable({ write: common.mustCall((buf, enc, cb) => { cb(new Error()); - }) + }), }); writable.on('error', common.mustCall()); diff --git a/test/parallel/test-stream-writable-write-cb-twice.js b/test/parallel/test-stream-writable-write-cb-twice.js index 244698c52253f7..cc2aa0594f7c3b 100644 --- a/test/parallel/test-stream-writable-write-cb-twice.js +++ b/test/parallel/test-stream-writable-write-cb-twice.js @@ -8,12 +8,12 @@ const { Writable } = require('stream'); write: common.mustCall((buf, enc, cb) => { cb(); cb(); - }) + }), }); writable.write('hi'); writable.on('error', common.expectsError({ code: 'ERR_MULTIPLE_CALLBACK', - name: 'Error' + name: 'Error', })); } @@ -25,12 +25,12 @@ const { Writable } = require('stream'); process.nextTick(() => { cb(); }); - }) + }), }); writable.write('hi'); writable.on('error', common.expectsError({ code: 'ERR_MULTIPLE_CALLBACK', - name: 'Error' + name: 'Error', })); } @@ -42,11 +42,11 @@ const { Writable } = require('stream'); process.nextTick(() => { cb(); }); - }) + }), }); writable.write('hi'); writable.on('error', common.expectsError({ code: 'ERR_MULTIPLE_CALLBACK', - name: 'Error' + name: 'Error', })); } diff --git a/test/parallel/test-stream-writable-write-error.js b/test/parallel/test-stream-writable-write-error.js index 069e32e1be8e3e..87509b24e5a100 100644 --- a/test/parallel/test-stream-writable-write-error.js +++ b/test/parallel/test-stream-writable-write-error.js @@ -31,7 +31,7 @@ function test(autoDestroy) { { const w = new Writable({ autoDestroy, - _write() {} + _write() {}, }); w.end(); expectError(w, ['asd'], 'ERR_STREAM_WRITE_AFTER_END'); @@ -40,7 +40,7 @@ function test(autoDestroy) { { const w = new Writable({ autoDestroy, - _write() {} + _write() {}, }); w.destroy(); } @@ -48,7 +48,7 @@ function test(autoDestroy) { { const w = new Writable({ autoDestroy, - _write() {} + _write() {}, }); expectError(w, [null], 'ERR_STREAM_NULL_VALUES', true); } @@ -56,7 +56,7 @@ function test(autoDestroy) { { const w = new Writable({ autoDestroy, - _write() {} + _write() {}, }); expectError(w, [{}], 'ERR_INVALID_ARG_TYPE', true); } @@ -65,7 +65,7 @@ function test(autoDestroy) { const w = new Writable({ decodeStrings: false, autoDestroy, - _write() {} + _write() {}, }); expectError(w, ['asd', 'noencoding'], 'ERR_UNKNOWN_ENCODING', true); } diff --git a/test/parallel/test-stream-write-destroy.js b/test/parallel/test-stream-write-destroy.js index 1acf45a9ab2781..be7bad66357b89 100644 --- a/test/parallel/test-stream-write-destroy.js +++ b/test/parallel/test-stream-write-destroy.js @@ -15,7 +15,7 @@ for (const withPendingData of [ false, true ]) { callbacks.push(cb); }, // Effectively disable the HWM to observe 'drain' events more easily. - highWaterMark: 1 + highWaterMark: 1, }); let chunksWritten = 0; diff --git a/test/parallel/test-stream-write-drain.js b/test/parallel/test-stream-write-drain.js index bd65c1fdbb8a15..638bd15194e434 100644 --- a/test/parallel/test-stream-write-drain.js +++ b/test/parallel/test-stream-write-drain.js @@ -8,7 +8,7 @@ const w = new Writable({ write(data, enc, cb) { process.nextTick(cb); }, - highWaterMark: 1 + highWaterMark: 1, }); w.on('drain', common.mustNotCall()); diff --git a/test/parallel/test-stream-write-final.js b/test/parallel/test-stream-write-final.js index 56537bd7fae94d..e6e4ebf4f942f8 100644 --- a/test/parallel/test-stream-write-final.js +++ b/test/parallel/test-stream-write-final.js @@ -15,7 +15,7 @@ const w = new stream.Writable({ }), write: function(chunk, e, cb) { process.nextTick(cb); - } + }, }); w.on('finish', common.mustCall(function() { assert(shutdown); diff --git a/test/parallel/test-stream-writev.js b/test/parallel/test-stream-writev.js index 5a42411c6f3a93..afa1587da9329f 100644 --- a/test/parallel/test-stream-writev.js +++ b/test/parallel/test-stream-writev.js @@ -86,7 +86,7 @@ function test(decode, uncork, multi, next) { return { encoding: chunk.encoding, chunk: Buffer.isBuffer(chunk.chunk) ? - Array.prototype.slice.call(chunk.chunk) : chunk.chunk + Array.prototype.slice.call(chunk.chunk) : chunk.chunk, }; }); cb(); @@ -124,7 +124,7 @@ function test(decode, uncork, multi, next) { const w = new stream.Writable({ writev: common.mustCall(function(chunks, cb) { cb(); - }) + }), }); w.write('asd', common.mustCall()); } diff --git a/test/parallel/test-stream2-large-read-stall.js b/test/parallel/test-stream2-large-read-stall.js index 2d44bb7f783b9d..90170bebe7296e 100644 --- a/test/parallel/test-stream2-large-read-stall.js +++ b/test/parallel/test-stream2-large-read-stall.js @@ -33,7 +33,7 @@ const HWM = 50; const Readable = require('stream').Readable; const r = new Readable({ - highWaterMark: HWM + highWaterMark: HWM, }); const rs = r._readableState; diff --git a/test/parallel/test-stream2-objects.js b/test/parallel/test-stream2-objects.js index a713a5de189cfa..5ca82454f3965b 100644 --- a/test/parallel/test-stream2-objects.js +++ b/test/parallel/test-stream2-objects.js @@ -122,7 +122,7 @@ function fromArray(list) { { // Verify that strings can be read as objects const r = new Readable({ - objectMode: true + objectMode: true, }); r._read = common.mustNotCall(); const list = ['one', 'two', 'three']; @@ -139,7 +139,7 @@ function fromArray(list) { { // Verify read(0) behavior for object streams const r = new Readable({ - objectMode: true + objectMode: true, }); r._read = common.mustNotCall(); @@ -154,7 +154,7 @@ function fromArray(list) { { // Verify the behavior of pushing falsey values const r = new Readable({ - objectMode: true + objectMode: true, }); r._read = common.mustNotCall(); @@ -172,7 +172,7 @@ function fromArray(list) { // Verify high watermark _read() behavior const r = new Readable({ highWaterMark: 6, - objectMode: true + objectMode: true, }); let calls = 0; const list = ['1', '2', '3', '4', '5', '6', '7', '8']; @@ -203,7 +203,7 @@ function fromArray(list) { // Verify high watermark push behavior const r = new Readable({ highWaterMark: 6, - objectMode: true + objectMode: true, }); r._read = common.mustNotCall(); for (let i = 0; i < 6; i++) { @@ -251,7 +251,7 @@ function fromArray(list) { { // Verify that strings can be written as objects const w = new Writable({ - objectMode: true + objectMode: true, }); const list = []; @@ -275,7 +275,7 @@ function fromArray(list) { { // Verify that stream buffers finish until callback is called const w = new Writable({ - objectMode: true + objectMode: true, }); let called = false; diff --git a/test/parallel/test-stream2-push.js b/test/parallel/test-stream2-push.js index 748a77b9c496ba..470998b83667e7 100644 --- a/test/parallel/test-stream2-push.js +++ b/test/parallel/test-stream2-push.js @@ -31,7 +31,7 @@ const EE = require('events').EventEmitter; const stream = new Readable({ highWaterMark: 16, - encoding: 'utf8' + encoding: 'utf8', }); const source = new EE(); @@ -75,7 +75,7 @@ function readStop() { } const writer = new Writable({ - decodeStrings: false + decodeStrings: false, }); const written = []; diff --git a/test/parallel/test-stream2-readable-wrap-destroy.js b/test/parallel/test-stream2-readable-wrap-destroy.js index e310ae09e6ff53..6661122dfea815 100644 --- a/test/parallel/test-stream2-readable-wrap-destroy.js +++ b/test/parallel/test-stream2-readable-wrap-destroy.js @@ -11,7 +11,7 @@ oldStream.resume = () => {}; { new Readable({ autoDestroy: false, - destroy: common.mustCall() + destroy: common.mustCall(), }) .wrap(oldStream); oldStream.emit('destroy'); @@ -20,7 +20,7 @@ oldStream.resume = () => {}; { new Readable({ autoDestroy: false, - destroy: common.mustCall() + destroy: common.mustCall(), }) .wrap(oldStream); oldStream.emit('close'); diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index 849cfb3538b306..b7d727b9a59477 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -27,7 +27,7 @@ const { PassThrough, Transform } = require('stream'); { // Verify writable side consumption const tx = new Transform({ - highWaterMark: 10 + highWaterMark: 10, }); let transformed = 0; diff --git a/test/parallel/test-stream2-unpipe-leak.js b/test/parallel/test-stream2-unpipe-leak.js index 52c16368f5a37d..640036474aaa12 100644 --- a/test/parallel/test-stream2-unpipe-leak.js +++ b/test/parallel/test-stream2-unpipe-leak.js @@ -39,7 +39,7 @@ const dest = new TestWriter(); class TestReader extends stream.Readable { constructor() { super({ - highWaterMark: 0x10000 + highWaterMark: 0x10000, }); } diff --git a/test/parallel/test-stream2-writable.js b/test/parallel/test-stream2-writable.js index 3d16fb62df3313..a5b30c1005bf49 100644 --- a/test/parallel/test-stream2-writable.js +++ b/test/parallel/test-stream2-writable.js @@ -50,7 +50,7 @@ for (let i = 0; i < chunks.length; i++) { { // Verify fast writing const tw = new TestWriter({ - highWaterMark: 100 + highWaterMark: 100, }); tw.on('finish', common.mustCall(function() { @@ -68,7 +68,7 @@ for (let i = 0; i < chunks.length; i++) { { // Verify slow writing const tw = new TestWriter({ - highWaterMark: 100 + highWaterMark: 100, }); tw.on('finish', common.mustCall(function() { @@ -89,7 +89,7 @@ for (let i = 0; i < chunks.length; i++) { { // Verify write backpressure const tw = new TestWriter({ - highWaterMark: 50 + highWaterMark: 50, }); let drains = 0; @@ -123,7 +123,7 @@ for (let i = 0; i < chunks.length; i++) { { // Verify write buffersize const tw = new TestWriter({ - highWaterMark: 100 + highWaterMark: 100, }); const encodings = @@ -156,7 +156,7 @@ for (let i = 0; i < chunks.length; i++) { // Verify write with no buffersize const tw = new TestWriter({ highWaterMark: 100, - decodeStrings: false + decodeStrings: false, }); tw._write = function(chunk, encoding, cb) { @@ -204,7 +204,7 @@ for (let i = 0; i < chunks.length; i++) { callbacks._called = []; const tw = new TestWriter({ - highWaterMark: 100 + highWaterMark: 100, }); tw.on('finish', common.mustCall(function() { @@ -425,7 +425,7 @@ const helloWorldBuffer = Buffer.from('hello world'); assert.throws(() => { w.write(null); }, { - code: 'ERR_STREAM_NULL_VALUES' + code: 'ERR_STREAM_NULL_VALUES', }); } diff --git a/test/parallel/test-streams-highwatermark.js b/test/parallel/test-streams-highwatermark.js index 7d13be2dd19077..a9596fd136302c 100644 --- a/test/parallel/test-streams-highwatermark.js +++ b/test/parallel/test-streams-highwatermark.js @@ -28,7 +28,7 @@ const { inspect } = require('util'); name: 'TypeError', code: 'ERR_INVALID_ARG_VALUE', message: "The property 'options.highWaterMark' is invalid. " + - `Received ${inspect(invalidHwm)}` + `Received ${inspect(invalidHwm)}`, }); } } diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js index be876f46e5af02..32776d2107db82 100644 --- a/test/parallel/test-string-decoder.js +++ b/test/parallel/test-string-decoder.js @@ -178,7 +178,7 @@ assert.throws( { code: 'ERR_UNKNOWN_ENCODING', name: 'TypeError', - message: 'Unknown encoding: 1' + message: 'Unknown encoding: 1', } ); @@ -187,7 +187,7 @@ assert.throws( { code: 'ERR_UNKNOWN_ENCODING', name: 'TypeError', - message: 'Unknown encoding: test' + message: 'Unknown encoding: test', } ); @@ -197,7 +197,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "buf" argument must be an instance of Buffer, TypedArray,' + - ' or DataView. Received null' + ' or DataView. Received null', } ); diff --git a/test/parallel/test-tcp-wrap-connect.js b/test/parallel/test-tcp-wrap-connect.js index 5e3e81f6e11712..dd125a4b7a43b5 100644 --- a/test/parallel/test-tcp-wrap-connect.js +++ b/test/parallel/test-tcp-wrap-connect.js @@ -6,7 +6,7 @@ const { internalBinding } = require('internal/test/binding'); const { TCP, constants: TCPConstants, - TCPConnectWrap + TCPConnectWrap, } = internalBinding('tcp_wrap'); const { ShutdownWrap } = internalBinding('stream_wrap'); diff --git a/test/parallel/test-tcp-wrap-listen.js b/test/parallel/test-tcp-wrap-listen.js index 72981b683ccea3..927a2de984ce47 100644 --- a/test/parallel/test-tcp-wrap-listen.js +++ b/test/parallel/test-tcp-wrap-listen.js @@ -9,7 +9,7 @@ const { WriteWrap, kReadBytesOrError, kArrayBufferOffset, - streamBaseState + streamBaseState, } = internalBinding('stream_wrap'); const server = new TCP(TCPConstants.SOCKET); diff --git a/test/parallel/test-timers-enroll-invalid-msecs.js b/test/parallel/test-timers-enroll-invalid-msecs.js index 466f1a2c4a8872..c017b7cb8b1d31 100644 --- a/test/parallel/test-timers-enroll-invalid-msecs.js +++ b/test/parallel/test-timers-enroll-invalid-msecs.js @@ -15,7 +15,7 @@ const timers = require('timers'); () => timers.enroll({}, val), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); }); @@ -32,7 +32,7 @@ const timers = require('timers'); name: 'RangeError', message: 'The value of "msecs" is out of range. ' + 'It must be a non-negative finite number. ' + - `Received ${val}` + `Received ${val}`, } ); }); diff --git a/test/parallel/test-timers-immediate-promisified.js b/test/parallel/test-timers-immediate-promisified.js index 65c8411f1b2ffd..8ef45bf3a768cd 100644 --- a/test/parallel/test-timers-immediate-promisified.js +++ b/test/parallel/test-timers-immediate-promisified.js @@ -68,7 +68,7 @@ process.on('multipleResolves', common.mustNotCall()); Promise.all( [1, '', false, Infinity].map( (i) => assert.rejects(setPromiseImmediate(10, i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) ) ).then(common.mustCall()); @@ -76,7 +76,7 @@ process.on('multipleResolves', common.mustNotCall()); Promise.all( [1, '', false, Infinity, null, {}].map( (signal) => assert.rejects(setPromiseImmediate(10, { signal }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) ) ).then(common.mustCall()); @@ -84,7 +84,7 @@ process.on('multipleResolves', common.mustNotCall()); Promise.all( [1, '', Infinity, null, {}].map( (ref) => assert.rejects(setPromiseImmediate(10, { ref }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) ) ).then(common.mustCall()); diff --git a/test/parallel/test-timers-immediate-queue-throw.js b/test/parallel/test-timers-immediate-queue-throw.js index e5aded86c55785..bcf9d3627dad2b 100644 --- a/test/parallel/test-timers-immediate-queue-throw.js +++ b/test/parallel/test-timers-immediate-queue-throw.js @@ -20,7 +20,7 @@ const QUEUE = 10; const errObj = { name: 'Error', - message: 'setImmediate Err' + message: 'setImmediate Err', }; process.once('uncaughtException', common.mustCall((err, errorOrigin) => { diff --git a/test/parallel/test-timers-max-duration-warning.js b/test/parallel/test-timers-max-duration-warning.js index a104c1700db81d..574f42e616150c 100644 --- a/test/parallel/test-timers-max-duration-warning.js +++ b/test/parallel/test-timers-max-duration-warning.js @@ -34,7 +34,7 @@ process.on('warning', common.mustCall((warning) => { { const timer = { - _onTimeout: timerNotCanceled + _onTimeout: timerNotCanceled, }; timers.enroll(timer, OVERFLOW); timers.active(timer); diff --git a/test/parallel/test-timers-refresh.js b/test/parallel/test-timers-refresh.js index 17b3b34af5662b..fdd345fb04d893 100644 --- a/test/parallel/test-timers-refresh.js +++ b/test/parallel/test-timers-refresh.js @@ -38,7 +38,7 @@ const { inspect } = require('util'); () => setUnrefTimeout(cb), { code: 'ERR_INVALID_CALLBACK', - message: `Callback must be a function. Received ${inspect(cb)}` + message: `Callback must be a function. Received ${inspect(cb)}`, } ); }); diff --git a/test/parallel/test-timers-throw-when-cb-not-function.js b/test/parallel/test-timers-throw-when-cb-not-function.js index 75f49b0f3b967e..d33d9b46f14e03 100644 --- a/test/parallel/test-timers-throw-when-cb-not-function.js +++ b/test/parallel/test-timers-throw-when-cb-not-function.js @@ -10,7 +10,7 @@ function doSetTimeout(callback, after) { const errMessage = { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }; assert.throws(doSetTimeout('foo'), errMessage); diff --git a/test/parallel/test-timers-timeout-promisified.js b/test/parallel/test-timers-timeout-promisified.js index 0b9a6b6f19a1c2..3e9622a71d6182 100644 --- a/test/parallel/test-timers-timeout-promisified.js +++ b/test/parallel/test-timers-timeout-promisified.js @@ -68,7 +68,7 @@ process.on('multipleResolves', common.mustNotCall()); Promise.all( [1, '', false, Infinity].map( (i) => assert.rejects(setPromiseTimeout(10, null, i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) ) ).then(common.mustCall()); @@ -76,7 +76,7 @@ process.on('multipleResolves', common.mustNotCall()); Promise.all( [1, '', false, Infinity, null, {}].map( (signal) => assert.rejects(setPromiseTimeout(10, null, { signal }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) ) ).then(common.mustCall()); @@ -84,7 +84,7 @@ process.on('multipleResolves', common.mustNotCall()); Promise.all( [1, '', Infinity, null, {}].map( (ref) => assert.rejects(setPromiseTimeout(10, null, { ref }), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) ) ).then(common.mustCall()); diff --git a/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js b/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js index 07c2f4398278b7..d37e2d02aebb4c 100644 --- a/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js +++ b/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js @@ -20,14 +20,14 @@ const foo = { _onTimeout: function() { ++nbTimersFired; timers.unenroll(bar); - } + }, }; const bar = { _onTimeout: function() { ++nbTimersFired; timers.unenroll(foo); - } + }, }; timers.enroll(bar, 1); diff --git a/test/parallel/test-timers-unref-remove-other-unref-timers.js b/test/parallel/test-timers-unref-remove-other-unref-timers.js index 0926bd308c1efa..49ec58d78d1cb6 100644 --- a/test/parallel/test-timers-unref-remove-other-unref-timers.js +++ b/test/parallel/test-timers-unref-remove-other-unref-timers.js @@ -8,13 +8,13 @@ const common = require('../common'); const timers = require('timers'); const foo = { - _onTimeout: common.mustNotCall('_onTimeout should not be called') + _onTimeout: common.mustNotCall('_onTimeout should not be called'), }; const bar = { _onTimeout: common.mustCall(function() { timers.unenroll(foo); - }) + }), }; // We use timers with expiration times that are sufficiently apart to make diff --git a/test/parallel/test-timers-unref-throw-then-ref.js b/test/parallel/test-timers-unref-throw-then-ref.js index 1dd5fdd0ad2786..9a935c0dcc0bcc 100644 --- a/test/parallel/test-timers-unref-throw-then-ref.js +++ b/test/parallel/test-timers-unref-throw-then-ref.js @@ -4,7 +4,7 @@ const assert = require('assert'); process.once('uncaughtException', common.mustCall((err) => { common.expectsError({ - message: 'Timeout Error' + message: 'Timeout Error', })(err); })); diff --git a/test/parallel/test-tls-0-dns-altname.js b/test/parallel/test-tls-0-dns-altname.js index 4bc87e44cb60c1..f48be43a0b88d1 100644 --- a/test/parallel/test-tls-0-dns-altname.js +++ b/test/parallel/test-tls-0-dns-altname.js @@ -32,7 +32,7 @@ const fixtures = require('../common/fixtures'); const server = tls.createServer({ key: fixtures.readSync(['0-dns', '0-dns-key.pem']), - cert: fixtures.readSync(['0-dns', '0-dns-cert.pem']) + cert: fixtures.readSync(['0-dns', '0-dns-cert.pem']), }, common.mustCall((c) => { c.once('data', common.mustCall(() => { c.destroy(); @@ -40,7 +40,7 @@ const server = tls.createServer({ })); })).listen(0, common.mustCall(() => { const c = tls.connect(server.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { const cert = c.getPeerCertificate(); assert.strictEqual(cert.subjectaltname, diff --git a/test/parallel/test-tls-addca.js b/test/parallel/test-tls-addca.js index 5ca44f7a26e7db..6f9239bff64b3a 100644 --- a/test/parallel/test-tls-addca.js +++ b/test/parallel/test-tls-addca.js @@ -7,7 +7,7 @@ const fixtures = require('../common/fixtures'); // depends on that CA using contextWithoutCert. const { - assert, connect, keys, tls + assert, connect, keys, tls, } = require(fixtures.path('tls-connect')); const contextWithoutCert = tls.createSecureContext({}); diff --git a/test/parallel/test-tls-alert-handling.js b/test/parallel/test-tls-alert-handling.js index bd86149bc5ac22..78884260bdbfa6 100644 --- a/test/parallel/test-tls-alert-handling.js +++ b/test/parallel/test-tls-alert-handling.js @@ -24,7 +24,7 @@ function loadPEM(n) { const opts = { key: loadPEM('agent2-key'), - cert: loadPEM('agent2-cert') + cert: loadPEM('agent2-cert'), }; const max_iter = 20; @@ -54,7 +54,7 @@ server.on('error', common.mustNotCall()); function sendClient() { const client = tls.connect(server.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }); client.on('data', common.mustCall(function() { if (iter++ === 2) sendBADTLSRecord(); @@ -79,7 +79,7 @@ function sendBADTLSRecord() { const socket = net.connect(server.address().port); const client = tls.connect({ socket: socket, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { client.write('x'); client.on('data', (data) => { diff --git a/test/parallel/test-tls-alert.js b/test/parallel/test-tls-alert.js index 5847f9ce9ad684..2b955afff4890c 100644 --- a/test/parallel/test-tls-alert.js +++ b/test/parallel/test-tls-alert.js @@ -41,7 +41,7 @@ function loadPEM(n) { const server = tls.Server({ secureProtocol: 'TLSv1_2_server_method', key: loadPEM('agent2-key'), - cert: loadPEM('agent2-cert') + cert: loadPEM('agent2-cert'), }, null).listen(0, function() { const args = ['s_client', '-quiet', '-tls1_1', '-connect', `127.0.0.1:${this.address().port}`]; 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 357cef30715d71..f4de5dd08f6c0b 100644 --- a/test/parallel/test-tls-async-cb-after-socket-end.js +++ b/test/parallel/test-tls-async-cb-after-socket-end.js @@ -16,7 +16,7 @@ const tls = require('tls'); const options = { secureOptions: SSL_OP_NO_TICKET, key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const server = tls.createServer(options, common.mustCall()); @@ -43,7 +43,7 @@ server.listen(0, common.mustCall(() => { maxVersion: 'TLSv1.2', port: server.address().port, rejectUnauthorized: false, - session: false + session: false, }; const s1 = tls.connect(clientOpts, common.mustCall(() => { diff --git a/test/parallel/test-tls-basic-validations.js b/test/parallel/test-tls-basic-validations.js index 67058daf158cd0..09e53b9bf74882 100644 --- a/test/parallel/test-tls-basic-validations.js +++ b/test/parallel/test-tls-basic-validations.js @@ -13,7 +13,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.ciphers" property must be of type string.' + - ' Received type number (1)' + ' Received type number (1)', }); assert.throws( @@ -22,7 +22,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.ciphers" property must be of type string.' + - ' Received type number (1)' + ' Received type number (1)', }); assert.throws( @@ -30,7 +30,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /The "options\.passphrase" property must be of type string/ + message: /The "options\.passphrase" property must be of type string/, }); assert.throws( @@ -38,7 +38,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /The "options\.passphrase" property must be of type string/ + message: /The "options\.passphrase" property must be of type string/, }); assert.throws( @@ -46,7 +46,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /The "options\.ecdhCurve" property must be of type string/ + message: /The "options\.ecdhCurve" property must be of type string/, }); assert.throws( @@ -55,7 +55,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.handshakeTimeout" property must be of type number.' + - " Received type string ('abcd')" + " Received type string ('abcd')", } ); @@ -64,7 +64,7 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /The "options\.sessionTimeout" property must be of type number/ + message: /The "options\.sessionTimeout" property must be of type number/, }); assert.throws( @@ -72,12 +72,12 @@ assert.throws( { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /The "options\.ticketKeys" property must be an instance of/ + message: /The "options\.ticketKeys" property must be an instance of/, }); assert.throws(() => tls.createServer({ ticketKeys: Buffer.alloc(0) }), { code: 'ERR_INVALID_ARG_VALUE', - message: /The property 'options\.ticketKeys' must be exactly 48 bytes/ + message: /The property 'options\.ticketKeys' must be exactly 48 bytes/, }); assert.throws( @@ -116,7 +116,7 @@ assert.throws( { code: 'ERR_OUT_OF_RANGE', message: 'The byte length of the protocol at index 0 exceeds the ' + - 'maximum length. It must be <= 255. Received 500' + 'maximum length. It must be <= 255. Received 500', } ); } @@ -124,11 +124,11 @@ assert.throws( assert.throws(() => { tls.createSecureContext({ minVersion: 'fhqwhgads' }); }, { code: 'ERR_TLS_INVALID_PROTOCOL_VERSION', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => { tls.createSecureContext({ maxVersion: 'fhqwhgads' }); }, { code: 'ERR_TLS_INVALID_PROTOCOL_VERSION', - name: 'TypeError' + name: 'TypeError', }); diff --git a/test/parallel/test-tls-buffersize.js b/test/parallel/test-tls-buffersize.js index eadd4cb1e40c9e..0ddc5fddb6ee2d 100644 --- a/test/parallel/test-tls-buffersize.js +++ b/test/parallel/test-tls-buffersize.js @@ -10,7 +10,7 @@ const iter = 10; const server = tls.createServer({ key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }, common.mustCall((socket) => { let str = ''; socket.setEncoding('utf-8'); @@ -25,7 +25,7 @@ const server = tls.createServer({ server.listen(0, common.mustCall(() => { const client = tls.connect({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { assert.strictEqual(client.bufferSize, 0); diff --git a/test/parallel/test-tls-ca-concat.js b/test/parallel/test-tls-ca-concat.js index 38a6a4dfec378f..7574f9d26dc67f 100644 --- a/test/parallel/test-tls-ca-concat.js +++ b/test/parallel/test-tls-ca-concat.js @@ -6,7 +6,7 @@ const fixtures = require('../common/fixtures'); // non-CA cert and showing that agent6's CA root is still found. const { - connect, keys + connect, keys, } = require(fixtures.path('tls-connect')); connect({ diff --git a/test/parallel/test-tls-cert-chains-concat.js b/test/parallel/test-tls-cert-chains-concat.js index c186f0f6c4e4b1..ad6220853949eb 100644 --- a/test/parallel/test-tls-cert-chains-concat.js +++ b/test/parallel/test-tls-cert-chains-concat.js @@ -6,7 +6,7 @@ const fixtures = require('../common/fixtures'); // known to the client. const { - assert, connect, debug, keys + assert, connect, debug, keys, } = require(fixtures.path('tls-connect')); // agent6-cert.pem includes cert for agent6 and ca3 diff --git a/test/parallel/test-tls-cert-chains-in-ca.js b/test/parallel/test-tls-cert-chains-in-ca.js index 0e834cc9bd11a2..c47ce6bd2053e8 100644 --- a/test/parallel/test-tls-cert-chains-in-ca.js +++ b/test/parallel/test-tls-cert-chains-in-ca.js @@ -6,7 +6,7 @@ const fixtures = require('../common/fixtures'); // known to the client. const { - assert, connect, debug, keys + assert, connect, debug, keys, } = require(fixtures.path('tls-connect')); diff --git a/test/parallel/test-tls-cert-ext-encoding.js b/test/parallel/test-tls-cert-ext-encoding.js index 4556b5791851c5..5fc7c6d5ed7486 100644 --- a/test/parallel/test-tls-cert-ext-encoding.js +++ b/test/parallel/test-tls-cert-ext-encoding.js @@ -78,7 +78,7 @@ const server = tls.createServer(options, (socket) => { server.listen(0, common.mustCall(function() { const client = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { // This should not crash process: client.getPeerCertificate(); diff --git a/test/parallel/test-tls-cert-regression.js b/test/parallel/test-tls-cert-regression.js index 478402772eb0df..d2c4784a7a7da1 100644 --- a/test/parallel/test-tls-cert-regression.js +++ b/test/parallel/test-tls-cert-regression.js @@ -69,7 +69,7 @@ sPWhSOb9VQjMXekI4Y2l8fqAVTS2Fn6+8jkVKxXBywSVCw== function test(cert, key, cb) { const server = tls.createServer({ cert, - key + key, }).listen(0, function() { server.close(cb); }); diff --git a/test/parallel/test-tls-check-server-identity.js b/test/parallel/test-tls-check-server-identity.js index ad79d93a3df6fd..5b93a94160d7c5 100644 --- a/test/parallel/test-tls-check-server-identity.js +++ b/test/parallel/test-tls-check-server-identity.js @@ -35,17 +35,17 @@ const tests = [ { host: false, cert: { subject: { CN: 'a.com' } }, - error: 'Host: false. is not cert\'s CN: a.com' + error: 'Host: false. is not cert\'s CN: a.com', }, { host: null, cert: { subject: { CN: 'a.com' } }, - error: 'Host: null. is not cert\'s CN: a.com' + error: 'Host: null. is not cert\'s CN: a.com', }, { host: undefined, cert: { subject: { CN: 'a.com' } }, - error: 'Host: undefined. is not cert\'s CN: a.com' + error: 'Host: undefined. is not cert\'s CN: a.com', }, // Basic CN handling @@ -54,13 +54,13 @@ const tests = [ { host: 'a.com', cert: { subject: { CN: 'b.com' } }, - error: 'Host: a.com. is not cert\'s CN: b.com' + error: 'Host: a.com. is not cert\'s CN: b.com', }, { host: 'a.com', cert: { subject: { CN: 'a.com.' } } }, { host: 'a.com', cert: { subject: { CN: '.a.com' } }, - error: 'Host: a.com. is not cert\'s CN: .a.com' + error: 'Host: a.com. is not cert\'s CN: .a.com', }, // IP address in CN. Technically allowed but so rare that we reject @@ -70,7 +70,7 @@ const tests = [ { host: '8.8.8.8', cert: { subject: { CN: '8.8.8.8' } }, - error: 'IP: 8.8.8.8 is not in the cert\'s list: ' + error: 'IP: 8.8.8.8 is not in the cert\'s list: ', }, // The spec suggests that a "DNS:" Subject Alternative Name containing an @@ -78,7 +78,7 @@ const tests = [ { host: '8.8.8.8', cert: { subject: { CN: '8.8.8.8' }, subjectaltname: 'DNS:8.8.8.8' }, - error: 'IP: 8.8.8.8 is not in the cert\'s list: ' + error: 'IP: 8.8.8.8 is not in the cert\'s list: ', }, // Likewise for "URI:" Subject Alternative Names. @@ -86,13 +86,13 @@ const tests = [ { host: '8.8.8.8', cert: { subject: { CN: '8.8.8.8' }, subjectaltname: 'URI:http://8.8.8.8/' }, - error: 'IP: 8.8.8.8 is not in the cert\'s list: ' + error: 'IP: 8.8.8.8 is not in the cert\'s list: ', }, // An "IP Address:" Subject Alternative Name however is acceptable. { host: '8.8.8.8', - cert: { subject: { CN: '8.8.8.8' }, subjectaltname: 'IP Address:8.8.8.8' } + cert: { subject: { CN: '8.8.8.8' }, subjectaltname: 'IP Address:8.8.8.8' }, }, // But not when it's a CIDR. @@ -100,9 +100,9 @@ const tests = [ host: '8.8.8.8', cert: { subject: { CN: '8.8.8.8' }, - subjectaltname: 'IP Address:8.8.8.0/24' + subjectaltname: 'IP Address:8.8.8.0/24', }, - error: 'IP: 8.8.8.8 is not in the cert\'s list: ' + error: 'IP: 8.8.8.8 is not in the cert\'s list: ', }, // Wildcards in CN @@ -110,12 +110,12 @@ const tests = [ { host: 'ba.com', cert: { subject: { CN: '*.a.com' } }, - error: 'Host: ba.com. is not cert\'s CN: *.a.com' + error: 'Host: ba.com. is not cert\'s CN: *.a.com', }, { host: '\n.b.com', cert: { subject: { CN: '*n.b.com' } }, - error: 'Host: \n.b.com. is not cert\'s CN: *n.b.com' + error: 'Host: \n.b.com. is not cert\'s CN: *n.b.com', }, { host: 'b.a.com', cert: { @@ -127,191 +127,191 @@ const tests = [ { host: 'b.a.com', cert: { subject: { CN: 'b*b.a.com' } }, - error: 'Host: b.a.com. is not cert\'s CN: b*b.a.com' + error: 'Host: b.a.com. is not cert\'s CN: b*b.a.com', }, // Empty Cert { host: 'a.com', cert: { }, - error: 'Cert is empty' + error: 'Cert is empty', }, // Empty Subject w/DNS name { host: 'a.com', cert: { subjectaltname: 'DNS:a.com', - } + }, }, // Empty Subject w/URI name { host: 'a.b.a.com', cert: { subjectaltname: 'URI:http://a.b.a.com/', - } + }, }, // Multiple CN fields { host: 'foo.com', cert: { - subject: { CN: ['foo.com', 'bar.com'] } // CN=foo.com; CN=bar.com; - } + subject: { CN: ['foo.com', 'bar.com'] }, // CN=foo.com; CN=bar.com; + }, }, // DNS names and CN { host: 'a.com', cert: { subjectaltname: 'DNS:*', - subject: { CN: 'b.com' } + subject: { CN: 'b.com' }, }, error: 'Host: a.com. is not in the cert\'s altnames: ' + - 'DNS:*' + 'DNS:*', }, { host: 'a.com', cert: { subjectaltname: 'DNS:*.com', - subject: { CN: 'b.com' } + subject: { CN: 'b.com' }, }, error: 'Host: a.com. is not in the cert\'s altnames: ' + - 'DNS:*.com' + 'DNS:*.com', }, { host: 'a.co.uk', cert: { subjectaltname: 'DNS:*.co.uk', - subject: { CN: 'b.com' } - } + subject: { CN: 'b.com' }, + }, }, { host: 'a.com', cert: { subjectaltname: 'DNS:*.a.com', - subject: { CN: 'a.com' } + subject: { CN: 'a.com' }, }, error: 'Host: a.com. is not in the cert\'s altnames: ' + - 'DNS:*.a.com' + 'DNS:*.a.com', }, { host: 'a.com', cert: { subjectaltname: 'DNS:*.a.com', - subject: { CN: 'b.com' } + subject: { CN: 'b.com' }, }, error: 'Host: a.com. is not in the cert\'s altnames: ' + - 'DNS:*.a.com' + 'DNS:*.a.com', }, { host: 'a.com', cert: { subjectaltname: 'DNS:a.com', - subject: { CN: 'b.com' } - } + subject: { CN: 'b.com' }, + }, }, { host: 'a.com', cert: { subjectaltname: 'DNS:A.COM', - subject: { CN: 'b.com' } - } + subject: { CN: 'b.com' }, + }, }, // DNS names { host: 'a.com', cert: { subjectaltname: 'DNS:*.a.com', - subject: {} + subject: {}, }, error: 'Host: a.com. is not in the cert\'s altnames: ' + - 'DNS:*.a.com' + 'DNS:*.a.com', }, { host: 'b.a.com', cert: { subjectaltname: 'DNS:*.a.com', - subject: {} - } + subject: {}, + }, }, { host: 'c.b.a.com', cert: { subjectaltname: 'DNS:*.a.com', - subject: {} + subject: {}, }, error: 'Host: c.b.a.com. is not in the cert\'s altnames: ' + - 'DNS:*.a.com' + 'DNS:*.a.com', }, { host: 'b.a.com', cert: { subjectaltname: 'DNS:*b.a.com', - subject: {} - } + subject: {}, + }, }, { host: 'a-cb.a.com', cert: { subjectaltname: 'DNS:*b.a.com', - subject: {} - } + subject: {}, + }, }, { host: 'a.b.a.com', cert: { subjectaltname: 'DNS:*b.a.com', - subject: {} + subject: {}, }, error: 'Host: a.b.a.com. is not in the cert\'s altnames: ' + - 'DNS:*b.a.com' + 'DNS:*b.a.com', }, // Multiple DNS names { host: 'a.b.a.com', cert: { subjectaltname: 'DNS:*b.a.com, DNS:a.b.a.com', - subject: {} - } + subject: {}, + }, }, // URI names { host: 'a.b.a.com', cert: { subjectaltname: 'URI:http://a.b.a.com/', - subject: {} - } + subject: {}, + }, }, { host: 'a.b.a.com', cert: { subjectaltname: 'URI:http://*.b.a.com/', - subject: {} + subject: {}, }, error: 'Host: a.b.a.com. is not in the cert\'s altnames: ' + - 'URI:http://*.b.a.com/' + 'URI:http://*.b.a.com/', }, // IP addresses { host: 'a.b.a.com', cert: { subjectaltname: 'IP Address:127.0.0.1', - subject: {} + subject: {}, }, error: 'Host: a.b.a.com. is not in the cert\'s altnames: ' + - 'IP Address:127.0.0.1' + 'IP Address:127.0.0.1', }, { host: '127.0.0.1', cert: { subjectaltname: 'IP Address:127.0.0.1', - subject: {} - } + subject: {}, + }, }, { host: '127.0.0.2', cert: { subjectaltname: 'IP Address:127.0.0.1', - subject: {} + subject: {}, }, error: 'IP: 127.0.0.2 is not in the cert\'s list: ' + - '127.0.0.1' + '127.0.0.1', }, { host: '127.0.0.1', cert: { subjectaltname: 'DNS:a.com', - subject: {} + subject: {}, }, - error: 'IP: 127.0.0.1 is not in the cert\'s list: ' + error: 'IP: 127.0.0.1 is not in the cert\'s list: ', }, { host: 'localhost', cert: { subjectaltname: 'DNS:a.com', - subject: { CN: 'localhost' } + subject: { CN: 'localhost' }, }, error: 'Host: localhost. is not in the cert\'s altnames: ' + - 'DNS:a.com' + 'DNS:a.com', }, // IDNA { diff --git a/test/parallel/test-tls-client-auth.js b/test/parallel/test-tls-client-auth.js index 476238961986cd..b322c8c3f7c5aa 100644 --- a/test/parallel/test-tls-client-auth.js +++ b/test/parallel/test-tls-client-auth.js @@ -4,7 +4,7 @@ const common = require('../common'); const fixtures = require('../common/fixtures'); const { - assert, connect, keys, tls + assert, connect, keys, tls, } = require(fixtures.path('tls-connect')); // Use ec10 and agent10, they are the only identities with intermediate CAs. diff --git a/test/parallel/test-tls-client-destroy-soon.js b/test/parallel/test-tls-client-destroy-soon.js index 1d49a6094bd7e6..930cb89516b672 100644 --- a/test/parallel/test-tls-client-destroy-soon.js +++ b/test/parallel/test-tls-client-destroy-soon.js @@ -34,7 +34,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }; const big = Buffer.alloc(2 * 1024 * 1024, 'Y'); @@ -49,7 +49,7 @@ const server = tls.createServer(options, common.mustCall(function(socket) { server.listen(0, common.mustCall(function() { const client = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { let bytesRead = 0; diff --git a/test/parallel/test-tls-client-getephemeralkeyinfo.js b/test/parallel/test-tls-client-getephemeralkeyinfo.js index 73ac215102ddbb..bb0cc0b3c564ca 100644 --- a/test/parallel/test-tls-client-getephemeralkeyinfo.js +++ b/test/parallel/test-tls-client-getephemeralkeyinfo.js @@ -23,7 +23,7 @@ function test(size, type, name, cipher) { const options = { key: key, cert: cert, - ciphers: cipher + ciphers: cipher, }; if (name) options.ecdhCurve = name; @@ -40,7 +40,7 @@ function test(size, type, name, cipher) { server.listen(0, '127.0.0.1', common.mustCall(() => { const client = tls.connect({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { const ekeyinfo = client.getEphemeralKeyInfo(); assert.strictEqual(ekeyinfo.type, type); diff --git a/test/parallel/test-tls-client-mindhsize.js b/test/parallel/test-tls-client-mindhsize.js index a6fbc67bd88361..5a464f7e3bdc6b 100644 --- a/test/parallel/test-tls-client-mindhsize.js +++ b/test/parallel/test-tls-client-mindhsize.js @@ -22,7 +22,7 @@ function test(size, err, next) { key: key, cert: cert, dhparam: loadDHParam(size), - ciphers: 'DHE-RSA-AES128-GCM-SHA256' + ciphers: 'DHE-RSA-AES128-GCM-SHA256', }; const server = tls.createServer(options, function(conn) { @@ -41,7 +41,7 @@ function test(size, err, next) { const client = tls.connect({ minDHSize: 2048, port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { nsuccess++; server.close(); diff --git a/test/parallel/test-tls-client-reject.js b/test/parallel/test-tls-client-reject.js index d41ad806ea3012..d8ea30d1a134df 100644 --- a/test/parallel/test-tls-client-reject.js +++ b/test/parallel/test-tls-client-reject.js @@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const server = tls.createServer(options, function(socket) { @@ -46,7 +46,7 @@ function unauthorized() { const socket = tls.connect({ port: server.address().port, servername: 'localhost', - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { let _data; assert(!socket.authorized); @@ -68,7 +68,7 @@ function unauthorized() { function rejectUnauthorized() { console.log('reject unauthorized'); const socket = tls.connect(server.address().port, { - servername: 'localhost' + servername: 'localhost', }, common.mustNotCall()); socket.on('data', common.mustNotCall()); socket.on('error', common.mustCall(function(err) { @@ -81,7 +81,7 @@ function authorized() { console.log('connect authorized'); const socket = tls.connect(server.address().port, { ca: [fixtures.readKey('rsa_cert.crt')], - servername: 'localhost' + servername: 'localhost', }, common.mustCall(function() { console.log('... authorized'); assert(socket.authorized); diff --git a/test/parallel/test-tls-client-renegotiation-13.js b/test/parallel/test-tls-client-renegotiation-13.js index a32baed0249a0a..97d9f2e7559121 100644 --- a/test/parallel/test-tls-client-renegotiation-13.js +++ b/test/parallel/test-tls-client-renegotiation-13.js @@ -6,7 +6,7 @@ const fixtures = require('../common/fixtures'); // Confirm that for TLSv1.3, renegotiate() is disallowed. const { - assert, connect, keys + assert, connect, keys, } = require(fixtures.path('tls-connect')); const server = keys.agent10; diff --git a/test/parallel/test-tls-client-resume.js b/test/parallel/test-tls-client-resume.js index 0f5c9caa7c3f8f..6c324987032278 100644 --- a/test/parallel/test-tls-client-resume.js +++ b/test/parallel/test-tls-client-resume.js @@ -34,7 +34,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }; // create server @@ -50,7 +50,7 @@ server.listen(0, common.mustCall(function() { let tls13; const client1 = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { tls13 = client1.getProtocol() === 'TLSv1.3'; assert.strictEqual(client1.isSessionReused(), false); diff --git a/test/parallel/test-tls-client-verify.js b/test/parallel/test-tls-client-verify.js index a8de1078bf2e9a..97f6d2159d5450 100644 --- a/test/parallel/test-tls-client-verify.js +++ b/test/parallel/test-tls-client-verify.js @@ -124,7 +124,7 @@ function runTest(testIndex) { ca: tcase.ca.map(loadPEM), key: loadPEM(tcase.key), cert: loadPEM(tcase.cert), - rejectUnauthorized: false + rejectUnauthorized: false, }; diff --git a/test/parallel/test-tls-clientcertengine-unsupported.js b/test/parallel/test-tls-clientcertengine-unsupported.js index 0d24005dc0a150..349a2d1da06712 100644 --- a/test/parallel/test-tls-clientcertengine-unsupported.js +++ b/test/parallel/test-tls-clientcertengine-unsupported.js @@ -24,7 +24,7 @@ const tls = require('tls'); () => { tls.createSecureContext({ clientCertEngine: 'Cannonmouth' }); }, { code: 'ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED', - message: 'Custom engines not supported by this OpenSSL' + message: 'Custom engines not supported by this OpenSSL', } ); } diff --git a/test/parallel/test-tls-close-error.js b/test/parallel/test-tls-close-error.js index de51b4686a93a4..74cae5ef0acd3e 100644 --- a/test/parallel/test-tls-close-error.js +++ b/test/parallel/test-tls-close-error.js @@ -10,7 +10,7 @@ const fixtures = require('../common/fixtures'); const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, function(c) { }).listen(0, common.mustCall(function() { const c = tls.connect(this.address().port, common.mustNotCall()); diff --git a/test/parallel/test-tls-close-event-after-write.js b/test/parallel/test-tls-close-event-after-write.js index 57c79e2e5ab72d..b1ad3e55896616 100644 --- a/test/parallel/test-tls-close-event-after-write.js +++ b/test/parallel/test-tls-close-event-after-write.js @@ -25,14 +25,14 @@ function test() { const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, (c) => { c.on('close', common.mustCall(() => server.close())); sconn = c; test(); }).listen(0, common.mustCall(function() { tls.connect(this.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { cconn = this; cconn.on('data', (d) => { diff --git a/test/parallel/test-tls-close-notify.js b/test/parallel/test-tls-close-notify.js index d7153b87ba7f19..4f74b6cc0049d7 100644 --- a/test/parallel/test-tls-close-notify.js +++ b/test/parallel/test-tls-close-notify.js @@ -33,7 +33,7 @@ const { ShutdownWrap } = internalBinding('stream_wrap'); const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, function(c) { // Ensure that we receive 'end' event anyway. c.on('end', common.mustCall(function() { @@ -41,7 +41,7 @@ const server = tls.createServer({ })); }).listen(0, common.mustCall(function() { const c = tls.connect(this.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { // Send close-notify without shutting down TCP socket. const req = new ShutdownWrap(); diff --git a/test/parallel/test-tls-cnnic-whitelist.js b/test/parallel/test-tls-cnnic-whitelist.js index 99ad02ee1c66be..81d52ae72f8381 100644 --- a/test/parallel/test-tls-cnnic-whitelist.js +++ b/test/parallel/test-tls-cnnic-whitelist.js @@ -24,13 +24,13 @@ const testCases = [ serverOpts: { ca: loadPEM('ca3-key'), key: loadPEM('agent6-key'), - cert: loadPEM('agent6-cert') + cert: loadPEM('agent6-cert'), }, clientOpts: { port: undefined, - rejectUnauthorized: true + rejectUnauthorized: true, }, - errorCode: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY' + errorCode: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY', }, ]; diff --git a/test/parallel/test-tls-connect-abort-controller.js b/test/parallel/test-tls-connect-abort-controller.js index f9a37f1603a7e3..26bc6f90c0fe78 100644 --- a/test/parallel/test-tls-connect-abort-controller.js +++ b/test/parallel/test-tls-connect-abort-controller.js @@ -10,7 +10,7 @@ const { getEventListeners, once } = require('events'); const serverOptions = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = tls.createServer(serverOptions); server.listen(0, common.mustCall(async () => { diff --git a/test/parallel/test-tls-connect-address-family.js b/test/parallel/test-tls-connect-address-family.js index 083208cc1d3ab0..a83058ff8cc27c 100644 --- a/test/parallel/test-tls-connect-address-family.js +++ b/test/parallel/test-tls-connect-address-family.js @@ -33,7 +33,7 @@ function runTest() { } dns.lookup('localhost', { - family: 6, all: true + family: 6, all: true, }, common.mustCall((err, addresses) => { if (err) { if (err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN') diff --git a/test/parallel/test-tls-connect-given-socket.js b/test/parallel/test-tls-connect-given-socket.js index f25cf4582d59b1..829f376b0978b4 100644 --- a/test/parallel/test-tls-connect-given-socket.js +++ b/test/parallel/test-tls-connect-given-socket.js @@ -31,7 +31,7 @@ const net = require('net'); const options = { key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const server = tls.createServer(options, common.mustCall((socket) => { @@ -41,7 +41,7 @@ const server = tls.createServer(options, common.mustCall((socket) => { function establish(socket, calls) { const client = tls.connect({ rejectUnauthorized: false, - socket: socket + socket: socket, }, common.mustCall(() => { let data = ''; client.on('data', common.mustCall((chunk) => { diff --git a/test/parallel/test-tls-connect-hints-option.js b/test/parallel/test-tls-connect-hints-option.js index 4653e0a1418bbd..f3e01a3383a10d 100644 --- a/test/parallel/test-tls-connect-hints-option.js +++ b/test/parallel/test-tls-connect-hints-option.js @@ -27,5 +27,5 @@ tls.connect({ assert.strictEqual(host, 'localhost'); assert.deepStrictEqual(options, { family: undefined, hints }); }), - hints + hints, }); diff --git a/test/parallel/test-tls-connect-hwm-option.js b/test/parallel/test-tls-connect-hwm-option.js index e016ccc6cba0dc..db8e430d4da989 100644 --- a/test/parallel/test-tls-connect-hwm-option.js +++ b/test/parallel/test-tls-connect-hwm-option.js @@ -14,7 +14,7 @@ let clients = 0; const server = tls.createServer({ key: pem('agent1-key'), - cert: pem('agent1-cert') + cert: pem('agent1-cert'), }, common.mustCall(() => { if (--clients === 0) server.close(); diff --git a/test/parallel/test-tls-connect-memleak.js b/test/parallel/test-tls-connect-memleak.js index b0dedfa0bba56d..07d2abf0d4ab6d 100644 --- a/test/parallel/test-tls-connect-memleak.js +++ b/test/parallel/test-tls-connect-memleak.js @@ -36,7 +36,7 @@ const fixtures = require('../common/fixtures'); const server = tls.createServer({ cert: fixtures.readKey('rsa_cert.crt'), - key: fixtures.readKey('rsa_private.pem') + key: fixtures.readKey('rsa_private.pem'), }).listen(0); let collected = false; diff --git a/test/parallel/test-tls-connect-no-host.js b/test/parallel/test-tls-connect-no-host.js index 97b95332c47c2e..88b51bd7e13c6f 100644 --- a/test/parallel/test-tls-connect-no-host.js +++ b/test/parallel/test-tls-connect-no-host.js @@ -16,7 +16,7 @@ const key = fixtures.readKey('rsa_private.pem'); // CN:'localhost' const server = tls.createServer({ key, - cert + cert, }).listen(0, common.mustCall(function() { const socket = tls.connect({ port: this.address().port, diff --git a/test/parallel/test-tls-connect-pipe.js b/test/parallel/test-tls-connect-pipe.js index 88e78b7a2b2e59..b6a25a68cbfd9d 100644 --- a/test/parallel/test-tls-connect-pipe.js +++ b/test/parallel/test-tls-connect-pipe.js @@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const tmpdir = require('../common/tmpdir'); diff --git a/test/parallel/test-tls-connect-secure-context.js b/test/parallel/test-tls-connect-secure-context.js index afa98cf3313b6f..0e602074dffed4 100644 --- a/test/parallel/test-tls-connect-secure-context.js +++ b/test/parallel/test-tls-connect-secure-context.js @@ -5,7 +5,7 @@ require('../common'); const fixtures = require('../common/fixtures'); const { - assert, connect, keys, tls + assert, connect, keys, tls, } = require(fixtures.path('tls-connect')); connect({ diff --git a/test/parallel/test-tls-connect-simple.js b/test/parallel/test-tls-connect-simple.js index 633529d6d3ccb1..33759ad7e01418 100644 --- a/test/parallel/test-tls-connect-simple.js +++ b/test/parallel/test-tls-connect-simple.js @@ -32,7 +32,7 @@ let serverConnected = 0; const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = tls.Server(options, common.mustCall(function(socket) { @@ -45,7 +45,7 @@ const server = tls.Server(options, common.mustCall(function(socket) { server.listen(0, function() { const client1options = { port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }; const client1 = tls.connect(client1options, common.mustCall(function() { client1.end(); @@ -53,7 +53,7 @@ server.listen(0, function() { const client2options = { port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }; const client2 = tls.connect(client2options); client2.on('secureConnect', common.mustCall(function() { diff --git a/test/parallel/test-tls-connect-stream-writes.js b/test/parallel/test-tls-connect-stream-writes.js index 001fe985800f28..9095bdab28b9d5 100644 --- a/test/parallel/test-tls-connect-stream-writes.js +++ b/test/parallel/test-tls-connect-stream-writes.js @@ -43,12 +43,12 @@ server.listen(0, function() { }, write: function write(data, enc, cb) { raw.write(data, enc, cb); - } + }, }); const socket = tls.connect({ socket: p, - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { for (let i = 0; i < 50; ++i) { socket.write(content); diff --git a/test/parallel/test-tls-connect-timeout-option.js b/test/parallel/test-tls-connect-timeout-option.js index 3c4328d94d917e..f4890ae60b59a0 100644 --- a/test/parallel/test-tls-connect-timeout-option.js +++ b/test/parallel/test-tls-connect-timeout-option.js @@ -14,7 +14,7 @@ const tls = require('tls'); const socket = tls.connect({ port: 42, lookup: () => {}, - timeout: 1000 + timeout: 1000, }); assert.strictEqual(socket.timeout, 1000); diff --git a/test/parallel/test-tls-delayed-attach-error.js b/test/parallel/test-tls-delayed-attach-error.js index 69a35f011ea774..63b534758ece57 100644 --- a/test/parallel/test-tls-delayed-attach-error.js +++ b/test/parallel/test-tls-delayed-attach-error.js @@ -12,14 +12,14 @@ const bonkers = Buffer.alloc(1024, 42); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = net.createServer(common.mustCall(function(c) { setTimeout(common.mustCall(function() { const s = new tls.TLSSocket(c, { isServer: true, - secureContext: tls.createSecureContext(options) + secureContext: tls.createSecureContext(options), }); s.on('_tlsError', common.mustCall()); diff --git a/test/parallel/test-tls-delayed-attach.js b/test/parallel/test-tls-delayed-attach.js index b756db2d67ca5f..789732d44db416 100644 --- a/test/parallel/test-tls-delayed-attach.js +++ b/test/parallel/test-tls-delayed-attach.js @@ -40,14 +40,14 @@ let received = ''; const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = net.createServer(common.mustCall((c) => { setTimeout(function() { const s = new tls.TLSSocket(c, { isServer: true, - secureContext: tls.createSecureContext(options) + secureContext: tls.createSecureContext(options), }); s.on('data', (chunk) => { @@ -61,7 +61,7 @@ const server = net.createServer(common.mustCall((c) => { }, 200); })).listen(0, common.mustCall(() => { const c = tls.connect(server.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }, () => { c.end(sent); }); diff --git a/test/parallel/test-tls-destroy-whilst-write.js b/test/parallel/test-tls-destroy-whilst-write.js index d157c7bf3f82b5..0ee4af3e8bac8f 100644 --- a/test/parallel/test-tls-destroy-whilst-write.js +++ b/test/parallel/test-tls-destroy-whilst-write.js @@ -16,11 +16,11 @@ const delay = new stream.Duplex({ console.log('done'); cb(); }); - } + }, }); const secure = tls.connect({ - socket: delay + socket: delay, }); setImmediate(function() { secure.destroy(); diff --git a/test/parallel/test-tls-dhe.js b/test/parallel/test-tls-dhe.js index ef645ce1b6c624..418e1223f516db 100644 --- a/test/parallel/test-tls-dhe.js +++ b/test/parallel/test-tls-dhe.js @@ -53,7 +53,7 @@ function test(keylen, expectedCipher, cb) { key: key, cert: cert, ciphers: ciphers, - dhparam: loadDHParam(keylen) + dhparam: loadDHParam(keylen), }; const server = tls.createServer(options, function(conn) { diff --git a/test/parallel/test-tls-disable-renegotiation.js b/test/parallel/test-tls-disable-renegotiation.js index f720eec6c6448a..cb99a0cc9d3582 100644 --- a/test/parallel/test-tls-disable-renegotiation.js +++ b/test/parallel/test-tls-disable-renegotiation.js @@ -23,7 +23,7 @@ const server = tls.Server(options, common.mustCall((socket) => { common.expectsError({ name: 'Error', code: 'ERR_TLS_RENEGOTIATION_DISABLED', - message: 'TLS session renegotiation disabled for this socket' + message: 'TLS session renegotiation disabled for this socket', })(err); socket.destroy(); server.close(); @@ -46,7 +46,7 @@ server.listen(0, common.mustCall(() => { const port = server.address().port; const options = { rejectUnauthorized: false, - port + port, }; const client = tls.connect(options, common.mustCall(() => { diff --git a/test/parallel/test-tls-ecdh-auto.js b/test/parallel/test-tls-ecdh-auto.js index 7b535ecd3a18f0..feaa95c0eac507 100644 --- a/test/parallel/test-tls-ecdh-auto.js +++ b/test/parallel/test-tls-ecdh-auto.js @@ -23,7 +23,7 @@ const options = { key: loadPEM('agent2-key'), cert: loadPEM('agent2-cert'), ciphers: '-ALL:ECDHE-RSA-AES128-SHA256', - ecdhCurve: 'auto' + ecdhCurve: 'auto', }; const reply = 'I AM THE WALRUS'; // Something recognizable diff --git a/test/parallel/test-tls-ecdh-multiple.js b/test/parallel/test-tls-ecdh-multiple.js index 25e6314a54a58d..1b22bb3928062d 100644 --- a/test/parallel/test-tls-ecdh-multiple.js +++ b/test/parallel/test-tls-ecdh-multiple.js @@ -23,7 +23,7 @@ const options = { key: loadPEM('agent2-key'), cert: loadPEM('agent2-cert'), ciphers: '-ALL:ECDHE-RSA-AES128-SHA256', - ecdhCurve: 'secp256k1:prime256v1:secp521r1' + ecdhCurve: 'secp256k1:prime256v1:secp521r1', }; const reply = 'I AM THE WALRUS'; // Something recognizable diff --git a/test/parallel/test-tls-ecdh.js b/test/parallel/test-tls-ecdh.js index c0d2625a9a6168..eb56df51fb8a2a 100644 --- a/test/parallel/test-tls-ecdh.js +++ b/test/parallel/test-tls-ecdh.js @@ -38,7 +38,7 @@ const options = { key: fixtures.readKey('agent2-key.pem'), cert: fixtures.readKey('agent2-cert.pem'), ciphers: '-ALL:ECDHE-RSA-AES128-SHA256', - ecdhCurve: 'prime256v1' + ecdhCurve: 'prime256v1', }; const reply = 'I AM THE WALRUS'; // Something recognizable diff --git a/test/parallel/test-tls-empty-sni-context.js b/test/parallel/test-tls-empty-sni-context.js index 9b963e66294c32..cc78eedf7046cd 100644 --- a/test/parallel/test-tls-empty-sni-context.js +++ b/test/parallel/test-tls-empty-sni-context.js @@ -10,7 +10,7 @@ const tls = require('tls'); const options = { SNICallback: (name, callback) => { callback(null, tls.createSecureContext()); - } + }, }; const server = tls.createServer(options, (c) => { @@ -22,7 +22,7 @@ const server = tls.createServer(options, (c) => { const c = tls.connect({ port: server.address().port, rejectUnauthorized: false, - servername: 'any.name' + servername: 'any.name', }, common.mustNotCall()); c.on('error', common.mustCall((err) => { diff --git a/test/parallel/test-tls-enable-keylog-cli.js b/test/parallel/test-tls-enable-keylog-cli.js index 128d9a096a0532..fdd6647d5d8e36 100644 --- a/test/parallel/test-tls-enable-keylog-cli.js +++ b/test/parallel/test-tls-enable-keylog-cli.js @@ -18,7 +18,7 @@ tmpdir.refresh(); const file = path.resolve(tmpdir.path, 'keylog.log'); const child = fork(__filename, ['test'], { - execArgv: ['--tls-keylog=' + file] + execArgv: ['--tls-keylog=' + file], }); child.on('close', common.mustCall((code, signal) => { @@ -33,7 +33,7 @@ child.on('close', common.mustCall((code, signal) => { function test() { const { - connect, keys + connect, keys, } = require(fixtures.path('tls-connect')); connect({ diff --git a/test/parallel/test-tls-enable-trace-cli.js b/test/parallel/test-tls-enable-trace-cli.js index 951dca4a87f1ed..6f79bc9d4bba6b 100644 --- a/test/parallel/test-tls-enable-trace-cli.js +++ b/test/parallel/test-tls-enable-trace-cli.js @@ -19,7 +19,7 @@ if (!binding('tls_wrap').HAVE_SSL_TRACE) const child = fork(__filename, ['test'], { silent: true, - execArgv: ['--trace-tls'] + execArgv: ['--trace-tls'], }); let stdout = ''; @@ -41,7 +41,7 @@ child.on('close', common.mustCall((code, signal) => { function test() { const { - connect, keys + connect, keys, } = require(fixtures.path('tls-connect')); connect({ @@ -51,7 +51,7 @@ function test() { }, server: { cert: keys.agent6.cert, - key: keys.agent6.key + key: keys.agent6.key, }, }, common.mustCall((err, pair, cleanup) => { if (pair.server.err) { diff --git a/test/parallel/test-tls-enable-trace.js b/test/parallel/test-tls-enable-trace.js index a3b1721ade10c2..bb4898d2a80eaf 100644 --- a/test/parallel/test-tls-enable-trace.js +++ b/test/parallel/test-tls-enable-trace.js @@ -37,7 +37,7 @@ child.on('exit', common.mustCall((code) => { function test() { const { - connect, keys + connect, keys, } = require(fixtures.path('tls-connect')); connect({ diff --git a/test/parallel/test-tls-env-extra-ca.js b/test/parallel/test-tls-env-extra-ca.js index 7ac5ca3c86e5b5..8fdc623f3e3aff 100644 --- a/test/parallel/test-tls-env-extra-ca.js +++ b/test/parallel/test-tls-env-extra-ca.js @@ -36,7 +36,7 @@ const server = tls.createServer(options, common.mustCall(function(s) { ...process.env, CHILD: 'yes', PORT: this.address().port, - NODE_EXTRA_CA_CERTS: fixtures.path('keys', 'ca1-cert.pem') + NODE_EXTRA_CA_CERTS: fixtures.path('keys', 'ca1-cert.pem'), }; fork(__filename, { env }).on('exit', common.mustCall(function(status) { diff --git a/test/parallel/test-tls-error-servername.js b/test/parallel/test-tls-error-servername.js index 12e6f89e60fc0f..55f871cabc262d 100644 --- a/test/parallel/test-tls-error-servername.js +++ b/test/parallel/test-tls-error-servername.js @@ -20,7 +20,7 @@ const ca = fixtures.readKey('ca1-cert.pem'); const client = connect({ socket: clientSide, ca, - host: 'agent1' // Hostname from certificate + host: 'agent1', // Hostname from certificate }); [undefined, null, 1, true, {}].forEach((value) => { @@ -29,7 +29,7 @@ const client = connect({ }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "name" argument must be of type string.' + - common.invalidArgTypeHelper(value) + common.invalidArgTypeHelper(value), }); }); @@ -37,12 +37,12 @@ const server = new TLSSocket(serverSide, { isServer: true, key, cert, - ca + ca, }); assert.throws(() => { server.setServername('localhost'); }, { code: 'ERR_TLS_SNI_FROM_SERVER', - message: 'Cannot issue SNI from a TLS server-side socket' + message: 'Cannot issue SNI from a TLS server-side socket', }); diff --git a/test/parallel/test-tls-exportkeyingmaterial.js b/test/parallel/test-tls-exportkeyingmaterial.js index b3173f94001194..762662846ccb6e 100644 --- a/test/parallel/test-tls-exportkeyingmaterial.js +++ b/test/parallel/test-tls-exportkeyingmaterial.js @@ -19,7 +19,7 @@ const server = net.createServer(common.mustCall((s) => { const tlsSocket = new tls.TLSSocket(s, { isServer: true, server: server, - secureContext: tls.createSecureContext({ key, cert }) + secureContext: tls.createSecureContext({ key, cert }), }); assert.throws(() => { @@ -27,7 +27,7 @@ const server = net.createServer(common.mustCall((s) => { }, { name: 'Error', message: 'TLS socket connection must be securely established', - code: 'ERR_TLS_INVALID_STATE' + code: 'ERR_TLS_INVALID_STATE', }); tlsSocket.on('secure', common.mustCall(() => { @@ -51,42 +51,42 @@ const server = net.createServer(common.mustCall((s) => { tlsSocket.exportKeyingMaterial(128, label, 'stringAsContextNotSupported'); }, { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => { tlsSocket.exportKeyingMaterial(128, label, 1234); }, { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => { tlsSocket.exportKeyingMaterial(10, null); }, { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => { tlsSocket.exportKeyingMaterial('length', 1234); }, { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => { tlsSocket.exportKeyingMaterial(-3, 'a'); }, { name: 'RangeError', - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); assert.throws(() => { tlsSocket.exportKeyingMaterial(0, 'a'); }, { name: 'RangeError', - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); tlsSocket.end(); @@ -95,7 +95,7 @@ const server = net.createServer(common.mustCall((s) => { })).listen(0, () => { const opts = { port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }; tls.connect(opts, common.mustCall(function() { this.end(); })); diff --git a/test/parallel/test-tls-finished.js b/test/parallel/test-tls-finished.js index 8b52934b049d95..3a050c5c1df743 100644 --- a/test/parallel/test-tls-finished.js +++ b/test/parallel/test-tls-finished.js @@ -20,11 +20,11 @@ const msg = {}; const pem = (n) => fixtures.readKey(`${n}.pem`); const server = tls.createServer({ key: pem('agent1-key'), - cert: pem('agent1-cert') + cert: pem('agent1-cert'), }, common.mustCall((alice) => { msg.server = { alice: alice.getFinished(), - bob: alice.getPeerFinished() + bob: alice.getPeerFinished(), }; server.close(); })); @@ -32,18 +32,18 @@ const server = tls.createServer({ server.listen(0, common.mustCall(() => { const bob = tls.connect({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { msg.client = { alice: bob.getPeerFinished(), - bob: bob.getFinished() + bob: bob.getFinished(), }; bob.end(); })); msg.before = { alice: bob.getPeerFinished(), - bob: bob.getFinished() + bob: bob.getFinished(), }; })); diff --git a/test/parallel/test-tls-generic-stream.js b/test/parallel/test-tls-generic-stream.js index d4e5427acae110..9aba5908d77ff0 100644 --- a/test/parallel/test-tls-generic-stream.js +++ b/test/parallel/test-tls-generic-stream.js @@ -17,13 +17,13 @@ const { clientSide, serverSide } = makeDuplexPair(); const clientTLS = connect({ socket: clientSide, ca, - host: 'agent1' // Hostname from certificate + host: 'agent1', // Hostname from certificate }); const serverTLS = new TLSSocket(serverSide, { isServer: true, key, cert, - ca + ca, }); assert.strictEqual(clientTLS.connecting, false); diff --git a/test/parallel/test-tls-getcertificate-x509.js b/test/parallel/test-tls-getcertificate-x509.js index 5be788f6793113..7f5fa2ff975186 100644 --- a/test/parallel/test-tls-getcertificate-x509.js +++ b/test/parallel/test-tls-getcertificate-x509.js @@ -10,7 +10,7 @@ const { X509Certificate } = require('crypto'); const options = { key: fixtures.readKey('agent6-key.pem'), - cert: fixtures.readKey('agent6-cert.pem') + cert: fixtures.readKey('agent6-cert.pem'), }; const server = tls.createServer(options, function(cleartext) { @@ -28,7 +28,7 @@ server.once('secureConnection', common.mustCall(function(socket) { server.listen(0, common.mustCall(function() { const socket = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { const peerCert = socket.getPeerX509Certificate(); assert(peerCert.issuerCertificate instanceof X509Certificate); diff --git a/test/parallel/test-tls-getcipher.js b/test/parallel/test-tls-getcipher.js index 744276aa59bf37..fd2c675ca07e12 100644 --- a/test/parallel/test-tls-getcipher.js +++ b/test/parallel/test-tls-getcipher.js @@ -33,7 +33,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent2-key.pem'), cert: fixtures.readKey('agent2-cert.pem'), - honorCipherOrder: true + honorCipherOrder: true, }; let clients = 0; @@ -48,7 +48,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { host: '127.0.0.1', port: this.address().port, ciphers: 'AES128-SHA256', - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { const cipher = this.getCipher(); assert.strictEqual(cipher.name, 'AES128-SHA256'); @@ -62,7 +62,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { host: '127.0.0.1', port: this.address().port, ciphers: 'ECDHE-RSA-AES128-GCM-SHA256', - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { const cipher = this.getCipher(); assert.strictEqual(cipher.name, 'ECDHE-RSA-AES128-GCM-SHA256'); @@ -85,7 +85,7 @@ tls.createServer({ port: this.address().port, ciphers: 'TLS_AES_128_CCM_8_SHA256', maxVersion: 'TLSv1.3', - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { const cipher = client.getCipher(); assert.strictEqual(cipher.name, 'TLS_AES_128_CCM_8_SHA256'); diff --git a/test/parallel/test-tls-getprotocol.js b/test/parallel/test-tls-getprotocol.js index 02c683c71c8775..e1ed64b1453abd 100644 --- a/test/parallel/test-tls-getprotocol.js +++ b/test/parallel/test-tls-getprotocol.js @@ -20,7 +20,7 @@ const serverConfig = { secureProtocol: 'TLS_method', ciphers: 'RSA@SECLEVEL=0', key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }; const server = tls.createServer(serverConfig, common.mustCall(function() { @@ -32,7 +32,7 @@ const server = tls.createServer(serverConfig, common.mustCall(function() { host: common.localhostIPv4, port: server.address().port, rejectUnauthorized: false, - secureProtocol: v.secureProtocol + secureProtocol: v.secureProtocol, }, common.mustCall(function() { assert.strictEqual(this.getProtocol(), v.version); this.on('end', common.mustCall()); diff --git a/test/parallel/test-tls-handshake-error.js b/test/parallel/test-tls-handshake-error.js index 500e7a0cc6016c..8dfce37e2c1990 100644 --- a/test/parallel/test-tls-handshake-error.js +++ b/test/parallel/test-tls-handshake-error.js @@ -13,13 +13,13 @@ const fixtures = require('../common/fixtures'); const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), - rejectUnauthorized: true + rejectUnauthorized: true, }, function(c) { }).listen(0, common.mustCall(function() { assert.throws(() => { tls.connect({ port: this.address().port, - ciphers: 'no-such-cipher' + ciphers: 'no-such-cipher', }, common.mustNotCall()); }, /no cipher match/i); diff --git a/test/parallel/test-tls-hello-parser-failure.js b/test/parallel/test-tls-hello-parser-failure.js index 07776dd89e9227..0c186e8524989b 100644 --- a/test/parallel/test-tls-hello-parser-failure.js +++ b/test/parallel/test-tls-hello-parser-failure.js @@ -37,7 +37,7 @@ const net = require('net'); const options = { key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const bonkers = Buffer.alloc(1024 * 1024, 42); diff --git a/test/parallel/test-tls-honorcipherorder.js b/test/parallel/test-tls-honorcipherorder.js index 8e7c4badcb269d..5355d98f5b8ce4 100644 --- a/test/parallel/test-tls-honorcipherorder.js +++ b/test/parallel/test-tls-honorcipherorder.js @@ -35,7 +35,7 @@ function test(honorCipherOrder, clientCipher, expectedCipher, defaultCiphers) { server.listen(0, localhost, mustCall(function() { const coptions = { rejectUnauthorized: false, - secureProtocol: SSL_Method + secureProtocol: SSL_Method, }; if (clientCipher) { coptions.ciphers = clientCipher; diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js index 7310308e6f9876..8e385975409e7c 100644 --- a/test/parallel/test-tls-inception.js +++ b/test/parallel/test-tls-inception.js @@ -33,7 +33,7 @@ const net = require('net'); const options = { key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const body = 'A'.repeat(40000); @@ -43,7 +43,7 @@ const a = tls.createServer(options, function(socket) { const myOptions = { host: '127.0.0.1', port: b.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }; const dest = net.connect(myOptions); dest.pipe(socket); @@ -64,12 +64,12 @@ a.listen(0, function() { const myOptions = { host: '127.0.0.1', port: a.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }; const socket = tls.connect(myOptions); const ssl = tls.connect({ socket: socket, - rejectUnauthorized: false + rejectUnauthorized: false, }); ssl.setEncoding('utf8'); let buf = ''; diff --git a/test/parallel/test-tls-invoke-queued.js b/test/parallel/test-tls-invoke-queued.js index 482ab847352793..6e21ebb45aa796 100644 --- a/test/parallel/test-tls-invoke-queued.js +++ b/test/parallel/test-tls-invoke-queued.js @@ -34,7 +34,7 @@ let received = ''; const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, common.mustCall(function(c) { c.write('hello ', null, common.mustCall(function() { c.write('world!', null, common.mustCall(function() { @@ -47,7 +47,7 @@ const server = tls.createServer({ server.close(); })).listen(0, common.mustCall(function() { const c = tls.connect(this.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { c.on('data', function(chunk) { received += chunk; diff --git a/test/parallel/test-tls-ip-servername-deprecation.js b/test/parallel/test-tls-ip-servername-deprecation.js index b747caa03d57c4..ebc94b3d27f16c 100644 --- a/test/parallel/test-tls-ip-servername-deprecation.js +++ b/test/parallel/test-tls-ip-servername-deprecation.js @@ -20,7 +20,7 @@ common.expectWarning( { const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = tls.createServer(options, function(s) { diff --git a/test/parallel/test-tls-js-stream.js b/test/parallel/test-tls-js-stream.js index 298252962ba9cd..a83fa49fdc1541 100644 --- a/test/parallel/test-tls-js-stream.js +++ b/test/parallel/test-tls-js-stream.js @@ -12,7 +12,7 @@ const tls = require('tls'); const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, common.mustCall(function(c) { console.log('new client'); @@ -46,12 +46,12 @@ const server = tls.createServer({ write: function write(data, enc, cb) { console.log('write', data, enc); raw.write(data, enc, cb); - } + }, }); const socket = tls.connect({ socket: p, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { console.log('client secure'); diff --git a/test/parallel/test-tls-junk-closes-server.js b/test/parallel/test-tls-junk-closes-server.js index 06fa57267a9104..4ddad3fb2b5948 100644 --- a/test/parallel/test-tls-junk-closes-server.js +++ b/test/parallel/test-tls-junk-closes-server.js @@ -31,7 +31,7 @@ const net = require('net'); const options = { key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }; const server = tls.createServer(options, common.mustNotCall()); diff --git a/test/parallel/test-tls-key-mismatch.js b/test/parallel/test-tls-key-mismatch.js index fdbb3676267a9d..eb08ae852c00a2 100644 --- a/test/parallel/test-tls-key-mismatch.js +++ b/test/parallel/test-tls-key-mismatch.js @@ -35,7 +35,7 @@ const errorMessageRegex = common.hasOpenSSL3 ? const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }; assert.throws(function() { diff --git a/test/parallel/test-tls-keyengine-unsupported.js b/test/parallel/test-tls-keyengine-unsupported.js index 5fcfe495d516db..3c7e232650f3df 100644 --- a/test/parallel/test-tls-keyengine-unsupported.js +++ b/test/parallel/test-tls-keyengine-unsupported.js @@ -24,12 +24,12 @@ const tls = require('tls'); () => { tls.createSecureContext({ privateKeyEngine: 'engine', - privateKeyIdentifier: 'key' + privateKeyIdentifier: 'key', }); }, { code: 'ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED', - message: 'Custom engines not supported by this OpenSSL' + message: 'Custom engines not supported by this OpenSSL', } ); } diff --git a/test/parallel/test-tls-max-send-fragment.js b/test/parallel/test-tls-max-send-fragment.js index bbb7849f005bf9..dacc714b6b3417 100644 --- a/test/parallel/test-tls-max-send-fragment.js +++ b/test/parallel/test-tls-max-send-fragment.js @@ -35,12 +35,12 @@ const maxChunk = 768; const invalidArgumentError = { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }; const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, function(c) { // No size is passed. @@ -54,7 +54,7 @@ const server = tls.createServer({ [NaN, Infinity, 2 ** 31].forEach((arg) => { assert.throws(() => c.setMaxSendFragment(arg), { name: 'RangeError', - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }); }); @@ -70,7 +70,7 @@ const server = tls.createServer({ c.end(buf); }).listen(0, common.mustCall(function() { const c = tls.connect(this.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { c.on('data', function(chunk) { assert(chunk.length <= maxChunk); diff --git a/test/parallel/test-tls-min-max-version.js b/test/parallel/test-tls-min-max-version.js index 8dbef1fa37aa2d..496bb33c1ba2e4 100644 --- a/test/parallel/test-tls-min-max-version.js +++ b/test/parallel/test-tls-min-max-version.js @@ -6,7 +6,7 @@ const { inspect } = require('util'); // Check min/max protocol versions. const { - assert, connect, keys, tls + assert, connect, keys, tls, } = require(fixtures.path('tls-connect')); const DEFAULT_MIN_VERSION = tls.DEFAULT_MIN_VERSION; const DEFAULT_MAX_VERSION = tls.DEFAULT_MAX_VERSION; @@ -33,7 +33,7 @@ function test(cmin, cmax, cprot, smin, smax, sprot, proto, cerr, serr) { minVersion: cmin, maxVersion: cmax, secureProtocol: cprot, - ciphers: ciphers + ciphers: ciphers, }, server: { cert: keys.agent6.cert, @@ -41,7 +41,7 @@ function test(cmin, cmax, cprot, smin, smax, sprot, proto, cerr, serr) { minVersion: smin, maxVersion: smax, secureProtocol: sprot, - ciphers: ciphers + ciphers: ciphers, }, }, common.mustCall((err, pair, cleanup) => { function u(_) { return _ === undefined ? 'U' : _; } diff --git a/test/parallel/test-tls-multi-key.js b/test/parallel/test-tls-multi-key.js index b9eaa05d59feb6..39a882fb945fc6 100644 --- a/test/parallel/test-tls-multi-key.js +++ b/test/parallel/test-tls-multi-key.js @@ -158,7 +158,7 @@ function test(options) { assert.deepStrictEqual(ecdsa.getCipher(), { name: 'ECDHE-ECDSA-AES256-GCM-SHA384', standardName: 'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384', - version: 'TLSv1.2' + version: 'TLSv1.2', }); assert.strictEqual(ecdsa.getPeerCertificate().subject.CN, eccCN); assert.strictEqual(ecdsa.getPeerCertificate().asn1Curve, 'prime256v1'); @@ -177,7 +177,7 @@ function test(options) { assert.deepStrictEqual(rsa.getCipher(), { name: 'ECDHE-RSA-AES256-GCM-SHA384', standardName: 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384', - version: 'TLSv1.2' + version: 'TLSv1.2', }); assert.strictEqual(rsa.getPeerCertificate().subject.CN, rsaCN); assert(rsa.getPeerCertificate().exponent, 'cert for an RSA key'); diff --git a/test/parallel/test-tls-multi-pfx.js b/test/parallel/test-tls-multi-pfx.js index f353183ce2fa0c..f2b3016ebd01d7 100644 --- a/test/parallel/test-tls-multi-pfx.js +++ b/test/parallel/test-tls-multi-pfx.js @@ -11,10 +11,10 @@ const options = { pfx: [ { buf: fixtures.readKey('agent1.pfx'), - passphrase: 'sample' + passphrase: 'sample', }, fixtures.readKey('ec.pfx'), - ] + ], }; const ciphers = []; @@ -24,12 +24,12 @@ const server = tls.createServer(options, function(conn) { }).listen(0, function() { const ecdsa = tls.connect(this.address().port, { ciphers: 'ECDHE-ECDSA-AES256-GCM-SHA384', - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { ciphers.push(ecdsa.getCipher()); const rsa = tls.connect(server.address().port, { ciphers: 'ECDHE-RSA-AES256-GCM-SHA384', - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { ciphers.push(rsa.getCipher()); ecdsa.end(); @@ -43,10 +43,10 @@ process.on('exit', function() { assert.deepStrictEqual(ciphers, [{ name: 'ECDHE-ECDSA-AES256-GCM-SHA384', standardName: 'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384', - version: 'TLSv1.2' + version: 'TLSv1.2', }, { name: 'ECDHE-RSA-AES256-GCM-SHA384', standardName: 'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384', - version: 'TLSv1.2' + version: 'TLSv1.2', }]); }); diff --git a/test/parallel/test-tls-multiple-cas-as-string.js b/test/parallel/test-tls-multiple-cas-as-string.js index 679d6b6c4cdc42..36eb04427771f9 100644 --- a/test/parallel/test-tls-multiple-cas-as-string.js +++ b/test/parallel/test-tls-multiple-cas-as-string.js @@ -26,7 +26,7 @@ function test(ca) { servername: 'agent3', host, port: server.address().port, - ca + ca, }, common.mustCall(() => { socket.end(); })); diff --git a/test/parallel/test-tls-net-connect-prefer-path.js b/test/parallel/test-tls-net-connect-prefer-path.js index cefeb5d4714e70..34ea11add42359 100644 --- a/test/parallel/test-tls-net-connect-prefer-path.js +++ b/test/parallel/test-tls-net-connect-prefer-path.js @@ -30,7 +30,7 @@ function mkServer(lib, tcp, cb) { if (lib === tls) { args.unshift({ cert: fixtures.readKey('rsa_cert.crt'), - key: fixtures.readKey('rsa_private.pem') + key: fixtures.readKey('rsa_private.pem'), }); } const server = lib.createServer(...args); @@ -44,7 +44,7 @@ function testLib(lib, cb) { path: unixServer.address(), port: tcpServer.address().port, host: 'localhost', - rejectUnauthorized: false + rejectUnauthorized: false, }, () => { const bufs = []; client.on('data', common.mustCall((d) => { diff --git a/test/parallel/test-tls-no-cert-required.js b/test/parallel/test-tls-no-cert-required.js index b3dcfa516ab502..7388dd509be22e 100644 --- a/test/parallel/test-tls-no-cert-required.js +++ b/test/parallel/test-tls-no-cert-required.js @@ -45,7 +45,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object. ' + - "Received type string ('this is not valid')" + "Received type string ('this is not valid')", } ); diff --git a/test/parallel/test-tls-no-rsa-key.js b/test/parallel/test-tls-no-rsa-key.js index e3c1b5eda316b3..adb21f92f4c4d3 100644 --- a/test/parallel/test-tls-no-rsa-key.js +++ b/test/parallel/test-tls-no-rsa-key.js @@ -30,14 +30,14 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('/ec-key.pem'), - cert: fixtures.readKey('ec-cert.pem') + cert: fixtures.readKey('ec-cert.pem'), }; const server = tls.createServer(options, function(conn) { conn.end('ok'); }).listen(0, common.mustCall(function() { const c = tls.connect(this.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { c.on('end', common.mustCall(function() { c.end(); diff --git a/test/parallel/test-tls-ocsp-callback.js b/test/parallel/test-tls-ocsp-callback.js index d374ebdf63fb2c..18613585cffbf9 100644 --- a/test/parallel/test-tls-ocsp-callback.js +++ b/test/parallel/test-tls-ocsp-callback.js @@ -44,7 +44,7 @@ function test(testOptions, cb) { const options = { key, cert, - ca: [ca] + ca: [ca], }; const requestCount = testOptions.response ? 0 : 1; @@ -86,7 +86,7 @@ function test(testOptions, cb) { port: this.address().port, requestOCSP: testOptions.ocsp, secureOptions: testOptions.ocsp ? 0 : SSL_OP_NO_TICKET, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { }, requestCount)); client.on('OCSPResponse', common.mustCall((resp) => { diff --git a/test/parallel/test-tls-on-empty-socket.js b/test/parallel/test-tls-on-empty-socket.js index 87d51a81bbe08e..ddc4a5953b3485 100644 --- a/test/parallel/test-tls-on-empty-socket.js +++ b/test/parallel/test-tls-on-empty-socket.js @@ -13,7 +13,7 @@ let out = ''; const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, function(c) { c.end('hello'); }).listen(0, function() { @@ -21,7 +21,7 @@ const server = tls.createServer({ const s = tls.connect({ socket: socket, - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { s.on('data', function(chunk) { out += chunk; diff --git a/test/parallel/test-tls-onread-static-buffer.js b/test/parallel/test-tls-onread-static-buffer.js index 6e19184e887d2a..2c3abdcfffed29 100644 --- a/test/parallel/test-tls-onread-static-buffer.js +++ b/test/parallel/test-tls-onread-static-buffer.js @@ -9,7 +9,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }; const smallMessage = Buffer.from('hello world'); @@ -33,8 +33,8 @@ tls.createServer(options, common.mustCall(function(socket) { assert.strictEqual(buf, sockBuf); received += nread; buffers.push(Buffer.from(buf.slice(0, nread))); - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, smallMessage.length); assert.deepStrictEqual(Buffer.concat(buffers), smallMessage); @@ -61,8 +61,8 @@ tls.createServer(options, common.mustCall(function(socket) { newIncoming.set(incoming); newIncoming.set(buf.slice(0, nread), incoming.length); incoming = newIncoming; - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, smallMessage.length); assert.deepStrictEqual(incoming, new Uint8Array(smallMessage)); @@ -92,8 +92,8 @@ tls.createServer(options, common.mustCall(function(socket) { assert.strictEqual(buf, bufPool[bufPoolIdx]); received += nread; incoming.push(Buffer.from(buf.slice(0, nread))); - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, smallMessage.length); assert.deepStrictEqual(Buffer.concat(incoming), smallMessage); @@ -127,8 +127,8 @@ tls.createServer(options, common.mustCall(function(socket) { newIncoming.set(incoming); newIncoming.set(buf.slice(0, nread), incoming.length); incoming = newIncoming; - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, smallMessage.length); assert.deepStrictEqual(incoming, new Uint8Array(smallMessage)); @@ -162,8 +162,8 @@ tls.createServer(options, common.mustCall(function(socket) { client.resume(); }, 100); } - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, largeMessage.length); assert.deepStrictEqual(Buffer.concat(buffers), largeMessage); @@ -197,8 +197,8 @@ tls.createServer(options, common.mustCall(function(socket) { return false; } return true; - } - } + }, + }, }).on('data', common.mustNotCall()).on('end', common.mustCall(() => { assert.strictEqual(received, largeMessage.length); assert.deepStrictEqual(Buffer.concat(buffers), largeMessage); diff --git a/test/parallel/test-tls-options-boolean-check.js b/test/parallel/test-tls-options-boolean-check.js index 900a39f0c1cd42..81cd7a7b20df90 100644 --- a/test/parallel/test-tls-options-boolean-check.js +++ b/test/parallel/test-tls-options-boolean-check.js @@ -89,7 +89,7 @@ const caArrDataView = toDataView(caCert); name: 'TypeError', message: 'The "options.key" property must be of type string or an ' + 'instance of Buffer, TypedArray, or DataView.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), }); }); @@ -115,7 +115,7 @@ const caArrDataView = toDataView(caCert); name: 'TypeError', message: 'The "options.cert" property must be of type string or an ' + 'instance of Buffer, TypedArray, or DataView.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), }); }); @@ -150,7 +150,7 @@ const caArrDataView = toDataView(caCert); name: 'TypeError', message: 'The "options.ca" property must be of type string or an instance' + ' of Buffer, TypedArray, or DataView.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), }); }); diff --git a/test/parallel/test-tls-over-http-tunnel.js b/test/parallel/test-tls-over-http-tunnel.js index b26cf7872f6582..5a52013e41c544 100644 --- a/test/parallel/test-tls-over-http-tunnel.js +++ b/test/parallel/test-tls-over-http-tunnel.js @@ -43,7 +43,7 @@ const options = { key, cert }; const server = https.createServer(options, common.mustCall((req, res) => { console.log('SERVER: got request'); res.writeHead(200, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }); console.log('SERVER: sending response'); res.end('hello world\n'); @@ -104,8 +104,8 @@ proxy.listen(0, common.mustCall(() => { method: 'CONNECT', path: `localhost:${server.address().port}`, headers: { - 'Proxy-Connections': 'keep-alive' - } + 'Proxy-Connections': 'keep-alive', + }, }); req.useChunkedEncodingByDefault = false; // for v0.6 req.on('response', onResponse); // for v0.6 @@ -147,7 +147,7 @@ proxy.listen(0, common.mustCall(() => { cert: cert, socket: socket, // reuse the socket agent: false, - rejectUnauthorized: false + rejectUnauthorized: false, }, (res) => { assert.strictEqual(res.statusCode, 200); diff --git a/test/parallel/test-tls-parse-cert-string.js b/test/parallel/test-tls-parse-cert-string.js index f5412cad4074c4..af4aa6fe81933c 100644 --- a/test/parallel/test-tls-parse-cert-string.js +++ b/test/parallel/test-tls-parse-cert-string.js @@ -7,7 +7,7 @@ if (!common.hasCrypto) const { hijackStderr, - restoreStderr + restoreStderr, } = require('../common/hijackstdio'); const assert = require('assert'); // Flags: --expose-internals @@ -29,7 +29,7 @@ hijackStderr(noOutput); O: 'Node.js Foundation', OU: 'Node.js', CN: 'ca1', - emailAddress: 'ry@clouds.org' + emailAddress: 'ry@clouds.org', }); } @@ -40,7 +40,7 @@ hijackStderr(noOutput); assert.deepStrictEqual(doublesOut, { __proto__: null, OU: [ 'Domain Control Validated', 'PositiveSSL Wildcard' ], - CN: '*.nodejs.org' + CN: '*.nodejs.org', }); } diff --git a/test/parallel/test-tls-passphrase.js b/test/parallel/test-tls-passphrase.js index ce77dd18a6e620..2610f3575ebf59 100644 --- a/test/parallel/test-tls-passphrase.js +++ b/test/parallel/test-tls-passphrase.js @@ -47,7 +47,7 @@ const server = tls.Server({ cert: cert, ca: [cert], requestCert: true, - rejectUnauthorized: true + rejectUnauthorized: true, }); server.listen(0, common.mustCall(function() { @@ -57,14 +57,14 @@ server.listen(0, common.mustCall(function() { key: passKey, passphrase: 'password', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ port: this.address().port, key: rawKey, cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ @@ -72,7 +72,7 @@ server.listen(0, common.mustCall(function() { key: rawKey, passphrase: 'ignored', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); // Buffer[] @@ -81,14 +81,14 @@ server.listen(0, common.mustCall(function() { key: [passKey], passphrase: 'password', cert: [cert], - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ port: this.address().port, key: [rawKey], cert: [cert], - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ @@ -96,7 +96,7 @@ server.listen(0, common.mustCall(function() { key: [rawKey], passphrase: 'ignored', cert: [cert], - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); // string @@ -105,14 +105,14 @@ server.listen(0, common.mustCall(function() { key: passKey.toString(), passphrase: 'password', cert: cert.toString(), - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ port: this.address().port, key: rawKey.toString(), cert: cert.toString(), - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ @@ -120,7 +120,7 @@ server.listen(0, common.mustCall(function() { key: rawKey.toString(), passphrase: 'ignored', cert: cert.toString(), - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); // String[] @@ -129,14 +129,14 @@ server.listen(0, common.mustCall(function() { key: [passKey.toString()], passphrase: 'password', cert: [cert.toString()], - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ port: this.address().port, key: [rawKey.toString()], cert: [cert.toString()], - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ @@ -144,7 +144,7 @@ server.listen(0, common.mustCall(function() { key: [rawKey.toString()], passphrase: 'ignored', cert: [cert.toString()], - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); // Object[] @@ -152,7 +152,7 @@ server.listen(0, common.mustCall(function() { port: this.address().port, key: [{ pem: passKey, passphrase: 'password' }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ @@ -160,7 +160,7 @@ server.listen(0, common.mustCall(function() { key: [{ pem: passKey, passphrase: 'password' }], passphrase: 'ignored', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ @@ -168,28 +168,28 @@ server.listen(0, common.mustCall(function() { key: [{ pem: passKey }], passphrase: 'password', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ port: this.address().port, key: [{ pem: passKey.toString(), passphrase: 'password' }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ port: this.address().port, key: [{ pem: rawKey, passphrase: 'ignored' }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ port: this.address().port, key: [{ pem: rawKey.toString(), passphrase: 'ignored' }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ @@ -197,7 +197,7 @@ server.listen(0, common.mustCall(function() { key: [{ pem: rawKey }], passphrase: 'ignored', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ @@ -205,21 +205,21 @@ server.listen(0, common.mustCall(function() { key: [{ pem: rawKey.toString() }], passphrase: 'ignored', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ port: this.address().port, key: [{ pem: rawKey }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); tls.connect({ port: this.address().port, key: [{ pem: rawKey.toString() }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, onSecureConnect()); })).unref(); @@ -232,7 +232,7 @@ assert.throws(function() { port: server.address().port, key: passKey, cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessagePassword); @@ -241,7 +241,7 @@ assert.throws(function() { port: server.address().port, key: [passKey], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessagePassword); @@ -250,7 +250,7 @@ assert.throws(function() { port: server.address().port, key: [{ pem: passKey }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessagePassword); @@ -263,7 +263,7 @@ assert.throws(function() { key: passKey, passphrase: 'invalid', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessageDecrypt); @@ -273,7 +273,7 @@ assert.throws(function() { key: [passKey], passphrase: 'invalid', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessageDecrypt); @@ -283,7 +283,7 @@ assert.throws(function() { key: [{ pem: passKey }], passphrase: 'invalid', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessageDecrypt); @@ -293,6 +293,6 @@ assert.throws(function() { key: [{ pem: passKey, passphrase: 'invalid' }], passphrase: 'password', // Valid but unused cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessageDecrypt); diff --git a/test/parallel/test-tls-pause.js b/test/parallel/test-tls-pause.js index 120d6d87a7a913..fe978792e31b96 100644 --- a/test/parallel/test-tls-pause.js +++ b/test/parallel/test-tls-pause.js @@ -33,7 +33,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const bufSize = 1024 * 1024; @@ -51,7 +51,7 @@ server.listen(0, common.mustCall(() => { let resumed = false; const client = tls.connect({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { console.error('connected'); client.pause(); diff --git a/test/parallel/test-tls-peer-certificate-encoding.js b/test/parallel/test-tls-peer-certificate-encoding.js index 154c31c0a1386b..0c75a47be0e78e 100644 --- a/test/parallel/test-tls-peer-certificate-encoding.js +++ b/test/parallel/test-tls-peer-certificate-encoding.js @@ -32,7 +32,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent5-key.pem'), cert: fixtures.readKey('agent5-cert.pem'), - ca: [ fixtures.readKey('ca2-cert.pem') ] + ca: [ fixtures.readKey('ca2-cert.pem') ], }; const server = tls.createServer(options, (cleartext) => { @@ -41,7 +41,7 @@ const server = tls.createServer(options, (cleartext) => { server.listen(0, common.mustCall(function() { const socket = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { const peerCert = socket.getPeerCertificate(); diff --git a/test/parallel/test-tls-peer-certificate-multi-keys.js b/test/parallel/test-tls-peer-certificate-multi-keys.js index ce4a0d406f9ea1..9d64324f7ef04e 100644 --- a/test/parallel/test-tls-peer-certificate-multi-keys.js +++ b/test/parallel/test-tls-peer-certificate-multi-keys.js @@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const server = tls.createServer(options, function(cleartext) { @@ -49,7 +49,7 @@ server.once('secureConnection', common.mustCall(function(socket) { server.listen(0, common.mustCall(function() { const socket = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { const peerCert = socket.getPeerCertificate(); assert.deepStrictEqual( diff --git a/test/parallel/test-tls-peer-certificate.js b/test/parallel/test-tls-peer-certificate.js index 523638d4a39649..e4d4c5b06b4a2d 100644 --- a/test/parallel/test-tls-peer-certificate.js +++ b/test/parallel/test-tls-peer-certificate.js @@ -30,7 +30,7 @@ const crypto = require('crypto'); // Verify that detailed getPeerCertificate() return value has all certs. const { - assert, connect, debug, keys + assert, connect, debug, keys, } = require(fixtures.path('tls-connect')); function sha256(s) { diff --git a/test/parallel/test-tls-pfx-authorizationerror.js b/test/parallel/test-tls-pfx-authorizationerror.js index 5105a60dacd6de..0a1f5d3e823b8f 100644 --- a/test/parallel/test-tls-pfx-authorizationerror.js +++ b/test/parallel/test-tls-pfx-authorizationerror.js @@ -19,7 +19,7 @@ const server = tls pfx: pfx, passphrase: 'sample', requestCert: true, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function(c) { assert.strictEqual(c.getPeerCertificate().serialNumber, @@ -34,7 +34,7 @@ const server = tls port: this.address().port, pfx: pfx, passphrase: 'sample', - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { for (let i = 0; i < 10; ++i) { diff --git a/test/parallel/test-tls-psk-server.js b/test/parallel/test-tls-psk-server.js index b9260958401522..addf8592c4c8bf 100644 --- a/test/parallel/test-tls-psk-server.js +++ b/test/parallel/test-tls-psk-server.js @@ -23,7 +23,7 @@ const server = tls.createServer({ assert.ok(typeof identity === 'string'); if (identity === IDENTITY) return Buffer.from(KEY, 'hex'); - } + }, }); server.on('connection', common.mustCall()); diff --git a/test/parallel/test-tls-request-timeout.js b/test/parallel/test-tls-request-timeout.js index 6bbb8432f5ed0b..b4c0150fd855c7 100644 --- a/test/parallel/test-tls-request-timeout.js +++ b/test/parallel/test-tls-request-timeout.js @@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = tls.Server(options, common.mustCall(function(socket) { @@ -46,6 +46,6 @@ const server = tls.Server(options, common.mustCall(function(socket) { server.listen(0, function() { tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }); }); diff --git a/test/parallel/test-tls-retain-handle-no-abort.js b/test/parallel/test-tls-retain-handle-no-abort.js index 6571aab3a95721..6efa92df2d9a11 100644 --- a/test/parallel/test-tls-retain-handle-no-abort.js +++ b/test/parallel/test-tls-retain-handle-no-abort.js @@ -13,7 +13,7 @@ const sent = 'hello world'; const serverOptions = { isServer: true, key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; let ssl = null; diff --git a/test/parallel/test-tls-reuse-host-from-socket.js b/test/parallel/test-tls-reuse-host-from-socket.js index 1a7705d911b69e..c0ecf43e6194c4 100644 --- a/test/parallel/test-tls-reuse-host-from-socket.js +++ b/test/parallel/test-tls-reuse-host-from-socket.js @@ -31,7 +31,7 @@ const fixtures = require('../common/fixtures'); const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }).listen(0, common.mustCall(() => { const socket = net.connect(server.address().port, common.mustCall(() => { const opts = { socket, rejectUnauthorized: false }; diff --git a/test/parallel/test-tls-secure-context-usage-order.js b/test/parallel/test-tls-secure-context-usage-order.js index c79a3eac775822..2270e567d45418 100644 --- a/test/parallel/test-tls-secure-context-usage-order.js +++ b/test/parallel/test-tls-secure-context-usage-order.js @@ -25,13 +25,13 @@ const serverOptions = { const badSecureContext = { key: loadPEM('agent1-key'), cert: loadPEM('agent1-cert'), - ca: [ loadPEM('ca2-cert') ] + ca: [ loadPEM('ca2-cert') ], }; const goodSecureContext = { key: loadPEM('agent1-key'), cert: loadPEM('agent1-cert'), - ca: [ loadPEM('ca1-cert') ] + ca: [ loadPEM('ca1-cert') ], }; const server = tls.createServer(serverOptions, (c) => { diff --git a/test/parallel/test-tls-secure-session.js b/test/parallel/test-tls-secure-session.js index b4b9638a2ccc7a..712400a5ff3e47 100644 --- a/test/parallel/test-tls-secure-session.js +++ b/test/parallel/test-tls-secure-session.js @@ -15,7 +15,7 @@ const options = { // NOTE: TLS 1.3 creates new session ticket **after** handshake so // `getSession()` output will be different even if the session was reused // during the handshake. - secureProtocol: 'TLSv1_2_method' + secureProtocol: 'TLSv1_2_method', }; const server = tls.createServer(options, common.mustCall((socket) => { diff --git a/test/parallel/test-tls-securepair-fiftharg.js b/test/parallel/test-tls-securepair-fiftharg.js index 9adb2bf424818b..966d48eab3c013 100644 --- a/test/parallel/test-tls-securepair-fiftharg.js +++ b/test/parallel/test-tls-securepair-fiftharg.js @@ -10,13 +10,13 @@ const fixtures = require('../common/fixtures'); const sslcontext = tls.createSecureContext({ cert: fixtures.readKey('rsa_cert.crt'), - key: fixtures.readKey('rsa_private.pem') + key: fixtures.readKey('rsa_private.pem'), }); const pair = tls.createSecurePair(sslcontext, true, false, false, { SNICallback: common.mustCall((servername, cb) => { assert.strictEqual(servername, 'www.google.com'); - }) + }), }); // Captured traffic from browser's request to https://www.google.com diff --git a/test/parallel/test-tls-server-capture-rejection.js b/test/parallel/test-tls-server-capture-rejection.js index f9bd3320e101f0..0e5dd4356a7385 100644 --- a/test/parallel/test-tls-server-capture-rejection.js +++ b/test/parallel/test-tls-server-capture-rejection.js @@ -27,7 +27,7 @@ server.listen(0, common.mustCall(() => { const sock = connect({ port: server.address().port, host: server.address().host, - rejectUnauthorized: false + rejectUnauthorized: false, }); sock.on('close', common.mustCall()); diff --git a/test/parallel/test-tls-server-connection-server.js b/test/parallel/test-tls-server-connection-server.js index 7fb2c74996ab4b..e132245c418fca 100644 --- a/test/parallel/test-tls-server-connection-server.js +++ b/test/parallel/test-tls-server-connection-server.js @@ -10,7 +10,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = tls.createServer(options, function(s) { @@ -18,7 +18,7 @@ const server = tls.createServer(options, function(s) { }).listen(0, function() { const opts = { port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }; server.on('connection', common.mustCall(function(socket) { diff --git a/test/parallel/test-tls-server-parent-constructor-options.js b/test/parallel/test-tls-server-parent-constructor-options.js index f8b34e8b0cab62..c51af3c8cac267 100644 --- a/test/parallel/test-tls-server-parent-constructor-options.js +++ b/test/parallel/test-tls-server-parent-constructor-options.js @@ -28,7 +28,7 @@ const options = { server.listen(0, common.mustCall(() => { const socket = tls.connect({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { socket.end(); })); @@ -43,7 +43,7 @@ const options = { const server = tls.createServer({ allowHalfOpen: true, pauseOnConnect: true, - ...options + ...options, }, common.mustCall((socket) => { assert.strictEqual(socket.allowHalfOpen, true); assert.strictEqual(socket.isPaused(), true); @@ -56,7 +56,7 @@ const options = { server.listen(0, common.mustCall(() => { const socket = tls.connect({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(() => { socket.end(); })); diff --git a/test/parallel/test-tls-server-verify.js b/test/parallel/test-tls-server-verify.js index 51ccd0d747fdf5..cfc9fd65ef6d03 100644 --- a/test/parallel/test-tls-server-verify.js +++ b/test/parallel/test-tls-server-verify.js @@ -256,7 +256,7 @@ function runTest(port, testIndex) { ca: cas, crl: crl, requestCert: tcase.requestCert, - rejectUnauthorized: tcase.rejectUnauthorized + rejectUnauthorized: tcase.rejectUnauthorized, }; // If renegotiating - session might be resumed and openssl won't request @@ -283,7 +283,7 @@ function runTest(port, testIndex) { c.write('\n_renegotiating\n'); return c.renegotiate({ requestCert: true, - rejectUnauthorized: false + rejectUnauthorized: false, }, function(err) { assert.ifError(err); c.write('\n_renegotiated\n'); diff --git a/test/parallel/test-tls-session-cache.js b/test/parallel/test-tls-session-cache.js index c4bebff2e32085..d998659e4c033a 100644 --- a/test/parallel/test-tls-session-cache.js +++ b/test/parallel/test-tls-session-cache.js @@ -50,7 +50,7 @@ function doTest(testOptions, callback) { requestCert: true, rejectUnauthorized: false, secureProtocol: 'TLS_method', - ciphers: 'RSA@SECLEVEL=0' + ciphers: 'RSA@SECLEVEL=0', }; let requestCount = 0; let resumeCount = 0; @@ -109,7 +109,7 @@ function doTest(testOptions, callback) { function spawnClient() { const client = spawn(common.opensslCli, args, { - stdio: [ 0, 1, 'pipe' ] + stdio: [ 0, 1, 'pipe' ], }); let err = ''; client.stderr.setEncoding('utf8'); diff --git a/test/parallel/test-tls-set-ciphers-error.js b/test/parallel/test-tls-set-ciphers-error.js index f963b414f44630..455351b4ae07f0 100644 --- a/test/parallel/test-tls-set-ciphers-error.js +++ b/test/parallel/test-tls-set-ciphers-error.js @@ -12,7 +12,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent2-key.pem'), cert: fixtures.readKey('agent2-cert.pem'), - ciphers: 'aes256-sha' + ciphers: 'aes256-sha', }; assert.throws(() => tls.createServer(options, common.mustNotCall()), /no cipher match/i); diff --git a/test/parallel/test-tls-set-ciphers.js b/test/parallel/test-tls-set-ciphers.js index f08af9b089adb9..47b433340abced 100644 --- a/test/parallel/test-tls-set-ciphers.js +++ b/test/parallel/test-tls-set-ciphers.js @@ -9,7 +9,7 @@ const { inspect } = require('util'); // Test cipher: option for TLS. const { - assert, connect, keys + assert, connect, keys, } = require(fixtures.path('tls-connect')); diff --git a/test/parallel/test-tls-set-encoding.js b/test/parallel/test-tls-set-encoding.js index ad0fcf325d69a3..a7fdc2d0e66e26 100644 --- a/test/parallel/test-tls-set-encoding.js +++ b/test/parallel/test-tls-set-encoding.js @@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }; // Contains a UTF8 only character @@ -48,7 +48,7 @@ const server = tls.Server(options, common.mustCall(function(socket) { server.listen(0, function() { const client = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }); let buffer = ''; diff --git a/test/parallel/test-tls-set-secure-context.js b/test/parallel/test-tls-set-secure-context.js index d62b6b9f94f601..c64020234a20a3 100644 --- a/test/parallel/test-tls-set-secure-context.js +++ b/test/parallel/test-tls-set-secure-context.js @@ -15,12 +15,12 @@ const credentialOptions = [ { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), - ca: fixtures.readKey('ca1-cert.pem') + ca: fixtures.readKey('ca1-cert.pem'), }, { key: fixtures.readKey('agent2-key.pem'), cert: fixtures.readKey('agent2-cert.pem'), - ca: fixtures.readKey('ca2-cert.pem') + ca: fixtures.readKey('ca2-cert.pem'), }, ]; let firstResponse; @@ -82,7 +82,7 @@ function makeRequest(port, id) { rejectUnauthorized: true, ca: credentialOptions[0].ca, servername: 'agent1', - headers: { id } + headers: { id }, }; let errored = false; diff --git a/test/parallel/test-tls-set-sigalgs.js b/test/parallel/test-tls-set-sigalgs.js index 59dc2ca0c786cf..00bff7ca89f60a 100644 --- a/test/parallel/test-tls-set-sigalgs.js +++ b/test/parallel/test-tls-set-sigalgs.js @@ -6,7 +6,7 @@ const fixtures = require('../common/fixtures'); // Test sigalgs: option for TLS. const { - assert, connect, keys + assert, connect, keys, } = require(fixtures.path('tls-connect')); function assert_arrays_equal(left, right) { @@ -24,7 +24,7 @@ function test(csigalgs, ssigalgs, shared_sigalgs, cerr, serr) { ca: `${keys.agent1.cert}\n${keys.agent6.ca}`, cert: keys.agent2.cert, key: keys.agent2.key, - sigalgs: csigalgs + sigalgs: csigalgs, }, server: { cert: keys.agent6.cert, @@ -32,9 +32,9 @@ function test(csigalgs, ssigalgs, shared_sigalgs, cerr, serr) { ca: keys.agent2.ca, context: { requestCert: true, - rejectUnauthorized: true + rejectUnauthorized: true, }, - sigalgs: ssigalgs + sigalgs: ssigalgs, }, }, common.mustCall((err, pair, cleanup) => { if (shared_sigalgs) { diff --git a/test/parallel/test-tls-sni-option.js b/test/parallel/test-tls-sni-option.js index 9ac5a8c5622de4..3ed2754f007b4a 100644 --- a/test/parallel/test-tls-sni-option.js +++ b/test/parallel/test-tls-sni-option.js @@ -51,22 +51,22 @@ const serverOptions = { callback(null, null); } }, 100); - } + }, }; const SNIContexts = { 'a.example.com': { key: loadPEM('agent1-key'), cert: loadPEM('agent1-cert'), - ca: [ loadPEM('ca2-cert') ] + ca: [ loadPEM('ca2-cert') ], }, 'b.example.com': { key: loadPEM('agent3-key'), - cert: loadPEM('agent3-cert') + cert: loadPEM('agent3-cert'), }, 'c.another.com': { - emptyRegression: true - } + emptyRegression: true, + }, }; test({ @@ -75,7 +75,7 @@ test({ cert: loadPEM('agent1-cert'), ca: [loadPEM('ca1-cert')], servername: 'a.example.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, true, { sni: 'a.example.com', authorized: false }, @@ -88,7 +88,7 @@ test({ cert: loadPEM('agent4-cert'), ca: [loadPEM('ca1-cert')], servername: 'a.example.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, true, { sni: 'a.example.com', authorized: true }, @@ -101,7 +101,7 @@ test({ cert: loadPEM('agent2-cert'), ca: [loadPEM('ca2-cert')], servername: 'b.example.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, true, { sni: 'b.example.com', authorized: false }, @@ -114,7 +114,7 @@ test({ cert: loadPEM('agent3-cert'), ca: [loadPEM('ca1-cert')], servername: 'c.wrong.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, false, { sni: 'c.wrong.com', authorized: false }, @@ -127,7 +127,7 @@ test({ cert: loadPEM('agent3-cert'), ca: [loadPEM('ca1-cert')], servername: 'c.another.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, false, null, diff --git a/test/parallel/test-tls-sni-server-client.js b/test/parallel/test-tls-sni-server-client.js index 79f3601561ee19..f3f327a5c6ec92 100644 --- a/test/parallel/test-tls-sni-server-client.js +++ b/test/parallel/test-tls-sni-server-client.js @@ -35,29 +35,29 @@ function loadPEM(n) { const serverOptions = { key: loadPEM('agent2-key'), - cert: loadPEM('agent2-cert') + cert: loadPEM('agent2-cert'), }; const SNIContexts = { 'a.example.com': { key: loadPEM('agent1-key'), - cert: loadPEM('agent1-cert') + cert: loadPEM('agent1-cert'), }, 'asterisk.test.com': { key: loadPEM('agent3-key'), - cert: loadPEM('agent3-cert') + cert: loadPEM('agent3-cert'), }, 'chain.example.com': { key: loadPEM('agent6-key'), // NOTE: Contains ca3 chain cert - cert: loadPEM('agent6-cert') - } + cert: loadPEM('agent6-cert'), + }, }; test( { ca: [loadPEM('ca1-cert')], - servername: 'a.example.com' + servername: 'a.example.com', }, true, 'a.example.com' @@ -115,7 +115,7 @@ function test(options, clientResult, serverResult) { const client = tls.connect({ ...options, port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, () => { const result = client.authorizationError && (client.authorizationError === 'ERR_TLS_CERT_ALTNAME_INVALID'); diff --git a/test/parallel/test-tls-sni-servername.js b/test/parallel/test-tls-sni-servername.js index 2c5785df5426c9..8141c4de617c44 100644 --- a/test/parallel/test-tls-sni-servername.js +++ b/test/parallel/test-tls-sni-servername.js @@ -18,7 +18,7 @@ const serverOptions = { } else { callback(new Error('Invalid SNI context'), null); } - } + }, }; function test(options) { @@ -46,11 +46,11 @@ function test(options) { test({ port: undefined, servername: 'c.another.com', - rejectUnauthorized: false + rejectUnauthorized: false, }); test({ port: undefined, servername: 'c.wrong.com', - rejectUnauthorized: false + rejectUnauthorized: false, }); diff --git a/test/parallel/test-tls-socket-allow-half-open-option.js b/test/parallel/test-tls-socket-allow-half-open-option.js index 6b94c39747a31c..1a9a05973550dd 100644 --- a/test/parallel/test-tls-socket-allow-half-open-option.js +++ b/test/parallel/test-tls-socket-allow-half-open-option.js @@ -23,7 +23,7 @@ const tls = require('tls'); // `stream.Duplex`. const duplex = new stream.Duplex({ allowHalfOpen: false, - read() {} + read() {}, }); const socket = new tls.TLSSocket(duplex, { allowHalfOpen: true }); assert.strictEqual(socket.allowHalfOpen, false); diff --git a/test/parallel/test-tls-socket-close.js b/test/parallel/test-tls-socket-close.js index 87355cf8d7bd2d..5e01320ca8e39e 100644 --- a/test/parallel/test-tls-socket-close.js +++ b/test/parallel/test-tls-socket-close.js @@ -50,7 +50,7 @@ function connectClient(server) { const tlsConnection = tls.connect({ host: 'localhost', port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }); tlsConnection.write('foo', 'utf8', common.mustCall(() => { diff --git a/test/parallel/test-tls-socket-constructor-alpn-options-parsing.js b/test/parallel/test-tls-socket-constructor-alpn-options-parsing.js index 686f6444ef9d2f..dc68902fdae7bc 100644 --- a/test/parallel/test-tls-socket-constructor-alpn-options-parsing.js +++ b/test/parallel/test-tls-socket-constructor-alpn-options-parsing.js @@ -40,7 +40,7 @@ server.listen(0, common.mustCall(() => { const alpnOpts = { port: server.address().port, rejectUnauthorized: false, - ALPNProtocols: ['h2', 'http/1.1'] + ALPNProtocols: ['h2', 'http/1.1'], }; tls.connect(alpnOpts, common.mustCall(function() { diff --git a/test/parallel/test-tls-socket-default-options.js b/test/parallel/test-tls-socket-default-options.js index 87f785dab5e1b3..98d7c18aeaba18 100644 --- a/test/parallel/test-tls-socket-default-options.js +++ b/test/parallel/test-tls-socket-default-options.js @@ -6,7 +6,7 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const { - connect, keys, tls + connect, keys, tls, } = require(fixtures.path('tls-connect')); test(undefined, (err) => { 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 d67a5498d65195..ae4d4552a0ce88 100644 --- a/test/parallel/test-tls-socket-failed-handshake-emits-error.js +++ b/test/parallel/test-tls-socket-failed-handshake-emits-error.js @@ -14,7 +14,7 @@ const server = net.createServer(function(c) { setTimeout(function() { const s = new tls.TLSSocket(c, { isServer: true, - server: server + server: server, }); s.on('error', common.mustCall(function(e) { diff --git a/test/parallel/test-tls-socket-snicallback-without-server.js b/test/parallel/test-tls-socket-snicallback-without-server.js index 3ef28b95702552..d6845618593b10 100644 --- a/test/parallel/test-tls-socket-snicallback-without-server.js +++ b/test/parallel/test-tls-socket-snicallback-without-server.js @@ -17,7 +17,7 @@ new tls.TLSSocket(serverSide, { isServer: true, SNICallback: common.mustCall((servername, cb) => { assert.strictEqual(servername, 'www.google.com'); - }) + }), }); // Captured traffic from browser's request to https://www.google.com diff --git a/test/parallel/test-tls-startcom-wosign-whitelist.js b/test/parallel/test-tls-startcom-wosign-whitelist.js index 56ffd73aac0e54..2352a42e7f0f59 100644 --- a/test/parallel/test-tls-startcom-wosign-whitelist.js +++ b/test/parallel/test-tls-startcom-wosign-whitelist.js @@ -18,27 +18,27 @@ const testCases = [ // Oct 20 23:59:59 2016 GMT. It passes StartCom/WoSign check. serverOpts: { key: loadPEM('agent8-key'), - cert: loadPEM('agent8-cert') + cert: loadPEM('agent8-cert'), }, clientOpts: { ca: loadPEM('fake-startcom-root-cert'), port: undefined, - rejectUnauthorized: true + rejectUnauthorized: true, }, - errorCode: 'CERT_REVOKED' + errorCode: 'CERT_REVOKED', }, { // agent9 is signed by fake-startcom-root with notBefore of // Oct 21 00:00:01 2016 GMT. It fails StartCom/WoSign check. serverOpts: { key: loadPEM('agent9-key'), - cert: loadPEM('agent9-cert') + cert: loadPEM('agent9-cert'), }, clientOpts: { ca: loadPEM('fake-startcom-root-cert'), port: undefined, - rejectUnauthorized: true + rejectUnauthorized: true, }, - errorCode: 'CERT_REVOKED' + errorCode: 'CERT_REVOKED', }, ]; diff --git a/test/parallel/test-tls-starttls-server.js b/test/parallel/test-tls-starttls-server.js index d9a1c02fc87c0f..67d4b5a0a33a1f 100644 --- a/test/parallel/test-tls-starttls-server.js +++ b/test/parallel/test-tls-starttls-server.js @@ -27,7 +27,7 @@ const server = net.createServer(common.mustCall((s) => { assert.strictEqual(hostname, 'test.test'); callback(null, null); - }) + }), }); tlsSocket.on('secure', common.mustCall(() => { @@ -39,7 +39,7 @@ const server = net.createServer(common.mustCall((s) => { servername: 'test.test', port: server.address().port, rejectUnauthorized: false, - requestOCSP: true + requestOCSP: true, }; tls.connect(opts, function() { diff --git a/test/parallel/test-tls-streamwrap-buffersize.js b/test/parallel/test-tls-streamwrap-buffersize.js index 0e0a49883a5a08..d415df44dace64 100644 --- a/test/parallel/test-tls-streamwrap-buffersize.js +++ b/test/parallel/test-tls-streamwrap-buffersize.js @@ -33,7 +33,7 @@ const net = require('net'); const server = tls.createServer({ key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }, common.mustCall((socket) => { let str = ''; socket.setEncoding('utf-8'); diff --git a/test/parallel/test-tls-ticket-cluster.js b/test/parallel/test-tls-ticket-cluster.js index 089660258cda41..6d9a3c4bed28d1 100644 --- a/test/parallel/test-tls-ticket-cluster.js +++ b/test/parallel/test-tls-ticket-cluster.js @@ -44,7 +44,7 @@ if (cluster.isPrimary) { workerPort, 'session?', !!lastSession); const c = tls.connect(workerPort, { session: lastSession, - rejectUnauthorized: false + rejectUnauthorized: false, }, () => { c.end(); }).on('close', () => { diff --git a/test/parallel/test-tls-ticket.js b/test/parallel/test-tls-ticket.js index 8d9cd8cdd25155..99bde213dc259f 100644 --- a/test/parallel/test-tls-ticket.js +++ b/test/parallel/test-tls-ticket.js @@ -46,7 +46,7 @@ function createServer() { const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), - ticketKeys: keys + ticketKeys: keys, }, function(c) { serverLog.push(id); // TODO(@sam-github) Triggers close_notify before NewSessionTicket bug. @@ -120,7 +120,7 @@ function start(callback) { function connect() { s = tls.connect(shared.address().port, { session: sess, - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { if (s.isSessionReused()) ticketLog.push(s.getTLSTicket().toString('hex')); diff --git a/test/parallel/test-tls-timeout-server-2.js b/test/parallel/test-tls-timeout-server-2.js index d2ffaf799008ff..11f63781f1253d 100644 --- a/test/parallel/test-tls-timeout-server-2.js +++ b/test/parallel/test-tls-timeout-server-2.js @@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = tls.createServer(options, common.mustCall(function(cleartext) { @@ -45,6 +45,6 @@ server.listen(0, common.mustCall(function() { tls.connect({ host: '127.0.0.1', port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }); })); diff --git a/test/parallel/test-tls-timeout-server.js b/test/parallel/test-tls-timeout-server.js index 7ca85f14d7ae33..e7fccdaf229607 100644 --- a/test/parallel/test-tls-timeout-server.js +++ b/test/parallel/test-tls-timeout-server.js @@ -32,7 +32,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), cert: fixtures.readKey('agent1-cert.pem'), - handshakeTimeout: 50 + handshakeTimeout: 50, }; const server = tls.createServer(options, common.mustNotCall()); diff --git a/test/parallel/test-tls-tlswrap-segfault.js b/test/parallel/test-tls-tlswrap-segfault.js index a36016efa48a02..3336123e04a2ca 100644 --- a/test/parallel/test-tls-tlswrap-segfault.js +++ b/test/parallel/test-tls-tlswrap-segfault.js @@ -13,7 +13,7 @@ const tls = require('tls'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = tls.createServer(options, function(s) { @@ -21,7 +21,7 @@ const server = tls.createServer(options, function(s) { }).listen(0, function() { const opts = { port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }; const client = tls.connect(opts, function() { putImmediate(client); diff --git a/test/parallel/test-tls-wrap-econnreset-localaddress.js b/test/parallel/test-tls-wrap-econnreset-localaddress.js index 30d3a8873fa8f0..0c95f8a15e8db0 100644 --- a/test/parallel/test-tls-wrap-econnreset-localaddress.js +++ b/test/parallel/test-tls-wrap-econnreset-localaddress.js @@ -16,7 +16,7 @@ const server = net.createServer((c) => { let errored = false; tls.connect({ port: port, - localAddress: common.localhostIPv4 + localAddress: common.localhostIPv4, }, common.localhostIPv4) .once('error', common.mustCall((e) => { assert.strictEqual(e.code, 'ECONNRESET'); diff --git a/test/parallel/test-tls-wrap-timeout.js b/test/parallel/test-tls-wrap-timeout.js index 7b9cb4170c888f..126434aa381b22 100644 --- a/test/parallel/test-tls-wrap-timeout.js +++ b/test/parallel/test-tls-wrap-timeout.js @@ -14,7 +14,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; const server = tls.createServer(options, common.mustCall((c) => { @@ -43,7 +43,7 @@ server.listen(0, () => { const tsocket = tls.connect({ socket: socket, - rejectUnauthorized: false + rejectUnauthorized: false, }); tsocket.resume(); }); diff --git a/test/parallel/test-tls-write-error.js b/test/parallel/test-tls-write-error.js index b06f2fa2c53ea7..04ff08455527d8 100644 --- a/test/parallel/test-tls-write-error.js +++ b/test/parallel/test-tls-write-error.js @@ -17,7 +17,7 @@ const server_cert = fixtures.readKey('agent1-cert.pem'); const opts = { key: server_key, cert: server_cert, - ciphers: 'ALL@SECLEVEL=0' + ciphers: 'ALL@SECLEVEL=0', }; const server = https.createServer(opts, (req, res) => { @@ -27,7 +27,7 @@ const server = https.createServer(opts, (req, res) => { client.connect({ host: 'localhost', - port: server.address().port + port: server.address().port, }, common.mustCall(() => { const ch = client.createClientHello(); client.write(ch); diff --git a/test/parallel/test-tls-zero-clear-in.js b/test/parallel/test-tls-zero-clear-in.js index f24fb6f992e75d..3bad5168a5bfcb 100644 --- a/test/parallel/test-tls-zero-clear-in.js +++ b/test/parallel/test-tls-zero-clear-in.js @@ -33,7 +33,7 @@ const key = fixtures.readKey('rsa_private.pem'); const server = tls.createServer({ cert, - key + key, }, function(c) { // Nop setTimeout(function() { @@ -45,7 +45,7 @@ const server = tls.createServer({ cert: cert, key: key, rejectUnauthorized: false, - port: this.address().port + port: this.address().port, }, function() { setTimeout(function() { conn.destroy(); diff --git a/test/parallel/test-trace-events-api-worker-disabled.js b/test/parallel/test-trace-events-api-worker-disabled.js index 71a6cd29914360..2c45f1b0b73beb 100644 --- a/test/parallel/test-trace-events-api-worker-disabled.js +++ b/test/parallel/test-trace-events-api-worker-disabled.js @@ -6,5 +6,5 @@ const { Worker } = require('worker_threads'); new Worker("require('trace_events')", { eval: true }) .on('error', common.expectsError({ code: 'ERR_TRACE_EVENTS_UNAVAILABLE', - name: 'Error' + name: 'Error', })); diff --git a/test/parallel/test-trace-events-api.js b/test/parallel/test-trace-events-api.js index 1cd0210f39aeeb..e336e579c3e786 100644 --- a/test/parallel/test-trace-events-api.js +++ b/test/parallel/test-trace-events-api.js @@ -17,7 +17,7 @@ const fs = require('fs'); const tmpdir = require('../common/tmpdir'); const { createTracing, - getEnabledCategories + getEnabledCategories, } = require('trace_events'); function getEnabledCategoriesFromCommandLine() { @@ -35,11 +35,11 @@ assert.strictEqual(getEnabledCategories(), enabledCategories); [1, 'foo', true, false, null, undefined].forEach((i) => { assert.throws(() => createTracing(i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); assert.throws(() => createTracing({ categories: i }), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -47,7 +47,7 @@ assert.throws( () => createTracing({ categories: [] }), { code: 'ERR_TRACE_EVENTS_CATEGORY_REQUIRED', - name: 'TypeError' + name: 'TypeError', } ); @@ -84,7 +84,7 @@ if (isChild) { trace: { TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN: kBeforeEvent, TRACE_EVENT_PHASE_NESTABLE_ASYNC_END: kEndEvent, - } + }, } = internalBinding('constants'); const { trace } = internalBinding('trace_events'); @@ -143,7 +143,7 @@ function testApiInChildProcess(execArgs, cb) { '--expose-internals', '--no-warnings', ...execArgs, - ] + ], }); proc.once('exit', common.mustCall(() => { diff --git a/test/parallel/test-trace-events-async-hooks-dynamic.js b/test/parallel/test-trace-events-async-hooks-dynamic.js index a1b59d48c03875..7eeb1a7442fe74 100644 --- a/test/parallel/test-trace-events-async-hooks-dynamic.js +++ b/test/parallel/test-trace-events-async-hooks-dynamic.js @@ -31,7 +31,7 @@ const proc = cp.spawnSync( cwd: tmpdir.path, env: { ...process.env, 'NODE_DEBUG_NATIVE': 'tracing', - 'NODE_DEBUG': 'tracing' } + 'NODE_DEBUG': 'tracing' }, }); console.log('process exit with signal:', proc.signal); diff --git a/test/parallel/test-trace-events-async-hooks-worker.js b/test/parallel/test-trace-events-async-hooks-worker.js index 7807a29925ca11..0ba77b362ce956 100644 --- a/test/parallel/test-trace-events-async-hooks-worker.js +++ b/test/parallel/test-trace-events-async-hooks-worker.js @@ -38,7 +38,7 @@ const proc = cp.spawnSync( cwd: tmpdir.path, env: { ...process.env, 'NODE_DEBUG_NATIVE': 'tracing', - 'NODE_DEBUG': 'tracing' } + 'NODE_DEBUG': 'tracing' }, }); console.log('process exit with signal:', proc.signal); diff --git a/test/parallel/test-trace-events-binding.js b/test/parallel/test-trace-events-binding.js index a6994d47b3e695..d2f41dbe63056d 100644 --- a/test/parallel/test-trace-events-binding.js +++ b/test/parallel/test-trace-events-binding.js @@ -49,7 +49,7 @@ proc.once('exit', common.mustCall(() => { assert.strictEqual(traces[1].id, '0x14'); assert.deepStrictEqual(traces[1].args.data, { 'first-value': 20, - 'second-value': 30 + 'second-value': 30, }); assert.strictEqual(traces[2].pid, proc.pid); diff --git a/test/parallel/test-trace-events-bootstrap.js b/test/parallel/test-trace-events-bootstrap.js index 3b9cb95a69f7b6..094f4e0ac7de10 100644 --- a/test/parallel/test-trace-events-bootstrap.js +++ b/test/parallel/test-trace-events-bootstrap.js @@ -26,7 +26,7 @@ if (process.argv[2] === 'child') { execArgv: [ '--trace-event-categories', 'node.bootstrap', - ] + ], }); proc.once('exit', common.mustCall(() => { diff --git a/test/parallel/test-trace-events-console.js b/test/parallel/test-trace-events-console.js index 01a532d69e704a..993b17a026338b 100644 --- a/test/parallel/test-trace-events-console.js +++ b/test/parallel/test-trace-events-console.js @@ -38,7 +38,7 @@ if (process.argv[2] === 'child') { execArgv: [ '--trace-event-categories', 'node.console', - ] + ], }); proc.once('exit', common.mustCall(async () => { diff --git a/test/parallel/test-trace-events-dynamic-enable-workers-disabled.js b/test/parallel/test-trace-events-dynamic-enable-workers-disabled.js index 634017f95ad051..8fee39de1f51fa 100644 --- a/test/parallel/test-trace-events-dynamic-enable-workers-disabled.js +++ b/test/parallel/test-trace-events-dynamic-enable-workers-disabled.js @@ -17,12 +17,12 @@ const { Session } = require('inspector'); const session = new Session(); session.connect(); session.post('NodeTracing.start', { - traceConfig: { includedCategories: ['node.perf'] } + traceConfig: { includedCategories: ['node.perf'] }, }, common.mustCall((err) => { assert.deepStrictEqual(err, { code: -32000, message: - 'Tracing properties can only be changed through main thread sessions' + 'Tracing properties can only be changed through main thread sessions', }); })); session.disconnect(); diff --git a/test/parallel/test-trace-events-dynamic-enable.js b/test/parallel/test-trace-events-dynamic-enable.js index 237bb1de8df743..8da7c841b7d860 100644 --- a/test/parallel/test-trace-events-dynamic-enable.js +++ b/test/parallel/test-trace-events-dynamic-enable.js @@ -10,8 +10,8 @@ const { internalBinding } = require('internal/test/binding'); const { trace: { - TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN: kBeforeEvent - } + TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN: kBeforeEvent, + }, } = internalBinding('constants'); const { trace } = internalBinding('trace_events'); diff --git a/test/parallel/test-trace-events-environment.js b/test/parallel/test-trace-events-environment.js index 8105b8394b0d71..df039a66abd2a0 100644 --- a/test/parallel/test-trace-events-environment.js +++ b/test/parallel/test-trace-events-environment.js @@ -38,7 +38,7 @@ if (process.argv[2] === 'child') { execArgv: [ '--trace-event-categories', 'node.environment', - ] + ], }); proc.once('exit', common.mustCall(async () => { diff --git a/test/parallel/test-trace-events-promises.js b/test/parallel/test-trace-events-promises.js index 37e4866c6b8afc..c3ee27e6e5a300 100644 --- a/test/parallel/test-trace-events-promises.js +++ b/test/parallel/test-trace-events-promises.js @@ -22,7 +22,7 @@ if (process.argv[2] === 'child') { '--no-warnings', '--trace-event-categories', 'node.promises.rejections', - ] + ], }); proc.once('exit', common.mustCall(() => { diff --git a/test/parallel/test-trace-events-vm.js b/test/parallel/test-trace-events-vm.js index b3d3a403bec711..6b29dd51f7dc1d 100644 --- a/test/parallel/test-trace-events-vm.js +++ b/test/parallel/test-trace-events-vm.js @@ -24,7 +24,7 @@ if (process.argv[2] === 'child') { execArgv: [ '--trace-event-categories', 'node.vm.script', - ] + ], }); proc.once('exit', common.mustCall(() => { diff --git a/test/parallel/test-tty-backwards-api.js b/test/parallel/test-tty-backwards-api.js index 16e71aab9e187c..3edb9ea88aea99 100644 --- a/test/parallel/test-tty-backwards-api.js +++ b/test/parallel/test-tty-backwards-api.js @@ -10,7 +10,7 @@ const TTY = internalBinding('tty_wrap').TTY = function() {}; TTY.prototype = { setBlocking: noop, - getWindowSize: noop + getWindowSize: noop, }; const { WriteStream } = require('tty'); diff --git a/test/parallel/test-ttywrap-invalid-fd.js b/test/parallel/test-ttywrap-invalid-fd.js index ea2e0f276dbf9a..775a44a418ed66 100644 --- a/test/parallel/test-ttywrap-invalid-fd.js +++ b/test/parallel/test-ttywrap-invalid-fd.js @@ -6,7 +6,7 @@ const tty = require('tty'); const { internalBinding } = require('internal/test/binding'); const { UV_EBADF, - UV_EINVAL + UV_EINVAL, } = internalBinding('uv'); const assert = require('assert'); @@ -15,7 +15,7 @@ assert.throws( { code: 'ERR_INVALID_FD', name: 'RangeError', - message: '"fd" must be a positive integer: -1' + message: '"fd" must be a positive integer: -1', } ); @@ -24,7 +24,7 @@ assert.throws( code: common.isWindows ? 'EBADF' : 'EINVAL', message: common.isWindows ? 'bad file descriptor' : 'invalid argument', errno: common.isWindows ? UV_EBADF : UV_EINVAL, - syscall: 'uv_tty_init' + syscall: 'uv_tty_init', }; const suffix = common.isWindows ? @@ -40,7 +40,7 @@ assert.throws( code: 'ERR_TTY_INIT_FAILED', name: 'SystemError', message, - info + info, } ); @@ -53,7 +53,7 @@ assert.throws( code: 'ERR_TTY_INIT_FAILED', name: 'SystemError', message, - info + info, }); } @@ -62,6 +62,6 @@ assert.throws( { code: 'ERR_INVALID_FD', name: 'RangeError', - message: '"fd" must be a positive integer: -1' + message: '"fd" must be a positive integer: -1', } ); diff --git a/test/parallel/test-unicode-node-options.js b/test/parallel/test-unicode-node-options.js index e5a40d118791d3..cd22f7df1ba282 100644 --- a/test/parallel/test-unicode-node-options.js +++ b/test/parallel/test-unicode-node-options.js @@ -14,9 +14,9 @@ if (process.argv.length === 2) { { env: { ...process.env, - NODE_OPTIONS + NODE_OPTIONS, }, - stdio: 'inherit' + stdio: 'inherit', }); assert.strictEqual(result.status, 0); } else { diff --git a/test/parallel/test-url-fileurltopath.js b/test/parallel/test-url-fileurltopath.js index 75cf1479f2f876..db34b51bf8d1f2 100644 --- a/test/parallel/test-url-fileurltopath.js +++ b/test/parallel/test-url-fileurltopath.js @@ -6,7 +6,7 @@ const url = require('url'); function testInvalidArgs(...args) { for (const arg of args) { assert.throws(() => url.fileURLToPath(arg), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); } } @@ -16,7 +16,7 @@ testInvalidArgs(null, undefined, 1, {}, true); // Input must be a file URL assert.throws(() => url.fileURLToPath('https://a/b/c'), { - code: 'ERR_INVALID_URL_SCHEME' + code: 'ERR_INVALID_URL_SCHEME', }); { @@ -26,7 +26,7 @@ assert.throws(() => url.fileURLToPath('https://a/b/c'), { assert.strictEqual(url.fileURLToPath(withHost), '\\\\host\\a'); } else { assert.throws(() => url.fileURLToPath(withHost), { - code: 'ERR_INVALID_FILE_URL_HOST' + code: 'ERR_INVALID_FILE_URL_HOST', }); } } @@ -34,17 +34,17 @@ assert.throws(() => url.fileURLToPath('https://a/b/c'), { { if (isWindows) { assert.throws(() => url.fileURLToPath('file:///C:/a%2F/'), { - code: 'ERR_INVALID_FILE_URL_PATH' + code: 'ERR_INVALID_FILE_URL_PATH', }); assert.throws(() => url.fileURLToPath('file:///C:/a%5C/'), { - code: 'ERR_INVALID_FILE_URL_PATH' + code: 'ERR_INVALID_FILE_URL_PATH', }); assert.throws(() => url.fileURLToPath('file:///?:/'), { - code: 'ERR_INVALID_FILE_URL_PATH' + code: 'ERR_INVALID_FILE_URL_PATH', }); } else { assert.throws(() => url.fileURLToPath('file:///a%2F/'), { - code: 'ERR_INVALID_FILE_URL_PATH' + code: 'ERR_INVALID_FILE_URL_PATH', }); } } diff --git a/test/parallel/test-url-format-invalid-input.js b/test/parallel/test-url-format-invalid-input.js index efa1a9ba1df6bf..87803bc02df200 100644 --- a/test/parallel/test-url-format-invalid-input.js +++ b/test/parallel/test-url-format-invalid-input.js @@ -20,7 +20,7 @@ for (const urlObject of throwsObjsAndReportTypes) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "urlObject" argument must be one of type object or string.' + - common.invalidArgTypeHelper(urlObject) + common.invalidArgTypeHelper(urlObject), }); } assert.strictEqual(url.format(''), ''); diff --git a/test/parallel/test-url-format-whatwg.js b/test/parallel/test-url-format-whatwg.js index 9c86a7ae2c6910..fe38146e86c6e5 100644 --- a/test/parallel/test-url-format-whatwg.js +++ b/test/parallel/test-url-format-whatwg.js @@ -27,7 +27,7 @@ assert.strictEqual( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object.' + - common.invalidArgTypeHelper(value) + common.invalidArgTypeHelper(value), } ); }); diff --git a/test/parallel/test-url-format.js b/test/parallel/test-url-format.js index 883d060ac2a152..9374709167e874 100644 --- a/test/parallel/test-url-format.js +++ b/test/parallel/test-url-format.js @@ -17,7 +17,7 @@ const formatTests = { hostname: 'example.com', search: '?', query: {}, - pathname: '/' + pathname: '/', }, 'http://example.com?foo=bar#frag': { href: 'http://example.com/?foo=bar#frag', @@ -27,7 +27,7 @@ const formatTests = { hash: '#frag', search: '?foo=bar', query: 'foo=bar', - pathname: '/' + pathname: '/', }, 'http://example.com?foo=@bar#frag': { href: 'http://example.com/?foo=@bar#frag', @@ -37,7 +37,7 @@ const formatTests = { hash: '#frag', search: '?foo=@bar', query: 'foo=@bar', - pathname: '/' + pathname: '/', }, 'http://example.com?foo=/bar/#frag': { href: 'http://example.com/?foo=/bar/#frag', @@ -47,7 +47,7 @@ const formatTests = { hash: '#frag', search: '?foo=/bar/', query: 'foo=/bar/', - pathname: '/' + pathname: '/', }, 'http://example.com?foo=?bar/#frag': { href: 'http://example.com/?foo=?bar/#frag', @@ -57,7 +57,7 @@ const formatTests = { hash: '#frag', search: '?foo=?bar/', query: 'foo=?bar/', - pathname: '/' + pathname: '/', }, 'http://example.com#frag=?bar/#frag': { href: 'http://example.com/#frag=?bar/#frag', @@ -65,13 +65,13 @@ const formatTests = { host: 'example.com', hostname: 'example.com', hash: '#frag=?bar/#frag', - pathname: '/' + pathname: '/', }, 'http://google.com" onload="alert(42)/': { href: 'http://google.com/%22%20onload=%22alert(42)/', protocol: 'http:', host: 'google.com', - pathname: '/%22%20onload=%22alert(42)/' + pathname: '/%22%20onload=%22alert(42)/', }, 'http://a.com/a/b/c?s#h': { href: 'http://a.com/a/b/c?s#h', @@ -79,61 +79,61 @@ const formatTests = { host: 'a.com', pathname: 'a/b/c', hash: 'h', - search: 's' + search: 's', }, 'xmpp:isaacschlueter@jabber.org': { href: 'xmpp:isaacschlueter@jabber.org', protocol: 'xmpp:', host: 'jabber.org', auth: 'isaacschlueter', - hostname: 'jabber.org' + hostname: 'jabber.org', }, 'http://atpass:foo%40bar@127.0.0.1/': { href: 'http://atpass:foo%40bar@127.0.0.1/', auth: 'atpass:foo@bar', hostname: '127.0.0.1', protocol: 'http:', - pathname: '/' + pathname: '/', }, 'http://atslash%2F%40:%2F%40@foo/': { href: 'http://atslash%2F%40:%2F%40@foo/', auth: 'atslash/@:/@', hostname: 'foo', protocol: 'http:', - pathname: '/' + pathname: '/', }, 'svn+ssh://foo/bar': { href: 'svn+ssh://foo/bar', hostname: 'foo', protocol: 'svn+ssh:', pathname: '/bar', - slashes: true + slashes: true, }, 'dash-test://foo/bar': { href: 'dash-test://foo/bar', hostname: 'foo', protocol: 'dash-test:', pathname: '/bar', - slashes: true + slashes: true, }, 'dash-test:foo/bar': { href: 'dash-test:foo/bar', hostname: 'foo', protocol: 'dash-test:', - pathname: '/bar' + pathname: '/bar', }, 'dot.test://foo/bar': { href: 'dot.test://foo/bar', hostname: 'foo', protocol: 'dot.test:', pathname: '/bar', - slashes: true + slashes: true, }, 'dot.test:foo/bar': { href: 'dot.test:foo/bar', hostname: 'foo', protocol: 'dot.test:', - pathname: '/bar' + pathname: '/bar', }, // IPv6 support 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature': { @@ -143,19 +143,19 @@ const formatTests = { hostname: '::1', port: '61616', pathname: '/.well-known/r', - search: 'n=Temperature' + search: 'n=Temperature', }, 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton': { href: 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton', protocol: 'coap', host: '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616', - pathname: '/s/stopButton' + pathname: '/s/stopButton', }, 'http://[::]/': { href: 'http://[::]/', protocol: 'http:', hostname: '[::]', - pathname: '/' + pathname: '/', }, // Encode context-specific delimiters in path and query, but do not touch @@ -167,9 +167,9 @@ const formatTests = { href: '/path/to/%%23%3F+=&.txt?foo=theA1#bar', pathname: '/path/to/%#?+=&.txt', query: { - foo: 'theA1' + foo: 'theA1', }, - hash: '#bar' + hash: '#bar', }, // `#`,`?` in path + `#` in query @@ -177,9 +177,9 @@ const formatTests = { href: '/path/to/%%23%3F+=&.txt?foo=the%231#bar', pathname: '/path/to/%#?+=&.txt', query: { - foo: 'the#1' + foo: 'the#1', }, - hash: '#bar' + hash: '#bar', }, // `#` in path end + `#` in query @@ -187,9 +187,9 @@ const formatTests = { href: '/path/to/%%23?foo=the%231#bar', pathname: '/path/to/%#', query: { - foo: 'the#1' + foo: 'the#1', }, - hash: '#bar' + hash: '#bar', }, // `?` and `#` in path and search @@ -222,7 +222,7 @@ const formatTests = { hash: '#frag', search: '?foo=bar#1#2#3&abc=#4##5', query: {}, - pathname: '/' + pathname: '/', }, // More than 255 characters in hostname which exceeds the limit @@ -233,7 +233,7 @@ const formatTests = { host: '', hostname: '', pathname: '/node', - path: '/node' + path: '/node', }, // Greater than or equal to 63 characters after `.` in hostname @@ -244,7 +244,7 @@ const formatTests = { host: `www.${'z'.repeat(63)}example.com`, hostname: `www.${'z'.repeat(63)}example.com`, pathname: '/node', - path: '/node' + path: '/node', }, // https://github.com/nodejs/node/issues/3361 @@ -252,7 +252,7 @@ const formatTests = { href: 'file:///home/user', protocol: 'file', pathname: '/home/user', - path: '/home/user' + path: '/home/user', }, // surrogate in auth @@ -261,8 +261,8 @@ const formatTests = { protocol: 'http:', auth: '\uD83D\uDE00', hostname: 'www.example.com', - pathname: '/' - } + pathname: '/', + }, }; for (const u in formatTests) { const expect = formatTests[u].href; diff --git a/test/parallel/test-url-parse-format.js b/test/parallel/test-url-parse-format.js index cbfc58b1123a72..9050e13c23f115 100644 --- a/test/parallel/test-url-parse-format.js +++ b/test/parallel/test-url-parse-format.js @@ -15,7 +15,7 @@ const parseTests = { '//some_path': { href: '//some_path', pathname: '//some_path', - path: '//some_path' + path: '//some_path', }, 'http:\\\\evil-phisher\\foo.html#h\\a\\s\\h': { @@ -26,7 +26,7 @@ const parseTests = { pathname: '/foo.html', path: '/foo.html', hash: '#h%5Ca%5Cs%5Ch', - href: 'http://evil-phisher/foo.html#h%5Ca%5Cs%5Ch' + href: 'http://evil-phisher/foo.html#h%5Ca%5Cs%5Ch', }, 'http:\\\\evil-phisher\\foo.html?json="\\"foo\\""#h\\a\\s\\h': { @@ -39,7 +39,7 @@ const parseTests = { query: 'json=%22%5C%22foo%5C%22%22', path: '/foo.html?json=%22%5C%22foo%5C%22%22', hash: '#h%5Ca%5Cs%5Ch', - href: 'http://evil-phisher/foo.html?json=%22%5C%22foo%5C%22%22#h%5Ca%5Cs%5Ch' + href: 'http://evil-phisher/foo.html?json=%22%5C%22foo%5C%22%22#h%5Ca%5Cs%5Ch', }, 'http:\\\\evil-phisher\\foo.html#h\\a\\s\\h?blarg': { @@ -50,7 +50,7 @@ const parseTests = { pathname: '/foo.html', path: '/foo.html', hash: '#h%5Ca%5Cs%5Ch?blarg', - href: 'http://evil-phisher/foo.html#h%5Ca%5Cs%5Ch?blarg' + href: 'http://evil-phisher/foo.html#h%5Ca%5Cs%5Ch?blarg', }, @@ -61,7 +61,7 @@ const parseTests = { hostname: 'evil-phisher', pathname: '/foo.html', path: '/foo.html', - href: 'http://evil-phisher/foo.html' + href: 'http://evil-phisher/foo.html', }, 'HTTP://www.example.com/': { @@ -71,7 +71,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'HTTP://www.example.com': { @@ -81,7 +81,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://www.ExAmPlE.com/': { @@ -91,7 +91,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://user:pw@www.ExAmPlE.com/': { @@ -102,7 +102,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://USER:PW@www.ExAmPlE.com/': { @@ -113,7 +113,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://user@www.example.com/': { @@ -124,7 +124,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://user%3Apw@www.example.com/': { @@ -135,7 +135,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://x.com/path?that\'s#all, folks': { @@ -148,7 +148,7 @@ const parseTests = { query: 'that%27s', pathname: '/path', hash: '#all,%20folks', - path: '/path?that%27s' + path: '/path?that%27s', }, 'HTTP://X.COM/Y': { @@ -158,7 +158,7 @@ const parseTests = { host: 'x.com', hostname: 'x.com', pathname: '/Y', - path: '/Y' + path: '/Y', }, // Whitespace in the front @@ -169,7 +169,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, // + not an invalid host character @@ -181,7 +181,7 @@ const parseTests = { host: 'x.y.com+a', hostname: 'x.y.com+a', pathname: '/b/c', - path: '/b/c' + path: '/b/c', }, // An unexpected invalid char in the hostname. @@ -195,7 +195,7 @@ const parseTests = { search: '?d=e', query: 'd=e', hash: '#f%20g%3Ch%3Ei', - path: ';a/b/c?d=e' + path: ';a/b/c?d=e', }, // Make sure that we don't accidentally lcast the path parts. @@ -209,7 +209,7 @@ const parseTests = { search: '?d=e', query: 'd=e', hash: '#f%20g%3Ch%3Ei', - path: ';A/b/c?d=e' + path: ';A/b/c?d=e', }, 'http://x...y...#p': { @@ -220,7 +220,7 @@ const parseTests = { hostname: 'x...y...', hash: '#p', pathname: '/', - path: '/' + path: '/', }, 'http://x/p/"quoted"': { @@ -230,13 +230,13 @@ const parseTests = { host: 'x', hostname: 'x', pathname: '/p/%22quoted%22', - path: '/p/%22quoted%22' + path: '/p/%22quoted%22', }, ' Is a URL!': { href: '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', pathname: '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', - path: '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!' + path: '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', }, 'http://www.narwhaljs.org/blog/categories?id=news': { @@ -248,7 +248,7 @@ const parseTests = { search: '?id=news', query: 'id=news', pathname: '/blog/categories', - path: '/blog/categories?id=news' + path: '/blog/categories?id=news', }, 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=': { @@ -258,7 +258,7 @@ const parseTests = { host: 'mt0.google.com', hostname: 'mt0.google.com', pathname: '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', - path: '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' + path: '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', }, 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': { @@ -271,7 +271,7 @@ const parseTests = { search: '???&hl=en&src=api&x=2&y=2&z=3&s=', query: '??&hl=en&src=api&x=2&y=2&z=3&s=', pathname: '/vt/lyrs=m@114', - path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' + path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=', }, 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': { @@ -284,7 +284,7 @@ const parseTests = { search: '???&hl=en&src=api&x=2&y=2&z=3&s=', query: '??&hl=en&src=api&x=2&y=2&z=3&s=', pathname: '/vt/lyrs=m@114', - path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' + path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=', }, 'file:///etc/passwd': { @@ -294,7 +294,7 @@ const parseTests = { pathname: '/etc/passwd', hostname: '', host: '', - path: '/etc/passwd' + path: '/etc/passwd', }, 'file://localhost/etc/passwd': { @@ -304,7 +304,7 @@ const parseTests = { pathname: '/etc/passwd', hostname: 'localhost', host: 'localhost', - path: '/etc/passwd' + path: '/etc/passwd', }, 'file://foo/etc/passwd': { @@ -314,7 +314,7 @@ const parseTests = { pathname: '/etc/passwd', hostname: 'foo', host: 'foo', - path: '/etc/passwd' + path: '/etc/passwd', }, 'file:///etc/node/': { @@ -324,7 +324,7 @@ const parseTests = { pathname: '/etc/node/', hostname: '', host: '', - path: '/etc/node/' + path: '/etc/node/', }, 'file://localhost/etc/node/': { @@ -334,7 +334,7 @@ const parseTests = { pathname: '/etc/node/', hostname: 'localhost', host: 'localhost', - path: '/etc/node/' + path: '/etc/node/', }, 'file://foo/etc/node/': { @@ -344,14 +344,14 @@ const parseTests = { pathname: '/etc/node/', hostname: 'foo', host: 'foo', - path: '/etc/node/' + path: '/etc/node/', }, 'http:/baz/../foo/bar': { href: 'http:/baz/../foo/bar', protocol: 'http:', pathname: '/baz/../foo/bar', - path: '/baz/../foo/bar' + path: '/baz/../foo/bar', }, 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag': { @@ -366,7 +366,7 @@ const parseTests = { search: '?baz=quux', query: 'baz=quux', pathname: '/foo/bar', - path: '/foo/bar?baz=quux' + path: '/foo/bar?baz=quux', }, '//user:pass@example.com:8000/foo/bar?baz=quux#frag': { @@ -380,7 +380,7 @@ const parseTests = { search: '?baz=quux', query: 'baz=quux', pathname: '/foo/bar', - path: '/foo/bar?baz=quux' + path: '/foo/bar?baz=quux', }, '/foo/bar?baz=quux#frag': { @@ -389,7 +389,7 @@ const parseTests = { search: '?baz=quux', query: 'baz=quux', pathname: '/foo/bar', - path: '/foo/bar?baz=quux' + path: '/foo/bar?baz=quux', }, 'http:/foo/bar?baz=quux#frag': { @@ -399,7 +399,7 @@ const parseTests = { search: '?baz=quux', query: 'baz=quux', pathname: '/foo/bar', - path: '/foo/bar?baz=quux' + path: '/foo/bar?baz=quux', }, 'mailto:foo@bar.com?subject=hello': { @@ -410,14 +410,14 @@ const parseTests = { hostname: 'bar.com', search: '?subject=hello', query: 'subject=hello', - path: '?subject=hello' + path: '?subject=hello', }, 'javascript:alert(\'hello\');': { href: 'javascript:alert(\'hello\');', protocol: 'javascript:', pathname: 'alert(\'hello\');', - path: 'alert(\'hello\');' + path: 'alert(\'hello\');', }, 'xmpp:isaacschlueter@jabber.org': { @@ -425,7 +425,7 @@ const parseTests = { protocol: 'xmpp:', host: 'jabber.org', auth: 'isaacschlueter', - hostname: 'jabber.org' + hostname: 'jabber.org', }, 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar': { @@ -440,7 +440,7 @@ const parseTests = { search: '?search=foo', query: 'search=foo', hash: '#bar', - path: '/path?search=foo' + path: '/path?search=foo', }, 'svn+ssh://foo/bar': { @@ -450,7 +450,7 @@ const parseTests = { protocol: 'svn+ssh:', pathname: '/bar', path: '/bar', - slashes: true + slashes: true, }, 'dash-test://foo/bar': { @@ -460,7 +460,7 @@ const parseTests = { protocol: 'dash-test:', pathname: '/bar', path: '/bar', - slashes: true + slashes: true, }, 'dash-test:foo/bar': { @@ -469,7 +469,7 @@ const parseTests = { hostname: 'foo', protocol: 'dash-test:', pathname: '/bar', - path: '/bar' + path: '/bar', }, 'dot.test://foo/bar': { @@ -479,7 +479,7 @@ const parseTests = { protocol: 'dot.test:', pathname: '/bar', path: '/bar', - slashes: true + slashes: true, }, 'dot.test:foo/bar': { @@ -488,7 +488,7 @@ const parseTests = { hostname: 'foo', protocol: 'dot.test:', pathname: '/bar', - path: '/bar' + path: '/bar', }, // IDNA tests @@ -499,7 +499,7 @@ const parseTests = { host: 'www.xn--wgv71a119e.com', hostname: 'www.xn--wgv71a119e.com', pathname: '/', - path: '/' + path: '/', }, 'http://example.Bücher.com/': { @@ -509,7 +509,7 @@ const parseTests = { host: 'example.xn--bcher-kva.com', hostname: 'example.xn--bcher-kva.com', pathname: '/', - path: '/' + path: '/', }, 'http://www.Äffchen.com/': { @@ -519,7 +519,7 @@ const parseTests = { host: 'www.xn--ffchen-9ta.com', hostname: 'www.xn--ffchen-9ta.com', pathname: '/', - path: '/' + path: '/', }, 'http://www.Äffchen.cOm;A/b/c?d=e#f gi': { @@ -532,7 +532,7 @@ const parseTests = { search: '?d=e', query: 'd=e', hash: '#f%20g%3Ch%3Ei', - path: ';A/b/c?d=e' + path: ';A/b/c?d=e', }, 'http://SÉLIER.COM/': { @@ -542,7 +542,7 @@ const parseTests = { host: 'xn--slier-bsa.com', hostname: 'xn--slier-bsa.com', pathname: '/', - path: '/' + path: '/', }, 'http://ليهمابتكلموشعربي؟.ي؟/': { @@ -552,7 +552,7 @@ const parseTests = { host: 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', hostname: 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', pathname: '/', - path: '/' + path: '/', }, 'http://➡.ws/➡': { @@ -562,7 +562,7 @@ const parseTests = { host: 'xn--hgi.ws', hostname: 'xn--hgi.ws', pathname: '/➡', - path: '/➡' + path: '/➡', }, 'http://bucket_name.s3.amazonaws.com/image.jpg': { @@ -572,7 +572,7 @@ const parseTests = { hostname: 'bucket_name.s3.amazonaws.com', pathname: '/image.jpg', href: 'http://bucket_name.s3.amazonaws.com/image.jpg', - path: '/image.jpg' + path: '/image.jpg', }, 'git+http://github.com/joyent/node.git': { @@ -582,7 +582,7 @@ const parseTests = { hostname: 'github.com', pathname: '/joyent/node.git', path: '/joyent/node.git', - href: 'git+http://github.com/joyent/node.git' + href: 'git+http://github.com/joyent/node.git', }, // If local1@domain1 is uses as a relative URL it may @@ -591,7 +591,7 @@ const parseTests = { 'local1@domain1': { pathname: 'local1@domain1', path: 'local1@domain1', - href: 'local1@domain1' + href: 'local1@domain1', }, // While this may seem counter-intuitive, a browser will parse @@ -599,14 +599,14 @@ const parseTests = { 'www.example.com': { href: 'www.example.com', pathname: 'www.example.com', - path: 'www.example.com' + path: 'www.example.com', }, // ipv6 support '[fe80::1]': { href: '[fe80::1]', pathname: '[fe80::1]', - path: '[fe80::1]' + path: '[fe80::1]', }, 'coap://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]': { @@ -616,7 +616,7 @@ const parseTests = { hostname: 'fedc:ba98:7654:3210:fedc:ba98:7654:3210', href: 'coap://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/', pathname: '/', - path: '/' + path: '/', }, 'coap://[1080:0:0:0:8:800:200C:417A]:61616/': { @@ -627,7 +627,7 @@ const parseTests = { hostname: '1080:0:0:0:8:800:200c:417a', href: 'coap://[1080:0:0:0:8:800:200c:417a]:61616/', pathname: '/', - path: '/' + path: '/', }, 'http://user:password@[3ffe:2a00:100:7031::1]:8080': { @@ -639,7 +639,7 @@ const parseTests = { hostname: '3ffe:2a00:100:7031::1', href: 'http://user:password@[3ffe:2a00:100:7031::1]:8080/', pathname: '/', - path: '/' + path: '/', }, 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature': { @@ -653,7 +653,7 @@ const parseTests = { search: '?n=Temperature', query: 'n=Temperature', pathname: '/.well-known/r', - path: '/.well-known/r?n=Temperature' + path: '/.well-known/r?n=Temperature', }, // empty port @@ -664,7 +664,7 @@ const parseTests = { hostname: 'example.com', href: 'http://example.com/', pathname: '/', - path: '/' + path: '/', }, 'http://example.com:/a/b.html': { @@ -674,7 +674,7 @@ const parseTests = { hostname: 'example.com', href: 'http://example.com/a/b.html', pathname: '/a/b.html', - path: '/a/b.html' + path: '/a/b.html', }, 'http://example.com:?a=b': { @@ -686,7 +686,7 @@ const parseTests = { search: '?a=b', query: 'a=b', pathname: '/', - path: '/?a=b' + path: '/?a=b', }, 'http://example.com:#abc': { @@ -697,7 +697,7 @@ const parseTests = { href: 'http://example.com/#abc', hash: '#abc', pathname: '/', - path: '/' + path: '/', }, 'http://[fe80::1]:/a/b?a=b#abc': { @@ -710,7 +710,7 @@ const parseTests = { query: 'a=b', hash: '#abc', pathname: '/a/b', - path: '/a/b?a=b' + path: '/a/b?a=b', }, 'http://-lovemonsterz.tumblr.com/rss': { @@ -809,7 +809,7 @@ const parseTests = { hostname: 'x', pathname: '/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/', path: '/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/', - href: 'http://x:1/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/' + href: 'http://x:1/%27%20%3C%3E%22%60/%7B%7D%7C/%5E~%60/', }, 'http://a@b@c/': { @@ -820,7 +820,7 @@ const parseTests = { hostname: 'c', href: 'http://a%40b@c/', path: '/', - pathname: '/' + pathname: '/', }, 'http://a@b?@c': { @@ -833,7 +833,7 @@ const parseTests = { path: '/?@c', pathname: '/', search: '?@c', - query: '@c' + query: '@c', }, 'http://a.b/\tbc\ndr\ref g"hq\'j?mn\\op^q=r`99{st|uv}wz': { @@ -847,7 +847,7 @@ const parseTests = { path: '/%09bc%0Adr%0Def%20g%22hq%27j%3Ckl%3E?mn%5Cop%5Eq=r%6099%7Bst%7Cuv%7Dwz', // eslint-disable-line max-len search: '?mn%5Cop%5Eq=r%6099%7Bst%7Cuv%7Dwz', query: 'mn%5Cop%5Eq=r%6099%7Bst%7Cuv%7Dwz', - href: 'http://a.b/%09bc%0Adr%0Def%20g%22hq%27j%3Ckl%3E?mn%5Cop%5Eq=r%6099%7Bst%7Cuv%7Dwz' + href: 'http://a.b/%09bc%0Adr%0Def%20g%22hq%27j%3Ckl%3E?mn%5Cop%5Eq=r%6099%7Bst%7Cuv%7Dwz', }, 'http://a\r" \t\n<\'b:b@c\r\nd/e?f': { @@ -862,7 +862,7 @@ const parseTests = { query: 'f', pathname: '%0D%0Ad/e', path: '%0D%0Ad/e?f', - href: 'http://a%0D%22%20%09%0A%3C\'b:b@c/%0D%0Ad/e?f' + href: 'http://a%0D%22%20%09%0A%3C\'b:b@c/%0D%0Ad/e?f', }, // Git urls used by npm @@ -878,7 +878,7 @@ const parseTests = { query: null, pathname: '/:npm/npm', path: '/:npm/npm', - href: 'git+ssh://git@github.com/:npm/npm' + href: 'git+ssh://git@github.com/:npm/npm', }, 'https://*': { @@ -893,7 +893,7 @@ const parseTests = { query: null, pathname: '/*', path: '/*', - href: 'https:///*' + href: 'https:///*', }, // The following two URLs are the same, but they differ for a capital A. @@ -910,7 +910,7 @@ const parseTests = { query: null, pathname: "alert(1);a='@white-listed.com'", path: "alert(1);a='@white-listed.com'", - href: "javascript:alert(1);a='@white-listed.com'" + href: "javascript:alert(1);a='@white-listed.com'", }, 'javAscript:alert(1);a=\x27@white-listed.com\x27': { @@ -925,7 +925,7 @@ const parseTests = { query: null, pathname: "alert(1);a='@white-listed.com'", path: "alert(1);a='@white-listed.com'", - href: "javascript:alert(1);a='@white-listed.com'" + href: "javascript:alert(1);a='@white-listed.com'", }, 'ws://www.example.com': { @@ -935,7 +935,7 @@ const parseTests = { host: 'www.example.com', pathname: '/', path: '/', - href: 'ws://www.example.com/' + href: 'ws://www.example.com/', }, 'wss://www.example.com': { @@ -945,8 +945,8 @@ const parseTests = { host: 'www.example.com', pathname: '/', path: '/', - href: 'wss://www.example.com/' - } + href: 'wss://www.example.com/', + }, }; for (const u in parseTests) { @@ -994,7 +994,7 @@ for (const u in parseTests) { query: null, pathname: "alert(1);a='@white-listed.com'", path: "alert(1);a='@white-listed.com'", - href: "javascript:alert(1);a='@white-listed.com'" + href: "javascript:alert(1);a='@white-listed.com'", }); assert.deepStrictEqual(parsed, expected); diff --git a/test/parallel/test-url-parse-invalid-input.js b/test/parallel/test-url-parse-invalid-input.js index 45d6ff94307381..67c6427897313c 100644 --- a/test/parallel/test-url-parse-invalid-input.js +++ b/test/parallel/test-url-parse-invalid-input.js @@ -22,7 +22,7 @@ const url = require('url'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "url" argument must be of type string.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), }); }); diff --git a/test/parallel/test-url-parse-query.js b/test/parallel/test-url-parse-query.js index f9174d599ad01b..0bacfce81f9a0b 100644 --- a/test/parallel/test-url-parse-query.js +++ b/test/parallel/test-url-parse-query.js @@ -27,7 +27,7 @@ const parseTestsWithQueryString = { search: '?baz=quux', query: createWithNoPrototype([{ key: 'baz', value: 'quux' }]), pathname: '/foo/bar', - path: '/foo/bar?baz=quux' + path: '/foo/bar?baz=quux', }, 'http://example.com': { href: 'http://example.com/', @@ -38,7 +38,7 @@ const parseTestsWithQueryString = { query: createWithNoPrototype(), search: null, pathname: '/', - path: '/' + path: '/', }, '/example': { protocol: null, @@ -52,7 +52,7 @@ const parseTestsWithQueryString = { query: createWithNoPrototype(), pathname: '/example', path: '/example', - href: '/example' + href: '/example', }, '/example?query=value': { protocol: null, @@ -66,8 +66,8 @@ const parseTestsWithQueryString = { query: createWithNoPrototype([{ key: 'query', value: 'value' }]), pathname: '/example', path: '/example?query=value', - href: '/example?query=value' - } + href: '/example?query=value', + }, }; for (const u in parseTestsWithQueryString) { const actual = url.parse(u, true); diff --git a/test/parallel/test-url-pathtofileurl.js b/test/parallel/test-url-pathtofileurl.js index 068a04e6613b28..cf551e3c0082fd 100644 --- a/test/parallel/test-url-pathtofileurl.js +++ b/test/parallel/test-url-pathtofileurl.js @@ -29,12 +29,12 @@ const url = require('url'); // Missing server: assert.throws(() => url.pathToFileURL('\\\\\\no-server'), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); // Missing share or resource: assert.throws(() => url.pathToFileURL('\\\\host'), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); } else { // UNC paths on posix are considered a single path that has backslashes: diff --git a/test/parallel/test-util-callbackify.js b/test/parallel/test-util-callbackify.js index 444e10b16bf85a..7add14952b29b2 100644 --- a/test/parallel/test-util-callbackify.js +++ b/test/parallel/test-util-callbackify.js @@ -51,7 +51,7 @@ const values = [ return { then(onRes, onRej) { onRes(value); - } + }, }; } @@ -97,7 +97,7 @@ const values = [ value: obj, writable: false, enumerable: false, - configurable: true + configurable: true, }); const cbPromiseFn = callbackify(promiseFn); @@ -122,7 +122,7 @@ const values = [ return { then(onRes, onRej) { onRej(value); - } + }, }; } @@ -172,7 +172,7 @@ const values = [ value: obj, writable: false, enumerable: false, - configurable: true + configurable: true, }); const cbPromiseFn = callbackify(promiseFn); @@ -253,7 +253,7 @@ const values = [ code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "original" argument must be of type function.' + - common.invalidArgTypeHelper(value) + common.invalidArgTypeHelper(value), }); }); } @@ -275,7 +275,7 @@ const values = [ code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The last argument must be of type function.' + - common.invalidArgTypeHelper(value) + common.invalidArgTypeHelper(value), }); }); } diff --git a/test/parallel/test-util-deprecate-invalid-code.js b/test/parallel/test-util-deprecate-invalid-code.js index 7e68c18817c0ca..19b63fd0b09723 100644 --- a/test/parallel/test-util-deprecate-invalid-code.js +++ b/test/parallel/test-util-deprecate-invalid-code.js @@ -9,6 +9,6 @@ const util = require('util'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "code" argument must be of type string.' + - common.invalidArgTypeHelper(notString) + common.invalidArgTypeHelper(notString), }); }); diff --git a/test/parallel/test-util-format.js b/test/parallel/test-util-format.js index 3d6404076471dd..9d7382b17faf45 100644 --- a/test/parallel/test-util-format.js +++ b/test/parallel/test-util-format.js @@ -217,7 +217,7 @@ assert.strictEqual(util.format('%s', -Infinity), '-Infinity'); get() { throw new Error(); }, - configurable: true + configurable: true, }); assert.strictEqual( util.format('%s', new D()), @@ -241,19 +241,19 @@ assert.strictEqual(util.format('%j %j', 42), '42 %j'); const obj = { foo: 'bar', foobar: 1, - func: function() {} + func: function() {}, }; const nestedObj = { foo: 'bar', foobar: { foo: 'bar', - func: function() {} - } + func: function() {}, + }, }; const nestedObj2 = { foo: 'bar', foobar: 1, - func: [{ a: function() {} }] + func: [{ a: function() {} }], }; assert.strictEqual(util.format('%o'), '%o'); assert.strictEqual(util.format('%o', 42), '42'); @@ -401,7 +401,7 @@ assert.strictEqual(util.format('%cab', 'color: blue', 'c'), 'ab c'); const o = { toJSON() { throw new Error('Not a circular object but still not serializable'); - } + }, }; assert.throws(() => util.format('%j', o), /^Error: Not a circular object but still not serializable$/); @@ -490,6 +490,6 @@ assert.strictEqual( util.formatWithOptions(invalidOptions, { a: true }); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"inspectOptions".+object/ + message: /"inspectOptions".+object/, }); }); diff --git a/test/parallel/test-util-inherits.js b/test/parallel/test-util-inherits.js index 1729b1734d03db..f36a09b3234bb5 100644 --- a/test/parallel/test-util-inherits.js +++ b/test/parallel/test-util-inherits.js @@ -24,7 +24,7 @@ assert.deepStrictEqual( value: A, enumerable: false, configurable: true, - writable: true + writable: true, } ); @@ -89,7 +89,7 @@ assert.throws(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "superCtor.prototype" property must be of type object. ' + - 'Received undefined' + 'Received undefined', }); assert.throws(() => { @@ -98,7 +98,7 @@ assert.throws(() => { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "superCtor" argument must be of type function. ' + - 'Received null' + 'Received null', }); assert.throws(() => { @@ -106,5 +106,5 @@ assert.throws(() => { }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: 'The "ctor" argument must be of type function. Received null' + message: 'The "ctor" argument must be of type function. Received null', }); diff --git a/test/parallel/test-util-inspect-getters-accessing-this.js b/test/parallel/test-util-inspect-getters-accessing-this.js index 998cd82db8f4b3..5c7852de45f99a 100644 --- a/test/parallel/test-util-inspect-getters-accessing-this.js +++ b/test/parallel/test-util-inspect-getters-accessing-this.js @@ -22,7 +22,7 @@ const { inspect } = require('util'); const result = inspect(new X(), { getters: true, - showHidden: true + showHidden: true, }); assert.strictEqual( @@ -54,7 +54,7 @@ const { inspect } = require('util'); const result = inspect(new B(), { depth: 1, getters: true, - showHidden: true + showHidden: true, }); assert.strictEqual( diff --git a/test/parallel/test-util-inspect-proxy.js b/test/parallel/test-util-inspect-proxy.js index 3e1341fadfc9f9..3915dd7904bd0f 100644 --- a/test/parallel/test-util-inspect-proxy.js +++ b/test/parallel/test-util-inspect-proxy.js @@ -19,7 +19,7 @@ const target = { } } return [1, 2, 3]; - } + }, }; const handler = { getPrototypeOf() { throw new Error('getPrototypeOf'); }, @@ -34,7 +34,7 @@ const handler = { deleteProperty() { throw new Error('deleteProperty'); }, ownKeys() { throw new Error('ownKeys'); }, apply() { throw new Error('apply'); }, - construct() { throw new Error('construct'); } + construct() { throw new Error('construct'); }, }; proxyObj = new Proxy(target, handler); @@ -152,7 +152,7 @@ const proxy11 = new Proxy(() => {}, { }, apply() { return proxy11; - } + }, }); const expected10 = '[Function (anonymous)]'; const expected11 = '[Function (anonymous)]'; diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 37d669c540eb52..33758cf2e784ac 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -66,7 +66,7 @@ assert.strictEqual(util.inspect(async () => {}), '[AsyncFunction (anonymous)]'); ); Object.defineProperty(fn, Symbol.toStringTag, { value: 'Foobar', - configurable: true + configurable: true, }); assert.strictEqual( util.inspect({ ['5']: fn }), @@ -333,7 +333,7 @@ assert(!/Object/.test( assert.strictEqual( util.inspect(Object.create({}, { visible: { value: 1, enumerable: true }, - hidden: { value: 2 } + hidden: { value: 2 }, }), { showHidden: true }), '{ visible: 1, [hidden]: 2 }' ); @@ -341,7 +341,7 @@ assert.strictEqual( assert.strictEqual( util.inspect(Object.create(null, { name: { value: 'Tim', enumerable: true }, - hidden: { value: 'secret' } + hidden: { value: 'secret' }, }), { showHidden: true }), "[Object: null prototype] { name: 'Tim', [hidden]: 'secret' }" ); @@ -349,7 +349,7 @@ assert.strictEqual( assert.strictEqual( util.inspect(Object.create(null, { name: { value: 'Tim', enumerable: true }, - hidden: { value: 'secret' } + hidden: { value: 'secret' }, })), "[Object: null prototype] { name: 'Tim' }" ); @@ -375,7 +375,7 @@ assert.strictEqual( const getterFn = { get one() { return null; - } + }, }; assert.strictEqual( util.inspect(getterFn, { getters: true }), @@ -391,7 +391,7 @@ assert.strictEqual( 'growingLength', { enumerable: true, - get: function() { this.push(true); return this.length; } + get: function() { this.push(true); return this.length; }, } ); Object.defineProperty( @@ -399,7 +399,7 @@ assert.strictEqual( '-1', { enumerable: true, - value: -1 + value: -1, } ); assert.strictEqual(util.inspect(value), @@ -571,7 +571,7 @@ assert.strictEqual(util.inspect(-5e-324), '-5e-324'); ); // test 4 special case assert.strictEqual(util.inspect(a, { - maxArrayLength: 2 + maxArrayLength: 2, }), "[ 'foo', <1 empty item>, ... 99 more items ]"); } @@ -606,19 +606,19 @@ assert.strictEqual(util.inspect(-5e-324), '-5e-324'); { const getter = Object.create(null, { a: { - get: function() { return 'aaa'; } - } + get: function() { return 'aaa'; }, + }, }); const setter = Object.create(null, { b: { // eslint-disable-line accessor-pairs - set: function() {} - } + set: function() {}, + }, }); const getterAndSetter = Object.create(null, { c: { get: function() { return 'ccc'; }, - set: function() {} - } + set: function() {}, + }, }); assert.strictEqual( util.inspect(getter, true), @@ -815,7 +815,7 @@ assert.strictEqual(util.inspect(Object.create(Date.prototype)), 'Date {}'); '\\\\\\': 3, '\\\\\\\\': 4, '\n': 5, - '\r': 6 + '\r': 6, }; const y = ['a', 'b', 'c']; @@ -1014,7 +1014,7 @@ assert.strictEqual( baz: 35, b: { a: 35 }, veryLongKey: 'very long value', - evenLongerKey: ['with even longer value in array'] + evenLongerKey: ['with even longer value in array'], }); } @@ -1264,7 +1264,7 @@ if (typeof Symbol !== 'undefined') { Object.defineProperty(a, Symbol.toStringTag, { value: 'Foo', configurable: true, - writable: true + writable: true, }); assert.strictEqual(inspect(a, { depth: -1 }), '[Foo]'); delete a[Symbol.toStringTag]; @@ -1274,7 +1274,7 @@ if (typeof Symbol !== 'undefined') { assert.strictEqual(inspect(a, { depth: -1 }), '[Foo: null prototype] {}'); Object.defineProperty(a, Symbol.toStringTag, { value: 'ABC', - configurable: true + configurable: true, }); assert.strictEqual( inspect(a, { depth: -1 }), @@ -1282,7 +1282,7 @@ if (typeof Symbol !== 'undefined') { ); Object.defineProperty(a, Symbol.toStringTag, { value: 'Foo', - configurable: true + configurable: true, }); assert.strictEqual( inspect(a, { depth: -1 }), @@ -1386,7 +1386,7 @@ if (typeof Symbol !== 'undefined') { get: function() { throw new Error('should not access constructor'); }, - enumerable: true + enumerable: true, }); assert.strictEqual(util.inspect(x), '{ constructor: [Getter] }'); } @@ -1497,7 +1497,7 @@ if (typeof Symbol !== 'undefined') { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object. ' + - 'Received null' + 'Received null', } ); @@ -1507,7 +1507,7 @@ if (typeof Symbol !== 'undefined') { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object. ' + - "Received type string ('bad')" + "Received type string ('bad')", } ); } @@ -1532,7 +1532,7 @@ util.inspect(process); ); Object.defineProperty(obj, Symbol.toStringTag, { value: 'a', - enumerable: false + enumerable: false, }); assert.strictEqual(util.inspect(obj), 'Object [a] {}'); assert.strictEqual( @@ -1562,7 +1562,7 @@ util.inspect(process); assert.strictEqual( util.inspect(Object.create(Object.create(Foo.prototype), { - foo: { value: 'bar', enumerable: true } + foo: { value: 'bar', enumerable: true }, })), "Foo [bar] { foo: 'bar' }"); @@ -1591,7 +1591,7 @@ util.inspect(process); 'eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'test', 'foo']], 4], - b: new Map([['za', 1], ['zb', 'test']]) + b: new Map([['za', 1], ['zb', 'test']]), }; let out = util.inspect(o, { compact: true, depth: 5, breakLength: 80 }); @@ -1797,7 +1797,7 @@ util.inspect(process); assert.strict.equal(out, expected); out = util.inspect(map, { - showHidden: true, depth: 9, breakLength: 4, compact: true + showHidden: true, depth: 9, breakLength: 4, compact: true, }); expected = [ 'Map(2) {', @@ -1944,7 +1944,7 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'"); Object.defineProperty(foo, Symbol.toStringTag, { value: 'WOW', writable: true, - configurable: true + configurable: true, }); const stack = foo.stack; foo.stack = 'This is a stack'; @@ -2006,7 +2006,7 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'"); const inspected = util.inspect(clazz); assert.strictEqual(inspected, string); Object.defineProperty(clazz, Symbol.toStringTag, { - value: 'Woohoo' + value: 'Woohoo', }); const parts = inspected.slice(0, -1).split(' '); const [, name, ...rest] = parts; @@ -2097,12 +2097,12 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'"); Object.defineProperty(value, 'valueOf', { get() { throw new Error('valueOf'); - } + }, }); Object.defineProperty(value, 'toString', { get() { throw new Error('toString'); - } + }, }); assert.strictEqual(util.inspect(value), expected); value.foo = 'bar'; @@ -2364,17 +2364,17 @@ assert.strictEqual( Object.setPrototypeOf(obj, null); Object.defineProperty(obj, Symbol.iterator, { value: iterator, - configurable: true + configurable: true, }); assert.strictEqual(util.inspect(obj), '[Set(2): null prototype] { 1, 2 }'); Object.defineProperty(obj, Symbol.iterator, { value: true, - configurable: true + configurable: true, }); Object.defineProperty(obj, 'size', { value: NaN, configurable: true, - enumerable: true + enumerable: true, }); assert.strictEqual( util.inspect(obj), @@ -2389,7 +2389,7 @@ assert.strictEqual( const getset = { get foo() { return foo; }, set foo(val) { foo = val; }, - get inc() { return ++foo; } + get inc() { return ++foo; }, }; const thrower = { get foo() { throw new Error('Oops'); } }; assert.strictEqual( @@ -2424,9 +2424,9 @@ assert.strictEqual( c: { x: '10000000000000000 00000000000000000 '.repeat(1e1), d: 2, - e: 3 - } - } + e: 3, + }, + }, }, b: [ 1, @@ -2441,7 +2441,7 @@ assert.strictEqual( f: Array(9).fill('foobar'), g: Array(21).fill('foobar baz'), h: [100].concat(Array.from({ length: 9 }).map((e, n) => (n))), - long: Array(9).fill('This text is too long for grouping!') + long: Array(9).fill('This text is too long for grouping!'), }; let out = util.inspect(obj, { compact: 3, depth: 10, breakLength: 60 }); @@ -2577,13 +2577,13 @@ assert.strictEqual( x: 5, c: { d: 2, - e: 3 - } - } + e: 3, + }, + }, }, b: Array.from({ length: 9 }).map((e, n) => { return n % 2 === 0 ? 'foobar' : 'baz'; - }) + }), }; out = util.inspect(obj, { compact: 1, breakLength: Infinity, colors: true }); @@ -2976,7 +2976,7 @@ assert.strictEqual( const output = util.inspect(target, { stylize: common.mustCall((str) => { return {}; - }) + }), }); assert.strictEqual(output, '[object Object]'); assert.strictEqual(typeof target.ctx, 'object'); @@ -2990,7 +2990,7 @@ assert.strictEqual( const output = util.inspect(target, { stylize: common.mustCall((str) => { throw new Error('oops'); - }) + }), }); assert.strictEqual(output, '🐈'); assert.strictEqual(typeof target.ctx, 'object'); diff --git a/test/parallel/test-util-internal.js b/test/parallel/test-util-internal.js index cd38f3e7c57f44..259db495a22626 100644 --- a/test/parallel/test-util-internal.js +++ b/test/parallel/test-util-internal.js @@ -9,7 +9,7 @@ const { internalBinding } = require('internal/test/binding'); const { getHiddenValue, setHiddenValue, - arrow_message_private_symbol: kArrowMessagePrivateSymbolIndex + arrow_message_private_symbol: kArrowMessagePrivateSymbolIndex, } = internalBinding('util'); assert.strictEqual( diff --git a/test/parallel/test-util-promisify.js b/test/parallel/test-util-promisify.js index 7edeb6e493993e..d4fd97ee70c265 100644 --- a/test/parallel/test-util-promisify.js +++ b/test/parallel/test-util-promisify.js @@ -204,6 +204,6 @@ const stat = promisify(fs.stat); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "original" argument must be of type function.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), }); }); diff --git a/test/parallel/test-util-types.js b/test/parallel/test-util-types.js index 60380dca09a298..3ba97a6f0a0598 100644 --- a/test/parallel/test-util-types.js +++ b/test/parallel/test-util-types.js @@ -81,7 +81,7 @@ for (const [ value, _method ] of [ assert(types.isUint8Array(vm.runInNewContext('new Uint8Array'))); assert(!types.isUint8ClampedArray({ - [Symbol.toStringTag]: 'Uint8ClampedArray' + [Symbol.toStringTag]: 'Uint8ClampedArray', })); assert(types.isUint8ClampedArray( vm.runInNewContext('new Uint8ClampedArray') @@ -259,7 +259,7 @@ for (const [ value, _method ] of [ ], isBigUint64Array: [ bigUint64Array, stealthyBigUint64Array, - ] + ], }; for (const testedFunc of Object.keys(expected)) { diff --git a/test/parallel/test-uv-errmap.js b/test/parallel/test-uv-errmap.js index 6a077551b63d77..1aa76c5c0a109e 100644 --- a/test/parallel/test-uv-errmap.js +++ b/test/parallel/test-uv-errmap.js @@ -5,7 +5,7 @@ require('../common'); const assert = require('assert'); const { getSystemErrorMap, - _errnoException + _errnoException, } = require('util'); const { internalBinding } = require('internal/test/binding'); diff --git a/test/parallel/test-uv-errno.js b/test/parallel/test-uv-errno.js index e46b365e4b69e4..4d0930f34ba49f 100644 --- a/test/parallel/test-uv-errno.js +++ b/test/parallel/test-uv-errno.js @@ -5,7 +5,7 @@ const common = require('../common'); const assert = require('assert'); const { getSystemErrorName, - _errnoException + _errnoException, } = require('util'); const { internalBinding } = require('internal/test/binding'); @@ -32,7 +32,7 @@ function runTest(fn) { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "err" argument must be of type number.' + - common.invalidArgTypeHelper(err) + common.invalidArgTypeHelper(err), }); }); @@ -44,7 +44,7 @@ function runTest(fn) { name: 'RangeError', message: 'The value of "err" is out of range. ' + 'It must be a negative integer. ' + - `Received ${err}` + `Received ${err}`, }); }); } diff --git a/test/parallel/test-v8-coverage.js b/test/parallel/test-v8-coverage.js index ca5301b8bd08e0..0a9f7401e72a58 100644 --- a/test/parallel/test-v8-coverage.js +++ b/test/parallel/test-v8-coverage.js @@ -175,7 +175,7 @@ function nextdir() { require.resolve('../fixtures/v8-coverage/basic'), ], { cwd: tmpdir.path, - env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory } + env: { ...process.env, NODE_V8_COVERAGE: coverageDirectory }, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/parallel/test-v8-flag-type-check.js b/test/parallel/test-v8-flag-type-check.js index e46c09b79725c7..4dee1cb319403b 100644 --- a/test/parallel/test-v8-flag-type-check.js +++ b/test/parallel/test-v8-flag-type-check.js @@ -10,7 +10,7 @@ const v8 = require('v8'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "flags" argument must be of type string.' + - common.invalidArgTypeHelper(value) + common.invalidArgTypeHelper(value), } ); }); diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js index 1d3b6ff81168e7..2184fb8c309326 100644 --- a/test/parallel/test-v8-serdes.js +++ b/test/parallel/test-v8-serdes.js @@ -150,7 +150,7 @@ const hostObject = new (internalBinding('js_stream').JSStream)(); { assert.throws(() => v8.serialize(hostObject), { constructor: Error, - message: 'Unserializable host object: JSStream {}' + message: 'Unserializable host object: JSStream {}', }); } @@ -185,12 +185,12 @@ const hostObject = new (internalBinding('js_stream').JSStream)(); assert.throws(() => v8.Serializer(), { constructor: TypeError, message: "Class constructor Serializer cannot be invoked without 'new'", - code: 'ERR_CONSTRUCT_CALL_REQUIRED' + code: 'ERR_CONSTRUCT_CALL_REQUIRED', }); assert.throws(() => v8.Deserializer(), { constructor: TypeError, message: "Class constructor Deserializer cannot be invoked without 'new'", - code: 'ERR_CONSTRUCT_CALL_REQUIRED' + code: 'ERR_CONSTRUCT_CALL_REQUIRED', }); } diff --git a/test/parallel/test-v8-stop-coverage.js b/test/parallel/test-v8-stop-coverage.js index 020e18d8747eb2..d3131bb858ec29 100644 --- a/test/parallel/test-v8-stop-coverage.js +++ b/test/parallel/test-v8-stop-coverage.js @@ -24,7 +24,7 @@ const intervals = 20; ...process.env, NODE_V8_COVERAGE: tmpdir.path, NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER', - TEST_INTERVALS: intervals + TEST_INTERVALS: intervals, }, }); console.log(output.stderr.toString()); diff --git a/test/parallel/test-v8-take-coverage-noop.js b/test/parallel/test-v8-take-coverage-noop.js index c1c797bfd42220..23d850ee793024 100644 --- a/test/parallel/test-v8-take-coverage-noop.js +++ b/test/parallel/test-v8-take-coverage-noop.js @@ -22,7 +22,7 @@ const intervals = 40; env: { ...process.env, NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER', - TEST_INTERVALS: intervals + TEST_INTERVALS: intervals, }, }); console.log(output.stderr.toString()); diff --git a/test/parallel/test-v8-take-coverage.js b/test/parallel/test-v8-take-coverage.js index b5e99ac30a5717..5f34d3bbd5d011 100644 --- a/test/parallel/test-v8-take-coverage.js +++ b/test/parallel/test-v8-take-coverage.js @@ -23,7 +23,7 @@ const intervals = 40; ...process.env, NODE_V8_COVERAGE: tmpdir.path, NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER', - TEST_INTERVALS: intervals + TEST_INTERVALS: intervals, }, }); console.log(output.stderr.toString()); @@ -38,7 +38,7 @@ const intervals = 40; coverages.push({ file: coverageFile, func: result.functions.find((f) => f.functionName === 'interval'), - timestamp: coverage.timestamp + timestamp: coverage.timestamp, }); } } diff --git a/test/parallel/test-validators.js b/test/parallel/test-validators.js index 9dbf5f9c4599f2..73135adbc12638 100644 --- a/test/parallel/test-validators.js +++ b/test/parallel/test-validators.js @@ -98,7 +98,7 @@ const invalidArgValueError = { 1, Infinity, -Infinity, NaN, undefined, null, 1.1, ].forEach((i) => assert.throws(() => validateString(i, 'name'), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', })); } { @@ -108,6 +108,6 @@ const invalidArgValueError = { undefined, null, '', ' ', '0x', '-0x1', '-0o1', '-0b1', '0o', '0b', ].forEach((i) => assert.throws(() => validateNumber(i, 'name'), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', })); } diff --git a/test/parallel/test-vm-basic.js b/test/parallel/test-vm-basic.js index c6dadce9ad0263..c76c3c33f68d2a 100644 --- a/test/parallel/test-vm-basic.js +++ b/test/parallel/test-vm-basic.js @@ -49,7 +49,7 @@ const vm = require('vm'); assert.deepStrictEqual(sandbox, { foo: 'bar', baz: 'bar', - typeofProcess: 'undefined' + typeofProcess: 'undefined', }); assert.strictEqual(result, 'function'); } @@ -103,7 +103,7 @@ const vm = require('vm'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), }); }); @@ -114,7 +114,7 @@ const vm = require('vm'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: `The "options.${propertyName}" property must be of type string. ` + - 'Received null' + 'Received null', }); }); @@ -125,7 +125,7 @@ const vm = require('vm'); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: `The "options.${propertyName}" property must be of type string. ` + - 'Received null' + 'Received null', }); }); @@ -152,7 +152,7 @@ const vm = require('vm'); ); }, { name: 'SyntaxError', - message: "Unexpected token '}'" + message: "Unexpected token '}'", }); // Tests for failed argument validation @@ -160,7 +160,7 @@ const vm = require('vm'); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "code" argument must be of type string. ' + - 'Received undefined' + 'Received undefined', }); vm.compileFunction(''); // Should pass without params or options @@ -169,7 +169,7 @@ const vm = require('vm'); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "params" argument must be an instance of Array. ' + - 'Received null' + 'Received null', }); // vm.compileFunction('', undefined, null); @@ -191,7 +191,7 @@ const vm = require('vm'); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: typeErrorMessage + - ` ${optionTypes[option]}. Received null` + ` ${optionTypes[option]}. Received null`, }); } @@ -204,7 +204,7 @@ const vm = require('vm'); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "options.parsingContext" property must be an instance ' + - `of Context.${common.invalidArgTypeHelper(value)}` + `of Context.${common.invalidArgTypeHelper(value)}`, }); } ); @@ -218,7 +218,7 @@ const vm = require('vm'); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "params" argument must be an instance of Array.' + - common.invalidArgTypeHelper(value) + common.invalidArgTypeHelper(value), }); } ); @@ -238,7 +238,7 @@ const vm = require('vm'); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "options.contextExtensions" property must be an instance of' + - ' Array. Received null' + ' Array. Received null', }); assert.throws(() => { @@ -247,7 +247,7 @@ const vm = require('vm'); name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', message: 'The "options.contextExtensions[0]" property must be of type ' + - 'object. Received type number (0)' + 'object. Received type number (0)', }); const oldLimit = Error.stackTraceLimit; @@ -258,7 +258,7 @@ const vm = require('vm'); vm.compileFunction('throw new Error("Sample Error")')(); }, { message: 'Sample Error', - stack: 'Error: Sample Error\n at :1:7' + stack: 'Error: Sample Error\n at :1:7', }); assert.throws(() => { @@ -269,7 +269,7 @@ const vm = require('vm'); )(); }, { message: 'Sample Error', - stack: 'Error: Sample Error\n at :4:7' + stack: 'Error: Sample Error\n at :4:7', }); assert.throws(() => { @@ -280,7 +280,7 @@ const vm = require('vm'); )(); }, { message: 'Sample Error', - stack: 'Error: Sample Error\n at :1:10' + stack: 'Error: Sample Error\n at :1:10', }); assert.strictEqual( @@ -288,7 +288,7 @@ const vm = require('vm'); 'return varInContext', [], { - parsingContext: vm.createContext({ varInContext: 'abc' }) + parsingContext: vm.createContext({ varInContext: 'abc' }), } )(), 'abc' @@ -301,7 +301,8 @@ const vm = require('vm'); )(); }, { message: 'varInContext is not defined', - stack: 'ReferenceError: varInContext is not defined\n at :1:1' + stack: 'ReferenceError: varInContext is not defined' + + '\n at :1:1', }); assert.notDeepStrictEqual( @@ -309,7 +310,7 @@ const vm = require('vm'); 'return global', [], { - parsingContext: vm.createContext({ global: {} }) + parsingContext: vm.createContext({ global: {} }), } )(), global diff --git a/test/parallel/test-vm-cached-data.js b/test/parallel/test-vm-cached-data.js index a9f1293647278e..4bbc598e51ba3f 100644 --- a/test/parallel/test-vm-cached-data.js +++ b/test/parallel/test-vm-cached-data.js @@ -44,7 +44,7 @@ function testProduceConsume() { for (const cachedData of common.getArrayBufferViews(data)) { // It should consume code cache const script = new vm.Script(source, { - cachedData + cachedData, }); assert(!script.cachedDataRejected); assert.strictEqual(script.runInThisContext()(), 'original'); @@ -66,7 +66,7 @@ function testRejectInvalid() { // It should reject invalid code cache const script = new vm.Script(getSource('invalid_1'), { - cachedData: data + cachedData: data, }); assert(script.cachedDataRejected); assert.strictEqual(script.runInThisContext()(), 'invalid_1'); @@ -79,7 +79,7 @@ function testRejectSlice() { const data = produce(source).slice(4); const script = new vm.Script(source, { - cachedData: data + cachedData: data, }); assert(script.cachedDataRejected); } @@ -88,10 +88,10 @@ testRejectSlice(); // It should throw on non-Buffer cachedData assert.throws(() => { new vm.Script('function abc() {}', { - cachedData: 'ohai' + cachedData: 'ohai', }); }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /must be an instance of Buffer, TypedArray, or DataView/ + message: /must be an instance of Buffer, TypedArray, or DataView/, }); diff --git a/test/parallel/test-vm-codegen.js b/test/parallel/test-vm-codegen.js index 90b37c741a1c68..86e67d4e3e886c 100644 --- a/test/parallel/test-vm-codegen.js +++ b/test/parallel/test-vm-codegen.js @@ -51,7 +51,7 @@ assert.throws(() => { }, }); }, { - name: 'EvalError' + name: 'EvalError', }); assert.throws(() => { @@ -61,7 +61,7 @@ assert.throws(() => { }, }); }, { - name: 'CompileError' + name: 'CompileError', }); assert.throws(() => { @@ -81,7 +81,7 @@ assert.throws(() => { }, }); }, { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => { diff --git a/test/parallel/test-vm-context.js b/test/parallel/test-vm-context.js index bcfbb327bf72e8..636e39f90edcec 100644 --- a/test/parallel/test-vm-context.js +++ b/test/parallel/test-vm-context.js @@ -48,7 +48,7 @@ assert.throws(() => { vm.runInNewContext('', null, 'some.js'); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); // Issue GH-1140: @@ -67,12 +67,12 @@ assert.strictEqual(gh1140Exception.toString(), 'Error'); const nonContextualObjectError = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /must be of type object/ + message: /must be of type object/, }; const contextifiedObjectError = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /The "contextifiedObject" argument must be an vm\.Context/ + message: /The "contextifiedObject" argument must be an vm\.Context/, }; [ @@ -110,7 +110,7 @@ assert.strictEqual(script.runInContext(ctx), false); vm.runInContext(' throw new Error()', context, { filename: 'expected-filename.js', lineOffset: 32, - columnOffset: 123 + columnOffset: 123, }); }, (err) => { stack = err.stack; diff --git a/test/parallel/test-vm-create-context-accessors.js b/test/parallel/test-vm-create-context-accessors.js index 39fc5c4eec6ae3..e9f1a5f767486f 100644 --- a/test/parallel/test-vm-create-context-accessors.js +++ b/test/parallel/test-vm-create-context-accessors.js @@ -29,7 +29,7 @@ let ctx = {}; Object.defineProperty(ctx, 'getter', { get: function() { return 'ok'; - } + }, }); let val; @@ -39,7 +39,7 @@ Object.defineProperty(ctx, 'setter', { }, get: function() { return `ok=${val}`; - } + }, }); ctx = vm.createContext(ctx); diff --git a/test/parallel/test-vm-create-context-arg.js b/test/parallel/test-vm-create-context-arg.js index c07079cb6c3e72..30f4d68012b1c1 100644 --- a/test/parallel/test-vm-create-context-arg.js +++ b/test/parallel/test-vm-create-context-arg.js @@ -28,7 +28,7 @@ assert.throws(() => { vm.createContext('string is not supported'); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); // Should not throw. diff --git a/test/parallel/test-vm-getters.js b/test/parallel/test-vm-getters.js index af27eeee644032..3bcf80c785a7de 100644 --- a/test/parallel/test-vm-getters.js +++ b/test/parallel/test-vm-getters.js @@ -8,7 +8,7 @@ const sandbox = {}; Object.defineProperty(sandbox, 'prop', { get() { return 'foo'; - } + }, }); const descriptor = Object.getOwnPropertyDescriptor(sandbox, 'prop'); diff --git a/test/parallel/test-vm-global-property-interceptors.js b/test/parallel/test-vm-global-property-interceptors.js index 01ae72446047f9..d662a0a66fff06 100644 --- a/test/parallel/test-vm-global-property-interceptors.js +++ b/test/parallel/test-vm-global-property-interceptors.js @@ -6,26 +6,26 @@ const vm = require('vm'); const dSymbol = Symbol('d'); const sandbox = { a: 'a', - dSymbol + dSymbol, }; Object.defineProperties(sandbox, { b: { - value: 'b' + value: 'b', }, c: { value: 'c', writable: true, - enumerable: true + enumerable: true, }, [dSymbol]: { - value: 'd' + value: 'd', }, e: { value: 'e', - configurable: true + configurable: true, }, - f: {} + f: {}, }); const ctx = vm.createContext(sandbox); @@ -55,9 +55,9 @@ assert.deepEqual(result, { value: undefined, writable: false, enumerable: false, - configurable: false + configurable: false, }, - g: undefined + g: undefined, }); // Define new properties @@ -78,14 +78,14 @@ assert.deepStrictEqual(Object.getOwnPropertyDescriptor(ctx, 'h'), { value: 'h', writable: false, enumerable: false, - configurable: false + configurable: false, }); assert.deepStrictEqual(Object.getOwnPropertyDescriptor(ctx, 'i'), { value: undefined, writable: false, enumerable: false, - configurable: false + configurable: false, }); const jDesc = Object.getOwnPropertyDescriptor(ctx, 'j'); diff --git a/test/parallel/test-vm-inherited_properties.js b/test/parallel/test-vm-inherited_properties.js index 53087e1596e5c8..eb4f12815a41e7 100644 --- a/test/parallel/test-vm-inherited_properties.js +++ b/test/parallel/test-vm-inherited_properties.js @@ -6,11 +6,11 @@ const vm = require('vm'); const assert = require('assert'); let base = { - propBase: 1 + propBase: 1, }; let sandbox = Object.create(base, { - propSandbox: { value: 3 } + propSandbox: { value: 3 }, }); const context = vm.createContext(sandbox); diff --git a/test/parallel/test-vm-is-context.js b/test/parallel/test-vm-is-context.js index 02dc7a596db463..85836789b3b667 100644 --- a/test/parallel/test-vm-is-context.js +++ b/test/parallel/test-vm-is-context.js @@ -31,7 +31,7 @@ for (const valToTest of [ vm.isContext(valToTest); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); } diff --git a/test/parallel/test-vm-measure-memory-lazy.js b/test/parallel/test-vm-measure-memory-lazy.js index 513cfbc3672451..95fa8ae6e4e5cd 100644 --- a/test/parallel/test-vm-measure-memory-lazy.js +++ b/test/parallel/test-vm-measure-memory-lazy.js @@ -4,7 +4,7 @@ const common = require('../common'); const { assertSummaryShape, - expectExperimentalWarning + expectExperimentalWarning, } = require('../common/measure-memory'); const vm = require('vm'); diff --git a/test/parallel/test-vm-measure-memory-multi-context.js b/test/parallel/test-vm-measure-memory-multi-context.js index 3a3065a8edb631..906e428cfd2a1e 100644 --- a/test/parallel/test-vm-measure-memory-multi-context.js +++ b/test/parallel/test-vm-measure-memory-multi-context.js @@ -2,7 +2,7 @@ const common = require('../common'); const { assertDetailedShape, - expectExperimentalWarning + expectExperimentalWarning, } = require('../common/measure-memory'); const vm = require('vm'); const assert = require('assert'); @@ -13,7 +13,7 @@ expectExperimentalWarning(); const count = 10; for (let i = 0; i < count; ++i) { const context = vm.createContext({ - test: new Array(100).fill('foo') + test: new Array(100).fill('foo'), }); arr.push(context); } diff --git a/test/parallel/test-vm-measure-memory.js b/test/parallel/test-vm-measure-memory.js index 6b18db9be7a714..ca6db2a23c6e74 100644 --- a/test/parallel/test-vm-measure-memory.js +++ b/test/parallel/test-vm-measure-memory.js @@ -3,7 +3,7 @@ const common = require('../common'); const { assertSummaryShape, assertSingleDetailedShape, - expectExperimentalWarning + expectExperimentalWarning, } = require('../common/measure-memory'); const assert = require('assert'); const vm = require('vm'); @@ -22,15 +22,15 @@ expectExperimentalWarning(); .then(common.mustCall(assertSummaryShape)); assert.throws(() => vm.measureMemory(null), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => vm.measureMemory('summary'), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); assert.throws(() => vm.measureMemory({ mode: 'random' }), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); assert.throws(() => vm.measureMemory({ execution: 'random' }), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); } diff --git a/test/parallel/test-vm-module-basic.js b/test/parallel/test-vm-module-basic.js index d162f1bebd744c..5b3f8b33592af7 100644 --- a/test/parallel/test-vm-module-basic.js +++ b/test/parallel/test-vm-module-basic.js @@ -31,7 +31,7 @@ const util = require('util'); assert.deepStrictEqual(context, { foo: 'bar', baz: 'bar', - typeofProcess: 'undefined' + typeofProcess: 'undefined', }); }().then(common.mustCall())); @@ -88,7 +88,7 @@ const util = require('util'); () => m[util.inspect.custom].call(Object.create(null)), { code: 'ERR_VM_MODULE_NOT_MODULE', - message: 'Provided module is not an instance of Module' + message: 'Provided module is not an instance of Module', }, ); } @@ -121,7 +121,7 @@ const util = require('util'); { assert.throws(() => new Module(), { message: 'Module is not a constructor', - name: 'TypeError' + name: 'TypeError', }); } @@ -131,7 +131,7 @@ const util = require('util'); message: 'The "exportNames" argument must be an ' + 'Array of unique strings.' + ' Received undefined', - name: 'TypeError' + name: 'TypeError', }); } @@ -149,7 +149,7 @@ const util = require('util'); assert.throws(() => new SyntheticModule([], undefined, {}), { message: 'The "evaluateCallback" argument must be of type function.' + ' Received undefined', - name: 'TypeError' + name: 'TypeError', }); } @@ -158,7 +158,7 @@ const util = require('util'); assert.throws(() => new SyntheticModule([], () => {}, null), { message: 'The "options" argument must be of type object.' + ' Received null', - name: 'TypeError' + name: 'TypeError', }); } diff --git a/test/parallel/test-vm-module-errors.js b/test/parallel/test-vm-module-errors.js index 888250cef84f6f..33e5c0f4d12888 100644 --- a/test/parallel/test-vm-module-errors.js +++ b/test/parallel/test-vm-module-errors.js @@ -19,7 +19,7 @@ async function checkArgType() { new SourceTextModule(); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); for (const invalidOptions of [ @@ -30,7 +30,7 @@ async function checkArgType() { new SourceTextModule('', invalidOptions); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); } @@ -42,7 +42,7 @@ async function checkArgType() { await m.link(invalidLinker); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); } } @@ -55,7 +55,7 @@ async function checkModuleState() { assert.strictEqual(m.status, 'linked'); await m.link(common.mustNotCall()); }, { - code: 'ERR_VM_MODULE_ALREADY_LINKED' + code: 'ERR_VM_MODULE_ALREADY_LINKED', }); await assert.rejects(async () => { @@ -64,7 +64,7 @@ async function checkModuleState() { assert.strictEqual(m.status, 'linking'); await m.link(common.mustNotCall()); }, { - code: 'ERR_VM_MODULE_STATUS' + code: 'ERR_VM_MODULE_STATUS', }); await assert.rejects(async () => { @@ -72,7 +72,7 @@ async function checkModuleState() { await m.evaluate(); }, { code: 'ERR_VM_MODULE_STATUS', - message: 'Module status must be one of linked, evaluated, or errored' + message: 'Module status must be one of linked, evaluated, or errored', }); await assert.rejects(async () => { @@ -81,7 +81,7 @@ async function checkModuleState() { }, { code: 'ERR_INVALID_ARG_TYPE', message: 'The "options" argument must be of type object. ' + - 'Received type boolean (false)' + 'Received type boolean (false)', }); assert.throws(() => { @@ -89,7 +89,7 @@ async function checkModuleState() { m.error; // eslint-disable-line no-unused-expressions }, { code: 'ERR_VM_MODULE_STATUS', - message: 'Module status must be errored' + message: 'Module status must be errored', }); await assert.rejects(async () => { @@ -98,7 +98,7 @@ async function checkModuleState() { m.error; // eslint-disable-line no-unused-expressions }, { code: 'ERR_VM_MODULE_STATUS', - message: 'Module status must be errored' + message: 'Module status must be errored', }); assert.throws(() => { @@ -106,7 +106,7 @@ async function checkModuleState() { m.namespace; // eslint-disable-line no-unused-expressions }, { code: 'ERR_VM_MODULE_STATUS', - message: 'Module status must not be unlinked or linking' + message: 'Module status must not be unlinked or linking', }); } @@ -121,7 +121,7 @@ async function checkLinking() { throw err; } }, { - code: 'ERR_VM_MODULE_NOT_MODULE' + code: 'ERR_VM_MODULE_NOT_MODULE', }); await assert.rejects(async () => { @@ -136,7 +136,7 @@ async function checkLinking() { throw err; } }, { - code: 'ERR_VM_MODULE_DIFFERENT_CONTEXT' + code: 'ERR_VM_MODULE_DIFFERENT_CONTEXT', }); await assert.rejects(async () => { @@ -152,19 +152,19 @@ async function checkLinking() { const rootModule = new SourceTextModule('import "errored";'); await rootModule.link(common.mustCall(() => erroredModule)); }, { - code: 'ERR_VM_MODULE_LINKING_ERRORED' + code: 'ERR_VM_MODULE_LINKING_ERRORED', }); } assert.throws(() => { new SourceTextModule('', { - importModuleDynamically: 'hucairz' + importModuleDynamically: 'hucairz', }); }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.importModuleDynamically" property must be of type ' + - "function. Received type string ('hucairz')" + "function. Received type string ('hucairz')", }); // Check the JavaScript engine deals with exceptions correctly @@ -203,7 +203,7 @@ async function checkInvalidOptionForEvaluate() { message: 'The "options.breakOnSigint" property must be of type boolean. ' + "Received type string ('a-string')", - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); { @@ -212,7 +212,7 @@ async function checkInvalidOptionForEvaluate() { await Module.prototype[method](); }, { code: 'ERR_VM_MODULE_NOT_MODULE', - message: /Provided module is not an instance of Module/ + message: /Provided module is not an instance of Module/, }); }); } @@ -237,7 +237,7 @@ function checkInvalidCachedData() { function checkGettersErrors() { const expectedError = { code: 'ERR_VM_MODULE_NOT_MODULE', - message: /Provided module is not an instance of Module/ + message: /Provided module is not an instance of Module/, }; const getters = ['identifier', 'context', 'namespace', 'status', 'error']; getters.forEach((getter) => { diff --git a/test/parallel/test-vm-module-import-meta.js b/test/parallel/test-vm-module-import-meta.js index 4fa285a906086d..6abc587f5c1d8a 100644 --- a/test/parallel/test-vm-module-import-meta.js +++ b/test/parallel/test-vm-module-import-meta.js @@ -11,7 +11,7 @@ async function testBasic() { initializeImportMeta: common.mustCall((meta, module) => { assert.strictEqual(module, m); meta.prop = 42; - }) + }), }); await m.link(common.mustNotCall()); await m.evaluate(); @@ -29,11 +29,11 @@ async function testInvalid() { ]) { assert.throws(() => { new SourceTextModule('', { - initializeImportMeta: invalidValue + initializeImportMeta: invalidValue, }); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); } } diff --git a/test/parallel/test-vm-module-link.js b/test/parallel/test-vm-module-link.js index 9805d8fe3eee9c..8dfd3768971256 100644 --- a/test/parallel/test-vm-module-link.js +++ b/test/parallel/test-vm-module-link.js @@ -104,7 +104,7 @@ async function circular2() { './b.mjs': ` export * from './a.mjs'; export let fromB; - ` + `, }; const moduleMap = new Map(); const rootModule = new SourceTextModule(sourceMap.root, { diff --git a/test/parallel/test-vm-module-synthetic.js b/test/parallel/test-vm-module-synthetic.js index 9d1c07ead5c4cd..21fdf3a0951228 100644 --- a/test/parallel/test-vm-module-synthetic.js +++ b/test/parallel/test-vm-module-synthetic.js @@ -71,7 +71,7 @@ const assert = require('assert'); SyntheticModule.prototype.setExport.call({}, 'foo'); }, { code: 'ERR_VM_MODULE_NOT_MODULE', - message: /Provided module is not an instance of Module/ + message: /Provided module is not an instance of Module/, }); } diff --git a/test/parallel/test-vm-options-validation.js b/test/parallel/test-vm-options-validation.js index 1d02f8eb90bfaf..6985aaf5eb4fdd 100644 --- a/test/parallel/test-vm-options-validation.js +++ b/test/parallel/test-vm-options-validation.js @@ -6,12 +6,12 @@ const vm = require('vm'); const invalidArgType = { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }; const outOfRange = { name: 'RangeError', - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', }; assert.throws(() => { diff --git a/test/parallel/test-vm-preserves-property.js b/test/parallel/test-vm-preserves-property.js index 0846fd4f798170..ab921857040573 100644 --- a/test/parallel/test-vm-preserves-property.js +++ b/test/parallel/test-vm-preserves-property.js @@ -10,7 +10,7 @@ Object.defineProperty(x, 'prop', { configurable: false, enumerable: false, writable: false, - value: 'val' + value: 'val', }); const o = vm.createContext(x); diff --git a/test/parallel/test-vm-proxy-failure-CP.js b/test/parallel/test-vm-proxy-failure-CP.js index 93027576d85e80..b3ace4d28d1673 100644 --- a/test/parallel/test-vm-proxy-failure-CP.js +++ b/test/parallel/test-vm-proxy-failure-CP.js @@ -7,7 +7,7 @@ const vm = require('vm'); const handler = { getOwnPropertyDescriptor: (target, prop) => { throw new Error('whoops'); - } + }, }; const sandbox = new Proxy({ foo: 'bar' }, handler); const context = vm.createContext(sandbox); diff --git a/test/parallel/test-vm-script-throw-in-tostring.js b/test/parallel/test-vm-script-throw-in-tostring.js index 20e7a75079b33c..3e6c97d109f998 100644 --- a/test/parallel/test-vm-script-throw-in-tostring.js +++ b/test/parallel/test-vm-script-throw-in-tostring.js @@ -9,6 +9,6 @@ assert.throws(() => { new vm.Script({ toString() { throw new Error(); - } + }, }); }, Error); diff --git a/test/parallel/test-vm-set-property-proxy.js b/test/parallel/test-vm-set-property-proxy.js index 2e3293bf62947c..214c4c4c0826d2 100644 --- a/test/parallel/test-vm-set-property-proxy.js +++ b/test/parallel/test-vm-set-property-proxy.js @@ -8,7 +8,7 @@ const vm = require('vm'); const handler = { getOwnPropertyDescriptor: common.mustCallAtLeast(() => { return {}; - }) + }), }; const proxy = new Proxy({}, handler); diff --git a/test/parallel/test-vm-sigint-existing-handler.js b/test/parallel/test-vm-sigint-existing-handler.js index 47e5e80c743023..3587468b80d578 100644 --- a/test/parallel/test-vm-sigint-existing-handler.js +++ b/test/parallel/test-vm-sigint-existing-handler.js @@ -40,7 +40,7 @@ if (process.argv[2] === 'child') { () => { vm[method](script, ...args, options); }, { code: 'ERR_SCRIPT_EXECUTION_INTERRUPTED', - message: 'Script execution was interrupted by `SIGINT`' + message: 'Script execution was interrupted by `SIGINT`', }); assert.strictEqual(firstHandlerCalled, 0); assert.strictEqual(onceHandlerCalled, 0); @@ -73,7 +73,7 @@ if (process.argv[2] === 'child') { for (const method of methods) { const child = spawn(process.execPath, [__filename, 'child', method], { - stdio: [null, 'inherit', 'inherit', 'ipc'] + stdio: [null, 'inherit', 'inherit', 'ipc'], }); child.on('message', common.mustCall(() => { diff --git a/test/parallel/test-vm-sigint.js b/test/parallel/test-vm-sigint.js index 66f22ba8789505..4be4b0c3b8ec07 100644 --- a/test/parallel/test-vm-sigint.js +++ b/test/parallel/test-vm-sigint.js @@ -28,7 +28,7 @@ if (process.argv[2] === 'child') { () => { vm[method](script, ...args, options); }, { code: 'ERR_SCRIPT_EXECUTION_INTERRUPTED', - message: 'Script execution was interrupted by `SIGINT`' + message: 'Script execution was interrupted by `SIGINT`', }); return; } @@ -37,7 +37,7 @@ for (const method of ['runInThisContext', 'runInContext']) { for (const listeners of [0, 1, 2]) { const args = [__filename, 'child', method, listeners]; const child = spawn(process.execPath, args, { - stdio: [null, 'pipe', 'inherit', 'ipc'] + stdio: [null, 'pipe', 'inherit', 'ipc'], }); child.on('message', common.mustCall(() => { diff --git a/test/parallel/test-vm-timeout-escape-promise-2.js b/test/parallel/test-vm-timeout-escape-promise-2.js index a3cb3dbc7fd442..194b8ad37e8ff3 100644 --- a/test/parallel/test-vm-timeout-escape-promise-2.js +++ b/test/parallel/test-vm-timeout-escape-promise-2.js @@ -28,11 +28,11 @@ assert.throws(() => { 'Promise.resolve().then(() => loop());', { hrtime, - loop + loop, }, { timeout: 10, microtaskMode: 'afterEvaluate' } ); }, { code: 'ERR_SCRIPT_EXECUTION_TIMEOUT', - message: 'Script execution timed out after 10ms' + message: 'Script execution timed out after 10ms', }); diff --git a/test/parallel/test-vm-timeout-escape-promise-module.js b/test/parallel/test-vm-timeout-escape-promise-module.js index 3451c0af71c16f..13786acc704294 100644 --- a/test/parallel/test-vm-timeout-escape-promise-module.js +++ b/test/parallel/test-vm-timeout-escape-promise-module.js @@ -31,12 +31,12 @@ assert.rejects(async () => { { context: vm.createContext({ hrtime, - loop - }, { microtaskMode: 'afterEvaluate' }) + loop, + }, { microtaskMode: 'afterEvaluate' }), }); await module.link(common.mustNotCall()); await module.evaluate({ timeout: 5 }); }, { code: 'ERR_SCRIPT_EXECUTION_TIMEOUT', - message: 'Script execution timed out after 5ms' + message: 'Script execution timed out after 5ms', }); diff --git a/test/parallel/test-vm-timeout-escape-promise.js b/test/parallel/test-vm-timeout-escape-promise.js index 0e82ab8c86a935..8e30bc0d6f3bd0 100644 --- a/test/parallel/test-vm-timeout-escape-promise.js +++ b/test/parallel/test-vm-timeout-escape-promise.js @@ -29,11 +29,11 @@ assert.throws(() => { 'Promise.resolve().then(() => loop()); loop();', { hrtime, - loop + loop, }, { timeout: 5, microtaskMode: 'afterEvaluate' } ); }, { code: 'ERR_SCRIPT_EXECUTION_TIMEOUT', - message: 'Script execution timed out after 5ms' + message: 'Script execution timed out after 5ms', }); diff --git a/test/parallel/test-vm-timeout.js b/test/parallel/test-vm-timeout.js index 426d1e06925514..c830e0537a49a8 100644 --- a/test/parallel/test-vm-timeout.js +++ b/test/parallel/test-vm-timeout.js @@ -31,7 +31,7 @@ assert.throws( }, { code: 'ERR_SCRIPT_EXECUTION_TIMEOUT', - message: 'Script execution timed out after 100ms' + message: 'Script execution timed out after 100ms', }); // Timeout of 1000ms, script finishes first @@ -44,14 +44,14 @@ assert.throws( log: console.log, runInVM: function(timeout) { vm.runInNewContext('while(true) {}', context, { timeout }); - } + }, }; vm.runInNewContext('runInVM(10)', context, { timeout: 10000 }); throw new Error('Test 5 failed'); }, { code: 'ERR_SCRIPT_EXECUTION_TIMEOUT', - message: 'Script execution timed out after 10ms' + message: 'Script execution timed out after 10ms', }); // Nested vm timeouts, outer timeout is shorter and fires first. @@ -60,14 +60,14 @@ assert.throws( const context = { runInVM: function(timeout) { vm.runInNewContext('while(true) {}', context, { timeout }); - } + }, }; vm.runInNewContext('runInVM(10000)', context, { timeout: 100 }); throw new Error('Test 6 failed'); }, { code: 'ERR_SCRIPT_EXECUTION_TIMEOUT', - message: 'Script execution timed out after 100ms' + message: 'Script execution timed out after 100ms', }); // Nested vm timeouts, inner script throws an error. @@ -75,7 +75,7 @@ assert.throws(function() { const context = { runInVM: function(timeout) { vm.runInNewContext('throw new Error(\'foobar\')', context, { timeout }); - } + }, }; vm.runInNewContext('runInVM(10000)', context, { timeout: 100000 }); }, /foobar/); diff --git a/test/parallel/test-webcrypto-cryptokey-workers.js b/test/parallel/test-webcrypto-cryptokey-workers.js index 7f54481149dd59..9c14354c815188 100644 --- a/test/parallel/test-webcrypto-cryptokey-workers.js +++ b/test/parallel/test-webcrypto-cryptokey-workers.js @@ -24,7 +24,7 @@ const sig = '13691a79fb55a0417e4d6699a32f91ad29283fa2c1439865cc0632931f4f48dc'; async function doSig(key) { const signature = await subtle.sign({ - name: 'HMAC' + name: 'HMAC', }, key, 'some data'); assert.strictEqual(Buffer.from(signature).toString('hex'), sig); } diff --git a/test/parallel/test-webcrypto-derivebits-ecdh.js b/test/parallel/test-webcrypto-derivebits-ecdh.js index 49076ce443a54a..2c3ff7f8aa1879 100644 --- a/test/parallel/test-webcrypto-derivebits-ecdh.js +++ b/test/parallel/test-webcrypto-derivebits-ecdh.js @@ -63,7 +63,7 @@ async function prepareKeys() { Buffer.from(pkcs8, 'hex'), { name: 'ECDH', - namedCurve + namedCurve, }, true, ['deriveKey', 'deriveBits']), @@ -72,7 +72,7 @@ async function prepareKeys() { Buffer.from(spki, 'hex'), { name: 'ECDH', - namedCurve + namedCurve, }, true, ['deriveKey', 'deriveBits']), @@ -98,7 +98,7 @@ async function prepareKeys() { // Good parameters const bits = await subtle.deriveBits({ name: 'ECDH', - public: publicKey + public: publicKey, }, privateKey, 8 * size); assert(bits instanceof ArrayBuffer); @@ -109,7 +109,7 @@ async function prepareKeys() { // Case insensitivity const bits = await subtle.deriveBits({ name: 'eCdH', - public: publicKey + public: publicKey, }, privateKey, 8 * size); assert.strictEqual(Buffer.from(bits).toString('hex'), result); @@ -119,7 +119,7 @@ async function prepareKeys() { // Null length const bits = await subtle.deriveBits({ name: 'ECDH', - public: publicKey + public: publicKey, }, privateKey, null); assert.strictEqual(Buffer.from(bits).toString('hex'), result); @@ -129,7 +129,7 @@ async function prepareKeys() { // Short Result const bits = await subtle.deriveBits({ name: 'ECDH', - public: publicKey + public: publicKey, }, privateKey, 8 * size - 32); assert.strictEqual( @@ -141,9 +141,9 @@ async function prepareKeys() { // Too long result await assert.rejects(subtle.deriveBits({ name: 'ECDH', - public: publicKey + public: publicKey, }, privateKey, 8 * size + 8), { - message: /derived bit length is too small/ + message: /derived bit length is too small/, }); } @@ -151,7 +151,7 @@ async function prepareKeys() { // Non-multiple of 8 const bits = await subtle.deriveBits({ name: 'ECDH', - public: publicKey + public: publicKey, }, privateKey, 8 * size - 11); assert.strictEqual( @@ -177,7 +177,7 @@ async function prepareKeys() { subtle.deriveBits( { name: 'ECDH', - public: { message: 'Not a CryptoKey' } + public: { message: 'Not a CryptoKey' }, }, keys['P-384'].privateKey, 8 * keys['P-384'].size), @@ -190,7 +190,7 @@ async function prepareKeys() { subtle.deriveBits( { name: 'ECDH', - public: keys['P-384'].publicKey + public: keys['P-384'].publicKey, }, keys['P-521'].privateKey, 8 * keys['P-521'].size), @@ -202,14 +202,14 @@ async function prepareKeys() { const { publicKey } = await subtle.generateKey( { name: 'ECDSA', - namedCurve: 'P-521' + namedCurve: 'P-521', }, false, ['verify']); await assert.rejects(subtle.deriveBits({ name: 'ECDH', - public: publicKey + public: publicKey, }, keys['P-521'].privateKey, null), { - message: /Keys must be ECDH keys/ + message: /Keys must be ECDH keys/, }); } @@ -220,14 +220,14 @@ async function prepareKeys() { Buffer.from(kTests[0].pkcs8, 'hex'), { name: 'ECDH', - namedCurve: 'P-521' + namedCurve: 'P-521', }, false, ['deriveKey']); await assert.rejects(subtle.deriveBits({ name: 'ECDH', public: keys['P-521'].publicKey, }, privateKey, null), { - message: /baseKey does not have deriveBits usage/ + message: /baseKey does not have deriveBits usage/, }); } @@ -235,9 +235,9 @@ async function prepareKeys() { // Base key is not a private key await assert.rejects(subtle.deriveBits({ name: 'ECDH', - public: keys['P-521'].publicKey + public: keys['P-521'].publicKey, }, keys['P-521'].publicKey, null), { - message: /baseKey must be a private key/ + message: /baseKey must be a private key/, }); } @@ -245,9 +245,9 @@ async function prepareKeys() { // Base key is not a private key await assert.rejects(subtle.deriveBits({ name: 'ECDH', - public: keys['P-521'].privateKey + public: keys['P-521'].privateKey, }, keys['P-521'].publicKey, null), { - message: /algorithm\.public must be a public key/ + message: /algorithm\.public must be a public key/, }); } @@ -262,9 +262,9 @@ async function prepareKeys() { await assert.rejects(subtle.deriveBits({ name: 'ECDH', - public: key + public: key, }, keys['P-521'].publicKey, null), { - message: /algorithm\.public must be a public key/ + message: /algorithm\.public must be a public key/, }); } })().then(common.mustCall()); diff --git a/test/parallel/test-webcrypto-derivebits-hkdf.js b/test/parallel/test-webcrypto-derivebits-hkdf.js index 42d958e5f5f821..9987850a0ef751 100644 --- a/test/parallel/test-webcrypto-derivebits-hkdf.js +++ b/test/parallel/test-webcrypto-derivebits-hkdf.js @@ -36,12 +36,12 @@ const kDerivedKeys = { const kSalts = { normal: '536f6469756d2043686c6f7269646520636f6d706f756e64', - empty: '' + empty: '', }; const kInfos = { normal: '484b444620657874726120696e666f', - empty: '' + empty: '', }; const kDerivations = { @@ -51,53 +51,53 @@ const kDerivations = { normal: '19ba74368e6b993390f27fe9a7d02bc3' + '38173f72be71a19fc744fcdb3fd4b84b', empty: '97601f4e0c53a5d3f3a2810099bc6820' + - 'ec50083434769b59fc24a417a9543734' + 'ec50083434769b59fc24a417a9543734', }, 'SHA-512': { normal: '4bbd6db2435fb696157f6089c977c3c7' + '3f3eac5ef3dd6baae604cb53bfbb153e', empty: '2f3157e7fe0c10b01298c8f0886a90ed' + - 'cf80abdef5dbc1df2b1482532b52b934' + 'cf80abdef5dbc1df2b1482532b52b934', }, 'SHA-1': { normal: '05ad22ed2138c9600e4d9e2725ded301' + 'f5d287fbfb5702f999bc6536d3edef98', empty: 'd51b6fb7e599ca30c5ee264593e4b85f' + - '2220c7c3ab003157bff8cb4f369c7560' + '2220c7c3ab003157bff8cb4f369c7560', }, 'SHA-256': { normal: '2af5901e28849c28443857386aa1ac3b' + 'b127e92631c1c051482d6690941772b4', empty: '9e4b719033742101e90f1ad61e2ff3b4' + - '256863667296d74389f1f02af2c4e6a6' - } + '256863667296d74389f1f02af2c4e6a6', + }, }, empty: { 'SHA-384': { normal: 'fb482ff22c4f8d466c4dfe6e29f2cc2e' + 'cdabf5884328fbf08a738fd945f166cb', empty: '1e023c17b340533ceaef39230cb8b3bb' + - 'dbf663a13d6075d0dd326c049478fba5' + 'dbf663a13d6075d0dd326c049478fba5', }, 'SHA-512': { normal: 'f17b5bdcd8d7d3d4601036a19436317d' + '1644f9a4e0956efc0e372b83acdacfdb', empty: 'c7b474942f31f83faf5d14731802b1bd' + - '49478549cb3a8f3dbfedc4d3209cf5b6' + '49478549cb3a8f3dbfedc4d3209cf5b6', }, 'SHA-1': { normal: 'c126f1e6f25a9de42cf7d427059a52ed' + '9601f29a5815cbfbc64bc7f668c6a341', empty: '3215c3f08de70549b051b7033745a818' + - '4f8cbaa6b1735330d2bcb6b16f4642ef' + '4f8cbaa6b1735330d2bcb6b16f4642ef', }, 'SHA-256': { normal: '733c8b6bcfac875c7f08982a6e3ffb56' + '0acea6f165476eb83460b9353ed41dfe', empty: 'c8e12774135305c9147f2cc4766e5ead' + - '25d8f457b9a1953d52677361ced558fb' - } - } + '25d8f457b9a1953d52677361ced558fb', + }, + }, }, long: { normal: { @@ -105,53 +105,53 @@ const kDerivations = { normal: 'f91571b521f7eef13e573aa46378659e' + 'f3b7f36ffdd1bb055db2cd77d260c467', empty: '68af1c2cf6b9370d2054344798bdbb18' + - '47ccf407b7652b793dd136d4640e0348' + '47ccf407b7652b793dd136d4640e0348', }, 'SHA-512': { normal: '710aae2fdf889e45fe0fb995b2c26b33' + 'eb988650ec0faef167028a7a6ccb3638', empty: 'e5de568081c71e562750829871c34275' + - '8104765ed6f306f0613c9d4bb336f2aa' + '8104765ed6f306f0613c9d4bb336f2aa', }, 'SHA-1': { normal: '7f957edcbce3cb0b70566e1eb60efd1e' + '405a13304c661d3663778109bf06899c', empty: '3062f3cf1a730b9cef51f02c1dfac85e' + - 'd91e4b0065eb50ca9fd8b0107e728733' + 'd91e4b0065eb50ca9fd8b0107e728733', }, 'SHA-256': { normal: '31b7d68530a863e717c081ca6917b686' + '50b3dd9a29f30606e2cad199bec14d13', empty: 'e579d1f9e7f08e6f990ffcfcce1ed201' + - 'c5e37e62cdf606f0ba4aca80427fbc44' - } + 'c5e37e62cdf606f0ba4aca80427fbc44', + }, }, empty: { 'SHA-384': { normal: '619eb6f9287395bbd5ed6a67c968465a' + 'd82b6c559f3c38b604bbb08f58320b03', empty: 'ff447b423d83fe76836c32337228b56b' + - '5bd9bf68d58e7dca4b7cca842a45e11a' + '5bd9bf68d58e7dca4b7cca842a45e11a', }, 'SHA-512': { normal: '133e8a7f7ff433690cc88432c2a338c2' + '77e5c13756ff878f46753fe6a564e3e5', empty: 'de54f7eec80c9cc66d349fc987f80d46' + - '1db2ef4ff4e18505d28bd80cb42c7d76' + '1db2ef4ff4e18505d28bd80cb42c7d76', }, 'SHA-1': { normal: 'adb93cdbce79b7d51159b6c0131a2b62' + 'f23828d26acd685e34c06535e6f77496', empty: '47710d2a7507e05a1ddcc87a7c2f9061' + - '77a266efb9e622510cccb3713cd08d58' + '77a266efb9e622510cccb3713cd08d58', }, 'SHA-256': { normal: 'a401d7c9158a29e5c7193ab9730f0748' + '851cc5baadb42cad024b6290fe213436', empty: 'b4f7e7557674d501cbfbc0148ad800c0' + - '750189fe295a2aca5e1bf4122c85edf9' - } - } + '750189fe295a2aca5e1bf4122c85edf9', + }, + }, }, }; @@ -201,7 +201,7 @@ async function setupBaseKeys() { subtle.generateKey( { name: 'ECDH', - namedCurve: 'P-521' + namedCurve: 'P-521', }, false, ['deriveKey', 'deriveBits']) @@ -215,7 +215,7 @@ async function setupBaseKeys() { baseKeys, noBits, noKey, - wrongKey + wrongKey, }; } @@ -229,7 +229,7 @@ async function testDeriveBits( name: 'HKDF', salt: Buffer.from(kSalts[saltSize], 'hex'), info: Buffer.from(kInfos[infoSize], 'hex'), - hash + hash, }; const bits = await subtle.deriveBits( @@ -253,21 +253,21 @@ async function testDeriveBitsBadLengths( name: 'HKDF', salt: Buffer.from(kSalts[saltSize], 'hex'), info: Buffer.from(kInfos[infoSize], 'hex'), - hash + hash, }; return Promise.all([ assert.rejects( subtle.deriveBits(algorithm, baseKeys[size], 0), { - message: /length cannot be zero/ + message: /length cannot be zero/, }), assert.rejects( subtle.deriveBits(algorithm, baseKeys[size], null), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }), assert.rejects( subtle.deriveBits(algorithm, baseKeys[size], 15), { - message: /length must be a multiple of 8/ + message: /length must be a multiple of 8/, }), ]); } @@ -287,18 +287,18 @@ async function testDeriveBitsBadHash( subtle.deriveBits( { ...algorithm, - hash: hash.substring(0, 3) + hash.substring(4) + hash: hash.substring(0, 3) + hash.substring(4), }, baseKeys[size], 256), { - message: /Unrecognized name/ + message: /Unrecognized name/, }), assert.rejects( subtle.deriveBits( { ...algorithm, - hash: 'PBKDF2' + hash: 'PBKDF2', }, baseKeys[size], 256), { - message: /Unrecognized name/ + message: /Unrecognized name/, }), ]); } @@ -313,12 +313,12 @@ async function testDeriveBitsBadUsage( name: 'HKDF', salt: Buffer.from(kSalts[saltSize], 'hex'), info: Buffer.from(kInfos[infoSize], 'hex'), - hash + hash, }; return assert.rejects( subtle.deriveBits(algorithm, noBits[size], 256), { - message: /baseKey does not have deriveBits usage/ + message: /baseKey does not have deriveBits usage/, }); } @@ -331,12 +331,12 @@ async function testDeriveBitsMissingSalt( const algorithm = { name: 'HKDF', info: Buffer.from(kInfos[infoSize], 'hex'), - hash + hash, }; return assert.rejects( subtle.deriveBits(algorithm, baseKeys[size], 0), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); } @@ -349,12 +349,12 @@ async function testDeriveBitsMissingInfo( const algorithm = { name: 'HKDF', salt: Buffer.from(kSalts[infoSize], 'hex'), - hash + hash, }; return assert.rejects( subtle.deriveBits(algorithm, baseKeys[size], 0), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); } @@ -367,12 +367,12 @@ async function testBitsWrongKeyType( name: 'HKDF', salt: Buffer.from(kSalts[saltSize], 'hex'), info: Buffer.from(kInfos[infoSize], 'hex'), - hash + hash, }; return assert.rejects( subtle.deriveBits(algorithm, wrongKey, 256), { - message: /Key algorithm mismatch/ + message: /Key algorithm mismatch/, }); } @@ -388,7 +388,7 @@ async function testDeriveKey( name: 'HKDF', salt: Buffer.from(kSalts[saltSize], 'hex'), info: Buffer.from(kInfos[infoSize], 'hex'), - hash + hash, }; const key = await subtle.deriveKey( @@ -422,7 +422,7 @@ async function testDeriveKeyBadHash( subtle.deriveKey( { ...algorithm, - hash: hash.substring(0, 3) + hash.substring(4) + hash: hash.substring(0, 3) + hash.substring(4), }, baseKeys[size], keyType, @@ -433,7 +433,7 @@ async function testDeriveKeyBadHash( subtle.deriveKey( { ...algorithm, - hash: 'PBKDF2' + hash: 'PBKDF2', }, baseKeys[size], keyType, @@ -455,12 +455,12 @@ async function testDeriveKeyBadUsage( name: 'HKDF', salt: Buffer.from(kSalts[saltSize], 'hex'), info: Buffer.from(kInfos[infoSize], 'hex'), - hash + hash, }; return assert.rejects( subtle.deriveKey(algorithm, noKey[size], keyType, true, usages), { - message: /baseKey does not have deriveKey usage/ + message: /baseKey does not have deriveKey usage/, }); } @@ -476,12 +476,12 @@ async function testWrongKeyType( name: 'HKDF', salt: Buffer.from(kSalts[saltSize], 'hex'), info: Buffer.from(kInfos[infoSize], 'hex'), - hash + hash, }; return assert.rejects( subtle.deriveKey(algorithm, wrongKey, keyType, true, usages), { - message: /Key algorithm mismatch/ + message: /Key algorithm mismatch/, }); } diff --git a/test/parallel/test-webcrypto-derivebits-node-dh.js b/test/parallel/test-webcrypto-derivebits-node-dh.js index cab7d40c1a7abf..e9af776b7aec8d 100644 --- a/test/parallel/test-webcrypto-derivebits-node-dh.js +++ b/test/parallel/test-webcrypto-derivebits-node-dh.js @@ -105,14 +105,14 @@ async function prepareKeys() { const { publicKey, privateKey, - result + result, } = await prepareKeys(); { // Good parameters const bits = await subtle.deriveBits({ name: 'NODE-DH', - public: publicKey + public: publicKey, }, privateKey, null); assert(bits instanceof ArrayBuffer); @@ -123,7 +123,7 @@ async function prepareKeys() { // Case insensitivity const bits = await subtle.deriveBits({ name: 'node-dH', - public: publicKey + public: publicKey, }, privateKey, null); assert.strictEqual(Buffer.from(bits).toString('hex'), result); @@ -133,7 +133,7 @@ async function prepareKeys() { // Short Result const bits = await subtle.deriveBits({ name: 'NODE-DH', - public: publicKey + public: publicKey, }, privateKey, 16); assert.strictEqual( @@ -145,9 +145,9 @@ async function prepareKeys() { // Too long result await assert.rejects(subtle.deriveBits({ name: 'NODE-DH', - public: publicKey + public: publicKey, }, privateKey, result.length * 16), { - message: /derived bit length is too small/ + message: /derived bit length is too small/, }); } @@ -155,7 +155,7 @@ async function prepareKeys() { // Non-multiple of 8 const bits = await subtle.deriveBits({ name: 'NODE-DH', - public: publicKey + public: publicKey, }, privateKey, 15); assert.strictEqual( @@ -180,7 +180,7 @@ async function prepareKeys() { subtle.deriveBits( { name: 'NODE-DH', - public: { message: 'Not a CryptoKey' } + public: { message: 'Not a CryptoKey' }, }, privateKey, null), @@ -192,14 +192,14 @@ async function prepareKeys() { const { publicKey } = await subtle.generateKey( { name: 'ECDSA', - namedCurve: 'P-521' + namedCurve: 'P-521', }, false, ['verify']); await assert.rejects(subtle.deriveBits({ name: 'NODE-DH', - public: publicKey + public: publicKey, }, privateKey, null), { - message: /Keys must be DH keys/ + message: /Keys must be DH keys/, }); } @@ -216,7 +216,7 @@ async function prepareKeys() { name: 'NODE-DH', public: publicKey, }, privateKey, null), { - message: /baseKey does not have deriveBits usage/ + message: /baseKey does not have deriveBits usage/, }); } })().then(common.mustCall()); diff --git a/test/parallel/test-webcrypto-derivebits.js b/test/parallel/test-webcrypto-derivebits.js index 95c38f454fbb93..dc311187d294e7 100644 --- a/test/parallel/test-webcrypto-derivebits.js +++ b/test/parallel/test-webcrypto-derivebits.js @@ -24,10 +24,10 @@ const { internalBinding } = require('internal/test/binding'); const [secret1, secret2] = await Promise.all([ subtle.deriveBits({ - name: 'ECDH', namedCurve, public: alice.publicKey + name: 'ECDH', namedCurve, public: alice.publicKey, }, bob.privateKey, 128), subtle.deriveBits({ - name: 'ECDH', namedCurve, public: bob.publicKey + name: 'ECDH', namedCurve, public: bob.publicKey, }, alice.privateKey, 128), ]); @@ -52,7 +52,7 @@ const { internalBinding } = require('internal/test/binding'); name: 'HKDF', hash, salt: ec.encode(salt), - info: ec.encode(info) + info: ec.encode(info), }, key, length); assert.strictEqual(Buffer.from(secret).toString('hex'), expected); } diff --git a/test/parallel/test-webcrypto-derivekey-ecdh.js b/test/parallel/test-webcrypto-derivekey-ecdh.js index a0bf28e89e4e3a..60ba35e62533ba 100644 --- a/test/parallel/test-webcrypto-derivekey-ecdh.js +++ b/test/parallel/test-webcrypto-derivekey-ecdh.js @@ -58,7 +58,7 @@ async function prepareKeys() { Buffer.from(pkcs8, 'hex'), { name: 'ECDH', - namedCurve + namedCurve, }, true, ['deriveKey', 'deriveBits']), @@ -67,7 +67,7 @@ async function prepareKeys() { Buffer.from(spki, 'hex'), { name: 'ECDH', - namedCurve + namedCurve, }, true, ['deriveKey', 'deriveBits']), @@ -97,7 +97,7 @@ async function prepareKeys() { // Good parameters const key = await subtle.deriveKey({ name: 'ECDH', - public: publicKey + public: publicKey, }, privateKey, ...otherArgs); const raw = await subtle.exportKey('raw', key); @@ -109,11 +109,11 @@ async function prepareKeys() { // Case insensitivity const key = await subtle.deriveKey({ name: 'eCdH', - public: publicKey + public: publicKey, }, privateKey, { name: 'HmAc', hash: 'SHA-256', - length: 256 + length: 256, }, true, ['sign', 'verify']); const raw = await subtle.exportKey('raw', key); @@ -139,7 +139,7 @@ async function prepareKeys() { subtle.deriveKey( { name: 'ECDH', - public: { message: 'Not a CryptoKey' } + public: { message: 'Not a CryptoKey' }, }, keys['P-384'].privateKey, ...otherArgs), @@ -152,7 +152,7 @@ async function prepareKeys() { subtle.deriveKey( { name: 'ECDH', - public: keys['P-384'].publicKey + public: keys['P-384'].publicKey, }, keys['P-521'].privateKey, ...otherArgs), @@ -164,7 +164,7 @@ async function prepareKeys() { const { publicKey } = await subtle.generateKey( { name: 'ECDSA', - namedCurve: 'P-521' + namedCurve: 'P-521', }, false, ['verify']); @@ -173,7 +173,7 @@ async function prepareKeys() { subtle.deriveKey( { name: 'ECDH', - public: publicKey + public: publicKey, }, keys['P-521'].privateKey, ...otherArgs), @@ -187,7 +187,7 @@ async function prepareKeys() { Buffer.from(kTests[0].pkcs8, 'hex'), { name: 'ECDH', - namedCurve: 'P-521' + namedCurve: 'P-521', }, false, ['deriveBits']); await assert.rejects( @@ -207,7 +207,7 @@ async function prepareKeys() { subtle.deriveKey( { name: 'ECDH', - public: keys['P-521'].publicKey + public: keys['P-521'].publicKey, }, keys['P-521'].publicKey, ...otherArgs), @@ -220,7 +220,7 @@ async function prepareKeys() { subtle.deriveKey( { name: 'ECDH', - public: keys['P-521'].privateKey + public: keys['P-521'].privateKey, }, keys['P-521'].publicKey, ...otherArgs), @@ -240,7 +240,7 @@ async function prepareKeys() { subtle.deriveKey( { name: 'ECDH', - public: key + public: key, }, keys['P-521'].publicKey, ...otherArgs), diff --git a/test/parallel/test-webcrypto-derivekey.js b/test/parallel/test-webcrypto-derivekey.js index ee48a61f4ac8f5..87ba7cb5979dd9 100644 --- a/test/parallel/test-webcrypto-derivekey.js +++ b/test/parallel/test-webcrypto-derivekey.js @@ -24,16 +24,16 @@ const { internalBinding } = require('internal/test/binding'); const [secret1, secret2] = await Promise.all([ subtle.deriveKey({ - name: 'ECDH', namedCurve, public: alice.publicKey + name: 'ECDH', namedCurve, public: alice.publicKey, }, bob.privateKey, { name: 'AES-CBC', - length: 256 + length: 256, }, true, ['encrypt']), subtle.deriveKey({ - name: 'ECDH', namedCurve, public: bob.publicKey + name: 'ECDH', namedCurve, public: bob.publicKey, }, alice.privateKey, { name: 'AES-CBC', - length: 256 + length: 256, }, true, ['encrypt']), ]); @@ -62,10 +62,10 @@ const { internalBinding } = require('internal/test/binding'); name: 'HKDF', hash, salt: ec.encode(salt), - info: ec.encode(info) + info: ec.encode(info), }, key, { name: 'AES-CTR', - length: 256 + length: 256, }, true, ['encrypt']); const raw = await subtle.exportKey('raw', secret); @@ -101,7 +101,7 @@ const { internalBinding } = require('internal/test/binding'); iterations, }, key, { name: 'AES-CTR', - length: 256 + length: 256, }, true, ['encrypt']); const raw = await subtle.exportKey('raw', secret); @@ -135,7 +135,7 @@ if (typeof internalBinding('crypto').ScryptJob === 'function') { salt: ec.encode(salt), }, key, { name: 'AES-CTR', - length: 256 + length: 256, }, true, ['encrypt']); const raw = await subtle.exportKey('raw', secret); diff --git a/test/parallel/test-webcrypto-digest.js b/test/parallel/test-webcrypto-digest.js index 78b12ea6a5574c..8ab3deafb9e5c6 100644 --- a/test/parallel/test-webcrypto-digest.js +++ b/test/parallel/test-webcrypto-digest.js @@ -74,7 +74,7 @@ assert.rejects(subtle.digest(''), { message: /Unrecognized name/ }).then(common. Promise.all([1, [], {}, null, undefined].map((i) => assert.rejects(subtle.digest('SHA-256', i), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) )).then(common.mustCall()); @@ -83,7 +83,7 @@ Promise.all([1, [], {}, null, undefined].map((i) => // addition to the API, and is added as a support for future additional // hash algorithms that support variable digest output lengths. assert.rejects(subtle.digest({ name: 'SHA-512', length: 510 }, kData), { - message: /Digest method not supported/ + message: /Digest method not supported/, }).then(common.mustCall()); const kSourceData = { @@ -94,7 +94,7 @@ const kSourceData = { 'f340a3962a446b815b794b4bd43a4403502077b22' + '56cc807837f3aacd118eb4b9c2baeb897068625ab' + 'aca193', - long: null + long: null, }; kSourceData.long = kSourceData.medium.repeat(1024); @@ -104,13 +104,13 @@ const kDigestedData = { empty: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', short: 'c91318cdf2396a015e3f4e6a86a0ba65b8635944', medium: 'e541060870eb16bf33b68e51f513526893986729', - long: '3098b50037ecd02ebd657653b2bfa01eee27a2ea' + long: '3098b50037ecd02ebd657653b2bfa01eee27a2ea', }, 'sha-256': { empty: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', short: 'a2831186984792c7d32d59c89740687f19addc1b959e71a1cc538a3b7ed843f2', medium: '535367877ef014d7fc717e5cb7843e59b61aee62c7029cec7ec6c12fd924e0e4', - long: '14cdea9dc75f5a6274d9fc1e64009912f1dcd306b48fe8e9cf122de671571781' + long: '14cdea9dc75f5a6274d9fc1e64009912f1dcd306b48fe8e9cf122de671571781', }, 'sha-384': { empty: '38b060a751ac96384cd9327eb1b1e36a21fdb71114b' + @@ -124,7 +124,7 @@ const kDigestedData = { '9d279540e977', long: '49f4fdb3981968f97d57370f85345067cd5296a97dd1' + 'a18e06911e756e9608492529870e1ad130998d57cbfb' + - 'b7c1d09e' + 'b7c1d09e', }, 'sha-512': { empty: 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5' + @@ -138,8 +138,8 @@ const kDigestedData = { '761ff5be85328eeaf42c3830f1d95e7a41165b7d2d36', long: '4b02caf650276030ea5617e597c5d53fd9daa68b78bfe' + '60b22aab8d36a4c2a3affdb71234f49276737c575ddf7' + - '4d14054cbd6fdb98fd0ddcbcb46f91ad76b6ee' - } + '4d14054cbd6fdb98fd0ddcbcb46f91ad76b6ee', + }, }; async function testDigest(size, name) { diff --git a/test/parallel/test-webcrypto-ed25519-ed448.js b/test/parallel/test-webcrypto-ed25519-ed448.js index 9c60ceff64b1b4..378ec09b51cad4 100644 --- a/test/parallel/test-webcrypto-ed25519-ed448.js +++ b/test/parallel/test-webcrypto-ed25519-ed448.js @@ -8,14 +8,14 @@ if (!common.hasCrypto) const assert = require('assert'); const { generateKeyPairSync, - webcrypto: { subtle } + webcrypto: { subtle }, } = require('crypto'); async function generateKey(namedCurve) { return subtle.generateKey( { name: namedCurve, - namedCurve + namedCurve, }, true, ['sign', 'verify']); @@ -59,12 +59,12 @@ assert.rejects( Buffer.alloc(10), { name: 'NODE-ED25519', - namedCurve: 'NODE-ED25519' + namedCurve: 'NODE-ED25519', }, false, ['sign']), { - message: /NODE-ED25519 raw keys must be exactly 32-bytes/ + message: /NODE-ED25519 raw keys must be exactly 32-bytes/, }).then(common.mustCall()); assert.rejects( @@ -73,12 +73,12 @@ assert.rejects( Buffer.alloc(10), { name: 'NODE-ED448', - namedCurve: 'NODE-ED448' + namedCurve: 'NODE-ED448', }, false, ['sign']), { - message: /NODE-ED448 raw keys must be exactly 57-bytes/ + message: /NODE-ED448 raw keys must be exactly 57-bytes/, }).then(common.mustCall()); const testVectors = { @@ -239,7 +239,7 @@ const testVectors = { '028961c9bf8ffd973fe5d5c206492b140e00', 'hex'), crv: 'Ed448', }, - ] + ], }; async function test2(namedCurve) { @@ -254,7 +254,7 @@ async function test2(namedCurve) { vector.privateKey, { name: namedCurve, - namedCurve + namedCurve, }, true, ['sign']), subtle.importKey( @@ -263,7 +263,7 @@ async function test2(namedCurve) { { name: namedCurve, namedCurve, - public: true + public: true, }, true, ['verify']), ]); @@ -272,7 +272,7 @@ async function test2(namedCurve) { assert.deepStrictEqual(Buffer.from(rawPublicKey), vector.publicKey); assert.rejects(subtle.exportKey('raw', privateKey), { - message: new RegExp(`Unable to export a raw ${namedCurve} private key`) + message: new RegExp(`Unable to export a raw ${namedCurve} private key`), }).then(common.mustCall()); const sig = await subtle.sign( @@ -322,48 +322,48 @@ assert.rejects( subtle.generateKey( { name: 'ECDSA', - namedCurve: 'NODE-X25519' + namedCurve: 'NODE-X25519', }, true, ['sign', 'verify']), { - message: /Unsupported named curves for ECDSA/ + message: /Unsupported named curves for ECDSA/, }).then(common.mustCall()); assert.rejects( subtle.generateKey( { name: 'ECDSA', - namedCurve: 'NODE-X448' + namedCurve: 'NODE-X448', }, true, ['sign', 'verify']), { - message: /Unsupported named curves for ECDSA/ + message: /Unsupported named curves for ECDSA/, }).then(common.mustCall()); assert.rejects( subtle.generateKey( { name: 'ECDSA', - namedCurve: 'NODE-ED25519' + namedCurve: 'NODE-ED25519', }, true, ['sign', 'verify']), { - message: /Unsupported named curves for ECDSA/ + message: /Unsupported named curves for ECDSA/, }).then(common.mustCall()); assert.rejects( subtle.generateKey( { name: 'ECDSA', - namedCurve: 'NODE-ED448' + namedCurve: 'NODE-ED448', }, true, ['sign', 'verify']), { - message: /Unsupported named curves for ECDSA/ + message: /Unsupported named curves for ECDSA/, }).then(common.mustCall()); { @@ -394,7 +394,7 @@ assert.rejects( keyObject.type === 'private' ? ['sign'] : ['verify'] ), { - message: /Invalid algorithm name/ + message: /Invalid algorithm name/, }).then(common.mustCall()); assert.rejects( @@ -409,7 +409,7 @@ assert.rejects( keyObject.type === 'private' ? ['deriveBits', 'deriveKey'] : [], ), { - message: /Invalid algorithm name/ + message: /Invalid algorithm name/, }).then(common.mustCall()); } } diff --git a/test/parallel/test-webcrypto-encrypt-decrypt-aes.js b/test/parallel/test-webcrypto-encrypt-decrypt-aes.js index 7adb18918d2205..56ab89cdfa7005 100644 --- a/test/parallel/test-webcrypto-encrypt-decrypt-aes.js +++ b/test/parallel/test-webcrypto-encrypt-decrypt-aes.js @@ -45,7 +45,7 @@ async function testEncryptNoEncrypt({ keyBuffer, algorithm, plaintext }) { ['decrypt']); return assert.rejects(subtle.encrypt(algorithm, key, plaintext), { - message: /The requested operation is not valid for the provided key/ + message: /The requested operation is not valid for the provided key/, }); } @@ -60,7 +60,7 @@ async function testEncryptNoDecrypt({ keyBuffer, algorithm, plaintext }) { const output = await subtle.encrypt(algorithm, key, plaintext); return assert.rejects(subtle.decrypt(algorithm, key, output), { - message: /The requested operation is not valid for the provided key/ + message: /The requested operation is not valid for the provided key/, }); } @@ -74,7 +74,7 @@ async function testEncryptWrongAlg({ keyBuffer, algorithm, plaintext }, alg) { ['encrypt']); return assert.rejects(subtle.encrypt(algorithm, key, plaintext), { - message: /The requested operation is not valid for the provided key/ + message: /The requested operation is not valid for the provided key/, }); } @@ -94,7 +94,7 @@ async function testDecrypt({ keyBuffer, algorithm, result }) { const { passing, failing, - decryptionFailing + decryptionFailing, } = require('../fixtures/crypto/aes_cbc')(); (async function() { @@ -109,16 +109,16 @@ async function testDecrypt({ keyBuffer, algorithm, result }) { failing.forEach((vector) => { variations.push(assert.rejects(testEncrypt(vector), { - message: /algorithm\.iv must contain exactly 16 bytes/ + message: /algorithm\.iv must contain exactly 16 bytes/, })); variations.push(assert.rejects(testDecrypt(vector), { - message: /algorithm\.iv must contain exactly 16 bytes/ + message: /algorithm\.iv must contain exactly 16 bytes/, })); }); decryptionFailing.forEach((vector) => { variations.push(assert.rejects(testDecrypt(vector), { - message: /bad decrypt/ + message: /bad decrypt/, })); }); @@ -131,7 +131,7 @@ async function testDecrypt({ keyBuffer, algorithm, result }) { const { passing, failing, - decryptionFailing + decryptionFailing, } = require('../fixtures/crypto/aes_ctr')(); (async function() { @@ -148,16 +148,16 @@ async function testDecrypt({ keyBuffer, algorithm, result }) { // make them consistent failing.forEach((vector) => { variations.push(assert.rejects(testEncrypt(vector), { - message: /.*/ + message: /.*/, })); variations.push(assert.rejects(testDecrypt(vector), { - message: /.*/ + message: /.*/, })); }); decryptionFailing.forEach((vector) => { variations.push(assert.rejects(testDecrypt(vector), { - message: /bad decrypt/ + message: /bad decrypt/, })); }); @@ -170,7 +170,7 @@ async function testDecrypt({ keyBuffer, algorithm, result }) { const { passing, failing, - decryptionFailing + decryptionFailing, } = require('../fixtures/crypto/aes_gcm')(); (async function() { @@ -185,16 +185,16 @@ async function testDecrypt({ keyBuffer, algorithm, result }) { failing.forEach((vector) => { variations.push(assert.rejects(testEncrypt(vector), { - message: /is not a valid AES-GCM tag length/ + message: /is not a valid AES-GCM tag length/, })); variations.push(assert.rejects(testDecrypt(vector), { - message: /is not a valid AES-GCM tag length/ + message: /is not a valid AES-GCM tag length/, })); }); decryptionFailing.forEach((vector) => { variations.push(assert.rejects(testDecrypt(vector), { - message: /bad decrypt/ + message: /bad decrypt/, })); }); @@ -221,7 +221,7 @@ async function testDecrypt({ keyBuffer, algorithm, result }) { name: 'AES-GCM', iv, additionalData: aad, - tagLength: 128 + tagLength: 128, }, secretKey, getRandomValues(new Uint8Array(32)) diff --git a/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js b/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js index e01152c07f294d..5e9add4bdee2f3 100644 --- a/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js +++ b/test/parallel/test-webcrypto-encrypt-decrypt-rsa.js @@ -12,7 +12,7 @@ const assert = require('assert'); const { subtle } = require('crypto').webcrypto; const { - passing + passing, } = require('../fixtures/crypto/rsa')(); async function importVectorKey( @@ -42,7 +42,7 @@ async function testDecryption({ ciphertext, return; const { - privateKey + privateKey, } = await importVectorKey( publicKeyBuffer, privateKeyBuffer, @@ -76,12 +76,12 @@ async function testEncryption( plaintext, hash, publicKeyBuffer, - privateKeyBuffer + privateKeyBuffer, }, modify = false) { const { publicKey, - privateKey + privateKey, } = await importVectorKey( publicKeyBuffer, privateKeyBuffer, @@ -130,7 +130,7 @@ async function testEncryptionLongPlaintext({ algorithm, return assert.rejects( subtle.encrypt(algorithm, publicKey, newplaintext), { - message: /data too large/ + message: /data too large/, }); } @@ -150,7 +150,7 @@ async function testEncryptionWrongKey({ algorithm, ['decrypt']); return assert.rejects( subtle.encrypt(algorithm, privateKey, plaintext), { - message: /The requested operation is not valid/ + message: /The requested operation is not valid/, }); } @@ -170,7 +170,7 @@ async function testEncryptionBadUsage({ algorithm, ['decrypt']); return assert.rejects( subtle.encrypt(algorithm, publicKey, plaintext), { - message: /The requested operation is not valid/ + message: /The requested operation is not valid/, }); } @@ -183,7 +183,7 @@ async function testDecryptionWrongKey({ ciphertext, return; const { - publicKey + publicKey, } = await importVectorKey( publicKeyBuffer, privateKeyBuffer, @@ -194,7 +194,7 @@ async function testDecryptionWrongKey({ ciphertext, return assert.rejects( subtle.decrypt(algorithm, publicKey, ciphertext), { - message: /The requested operation is not valid/ + message: /The requested operation is not valid/, }); } @@ -207,7 +207,7 @@ async function testDecryptionBadUsage({ ciphertext, return; const { - publicKey + publicKey, } = await importVectorKey( publicKeyBuffer, privateKeyBuffer, @@ -218,7 +218,7 @@ async function testDecryptionBadUsage({ ciphertext, return assert.rejects( subtle.decrypt(algorithm, publicKey, ciphertext), { - message: /The requested operation is not valid/ + message: /The requested operation is not valid/, }); } diff --git a/test/parallel/test-webcrypto-encrypt-decrypt.js b/test/parallel/test-webcrypto-encrypt-decrypt.js index 50fa99a999cd92..ace5d8d1cb71ed 100644 --- a/test/parallel/test-webcrypto-encrypt-decrypt.js +++ b/test/parallel/test-webcrypto-encrypt-decrypt.js @@ -26,12 +26,12 @@ const { subtle, getRandomValues } = require('crypto').webcrypto; const ciphertext = await subtle.encrypt({ name: 'RSA-OAEP', - label: ec.encode('a label') + label: ec.encode('a label'), }, publicKey, buf); const plaintext = await subtle.decrypt({ name: 'RSA-OAEP', - label: ec.encode('a label') + label: ec.encode('a label'), }, privateKey, ciphertext); assert.strictEqual( @@ -50,7 +50,7 @@ const { subtle, getRandomValues } = require('crypto').webcrypto; async function test() { const key = await subtle.generateKey({ name: 'AES-CTR', - length: 256 + length: 256, }, true, ['encrypt', 'decrypt']); const ciphertext = await subtle.encrypt( @@ -77,7 +77,7 @@ const { subtle, getRandomValues } = require('crypto').webcrypto; async function test() { const key = await subtle.generateKey({ name: 'AES-CBC', - length: 256 + length: 256, }, true, ['encrypt', 'decrypt']); const ciphertext = await subtle.encrypt( @@ -104,7 +104,7 @@ const { subtle, getRandomValues } = require('crypto').webcrypto; async function test() { const key = await subtle.generateKey({ name: 'AES-GCM', - length: 256 + length: 256, }, true, ['encrypt', 'decrypt']); const ciphertext = await subtle.encrypt( diff --git a/test/parallel/test-webcrypto-export-import-dsa.js b/test/parallel/test-webcrypto-export-import-dsa.js index 6b47b99c1ddbf8..8fe66e5e1f75ca 100644 --- a/test/parallel/test-webcrypto-export-import-dsa.js +++ b/test/parallel/test-webcrypto-export-import-dsa.js @@ -75,7 +75,7 @@ async function testImportSpki({ name, publicUsages }, size, hash, extractable) { } else { await assert.rejects( subtle.exportKey('spki', key), { - message: /key is not extractable/ + message: /key is not extractable/, }); } } @@ -107,7 +107,7 @@ async function testImportPkcs8( } else { await assert.rejects( subtle.exportKey('pkcs8', key), { - message: /key is not extractable/ + message: /key is not extractable/, }); } } @@ -117,7 +117,7 @@ const testVectors = [ { name: 'NODE-DSA', privateUsages: ['sign'], - publicUsages: ['verify'] + publicUsages: ['verify'], }, ]; diff --git a/test/parallel/test-webcrypto-export-import-ec.js b/test/parallel/test-webcrypto-export-import-ec.js index e5453878a19050..8eac9cce47849f 100644 --- a/test/parallel/test-webcrypto-export-import-ec.js +++ b/test/parallel/test-webcrypto-export-import-ec.js @@ -40,8 +40,8 @@ const keyData = { y: 'AVAXNs_iRzlDINjkr8L9ObWpMxBhuB4iQSgrnheJGCK1t54FL0W' + 'XtZZD_Tk3nFG9USXE9IvD8CXOPNNpUyhsyzj7', d: 'APQIdYNoupMPMPdq4FT-XNLOf9osn3am1DbPddZsRAv-YzHHw' + - 'XKhJHgZPIJRSHvJEmP6UCF_hf9jb1nNVG46tIO0' - } + 'XKhJHgZPIJRSHvJEmP6UCF_hf9jb1nNVG46tIO0', + }, }, 'P-384': { jwsAlg: 'ES384', @@ -62,8 +62,8 @@ const keyData = { crv: 'P-384', x: 'IZwU1mYXs27G2IVrOFtzp000T9iude8EZDXdpU47RL1fvevR0I3Wni19wdwhjLQ1', y: 'vSgTjMd4M3qEL2vWGyQOdCSfJGZ8KlgQp2v8KOAzX4imUB3sAZdtqFr7AIactqzo', - d: 'RTe1mQeE08LSLpao-S-hqkku6HPldqQVguFEGDyYiNEOa560ztSyzEAS5KxeqEBz' - } + d: 'RTe1mQeE08LSLpao-S-hqkku6HPldqQVguFEGDyYiNEOa560ztSyzEAS5KxeqEBz', + }, }, 'P-256': { jwsAlg: 'ES256', @@ -82,8 +82,8 @@ const keyData = { crv: 'P-256', x: '1ugyipX-Ka_Nwwl3uSUe-7IZAigH9rFLs0aVtrS9uT4', y: '5mhFSKStE8SdAEM8RTFegnTzVA9Y9dee96GxhPTCHRc', - d: 'K8LtomXkaGbvqPj5namTF1tshcJG4V3OrtfjBw8T-_g' - } + d: 'K8LtomXkaGbvqPj5namTF1tshcJG4V3OrtfjBw8T-_g', + }, }, }; @@ -91,12 +91,12 @@ const testVectors = [ { name: 'ECDSA', privateUsages: ['sign'], - publicUsages: ['verify'] + publicUsages: ['verify'], }, { name: 'ECDH', privateUsages: ['deriveKey', 'deriveBits'], - publicUsages: [] + publicUsages: [], }, ]; @@ -122,7 +122,7 @@ async function testImportSpki({ name, publicUsages }, namedCurve, extractable) { } else { await assert.rejects( subtle.exportKey('spki', key), { - message: /key is not extractable/ + message: /key is not extractable/, }); } @@ -162,7 +162,7 @@ async function testImportPkcs8( } else { await assert.rejects( subtle.exportKey('pkcs8', key), { - message: /key is not extractable/ + message: /key is not extractable/, }); } } @@ -254,11 +254,11 @@ async function testImportJwk( } else { await assert.rejects( subtle.exportKey('jwk', publicKey), { - message: /key is not extractable/ + message: /key is not extractable/, }); await assert.rejects( subtle.exportKey('jwk', privateKey), { - message: /key is not extractable/ + message: /key is not extractable/, }); } } diff --git a/test/parallel/test-webcrypto-export-import-rsa.js b/test/parallel/test-webcrypto-export-import-rsa.js index 46e96628a33f8c..053e65ffa0e2d7 100644 --- a/test/parallel/test-webcrypto-export-import-rsa.js +++ b/test/parallel/test-webcrypto-export-import-rsa.js @@ -66,8 +66,8 @@ const keyData = { dq: 'hNRfwOSplNfhLvxLUN7a2qA3yYm-1MSz_1DWQP7srlLORlUcYPht2FZmsnEeDcAq' + 'ynBGPQUcbG2Av_hgHz2OZw', qi: 'zbpJQAhinrxSbVKxBQ2EZGFUD2e3WCXbAJRYpk8HVQ5AA52OhKTicOye2hEHnrgp' + - 'FKzC8iznTsCG3FMkvwcj4Q' - } + 'FKzC8iznTsCG3FMkvwcj4Q', + }, }, 2048: { @@ -147,8 +147,8 @@ const keyData = { 'TUDDIwbqUHeD3Nrx-TpOCOXped2P3Kzb7Sa0I5jF1ak', qi: 'nSIby2WhW-eV3_-6sq-oXcKjq2W6X24m-hcmEtVXISm7EgAVykRG7D_bnsmApmHS' + 'qtI4UFEYmPB8FIcWCVzRvWDWMUZKyJtSRmC9RllS0uV9h0C3w_PbeUkrFrh6XNF2' + - 'fhNSbvZtecaR4sfyUotpZSwpuiEKXmedI7IaaAy_DQc' - } + 'fhNSbvZtecaR4sfyUotpZSwpuiEKXmedI7IaaAy_DQc', + }, }, 4096: { @@ -295,8 +295,8 @@ const keyData = { 'HrnDh5EBVnM4_de63crEJON2sYI8Ozi-xp2OEmAr2seWKq4sxkFni6exLhqb-NE4' + 'm9HMKlng1EtQh2rLBFG1VYD3SYYpMLc5fxzqGvSxn3Fa-Xgg-IZPY3ubrcm52KYg' + 'mLUGmnYStfVqGSWSdhDXHlNgI5pdAA0FzpyBk3ZX-JsxhwcnneKrYBBweq06kRMG' + - 'WgvdbdAQ-7wSeGqqj5VPwA' - } + 'WgvdbdAQ-7wSeGqqj5VPwA', + }, }, }; @@ -325,7 +325,7 @@ async function testImportSpki({ name, publicUsages }, size, hash, extractable) { } else { await assert.rejects( subtle.exportKey('spki', key), { - message: /key is not extractable/ + message: /key is not extractable/, }); } } @@ -359,7 +359,7 @@ async function testImportPkcs8( } else { await assert.rejects( subtle.exportKey('pkcs8', key), { - message: /key is not extractable/ + message: /key is not extractable/, }); } } @@ -382,7 +382,7 @@ async function testImportJwk( kty: jwk.kty, n: jwk.n, e: jwk.e, - alg: `PS${hash.substring(4)}` + alg: `PS${hash.substring(4)}`, }, { name, hash }, extractable, @@ -438,11 +438,11 @@ async function testImportJwk( } else { await assert.rejects( subtle.exportKey('jwk', publicKey), { - message: /key is not extractable/ + message: /key is not extractable/, }); await assert.rejects( subtle.exportKey('jwk', privateKey), { - message: /key is not extractable/ + message: /key is not extractable/, }); } } @@ -452,17 +452,17 @@ const testVectors = [ { name: 'RSA-OAEP', privateUsages: ['decrypt', 'unwrapKey'], - publicUsages: ['encrypt', 'wrapKey'] + publicUsages: ['encrypt', 'wrapKey'], }, { name: 'RSA-PSS', privateUsages: ['sign'], - publicUsages: ['verify'] + publicUsages: ['verify'], }, { name: 'RSASSA-PKCS1-v1_5', privateUsages: ['sign'], - publicUsages: ['verify'] + publicUsages: ['verify'], }, ]; diff --git a/test/parallel/test-webcrypto-export-import.js b/test/parallel/test-webcrypto-export-import.js index 9cf8833cecfc47..0a733eb83675f4 100644 --- a/test/parallel/test-webcrypto-export-import.js +++ b/test/parallel/test-webcrypto-export-import.js @@ -17,57 +17,57 @@ const { subtle, getRandomValues } = require('crypto').webcrypto; await Promise.all([1, null, undefined, {}, []].map((format) => assert.rejects( subtle.importKey(format, keyData, {}, false, ['wrapKey']), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) )); await assert.rejects( subtle.importKey('not valid', keyData, {}, false, ['wrapKey']), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); await Promise.all([1, null, undefined, {}, []].map((keyData) => assert.rejects( subtle.importKey('raw', keyData, {}, false, ['deriveBits']), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }) )); await assert.rejects( subtle.importKey('raw', keyData, { - name: 'HMAC' + name: 'HMAC', }, false, ['sign', 'verify']), { - code: 'ERR_MISSING_OPTION' + code: 'ERR_MISSING_OPTION', }); await assert.rejects( subtle.importKey('raw', keyData, { name: 'HMAC', - hash: 'SHA-256' + hash: 'SHA-256', }, false, ['deriveBits']), { name: 'SyntaxError', - message: 'Unsupported key usage for an HMAC key' + message: 'Unsupported key usage for an HMAC key', }); await assert.rejects( subtle.importKey('node.keyObject', '', { name: 'HMAC', - hash: 'SHA-256' + hash: 'SHA-256', }, false, ['sign', 'verify']), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); await assert.rejects( subtle.importKey('raw', keyData, { name: 'HMAC', hash: 'SHA-256', - length: 0 + length: 0, }, false, ['sign', 'verify']), { name: 'DataError', - message: 'Zero-length key is not supported' + message: 'Zero-length key is not supported', }); await assert.rejects( subtle.importKey('raw', keyData, { name: 'HMAC', hash: 'SHA-256', - length: 1 + length: 1, }, false, ['sign', 'verify']), { name: 'DataError', - message: 'Invalid key length' + message: 'Invalid key length', }); await assert.rejects( subtle.importKey('jwk', null, { @@ -75,7 +75,7 @@ const { subtle, getRandomValues } = require('crypto').webcrypto; hash: 'SHA-256', }, false, ['sign', 'verify']), { name: 'DataError', - message: 'Invalid JWK keyData' + message: 'Invalid JWK keyData', }); } @@ -90,7 +90,7 @@ const { subtle, getRandomValues } = require('crypto').webcrypto; 'raw', keyData, { name: 'HMAC', - hash: 'SHA-256' + hash: 'SHA-256', }, true, ['sign', 'verify']); const raw = await subtle.exportKey('raw', key); @@ -149,7 +149,7 @@ const { subtle, getRandomValues } = require('crypto').webcrypto; name: 'RSA-PSS', modulusLength: 1024, publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-384' + hash: 'SHA-384', }, true, ['sign', 'verify']); const [ @@ -207,7 +207,7 @@ const { subtle, getRandomValues } = require('crypto').webcrypto; async function test() { const { publicKey, privateKey } = await subtle.generateKey({ name: 'ECDSA', - namedCurve: 'P-384' + namedCurve: 'P-384', }, true, ['sign', 'verify']); const [ @@ -235,19 +235,19 @@ const { subtle, getRandomValues } = require('crypto').webcrypto; ] = await Promise.all([ subtle.importKey('spki', spki, { name: 'ECDSA', - namedCurve: 'P-384' + namedCurve: 'P-384', }, true, ['verify']), subtle.importKey('pkcs8', pkcs8, { name: 'ECDSA', - namedCurve: 'P-384' + namedCurve: 'P-384', }, true, ['sign']), subtle.importKey('jwk', publicJwk, { name: 'ECDSA', - namedCurve: 'P-384' + namedCurve: 'P-384', }, true, ['verify']), subtle.importKey('jwk', privateJwk, { name: 'ECDSA', - namedCurve: 'P-384' + namedCurve: 'P-384', }, true, ['sign']), ]); diff --git a/test/parallel/test-webcrypto-keygen.js b/test/parallel/test-webcrypto-keygen.js index e94a7b4488222a..d4d35d2ce6d74a 100644 --- a/test/parallel/test-webcrypto-keygen.js +++ b/test/parallel/test-webcrypto-keygen.js @@ -31,7 +31,7 @@ const vectors = { 'wrapKey', 'unwrapKey', ], - mandatoryUsages: [] + mandatoryUsages: [], }, 'AES-CBC': { algorithm: { length: 256 }, @@ -41,7 +41,7 @@ const vectors = { 'wrapKey', 'unwrapKey', ], - mandatoryUsages: [] + mandatoryUsages: [], }, 'AES-GCM': { algorithm: { length: 256 }, @@ -51,7 +51,7 @@ const vectors = { 'wrapKey', 'unwrapKey', ], - mandatoryUsages: [] + mandatoryUsages: [], }, 'AES-KW': { algorithm: { length: 256 }, @@ -59,7 +59,7 @@ const vectors = { 'wrapKey', 'unwrapKey', ], - mandatoryUsages: [] + mandatoryUsages: [], }, 'HMAC': { algorithm: { length: 256, hash: 'SHA-256' }, @@ -67,13 +67,13 @@ const vectors = { 'sign', 'verify', ], - mandatoryUsages: [] + mandatoryUsages: [], }, 'RSASSA-PKCS1-v1_5': { algorithm: { modulusLength: 1024, publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-256' + hash: 'SHA-256', }, usages: [ 'sign', @@ -85,19 +85,19 @@ const vectors = { algorithm: { modulusLength: 1024, publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-256' + hash: 'SHA-256', }, usages: [ 'sign', 'verify', ], - mandatoryUsages: ['sign'] + mandatoryUsages: ['sign'], }, 'RSA-OAEP': { algorithm: { modulusLength: 1024, publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-256' + hash: 'SHA-256', }, usages: [ 'encrypt', @@ -108,7 +108,7 @@ const vectors = { mandatoryUsages: [ 'decrypt', 'unwrapKey', - ] + ], }, 'ECDSA': { algorithm: { namedCurve: 'P-521' }, @@ -116,7 +116,7 @@ const vectors = { 'sign', 'verify', ], - mandatoryUsages: ['sign'] + mandatoryUsages: ['sign'], }, 'ECDH': { algorithm: { namedCurve: 'P-521' }, @@ -127,7 +127,7 @@ const vectors = { mandatoryUsages: [ 'deriveKey', 'deriveBits', - ] + ], }, 'NODE-DSA': { algorithm: { modulusLength: 1024, hash: 'SHA-256' }, @@ -138,8 +138,8 @@ const vectors = { mandatoryUsages: [ 'sign', 'verify', - ] - } + ], + }, }; // Test invalid algorithms @@ -149,7 +149,7 @@ const vectors = { // The extractable and usages values are invalid here also, // but the unrecognized algorithm name should be caught first. subtle.generateKey(algorithm, 7, ['zebra']), { - message: /Unrecognized name/ + message: /Unrecognized name/, }); } @@ -163,17 +163,17 @@ const vectors = { name: 'RSA', hash: 'SHA-256', modulusLength: 2048, - publicExponent: new Uint8Array([1, 0, 1]) + publicExponent: new Uint8Array([1, 0, 1]), }, { name: 'RSA-PSS', hash: 'SHA', modulusLength: 2048, - publicExponent: new Uint8Array([1, 0, 1]) + publicExponent: new Uint8Array([1, 0, 1]), }, { name: 'EC', - namedCurve: 'P521' + namedCurve: 'P521', }, ].map(async (algorithm) => test(algorithm)); @@ -191,7 +191,7 @@ const vectors = { return assert.rejects( subtle.generateKey( { - name, ...vectors[name].algorithm + name, ...vectors[name].algorithm, }, true, invalidUsages), @@ -219,7 +219,7 @@ const vectors = { name, modulusLength, publicExponent, - hash + hash, }, true, usages); assert(publicKey); @@ -248,17 +248,17 @@ const vectors = { // Missing parameters await assert.rejects( subtle.generateKey({ name, publicExponent, hash }, true, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); await assert.rejects( subtle.generateKey({ name, modulusLength, hash }, true, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); await assert.rejects( subtle.generateKey({ name, modulusLength }, true, usages), { - code: 'ERR_MISSING_OPTION' + code: 'ERR_MISSING_OPTION', }); await Promise.all(['', true, {}].map((modulusLength) => { @@ -266,9 +266,9 @@ const vectors = { name, modulusLength, publicExponent, - hash + hash, }, true, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); })); @@ -292,9 +292,9 @@ const vectors = { name, modulusLength, publicExponent, - hash + hash, }, true, usages), { - message: /Unrecognized name/ + message: /Unrecognized name/, }); })); @@ -303,9 +303,9 @@ const vectors = { name, modulusLength, publicExponent, - hash + hash, }, extractable, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); })); @@ -314,9 +314,9 @@ const vectors = { name, modulusLength, publicExponent, - hash + hash, }, true, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); })); } @@ -367,7 +367,7 @@ const vectors = { const { publicKey, privateKey } = await subtle.generateKey({ name, - namedCurve + namedCurve, }, true, usages); assert(publicKey); @@ -390,7 +390,7 @@ const vectors = { [1, true, {}, [], undefined, null].forEach(async (namedCurve) => { await assert.rejects( subtle.generateKey({ name, namedCurve }, true, privateUsages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); } @@ -434,7 +434,7 @@ const vectors = { async function test(name, length, usages) { const key = await subtle.generateKey({ name, - length + length, }, true, usages); assert(key); @@ -450,14 +450,14 @@ const vectors = { [1, 100, 257].forEach(async (length) => { await assert.rejects( subtle.generateKey({ name, length }, true, usages), { - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', }); }); ['', {}, [], false, null, undefined].forEach(async (length) => { await assert.rejects( subtle.generateKey({ name, length }, true, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); } @@ -484,7 +484,7 @@ const vectors = { const key = await subtle.generateKey({ name: 'HMAC', length, - hash + hash, }, true, usages); if (length === undefined) { @@ -509,14 +509,14 @@ const vectors = { ['', {}, [], false, null].forEach(async (length) => { await assert.rejects( subtle.generateKey({ name: 'HMAC', length, hash }, true, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }); [1, {}, [], false, null].forEach(async (hash) => { await assert.rejects( subtle.generateKey({ name: 'HMAC', length, hash }, true, usages), { - message: /Unrecognized name/ + message: /Unrecognized name/, }); }); } @@ -549,7 +549,7 @@ const vectors = { const { publicKey, privateKey } = await subtle.generateKey({ name, modulusLength, - hash + hash, }, true, usages); assert(publicKey); @@ -573,21 +573,21 @@ const vectors = { // Missing parameters await assert.rejects( subtle.generateKey({ name, hash }, true, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); await assert.rejects( subtle.generateKey({ name, modulusLength }, true, usages), { - code: 'ERR_MISSING_OPTION' + code: 'ERR_MISSING_OPTION', }); await Promise.all(['', true, {}].map((modulusLength) => { return assert.rejects(subtle.generateKey({ name, modulusLength, - hash + hash, }, true, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); })); @@ -595,9 +595,9 @@ const vectors = { return assert.rejects(subtle.generateKey({ name, modulusLength, - hash + hash, }, true, usages), { - message: /Unrecognized name/ + message: /Unrecognized name/, }); })); @@ -605,9 +605,9 @@ const vectors = { return assert.rejects(subtle.generateKey({ name, modulusLength, - hash + hash, }, extractable, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); })); @@ -615,9 +615,9 @@ const vectors = { return assert.rejects(subtle.generateKey({ name, modulusLength, - hash + hash, }, true, usages), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); })); } @@ -642,7 +642,7 @@ const vectors = { const { publicKey, privateKey } = await subtle.generateKey({ name: 'NODE-DH', - group: 'modp15' + group: 'modp15', }, true, ['deriveKey']); assert(publicKey); assert(privateKey); @@ -658,7 +658,7 @@ const vectors = { // End user code cannot create CryptoKey directly assert.throws(() => new CryptoKey(), { - code: 'ERR_OPERATION_FAILED' + code: 'ERR_OPERATION_FAILED', }); { diff --git a/test/parallel/test-webcrypto-random.js b/test/parallel/test-webcrypto-random.js index fd933915c5e48e..a38248ab7f84e0 100644 --- a/test/parallel/test-webcrypto-random.js +++ b/test/parallel/test-webcrypto-random.js @@ -60,7 +60,7 @@ const { getRandomValues } = require('crypto').webcrypto; if (kData !== undefined) { assert.throws(() => getRandomValues(kData), { - code: 22 + code: 22, }); } } diff --git a/test/parallel/test-webcrypto-rsa-pss-params.js b/test/parallel/test-webcrypto-rsa-pss-params.js index d52a9bf6add223..6297b1270766c8 100644 --- a/test/parallel/test-webcrypto-rsa-pss-params.js +++ b/test/parallel/test-webcrypto-rsa-pss-params.js @@ -12,8 +12,8 @@ const { createPrivateKey, createPublicKey, webcrypto: { - subtle - } + subtle, + }, } = require('crypto'); const fixtures = require('../common/fixtures'); @@ -23,11 +23,11 @@ const fixtures = require('../common/fixtures'); const pkcs8 = createPrivateKey(rsaPssKeyWithoutParams).export({ type: 'pkcs8', - format: 'der' + format: 'der', }); const spki = createPublicKey(rsaPssKeyWithoutParams).export({ type: 'spki', - format: 'der' + format: 'der', }); const hashes = ['SHA-1', 'SHA-256', 'SHA-384', 'SHA-512']; diff --git a/test/parallel/test-webcrypto-sign-verify-ecdsa.js b/test/parallel/test-webcrypto-sign-verify-ecdsa.js index 8620498d89b00c..cc0ccb28203062 100644 --- a/test/parallel/test-webcrypto-sign-verify-ecdsa.js +++ b/test/parallel/test-webcrypto-sign-verify-ecdsa.js @@ -73,23 +73,23 @@ async function testVerify({ name, // Test failure when using wrong key await assert.rejects( subtle.verify({ name, hash }, privateKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); await assert.rejects( subtle.verify({ name, hash }, noVerifyPublicKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); // Test failure when using the wrong algorithms await assert.rejects( subtle.verify({ name, hash }, hmacKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); await assert.rejects( subtle.verify({ name, hash }, rsaKeys.publicKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); // Test failure when signature is altered @@ -120,13 +120,13 @@ async function testVerify({ name, const otherhash = hash === 'SHA-1' ? 'SHA-256' : 'SHA-1'; assert(!(await subtle.verify({ name, - hash: otherhash + hash: otherhash, }, publicKey, signature, copy))); } await assert.rejects( subtle.verify({ name, hash: 'sha256' }, publicKey, signature, copy), { - message: /Unrecognized name/ + message: /Unrecognized name/, }); } @@ -194,24 +194,24 @@ async function testSign({ name, // Test failure when using wrong key await assert.rejects( subtle.sign({ name, hash }, publicKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); // Test failure when no sign usage await assert.rejects( subtle.sign({ name, hash }, noSignPrivateKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); // Test failure when using the wrong algorithms await assert.rejects( subtle.sign({ name, hash }, hmacKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); await assert.rejects( subtle.sign({ name, hash }, rsaKeys.privateKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); } diff --git a/test/parallel/test-webcrypto-sign-verify-hmac.js b/test/parallel/test-webcrypto-sign-verify-hmac.js index 3028816054ca76..5a105b36151d18 100644 --- a/test/parallel/test-webcrypto-sign-verify-hmac.js +++ b/test/parallel/test-webcrypto-sign-verify-hmac.js @@ -56,13 +56,13 @@ async function testVerify({ hash, // Test failure when using wrong key await assert.rejects( subtle.verify({ name, hash }, noVerifyKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); // Test failure when using the wrong algorithms await assert.rejects( subtle.verify({ name, hash }, rsaKeys.publicKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); // Test failure when signature is altered @@ -93,13 +93,13 @@ async function testVerify({ hash, const otherhash = hash === 'SHA-1' ? 'SHA-256' : 'SHA-1'; assert(!(await subtle.verify({ name, - hash: otherhash + hash: otherhash, }, key, signature, copy))); } await assert.rejects( subtle.verify({ name, hash: 'sha256' }, key, signature, copy), { - message: /Unrecognized name/ + message: /Unrecognized name/, }); } @@ -156,19 +156,19 @@ async function testSign({ hash, subtle.generateKey({ name }, false, []), { name: 'TypeError', code: 'ERR_MISSING_OPTION', - message: 'algorithm.hash is required' + message: 'algorithm.hash is required', }); // Test failure when no sign usage await assert.rejects( subtle.sign({ name, hash }, noSignKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); // Test failure when using the wrong algorithms await assert.rejects( subtle.sign({ name, hash }, rsaKeys.privateKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); } diff --git a/test/parallel/test-webcrypto-sign-verify-node-dsa.js b/test/parallel/test-webcrypto-sign-verify-node-dsa.js index 24d739062fb098..890ab386103fee 100644 --- a/test/parallel/test-webcrypto-sign-verify-node-dsa.js +++ b/test/parallel/test-webcrypto-sign-verify-node-dsa.js @@ -71,23 +71,23 @@ async function testVerify({ algorithm, // Test failure when using wrong key await assert.rejects( subtle.verify(algorithm, privateKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); await assert.rejects( subtle.verify(algorithm, noVerifyPublicKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); // Test failure when using the wrong algorithms await assert.rejects( subtle.verify(algorithm, hmacKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); await assert.rejects( subtle.verify(algorithm, wrongKeys.publicKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); // Test failure when signature is altered @@ -114,7 +114,7 @@ async function testVerify({ algorithm, const otherhash = hash === 'SHA-1' ? 'SHA-256' : 'SHA-1'; assert(!(await subtle.verify({ ...algorithm, - hash: otherhash + hash: otherhash, }, publicKey, signature, copy))); } @@ -190,24 +190,24 @@ async function testSign({ // Test failure when using wrong key await assert.rejects( subtle.sign(algorithm, publicKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); // Test failure when no sign usage await assert.rejects( subtle.sign(algorithm, noSignPrivateKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); // Test failure when using the wrong algorithms await assert.rejects( subtle.sign(algorithm, hmacKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); await assert.rejects( subtle.sign(algorithm, wrongKeys.privateKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); } diff --git a/test/parallel/test-webcrypto-sign-verify-rsa.js b/test/parallel/test-webcrypto-sign-verify-rsa.js index 2cfcf6e2ec02bd..864f0d1c68afb1 100644 --- a/test/parallel/test-webcrypto-sign-verify-rsa.js +++ b/test/parallel/test-webcrypto-sign-verify-rsa.js @@ -74,23 +74,23 @@ async function testVerify({ // Test failure when using wrong key await assert.rejects( subtle.verify(algorithm, privateKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); await assert.rejects( subtle.verify(algorithm, noVerifyPublicKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); // Test failure when using the wrong algorithms await assert.rejects( subtle.verify(algorithm, hmacKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); await assert.rejects( subtle.verify(algorithm, ecdsaKeys.publicKey, signature, plaintext), { - message: /Unable to use this key to verify/ + message: /Unable to use this key to verify/, }); // Test failure when signature is altered @@ -117,7 +117,7 @@ async function testVerify({ const otherhash = hash === 'SHA-1' ? 'SHA-256' : 'SHA-1'; assert(!(await subtle.verify({ ...algorithm, - hash: otherhash + hash: otherhash, }, publicKey, signature, copy))); } @@ -194,24 +194,24 @@ async function testSign({ // Test failure when using wrong key await assert.rejects( subtle.sign(algorithm, publicKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); // Test failure when no sign usage await assert.rejects( subtle.sign(algorithm, noSignPrivateKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); // Test failure when using the wrong algorithms await assert.rejects( subtle.sign(algorithm, hmacKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); await assert.rejects( subtle.sign(algorithm, ecdsaKeys.privateKey, plaintext), { - message: /Unable to use this key to sign/ + message: /Unable to use this key to sign/, }); } diff --git a/test/parallel/test-webcrypto-sign-verify.js b/test/parallel/test-webcrypto-sign-verify.js index 71e357fedb7fc0..1a17e3f32733f5 100644 --- a/test/parallel/test-webcrypto-sign-verify.js +++ b/test/parallel/test-webcrypto-sign-verify.js @@ -19,15 +19,15 @@ const { subtle } = require('crypto').webcrypto; name: 'RSASSA-PKCS1-v1_5', modulusLength: 1024, publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-256' + hash: 'SHA-256', }, true, ['sign', 'verify']); const signature = await subtle.sign({ - name: 'RSASSA-PKCS1-v1_5' + name: 'RSASSA-PKCS1-v1_5', }, privateKey, ec.encode(data)); assert(await subtle.verify({ - name: 'RSASSA-PKCS1-v1_5' + name: 'RSASSA-PKCS1-v1_5', }, publicKey, signature, ec.encode(data))); } @@ -42,7 +42,7 @@ const { subtle } = require('crypto').webcrypto; name: 'RSA-PSS', modulusLength: 4096, publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-256' + hash: 'SHA-256', }, true, ['sign', 'verify']); const signature = await subtle.sign({ @@ -90,7 +90,7 @@ const { subtle } = require('crypto').webcrypto; const key = await subtle.generateKey({ name: 'HMAC', length: 256, - hash: 'SHA-256' + hash: 'SHA-256', }, true, ['sign', 'verify']); const signature = await subtle.sign({ diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js index 54a5a782a09586..8c3594efbe7be7 100644 --- a/test/parallel/test-webcrypto-wrap-unwrap.js +++ b/test/parallel/test-webcrypto-wrap-unwrap.js @@ -19,32 +19,32 @@ const kWrappingData = { hash: 'SHA-256', }, wrap: { label: new Uint8Array(8) }, - pair: true + pair: true, }, 'AES-CTR': { generate: { length: 128 }, wrap: { counter: new Uint8Array(16), length: 64 }, - pair: false + pair: false, }, 'AES-CBC': { generate: { length: 128 }, wrap: { iv: new Uint8Array(16) }, - pair: false + pair: false, }, 'AES-GCM': { generate: { length: 128 }, wrap: { iv: new Uint8Array(16), additionalData: new Uint8Array(16), - tagLength: 64 + tagLength: 64, }, - pair: false + pair: false, }, 'AES-KW': { generate: { length: 128 }, wrap: { }, - pair: false - } + pair: false, + }, }; function generateWrappingKeys() { @@ -70,7 +70,7 @@ async function generateKeysToWrap() { name: 'RSASSA-PKCS1-v1_5', modulusLength: 1024, publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-256' + hash: 'SHA-256', }, privateUsages: ['sign'], publicUsages: ['verify'], @@ -81,7 +81,7 @@ async function generateKeysToWrap() { name: 'RSA-PSS', modulusLength: 1024, publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-256' + hash: 'SHA-256', }, privateUsages: ['sign'], publicUsages: ['verify'], @@ -92,7 +92,7 @@ async function generateKeysToWrap() { name: 'RSA-OAEP', modulusLength: 1024, publicExponent: new Uint8Array([1, 0, 1]), - hash: 'SHA-256' + hash: 'SHA-256', }, privateUsages: ['decrypt'], publicUsages: ['encrypt'], @@ -101,7 +101,7 @@ async function generateKeysToWrap() { { algorithm: { name: 'ECDSA', - namedCurve: 'P-384' + namedCurve: 'P-384', }, privateUsages: ['sign'], publicUsages: ['verify'], @@ -110,7 +110,7 @@ async function generateKeysToWrap() { { algorithm: { name: 'ECDH', - namedCurve: 'P-384' + namedCurve: 'P-384', }, privateUsages: ['deriveBits'], publicUsages: [], @@ -119,7 +119,7 @@ async function generateKeysToWrap() { { algorithm: { name: 'AES-CTR', - length: 128 + length: 128, }, usages: ['encrypt', 'decrypt'], pair: false, @@ -127,14 +127,14 @@ async function generateKeysToWrap() { { algorithm: { name: 'AES-CBC', - length: 128 + length: 128, }, usages: ['encrypt', 'decrypt'], pair: false, }, { algorithm: { - name: 'AES-GCM', length: 128 + name: 'AES-GCM', length: 128, }, usages: ['encrypt', 'decrypt'], pair: false, @@ -142,7 +142,7 @@ async function generateKeysToWrap() { { algorithm: { name: 'AES-KW', - length: 128 + length: 128, }, usages: ['wrapKey', 'unwrapKey'], pair: false, @@ -151,7 +151,7 @@ async function generateKeysToWrap() { algorithm: { name: 'HMAC', length: 128, - hash: 'SHA-256' + hash: 'SHA-256', }, usages: ['sign', 'verify'], pair: false, @@ -253,7 +253,7 @@ async function testWrapping(name, keys) { const { wrappingKey, unwrappingKey, - wrap + wrap, } = kWrappingData[name]; keys.forEach((key) => { diff --git a/test/parallel/test-webcrypto-x25519-x448.js b/test/parallel/test-webcrypto-x25519-x448.js index cd079b5fb80a5e..d31347e412a0c4 100644 --- a/test/parallel/test-webcrypto-x25519-x448.js +++ b/test/parallel/test-webcrypto-x25519-x448.js @@ -9,7 +9,7 @@ const assert = require('assert'); const { generateKeyPairSync, - webcrypto: { subtle } + webcrypto: { subtle }, } = require('crypto'); // X25519 and X448 are ECDH named curves that should work @@ -20,7 +20,7 @@ async function generateKeys(namedCurve, ...usages) { return subtle.generateKey( { name: 'ECDH', - namedCurve + namedCurve, }, true, usages); @@ -58,10 +58,10 @@ async function importKey(namedCurve, keyData, isPublic = false) { } assert.rejects(importKey('NODE-X25519', Buffer.alloc(10), true), { - message: /NODE-X25519 raw keys must be exactly 32-bytes/ + message: /NODE-X25519 raw keys must be exactly 32-bytes/, }).then(common.mustCall()); assert.rejects(importKey('NODE-X448', Buffer.alloc(10), true), { - message: /NODE-X448 raw keys must be exactly 56-bytes/ + message: /NODE-X448 raw keys must be exactly 56-bytes/, }).then(common.mustCall()); async function test1(namedCurve) { @@ -229,24 +229,24 @@ assert.rejects( subtle.generateKey( { name: 'ECDH', - namedCurve: 'NODE-ED25519' + namedCurve: 'NODE-ED25519', }, true, ['deriveBits']), { - message: /Unsupported named curves for ECDH/ + message: /Unsupported named curves for ECDH/, }).then(common.mustCall()); assert.rejects( subtle.generateKey( { name: 'ECDH', - namedCurve: 'NODE-ED448' + namedCurve: 'NODE-ED448', }, true, ['deriveBits']), { - message: /Unsupported named curves for ECDH/ + message: /Unsupported named curves for ECDH/, }).then(common.mustCall()); { @@ -257,11 +257,11 @@ assert.rejects( crv: 'X25519', d: '8CE-XY7cvbR-Pu7mILHq8YZ4hLGAA2-RD01he5q2wUA', x: '42IbTo34ZYANub5o42547vB6OxdEd44ztwZewoRch0Q', - kty: 'OKP' + kty: 'OKP', }, { name: 'ECDH', - namedCurve: 'NODE-X25519' + namedCurve: 'NODE-X25519', }, true, ['deriveBits']).then(common.mustCall(), common.mustNotCall()); @@ -272,11 +272,11 @@ assert.rejects( { crv: 'X25519', x: '42IbTo34ZYANub5o42547vB6OxdEd44ztwZewoRch0Q', - kty: 'OKP' + kty: 'OKP', }, { name: 'ECDH', - namedCurve: 'NODE-X25519' + namedCurve: 'NODE-X25519', }, true, []).then(common.mustCall(), common.mustNotCall()); diff --git a/test/parallel/test-whatwg-encoding-custom-fatal-streaming.js b/test/parallel/test-whatwg-encoding-custom-fatal-streaming.js index 164088270c3e90..4826f14d627fd5 100644 --- a/test/parallel/test-whatwg-encoding-custom-fatal-streaming.js +++ b/test/parallel/test-whatwg-encoding-custom-fatal-streaming.js @@ -24,7 +24,7 @@ if (!common.hasIntl) code: 'ERR_ENCODING_INVALID_ENCODED_DATA', name: 'TypeError', message: - `The encoded data was not valid for encoding ${testCase.encoding}` + `The encoded data was not valid for encoding ${testCase.encoding}`, } ); }); @@ -43,7 +43,7 @@ if (!common.hasIntl) code: 'ERR_ENCODING_INVALID_ENCODED_DATA', name: 'TypeError', message: - 'The encoded data was not valid for encoding utf-16le' + 'The encoded data was not valid for encoding utf-16le', } ); @@ -55,7 +55,7 @@ if (!common.hasIntl) code: 'ERR_ENCODING_INVALID_ENCODED_DATA', name: 'TypeError', message: - 'The encoded data was not valid for encoding utf-16le' + 'The encoded data was not valid for encoding utf-16le', } ); } diff --git a/test/parallel/test-whatwg-encoding-custom-internals.js b/test/parallel/test-whatwg-encoding-custom-internals.js index c810b43b1ae447..30b90b2036192e 100644 --- a/test/parallel/test-whatwg-encoding-custom-internals.js +++ b/test/parallel/test-whatwg-encoding-custom-internals.js @@ -258,7 +258,7 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'ksc5601', 'ksc_5601', 'windows-949', - ] + ], }; Object.entries(mappings).forEach((i) => { const enc = i[0]; diff --git a/test/parallel/test-whatwg-encoding-custom-interop.js b/test/parallel/test-whatwg-encoding-custom-interop.js index 592dcc8582816f..3fef89e77a4aa6 100644 --- a/test/parallel/test-whatwg-encoding-custom-interop.js +++ b/test/parallel/test-whatwg-encoding-custom-interop.js @@ -48,7 +48,7 @@ assert(TextEncoder); const expectedError = { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type TextEncoder' + message: 'Value of "this" must be of type TextEncoder', }; inspectFn.call(instance, Infinity, {}); diff --git a/test/parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js b/test/parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js index a701d79a285a16..eb6d7819537d5f 100644 --- a/test/parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js +++ b/test/parallel/test-whatwg-encoding-custom-textdecoder-api-invalid-label.js @@ -18,7 +18,7 @@ const assert = require('assert'); () => new TextDecoder(`${ws}${i}`), { code: 'ERR_ENCODING_NOT_SUPPORTED', - name: 'RangeError' + name: 'RangeError', } ); @@ -26,7 +26,7 @@ const assert = require('assert'); () => new TextDecoder(`${i}${ws}`), { code: 'ERR_ENCODING_NOT_SUPPORTED', - name: 'RangeError' + name: 'RangeError', } ); @@ -34,7 +34,7 @@ const assert = require('assert'); () => new TextDecoder(`${ws}${i}${ws}`), { code: 'ERR_ENCODING_NOT_SUPPORTED', - name: 'RangeError' + name: 'RangeError', } ); }); diff --git a/test/parallel/test-whatwg-encoding-custom-textdecoder-fatal.js b/test/parallel/test-whatwg-encoding-custom-textdecoder-fatal.js index 8778fa018efa39..227288e9bb18c7 100644 --- a/test/parallel/test-whatwg-encoding-custom-textdecoder-fatal.js +++ b/test/parallel/test-whatwg-encoding-custom-textdecoder-fatal.js @@ -78,7 +78,7 @@ bad.forEach((t) => { .decode(new Uint8Array(t.input)); }, { code: 'ERR_ENCODING_INVALID_ENCODED_DATA', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-whatwg-encoding-custom-textdecoder-ignorebom.js b/test/parallel/test-whatwg-encoding-custom-textdecoder-ignorebom.js index 94fc3318d1f15e..e9989da1467ad7 100644 --- a/test/parallel/test-whatwg-encoding-custom-textdecoder-ignorebom.js +++ b/test/parallel/test-whatwg-encoding-custom-textdecoder-ignorebom.js @@ -10,11 +10,11 @@ const assert = require('assert'); const cases = [ { encoding: 'utf-8', - bytes: [0xEF, 0xBB, 0xBF, 0x61, 0x62, 0x63] + bytes: [0xEF, 0xBB, 0xBF, 0x61, 0x62, 0x63], }, { encoding: 'utf-16le', - bytes: [0xFF, 0xFE, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00] + bytes: [0xFF, 0xFE, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00], }, ]; diff --git a/test/parallel/test-whatwg-encoding-custom-textdecoder-invalid-arg.js b/test/parallel/test-whatwg-encoding-custom-textdecoder-invalid-arg.js index 5c8a9837f68f3b..5262ae456cd936 100644 --- a/test/parallel/test-whatwg-encoding-custom-textdecoder-invalid-arg.js +++ b/test/parallel/test-whatwg-encoding-custom-textdecoder-invalid-arg.js @@ -13,7 +13,7 @@ const assert = require('assert'); new TextDecoder(undefined, null).decode(invalidInputType); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); } diff --git a/test/parallel/test-whatwg-encoding-custom-textdecoder-streaming.js b/test/parallel/test-whatwg-encoding-custom-textdecoder-streaming.js index 5484929326254d..c021266183e150 100644 --- a/test/parallel/test-whatwg-encoding-custom-textdecoder-streaming.js +++ b/test/parallel/test-whatwg-encoding-custom-textdecoder-streaming.js @@ -18,7 +18,7 @@ const octets = { 0x00, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x80, 0x00, 0xFF, 0x00, 0x00, 0x01, 0x00, 0x10, 0xFD, 0xFF, 0x00, 0xD8, 0x00, 0xDC, 0xFF, 0xDB, - 0xFF, 0xDF] + 0xFF, 0xDF], }; Object.keys(octets).forEach((encoding) => { diff --git a/test/parallel/test-whatwg-encoding-custom-textdecoder-utf16-surrogates.js b/test/parallel/test-whatwg-encoding-custom-textdecoder-utf16-surrogates.js index 2a8eac5f187406..cc41819a71043d 100644 --- a/test/parallel/test-whatwg-encoding-custom-textdecoder-utf16-surrogates.js +++ b/test/parallel/test-whatwg-encoding-custom-textdecoder-utf16-surrogates.js @@ -15,31 +15,31 @@ const bad = [ encoding: 'utf-16le', input: [0x00, 0xd8], expected: '\uFFFD', - name: 'lone surrogate lead' + name: 'lone surrogate lead', }, { encoding: 'utf-16le', input: [0x00, 0xdc], expected: '\uFFFD', - name: 'lone surrogate trail' + name: 'lone surrogate trail', }, { encoding: 'utf-16le', input: [0x00, 0xd8, 0x00, 0x00], expected: '\uFFFD\u0000', - name: 'unmatched surrogate lead' + name: 'unmatched surrogate lead', }, { encoding: 'utf-16le', input: [0x00, 0xdc, 0x00, 0x00], expected: '\uFFFD\u0000', - name: 'unmatched surrogate trail' + name: 'unmatched surrogate trail', }, { encoding: 'utf-16le', input: [0x00, 0xdc, 0x00, 0xd8], expected: '\uFFFD\uFFFD', - name: 'swapped surrogate pair' + name: 'swapped surrogate pair', }, ]; @@ -50,7 +50,7 @@ bad.forEach((t) => { .decode(new Uint8Array(t.input)); }, { code: 'ERR_ENCODING_INVALID_ENCODED_DATA', - name: 'TypeError' + name: 'TypeError', } ); }); diff --git a/test/parallel/test-whatwg-encoding-custom-textdecoder.js b/test/parallel/test-whatwg-encoding-custom-textdecoder.js index 877cd43734451b..835fdef228c003 100644 --- a/test/parallel/test-whatwg-encoding-custom-textdecoder.js +++ b/test/parallel/test-whatwg-encoding-custom-textdecoder.js @@ -60,7 +60,7 @@ if (common.hasIntl) { code: 'ERR_ENCODING_INVALID_ENCODED_DATA', name: 'TypeError', message: 'The encoded data was not valid ' + - 'for encoding utf-8' + 'for encoding utf-8', }); }); @@ -75,7 +75,8 @@ if (common.hasIntl) { { code: 'ERR_NO_ICU', name: 'TypeError', - message: '"fatal" option is not supported on Node.js compiled without ICU' + message: '"fatal" option is not supported on Node.js' + + 'compiled without ICU', }); } @@ -163,7 +164,7 @@ if (common.hasIntl) { const expectedError = { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type TextDecoder' + message: 'Value of "this" must be of type TextDecoder', }; inspectFn.call(instance, Infinity, {}); @@ -187,7 +188,7 @@ if (common.hasIntl) { () => new TextDecoder('utf-8', 1), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', } ); } diff --git a/test/parallel/test-whatwg-url-constructor.js b/test/parallel/test-whatwg-url-constructor.js index 3dc1c5986027e7..76ca6e447b4e09 100644 --- a/test/parallel/test-whatwg-url-constructor.js +++ b/test/parallel/test-whatwg-url-constructor.js @@ -12,7 +12,7 @@ const { test, assert_equals, assert_true, assert_throws } = const request = { response: require( fixtures.path('wpt', 'url', 'resources', 'urltestdata.json') - ) + ), }; // The following tests are copied from WPT. Modifications to them should be diff --git a/test/parallel/test-whatwg-url-custom-global.js b/test/parallel/test-whatwg-url-custom-global.js index b99dfd8f3e7d94..902e464b52030a 100644 --- a/test/parallel/test-whatwg-url-custom-global.js +++ b/test/parallel/test-whatwg-url-custom-global.js @@ -11,7 +11,7 @@ assert.deepStrictEqual( value: URL, writable: true, configurable: true, - enumerable: false + enumerable: false, } ); @@ -21,6 +21,6 @@ assert.deepStrictEqual( value: URLSearchParams, writable: true, configurable: true, - enumerable: false + enumerable: false, } ); diff --git a/test/parallel/test-whatwg-url-custom-href-side-effect.js b/test/parallel/test-whatwg-url-custom-href-side-effect.js index 30967d9feaef54..9f9df1e2ee8f07 100644 --- a/test/parallel/test-whatwg-url-custom-href-side-effect.js +++ b/test/parallel/test-whatwg-url-custom-href-side-effect.js @@ -9,7 +9,7 @@ const url = new URL('http://example.com/path'); assert.throws(() => { url.href = ''; }, { - name: 'TypeError' + name: 'TypeError', }); assert.deepStrictEqual(url, ref); diff --git a/test/parallel/test-whatwg-url-custom-parsing.js b/test/parallel/test-whatwg-url-custom-parsing.js index a3532374ca684e..a32c8364658b3f 100644 --- a/test/parallel/test-whatwg-url-custom-parsing.js +++ b/test/parallel/test-whatwg-url-custom-parsing.js @@ -41,7 +41,7 @@ const aboutBlankFailures = originalFailures .map((test) => ({ input: 'about:blank', base: test.input, - failure: true + failure: true, })); const failureTests = originalFailures diff --git a/test/parallel/test-whatwg-url-custom-searchparams-append.js b/test/parallel/test-whatwg-url-custom-searchparams-append.js index 5d2976a23cad53..94bec3afe0fe41 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-append.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-append.js @@ -12,19 +12,19 @@ const assert = require('assert'); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); assert.throws(() => { params.append('a'); }, { code: 'ERR_MISSING_ARGS', name: 'TypeError', - message: 'The "name" and "value" arguments must be specified' + message: 'The "name" and "value" arguments must be specified', }); const obj = { toString() { throw new Error('toString'); }, - valueOf() { throw new Error('valueOf'); } + valueOf() { throw new Error('valueOf'); }, }; const sym = Symbol(); assert.throws(() => params.set(obj, 'b'), /^Error: toString$/); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-constructor.js b/test/parallel/test-whatwg-url-custom-searchparams-constructor.js index 878caed43ff0ab..5270d672d9d954 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-constructor.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-constructor.js @@ -9,7 +9,7 @@ function makeIterableFunc(array) { return Object.assign(() => {}, { [Symbol.iterator]() { return array[Symbol.iterator](); - } + }, }); } @@ -17,12 +17,12 @@ function makeIterableFunc(array) { const iterableError = { code: 'ERR_ARG_NOT_ITERABLE', name: 'TypeError', - message: 'Query pairs must be iterable' + message: 'Query pairs must be iterable', }; const tupleError = { code: 'ERR_INVALID_TUPLE', name: 'TypeError', - message: 'Each query pair must be an iterable [name, value] tuple' + message: 'Each query pair must be an iterable [name, value] tuple', }; let params; @@ -52,7 +52,7 @@ function makeIterableFunc(array) { { const obj = { toString() { throw new Error('toString'); }, - valueOf() { throw new Error('valueOf'); } + valueOf() { throw new Error('valueOf'); }, }; const sym = Symbol(); const toStringError = /^Error: toString$/; diff --git a/test/parallel/test-whatwg-url-custom-searchparams-delete.js b/test/parallel/test-whatwg-url-custom-searchparams-delete.js index e84f10e3f93df8..9c0ad0939e7375 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-delete.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-delete.js @@ -12,19 +12,19 @@ const assert = require('assert'); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); assert.throws(() => { params.delete(); }, { code: 'ERR_MISSING_ARGS', name: 'TypeError', - message: 'The "name" argument must be specified' + message: 'The "name" argument must be specified', }); const obj = { toString() { throw new Error('toString'); }, - valueOf() { throw new Error('valueOf'); } + valueOf() { throw new Error('valueOf'); }, }; const sym = Symbol(); assert.throws(() => params.delete(obj), /^Error: toString$/); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-entries.js b/test/parallel/test-whatwg-url-custom-searchparams-entries.js index 6e5dabb1a768c4..b22d6becb4897e 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-entries.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-entries.js @@ -10,19 +10,19 @@ assert.strictEqual(typeof entries[Symbol.iterator], 'function'); assert.strictEqual(entries[Symbol.iterator](), entries); assert.deepStrictEqual(entries.next(), { value: ['a', 'b'], - done: false + done: false, }); assert.deepStrictEqual(entries.next(), { value: ['c', 'd'], - done: false + done: false, }); assert.deepStrictEqual(entries.next(), { value: undefined, - done: true + done: true, }); assert.deepStrictEqual(entries.next(), { value: undefined, - done: true + done: true, }); assert.throws(() => { @@ -30,12 +30,12 @@ assert.throws(() => { }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParamsIterator' + message: 'Value of "this" must be of type URLSearchParamsIterator', }); assert.throws(() => { params.entries.call(undefined); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-foreach.js b/test/parallel/test-whatwg-url-custom-searchparams-foreach.js index 0c035161dbea97..89b580dd638d04 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-foreach.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-foreach.js @@ -12,6 +12,6 @@ const assert = require('assert'); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); } diff --git a/test/parallel/test-whatwg-url-custom-searchparams-get.js b/test/parallel/test-whatwg-url-custom-searchparams-get.js index 4ce16805ceceb9..e32582251739df 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-get.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-get.js @@ -12,19 +12,19 @@ const assert = require('assert'); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); assert.throws(() => { params.get(); }, { code: 'ERR_MISSING_ARGS', name: 'TypeError', - message: 'The "name" argument must be specified' + message: 'The "name" argument must be specified', }); const obj = { toString() { throw new Error('toString'); }, - valueOf() { throw new Error('valueOf'); } + valueOf() { throw new Error('valueOf'); }, }; const sym = Symbol(); assert.throws(() => params.get(obj), /^Error: toString$/); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-getall.js b/test/parallel/test-whatwg-url-custom-searchparams-getall.js index d3f271fcc5dc7b..48c118ed144052 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-getall.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-getall.js @@ -12,19 +12,19 @@ const assert = require('assert'); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); assert.throws(() => { params.getAll(); }, { code: 'ERR_MISSING_ARGS', name: 'TypeError', - message: 'The "name" argument must be specified' + message: 'The "name" argument must be specified', }); const obj = { toString() { throw new Error('toString'); }, - valueOf() { throw new Error('valueOf'); } + valueOf() { throw new Error('valueOf'); }, }; const sym = Symbol(); assert.throws(() => params.getAll(obj), /^Error: toString$/); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-has.js b/test/parallel/test-whatwg-url-custom-searchparams-has.js index 1963e40057ef72..b3406d10cdcf76 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-has.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-has.js @@ -12,19 +12,19 @@ const assert = require('assert'); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); assert.throws(() => { params.has(); }, { code: 'ERR_MISSING_ARGS', name: 'TypeError', - message: 'The "name" argument must be specified' + message: 'The "name" argument must be specified', }); const obj = { toString() { throw new Error('toString'); }, - valueOf() { throw new Error('valueOf'); } + valueOf() { throw new Error('valueOf'); }, }; const sym = Symbol(); assert.throws(() => params.has(obj), /^Error: toString$/); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-keys.js b/test/parallel/test-whatwg-url-custom-searchparams-keys.js index b65e71c9a24153..96fecd224b6d7e 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-keys.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-keys.js @@ -12,19 +12,19 @@ assert.strictEqual(typeof keys[Symbol.iterator], 'function'); assert.strictEqual(keys[Symbol.iterator](), keys); assert.deepStrictEqual(keys.next(), { value: 'a', - done: false + done: false, }); assert.deepStrictEqual(keys.next(), { value: 'c', - done: false + done: false, }); assert.deepStrictEqual(keys.next(), { value: undefined, - done: true + done: true, }); assert.deepStrictEqual(keys.next(), { value: undefined, - done: true + done: true, }); assert.throws(() => { @@ -32,12 +32,12 @@ assert.throws(() => { }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParamsIterator' + message: 'Value of "this" must be of type URLSearchParamsIterator', }); assert.throws(() => { params.keys.call(undefined); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-set.js b/test/parallel/test-whatwg-url-custom-searchparams-set.js index 106e94d6a249a9..f4e52b3be697d2 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-set.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-set.js @@ -12,19 +12,19 @@ const assert = require('assert'); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); assert.throws(() => { params.set('a'); }, { code: 'ERR_MISSING_ARGS', name: 'TypeError', - message: 'The "name" and "value" arguments must be specified' + message: 'The "name" and "value" arguments must be specified', }); const obj = { toString() { throw new Error('toString'); }, - valueOf() { throw new Error('valueOf'); } + valueOf() { throw new Error('valueOf'); }, }; const sym = Symbol(); assert.throws(() => params.append(obj, 'b'), /^Error: toString$/); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-sort.js b/test/parallel/test-whatwg-url-custom-searchparams-sort.js index e0b0c5c1ed12f6..0a16af3621b291 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-sort.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-sort.js @@ -23,7 +23,7 @@ tests[0].input = pairs.sort(() => Math.random() > 0.5) tests.push( { 'input': 'z=a&=b&c=d', - 'output': [['', 'b'], ['c', 'd'], ['z', 'a']] + 'output': [['', 'b'], ['c', 'd'], ['z', 'a']], } ); diff --git a/test/parallel/test-whatwg-url-custom-searchparams-stringifier.js b/test/parallel/test-whatwg-url-custom-searchparams-stringifier.js index e46865e8b014eb..f6b5dc776a190c 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-stringifier.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-stringifier.js @@ -12,7 +12,7 @@ const assert = require('assert'); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); } diff --git a/test/parallel/test-whatwg-url-custom-searchparams-values.js b/test/parallel/test-whatwg-url-custom-searchparams-values.js index 9c4bb05d0e587d..3a4fb29e909d8b 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams-values.js +++ b/test/parallel/test-whatwg-url-custom-searchparams-values.js @@ -12,19 +12,19 @@ assert.strictEqual(typeof values[Symbol.iterator], 'function'); assert.strictEqual(values[Symbol.iterator](), values); assert.deepStrictEqual(values.next(), { value: 'b', - done: false + done: false, }); assert.deepStrictEqual(values.next(), { value: 'd', - done: false + done: false, }); assert.deepStrictEqual(values.next(), { value: undefined, - done: true + done: true, }); assert.deepStrictEqual(values.next(), { value: undefined, - done: true + done: true, }); assert.throws(() => { @@ -32,12 +32,12 @@ assert.throws(() => { }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParamsIterator' + message: 'Value of "this" must be of type URLSearchParamsIterator', }); assert.throws(() => { params.values.call(undefined); }, { code: 'ERR_INVALID_THIS', name: 'TypeError', - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); diff --git a/test/parallel/test-whatwg-url-custom-searchparams.js b/test/parallel/test-whatwg-url-custom-searchparams.js index 272435b001a366..4619874aecd6e9 100644 --- a/test/parallel/test-whatwg-url-custom-searchparams.js +++ b/test/parallel/test-whatwg-url-custom-searchparams.js @@ -75,7 +75,7 @@ sp.forEach(function() { { const callbackErr = { code: 'ERR_INVALID_CALLBACK', - name: 'TypeError' + name: 'TypeError', }; assert.throws(() => sp.forEach(), callbackErr); assert.throws(() => sp.forEach(1), callbackErr); diff --git a/test/parallel/test-whatwg-url-custom-setters.js b/test/parallel/test-whatwg-url-custom-setters.js index b98bf5d8d3b393..81cd02d7e877ea 100644 --- a/test/parallel/test-whatwg-url-custom-setters.js +++ b/test/parallel/test-whatwg-url-custom-setters.js @@ -43,7 +43,7 @@ const additionalTestCases = const url = new URL('http://example.com/'); const obj = { toString() { throw new Error('toString'); }, - valueOf() { throw new Error('valueOf'); } + valueOf() { throw new Error('valueOf'); }, }; const sym = Symbol(); const props = Object.getOwnPropertyDescriptors(Object.getPrototypeOf(url)); diff --git a/test/parallel/test-whatwg-url-origin.js b/test/parallel/test-whatwg-url-origin.js index 532ff06bb1152f..1a550e86eade46 100644 --- a/test/parallel/test-whatwg-url-origin.js +++ b/test/parallel/test-whatwg-url-origin.js @@ -11,7 +11,7 @@ const { test, assert_equals } = require('../common/wpt').harness; const request = { response: require( fixtures.path('wpt', 'url', 'resources', 'urltestdata.json') - ) + ), }; // The following tests are copied from WPT. Modifications to them should be diff --git a/test/parallel/test-whatwg-url-setters.js b/test/parallel/test-whatwg-url-setters.js index 8742ab8ed372de..ee41ece39d0fc4 100644 --- a/test/parallel/test-whatwg-url-setters.js +++ b/test/parallel/test-whatwg-url-setters.js @@ -12,7 +12,7 @@ const fixtures = require('../common/fixtures'); const request = { response: require(fixtures.path( 'wpt', 'url', 'resources', 'setters_tests.json' - )) + )), }; // The following tests are copied from WPT. Modifications to them should be diff --git a/test/parallel/test-whatwg-url-toascii.js b/test/parallel/test-whatwg-url-toascii.js index e5180bfb344127..e44fbcee653162 100644 --- a/test/parallel/test-whatwg-url-toascii.js +++ b/test/parallel/test-whatwg-url-toascii.js @@ -11,7 +11,7 @@ const { test, assert_equals, assert_throws } = require('../common/wpt').harness; const request = { response: require( fixtures.path('wpt', 'url', 'resources', 'toascii.json') - ) + ), }; // The following tests are copied from WPT. Modifications to them should be diff --git a/test/parallel/test-worker-broadcastchannel.js b/test/parallel/test-worker-broadcastchannel.js index 4212e5bf2f7afb..c5d368173555a1 100644 --- a/test/parallel/test-worker-broadcastchannel.js +++ b/test/parallel/test-worker-broadcastchannel.js @@ -4,16 +4,16 @@ const common = require('../common'); const { BroadcastChannel, Worker, - receiveMessageOnPort + receiveMessageOnPort, } = require('worker_threads'); const assert = require('assert'); assert.throws(() => new BroadcastChannel(Symbol('test')), { - message: /Cannot convert a Symbol value to a string/ + message: /Cannot convert a Symbol value to a string/, }); assert.throws(() => new BroadcastChannel(), { - message: /The "name" argument must be specified/ + message: /The "name" argument must be specified/, }); // These should all just work @@ -27,7 +27,7 @@ assert.throws(() => new BroadcastChannel(), { // Empty postMessage throws const bc = new BroadcastChannel('whatever'); assert.throws(() => bc.postMessage(), { - message: /The "message" argument must be specified/ + message: /The "message" argument must be specified/, }); bc.close(); // Calling close multiple times should not throw @@ -35,7 +35,7 @@ assert.throws(() => new BroadcastChannel(), { // Calling postMessage after close should throw assert.throws(() => bc.postMessage(null), { - message: /BroadcastChannel is closed/ + message: /BroadcastChannel is closed/, }); } @@ -131,14 +131,14 @@ assert.throws(() => new BroadcastChannel(), { const bc1 = new BroadcastChannel('channel3'); const mc = new MessageChannel(); assert.throws(() => bc1.postMessage(mc), { - message: /Object that needs transfer was found/ + message: /Object that needs transfer was found/, }); assert.throws(() => bc1.postMessage(Symbol()), { - message: /Symbol\(\) could not be cloned/ + message: /Symbol\(\) could not be cloned/, }); bc1.close(); assert.throws(() => bc1.postMessage(Symbol()), { - message: /BroadcastChannel is closed/ + message: /BroadcastChannel is closed/, }); } diff --git a/test/parallel/test-worker-cjs-workerdata.js b/test/parallel/test-worker-cjs-workerdata.js index 949011fee8173e..730dd02938fe53 100644 --- a/test/parallel/test-worker-cjs-workerdata.js +++ b/test/parallel/test-worker-cjs-workerdata.js @@ -7,7 +7,7 @@ const { Worker } = require('worker_threads'); const workerData = 'Hello from main thread'; const worker = new Worker(fixtures.path('worker-data.cjs'), { - workerData + workerData, }); worker.on('message', common.mustCall((message) => { diff --git a/test/parallel/test-worker-debug.js b/test/parallel/test-worker-debug.js index 758d7acfc3a99f..54a4de91d15fc0 100644 --- a/test/parallel/test-worker-debug.js +++ b/test/parallel/test-worker-debug.js @@ -8,7 +8,7 @@ const EventEmitter = require('events'); const { Session } = require('inspector'); const { pathToFileURL } = require('url'); const { - Worker, isMainThread, parentPort, workerData + Worker, isMainThread, parentPort, workerData, } = require('worker_threads'); @@ -113,7 +113,7 @@ class WorkerSession extends EventEmitter { post(method, parameters) { const msg = { id: this._nextCommandId++, - method + method, }; if (parameters) msg.params = parameters; @@ -121,7 +121,7 @@ class WorkerSession extends EventEmitter { return new Promise((resolve, reject) => { this._requestCallbacks.set(msg.id, [resolve, reject]); this._parentSession.post('NodeWorker.sendMessageToWorker', { - sessionId: this._id, message: JSON.stringify(msg) + sessionId: this._id, message: JSON.stringify(msg), }); }); } @@ -213,7 +213,7 @@ async function testWaitForDisconnectInWorker(session, post) { const sessionWithoutWaitingPost = doPost.bind(null, sessionWithoutWaiting); await sessionWithoutWaitingPost('NodeWorker.enable', { - waitForDebuggerOnStart: true + waitForDebuggerOnStart: true, }); await post('NodeWorker.enable', { waitForDebuggerOnStart: true }); @@ -234,7 +234,7 @@ async function testWaitForDisconnectInWorker(session, post) { await workerSession2.post('Runtime.enable'); await workerSession1.post('Runtime.enable'); await workerSession1.post('NodeRuntime.notifyWhenWaitingForDisconnect', { - enabled: true + enabled: true, }); await workerSession1.post('Runtime.runIfWaitingForDebugger'); diff --git a/test/parallel/test-worker-execargv-invalid.js b/test/parallel/test-worker-execargv-invalid.js index be8ab0b8c423b7..cca9dafa2146e9 100644 --- a/test/parallel/test-worker-execargv-invalid.js +++ b/test/parallel/test-worker-execargv-invalid.js @@ -7,7 +7,7 @@ const { Worker } = require('worker_threads'); { const expectedErr = { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }; assert.throws(() => { @@ -21,7 +21,7 @@ const { Worker } = require('worker_threads'); { const expectedErr = { code: 'ERR_WORKER_INVALID_EXEC_ARGV', - name: 'Error' + name: 'Error', }; assert.throws(() => { new Worker(__filename, { execArgv: ['--foo'] }); @@ -37,13 +37,13 @@ const { Worker } = require('worker_threads'); { const expectedErr = { code: 'ERR_WORKER_INVALID_EXEC_ARGV', - name: 'Error' + name: 'Error', }; assert.throws(() => { new Worker(__filename, { env: { - NODE_OPTIONS: '--nonexistent-options' - } + NODE_OPTIONS: '--nonexistent-options', + }, }); }, expectedErr); } diff --git a/test/parallel/test-worker-heapdump-failure.js b/test/parallel/test-worker-heapdump-failure.js index 06e260374cd3a4..e40489fb38a969 100644 --- a/test/parallel/test-worker-heapdump-failure.js +++ b/test/parallel/test-worker-heapdump-failure.js @@ -10,6 +10,6 @@ const { once } = require('events'); await once(w, 'exit'); await assert.rejects(() => w.getHeapSnapshot(), { name: 'Error', - code: 'ERR_WORKER_NOT_RUNNING' + code: 'ERR_WORKER_NOT_RUNNING', }); })().then(common.mustCall()); diff --git a/test/parallel/test-worker-http2-generic-streams-terminate.js b/test/parallel/test-worker-http2-generic-streams-terminate.js index 234697fb4d26dc..84509b53cc3a8b 100644 --- a/test/parallel/test-worker-http2-generic-streams-terminate.js +++ b/test/parallel/test-worker-http2-generic-streams-terminate.js @@ -31,9 +31,9 @@ if (!workerData) { Atomics.add(counter, 0, 1); process.exit(); }, - read() { } + read() { }, }); - } + }, }); } } diff --git a/test/parallel/test-worker-invalid-workerdata.js b/test/parallel/test-worker-invalid-workerdata.js index 08fd78bdc0f5c5..93f40b48b54b57 100644 --- a/test/parallel/test-worker-invalid-workerdata.js +++ b/test/parallel/test-worker-invalid-workerdata.js @@ -9,6 +9,6 @@ const { Worker } = require('worker_threads'); assert.throws(() => { new Worker('./worker.js', { - workerData: { fn: () => {} } + workerData: { fn: () => {} }, }); }, /DataCloneError/); diff --git a/test/parallel/test-worker-message-event.js b/test/parallel/test-worker-message-event.js index 8ea08145a1d0a2..b88bd1592c6d31 100644 --- a/test/parallel/test-worker-message-event.js +++ b/test/parallel/test-worker-message-event.js @@ -10,49 +10,49 @@ const dummyPort = new MessageChannel().port1; ['message'], { type: 'message', data: null, origin: '', - lastEventId: '', source: null, ports: [] + lastEventId: '', source: null, ports: [], }, ], [ ['message', { data: undefined, origin: 'foo' }], { type: 'message', data: null, origin: 'foo', - lastEventId: '', source: null, ports: [] + lastEventId: '', source: null, ports: [], }, ], [ ['message', { data: 2, origin: 1, lastEventId: 0 }], { type: 'message', data: 2, origin: '1', - lastEventId: '0', source: null, ports: [] + lastEventId: '0', source: null, ports: [], }, ], [ ['message', { lastEventId: 'foo' }], { type: 'message', data: null, origin: '', - lastEventId: 'foo', source: null, ports: [] + lastEventId: 'foo', source: null, ports: [], }, ], [ ['messageerror', { lastEventId: 'foo', source: dummyPort }], { type: 'messageerror', data: null, origin: '', - lastEventId: 'foo', source: dummyPort, ports: [] + lastEventId: 'foo', source: dummyPort, ports: [], }, ], [ ['message', { ports: [dummyPort], source: null }], { type: 'message', data: null, origin: '', - lastEventId: '', source: null, ports: [dummyPort] + lastEventId: '', source: null, ports: [dummyPort], }, ], ]) { const ev = new MessageEvent(...args); const { type, data, origin, lastEventId, source, ports } = ev; assert.deepStrictEqual(expected, { - type, data, origin, lastEventId, source, ports + type, data, origin, lastEventId, source, ports, }); } } diff --git a/test/parallel/test-worker-message-port-close.js b/test/parallel/test-worker-message-port-close.js index 6abc01d1b7b568..47f812a8977cc2 100644 --- a/test/parallel/test-worker-message-port-close.js +++ b/test/parallel/test-worker-message-port-close.js @@ -36,6 +36,6 @@ function dummy() {} port2.close(); assert.throws(() => moveMessagePortToContext(port2, {}), { code: 'ERR_CLOSED_MESSAGE_PORT', - message: 'Cannot send data on closed MessagePort' + message: 'Cannot send data on closed MessagePort', }); } diff --git a/test/parallel/test-worker-message-port-constructor.js b/test/parallel/test-worker-message-port-constructor.js index 55bb61ecb3544c..b9a944e8bce4ed 100644 --- a/test/parallel/test-worker-message-port-constructor.js +++ b/test/parallel/test-worker-message-port-constructor.js @@ -13,15 +13,15 @@ assert.strictEqual(port1.constructor, MessagePort); assert.throws(() => MessagePort(), { constructor: TypeError, - code: 'ERR_CONSTRUCT_CALL_INVALID' + code: 'ERR_CONSTRUCT_CALL_INVALID', }); assert.throws(() => new MessagePort(), { constructor: TypeError, - code: 'ERR_CONSTRUCT_CALL_INVALID' + code: 'ERR_CONSTRUCT_CALL_INVALID', }); assert.throws(() => MessageChannel(), { constructor: TypeError, - code: 'ERR_CONSTRUCT_CALL_REQUIRED' + code: 'ERR_CONSTRUCT_CALL_REQUIRED', }); diff --git a/test/parallel/test-worker-message-port-inspect-during-init-hook.js b/test/parallel/test-worker-message-port-inspect-during-init-hook.js index 8f9678de1e970e..57c2c672921e2f 100644 --- a/test/parallel/test-worker-message-port-inspect-during-init-hook.js +++ b/test/parallel/test-worker-message-port-inspect-during-init-hook.js @@ -13,7 +13,7 @@ async_hooks.createHook({ assert.strictEqual( util.inspect(resource), 'MessagePort [EventTarget] { active: true, refed: false }'); - }, 2) + }, 2), }).enable(); const { port1 } = new MessageChannel(); diff --git a/test/parallel/test-worker-message-port-jstransferable-nested-untransferable.js b/test/parallel/test-worker-message-port-jstransferable-nested-untransferable.js index 621c42be5149cd..1e830887a3a45e 100644 --- a/test/parallel/test-worker-message-port-jstransferable-nested-untransferable.js +++ b/test/parallel/test-worker-message-port-jstransferable-nested-untransferable.js @@ -3,7 +3,7 @@ const common = require('../common'); const assert = require('assert'); const { - JSTransferable, kTransfer, kTransferList + JSTransferable, kTransfer, kTransferList, } = require('internal/worker/js_transferable'); const { MessageChannel } = require('worker_threads'); @@ -26,7 +26,7 @@ class OuterTransferable extends JSTransferable { [kTransfer] = common.mustCall(() => { return { data: { inner: this.inner }, - deserializeInfo: 'does-not:matter' + deserializeInfo: 'does-not:matter', }; }); } diff --git a/test/parallel/test-worker-message-port-message-port-transferring.js b/test/parallel/test-worker-message-port-message-port-transferring.js index b4f5726665147d..707b9236c1be5d 100644 --- a/test/parallel/test-worker-message-port-message-port-transferring.js +++ b/test/parallel/test-worker-message-port-message-port-transferring.js @@ -7,7 +7,7 @@ const { MessageChannel } = require('worker_threads'); { const { port1: basePort1, port2: basePort2 } = new MessageChannel(); const { - port1: transferredPort1, port2: transferredPort2 + port1: transferredPort1, port2: transferredPort2, } = new MessageChannel(); basePort1.postMessage({ transferredPort1 }, [ transferredPort1 ]); diff --git a/test/parallel/test-worker-message-port-move.js b/test/parallel/test-worker-message-port-move.js index 44efd2e6a6b94f..6333b54d8bf335 100644 --- a/test/parallel/test-worker-message-port-move.js +++ b/test/parallel/test-worker-message-port-move.js @@ -4,7 +4,7 @@ const common = require('../common'); const assert = require('assert'); const vm = require('vm'); const { - MessagePort, MessageChannel, moveMessagePortToContext + MessagePort, MessageChannel, moveMessagePortToContext, } = require('worker_threads'); const context = vm.createContext(); @@ -15,7 +15,7 @@ Object.assign(context, { global: context, assert, MessagePort, - MessageChannel + MessageChannel, }); vm.runInContext('(' + function() { diff --git a/test/parallel/test-worker-message-port-receive-message.js b/test/parallel/test-worker-message-port-receive-message.js index 8e5dc91a0790ae..c9e8a751cdf2e7 100644 --- a/test/parallel/test-worker-message-port-receive-message.js +++ b/test/parallel/test-worker-message-port-receive-message.js @@ -28,6 +28,6 @@ for (const value of [null, 0, -1, {}, []]) { assert.throws(() => receiveMessageOnPort(value), { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', - message: 'The "port" argument must be a MessagePort instance' + message: 'The "port" argument must be a MessagePort instance', }); } diff --git a/test/parallel/test-worker-message-port-terminate-transfer-list.js b/test/parallel/test-worker-message-port-terminate-transfer-list.js index a066405d9d14de..1dbd9bfc974461 100644 --- a/test/parallel/test-worker-message-port-terminate-transfer-list.js +++ b/test/parallel/test-worker-message-port-terminate-transfer-list.js @@ -18,7 +18,7 @@ if (!process.env.HAS_STARTED_WORKER) { // Make sure we don’t end up running JS after the infinite loop is broken. port1.postMessage({}, { - transfer: (function*() { while (true); })() + transfer: (function*() { while (true); })(), }); parentPort.postMessage('UNREACHABLE'); diff --git a/test/parallel/test-worker-message-port-transfer-fake-js-transferable-internal.js b/test/parallel/test-worker-message-port-transfer-fake-js-transferable-internal.js index 87e34f054b24f7..a39133e0a8bf8f 100644 --- a/test/parallel/test-worker-message-port-transfer-fake-js-transferable-internal.js +++ b/test/parallel/test-worker-message-port-transfer-fake-js-transferable-internal.js @@ -18,7 +18,7 @@ const { once } = require('events'); fh[kTransfer] = () => { return { data: '✨', - deserializeInfo: 'net:Socket' + deserializeInfo: 'net:Socket', }; }; diff --git a/test/parallel/test-worker-message-port-transfer-fake-js-transferable.js b/test/parallel/test-worker-message-port-transfer-fake-js-transferable.js index 494adbb9e2bc7c..984b78422ec4b4 100644 --- a/test/parallel/test-worker-message-port-transfer-fake-js-transferable.js +++ b/test/parallel/test-worker-message-port-transfer-fake-js-transferable.js @@ -9,7 +9,7 @@ const { once } = require('events'); // not enable loading arbitrary code from the disk. module.exports = { - NotARealClass: common.mustNotCall() + NotARealClass: common.mustNotCall(), }; (async function() { @@ -22,7 +22,7 @@ module.exports = { fh[kTransfer] = () => { return { data: '✨', - deserializeInfo: `${__filename}:NotARealClass` + deserializeInfo: `${__filename}:NotARealClass`, }; }; diff --git a/test/parallel/test-worker-message-port-transfer-filehandle.js b/test/parallel/test-worker-message-port-transfer-filehandle.js index 9fabf01b604fc4..163f222d82e4d8 100644 --- a/test/parallel/test-worker-message-port-transfer-filehandle.js +++ b/test/parallel/test-worker-message-port-transfer-filehandle.js @@ -14,7 +14,7 @@ const { once } = require('events'); assert.throws(() => { port1.postMessage(fh); }, { - code: 'ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST' + code: 'ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST', }); // Check that transferring FileHandle instances works. @@ -80,7 +80,7 @@ const { once } = require('events'); port1.postMessage(fh, [fh]); }, { message: 'Cannot transfer FileHandle while in use', - name: 'DataCloneError' + name: 'DataCloneError', }); assert.deepStrictEqual(await readPromise, await fs.readFile(__filename)); @@ -97,7 +97,7 @@ const { once } = require('events'); port1.postMessage(fh, [fh]); }, { message: 'Cannot transfer FileHandle while in use', - name: 'DataCloneError' + name: 'DataCloneError', }); await closePromise; })().then(common.mustCall()); diff --git a/test/parallel/test-worker-message-port-transfer-native.js b/test/parallel/test-worker-message-port-transfer-native.js index eb51b2b01af1a3..4f63cca264bdbd 100644 --- a/test/parallel/test-worker-message-port-transfer-native.js +++ b/test/parallel/test-worker-message-port-transfer-native.js @@ -16,7 +16,7 @@ const { internalBinding } = require('internal/test/binding'); port1.postMessage(function foo() {}); }, { name: 'DataCloneError', - message: /function foo\(\) \{\} could not be cloned\.$/ + message: /function foo\(\) \{\} could not be cloned\.$/, }); port1.close(); } @@ -31,7 +31,7 @@ const { internalBinding } = require('internal/test/binding'); port1.postMessage(nativeObject); }, { name: 'DataCloneError', - message: /Cannot transfer object of unsupported type\.$/ + message: /Cannot transfer object of unsupported type\.$/, }); port1.close(); } diff --git a/test/parallel/test-worker-message-port.js b/test/parallel/test-worker-message-port.js index ca28f6ccb73247..2d9ae74a13c793 100644 --- a/test/parallel/test-worker-message-port.js +++ b/test/parallel/test-worker-message-port.js @@ -95,7 +95,7 @@ const { MessageChannel, MessagePort } = require('worker_threads'); const err = { constructor: TypeError, code: 'ERR_INVALID_ARG_TYPE', - message: 'Optional transferList argument must be an iterable' + message: 'Optional transferList argument must be an iterable', }; assert.throws(() => port1.postMessage(5, 0), err); @@ -106,7 +106,7 @@ const { MessageChannel, MessagePort } = require('worker_threads'); const err2 = { constructor: TypeError, code: 'ERR_INVALID_ARG_TYPE', - message: 'Optional options.transfer argument must be an iterable' + message: 'Optional options.transfer argument must be an iterable', }; assert.throws(() => port1.postMessage(5, { transfer: null }), err2); @@ -114,13 +114,13 @@ const { MessageChannel, MessagePort } = require('worker_threads'); assert.throws(() => port1.postMessage(5, { transfer: false }), err2); assert.throws(() => port1.postMessage(5, { transfer: {} }), err2); assert.throws(() => port1.postMessage(5, { - transfer: { [Symbol.iterator]() { return {}; } } + transfer: { [Symbol.iterator]() { return {}; } }, }), err2); assert.throws(() => port1.postMessage(5, { - transfer: { [Symbol.iterator]() { return { next: 42 }; } } + transfer: { [Symbol.iterator]() { return { next: 42 }; } }, }), err2); assert.throws(() => port1.postMessage(5, { - transfer: { [Symbol.iterator]() { return { next: null }; } } + transfer: { [Symbol.iterator]() { return { next: null }; } }, }), err2); port1.close(); } @@ -154,7 +154,7 @@ const { MessageChannel, MessagePort } = require('worker_threads'); { const ab = new ArrayBuffer(10); port1.postMessage({ ab }, { - transfer: (function*() { yield ab; })() + transfer: (function*() { yield ab; })(), }); assert.strictEqual(ab.byteLength, 0); } diff --git a/test/parallel/test-worker-mjs-workerdata.js b/test/parallel/test-worker-mjs-workerdata.js index b0a65e2e805c1e..344e2331367307 100644 --- a/test/parallel/test-worker-mjs-workerdata.js +++ b/test/parallel/test-worker-mjs-workerdata.js @@ -7,7 +7,7 @@ const { Worker } = require('worker_threads'); const workerData = 'Hello from main thread'; const worker = new Worker(fixtures.path('worker-data.mjs'), { - workerData + workerData, }); worker.on('message', common.mustCall((message) => { diff --git a/test/parallel/test-worker-nested-uncaught.js b/test/parallel/test-worker-nested-uncaught.js index 00bb6832203442..570f6af90ebdff 100644 --- a/test/parallel/test-worker-nested-uncaught.js +++ b/test/parallel/test-worker-nested-uncaught.js @@ -10,5 +10,5 @@ const w = new Worker( { eval: true }); w.on('error', common.expectsError({ name: 'Error', - message: 'uncaught' + message: 'uncaught', })); diff --git a/test/parallel/test-worker-on-process-exit.js b/test/parallel/test-worker-on-process-exit.js index ec1c4affd1cc6f..9e31a8a82e32d1 100644 --- a/test/parallel/test-worker-on-process-exit.js +++ b/test/parallel/test-worker-on-process-exit.js @@ -9,7 +9,7 @@ const { Worker } = require('worker_threads'); if (process.argv[2] !== 'child') { const { - stdout, stderr, status + stdout, stderr, status, } = spawnSync(process.execPath, [__filename, 'child'], { encoding: 'utf8' }); assert.strictEqual(stderr, ''); assert.strictEqual(stdout, ''); diff --git a/test/parallel/test-worker-process-argv.js b/test/parallel/test-worker-process-argv.js index 0e541c453e2419..780807bd3a73d9 100644 --- a/test/parallel/test-worker-process-argv.js +++ b/test/parallel/test-worker-process-argv.js @@ -7,14 +7,14 @@ if (isMainThread) { assert.throws(() => { new Worker(__filename, { argv: 'foo' }); }, { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); [ new Worker(__filename, { argv: [null, 'foo', 123, Symbol('bar')], // Asserts only if the worker is started by the test. - workerData: 'assert-argv' + workerData: 'assert-argv', }), new Worker(` const assert = require('assert'); @@ -23,7 +23,7 @@ if (isMainThread) { [process.execPath, '[worker eval]'] ); `, { - eval: true + eval: true, }), new Worker(` const assert = require('assert'); @@ -34,7 +34,7 @@ if (isMainThread) { ); `, { argv: [null, 'foo', 123, Symbol('bar')], - eval: true + eval: true, }), ].forEach((worker) => { worker.on('exit', common.mustCall((code) => { diff --git a/test/parallel/test-worker-process-env-shared.js b/test/parallel/test-worker-process-env-shared.js index 314e5311fa193f..b7ce71b29f3df6 100644 --- a/test/parallel/test-worker-process-env-shared.js +++ b/test/parallel/test-worker-process-env-shared.js @@ -9,7 +9,7 @@ if (!workerData) { const w = new Worker(__filename, { workerData: 'runInWorker', - env: SHARE_ENV + env: SHARE_ENV, }).on('exit', common.mustCall(() => { // Env vars from the child thread are not set globally. assert.strictEqual(process.env.SET_IN_WORKER, 'set'); diff --git a/test/parallel/test-worker-process-env.js b/test/parallel/test-worker-process-env.js index 9680d685140f60..faa42db8d66b0b 100644 --- a/test/parallel/test-worker-process-env.js +++ b/test/parallel/test-worker-process-env.js @@ -20,7 +20,7 @@ if (!workerData && process.argv[2] !== 'child') { new Worker(__filename, { workerData: 'resetEnv', - env: { 'MANUALLY_SET': true } + env: { 'MANUALLY_SET': true }, }); assert.throws(() => { @@ -30,7 +30,7 @@ if (!workerData && process.argv[2] !== 'child') { code: 'ERR_INVALID_ARG_TYPE', message: 'The "options.env" property must be of type object or ' + 'one of undefined, null, or worker_threads.SHARE_ENV. Received type ' + - 'number (42)' + 'number (42)', }); } else if (workerData === 'runInWorker') { // Env vars from the parent thread are inherited. diff --git a/test/parallel/test-worker-resource-limits.js b/test/parallel/test-worker-resource-limits.js index ffda452f6c6335..ff5252d86cf5d7 100644 --- a/test/parallel/test-worker-resource-limits.js +++ b/test/parallel/test-worker-resource-limits.js @@ -27,7 +27,7 @@ if (!process.env.HAS_STARTED_WORKER) { w.on('error', common.expectsError({ code: 'ERR_WORKER_OUT_OF_MEMORY', message: 'Worker terminated due to reaching memory limit: ' + - 'JS heap out of memory' + 'JS heap out of memory', })); return; } diff --git a/test/parallel/test-worker-safe-getters.js b/test/parallel/test-worker-safe-getters.js index 69856659a5773b..bf10e068d18b3c 100644 --- a/test/parallel/test-worker-safe-getters.js +++ b/test/parallel/test-worker-safe-getters.js @@ -9,7 +9,7 @@ if (isMainThread) { const w = new Worker(__filename, { stdin: true, stdout: true, - stderr: true + stderr: true, }); const { stdin, stdout, stderr } = w; diff --git a/test/parallel/test-worker-stack-overflow-stack-size.js b/test/parallel/test-worker-stack-overflow-stack-size.js index a079624847bcb7..26a24b2179da0e 100644 --- a/test/parallel/test-worker-stack-overflow-stack-size.js +++ b/test/parallel/test-worker-stack-overflow-stack-size.js @@ -19,7 +19,7 @@ async function runWorker(options = {}) { f();`, { eval: true, workerData: { empiricalStackDepth }, - ...options + ...options, }); const [ error ] = await once(worker, 'error'); @@ -27,7 +27,7 @@ async function runWorker(options = {}) { if (!options.skipErrorCheck) { common.expectsError({ constructor: RangeError, - message: 'Maximum call stack size exceeded' + message: 'Maximum call stack size exceeded', })(error); } diff --git a/test/parallel/test-worker-stack-overflow.js b/test/parallel/test-worker-stack-overflow.js index 32351b7a4a6fad..b384c393abf774 100644 --- a/test/parallel/test-worker-stack-overflow.js +++ b/test/parallel/test-worker-stack-overflow.js @@ -6,5 +6,5 @@ const worker = new Worker('function f() { f(); } f();', { eval: true }); worker.on('error', common.expectsError({ constructor: RangeError, - message: 'Maximum call stack size exceeded' + message: 'Maximum call stack size exceeded', })); diff --git a/test/parallel/test-worker-stdio-from-preload-module.js b/test/parallel/test-worker-stdio-from-preload-module.js index e4178c58d46b21..89e3c391dc2143 100644 --- a/test/parallel/test-worker-stdio-from-preload-module.js +++ b/test/parallel/test-worker-stdio-from-preload-module.js @@ -12,7 +12,7 @@ for (let i = 0; i < 10; i++) { const w = new Worker('console.log("B");', { execArgv: ['--require', fixtures.path('printA.js')], eval: true, - stdout: true + stdout: true, }); w.on('exit', common.mustCall(() => { assert.strictEqual(w.stdout.read().toString(), 'A\nB\n'); diff --git a/test/parallel/test-worker-terminate-http2-respond-with-file.js b/test/parallel/test-worker-terminate-http2-respond-with-file.js index 80b58ddfc5bac0..82157b20ab3667 100644 --- a/test/parallel/test-worker-terminate-http2-respond-with-file.js +++ b/test/parallel/test-worker-terminate-http2-respond-with-file.js @@ -24,7 +24,7 @@ if (isMainThread) { server.emit('connection', serverSide); const client = http2.connect('http://localhost:80', { - createConnection: common.mustCall(() => clientSide) + createConnection: common.mustCall(() => clientSide), }); const req = client.request(); diff --git a/test/parallel/test-worker-terminate-source-map.js b/test/parallel/test-worker-terminate-source-map.js index c855dab975be01..29324b4931c593 100644 --- a/test/parallel/test-worker-terminate-source-map.js +++ b/test/parallel/test-worker-terminate-source-map.js @@ -30,7 +30,7 @@ function increaseCallCount() { callCount[0]++; } for (const property of ['_cache', 'lineLengths', 'url']) { Object.defineProperty(Object.prototype, property, { get: increaseCallCount, - set: increaseCallCount + set: increaseCallCount, }); } Object.getPrototypeOf([][Symbol.iterator]()).next = increaseCallCount; diff --git a/test/parallel/test-worker-type-check.js b/test/parallel/test-worker-type-check.js index 9a718dfad055b4..43dc9c739dab5b 100644 --- a/test/parallel/test-worker-type-check.js +++ b/test/parallel/test-worker-type-check.js @@ -22,7 +22,7 @@ const { Worker } = require('worker_threads'); name: 'TypeError', message: 'The "filename" argument must be of type string ' + 'or an instance of URL.' + - common.invalidArgTypeHelper(val) + common.invalidArgTypeHelper(val), } ); }); diff --git a/test/parallel/test-worker-unsupported-path.js b/test/parallel/test-worker-unsupported-path.js index 227b759dcfe753..75001a04e3b289 100644 --- a/test/parallel/test-worker-unsupported-path.js +++ b/test/parallel/test-worker-unsupported-path.js @@ -8,7 +8,7 @@ const { Worker } = require('worker_threads'); { const expectedErr = { code: 'ERR_WORKER_UNSUPPORTED_EXTENSION', - name: 'TypeError' + name: 'TypeError', }; assert.throws(() => { new Worker('/b'); }, expectedErr); assert.throws(() => { new Worker('/c.wasm'); }, expectedErr); @@ -19,7 +19,7 @@ const { Worker } = require('worker_threads'); { const expectedErr = { code: 'ERR_WORKER_PATH', - name: 'TypeError' + name: 'TypeError', }; const existingRelPathNoDot = path.relative('.', __filename); assert.throws(() => { new Worker(existingRelPathNoDot); }, expectedErr); @@ -47,7 +47,7 @@ const { Worker } = require('worker_threads'); { const expectedErr = { code: 'ERR_INVALID_URL_SCHEME', - name: 'TypeError' + name: 'TypeError', }; assert.throws(() => { new Worker(new URL('https://www.url.com')); }, expectedErr); diff --git a/test/parallel/test-worker-unsupported-things.js b/test/parallel/test-worker-unsupported-things.js index 18c1617c3cde5e..2c847af0f27a2c 100644 --- a/test/parallel/test-worker-unsupported-things.js +++ b/test/parallel/test-worker-unsupported-things.js @@ -28,7 +28,7 @@ if (!process.env.HAS_STARTED_WORKER) { const mask = 0o600; assert.throws(() => { process.umask(mask); }, { code: 'ERR_WORKER_UNSUPPORTED_OPERATION', - message: 'Setting process.umask() is not supported in workers' + message: 'Setting process.umask() is not supported in workers', }); } @@ -45,7 +45,7 @@ if (!process.env.HAS_STARTED_WORKER) { process[fn](); }, { code: 'ERR_WORKER_UNSUPPORTED_OPERATION', - message: `process.${fn}() is not supported in workers` + message: `process.${fn}() is not supported in workers`, }); }); @@ -54,7 +54,7 @@ if (!process.env.HAS_STARTED_WORKER) { process[fn]; // eslint-disable-line no-unused-expressions }, { code: 'ERR_WORKER_UNSUPPORTED_OPERATION', - message: `process.${fn} is not supported in workers` + message: `process.${fn} is not supported in workers`, }); }); diff --git a/test/parallel/test-worker-workerdata-messageport.js b/test/parallel/test-worker-workerdata-messageport.js index 29a06a3196ae86..ecc78292cc1094 100644 --- a/test/parallel/test-worker-workerdata-messageport.js +++ b/test/parallel/test-worker-workerdata-messageport.js @@ -4,7 +4,7 @@ require('../common'); const assert = require('assert'); const { - Worker, MessageChannel + Worker, MessageChannel, } = require('worker_threads'); const channel = new MessageChannel(); @@ -35,7 +35,7 @@ const meowScript = () => 'meow'; `, { eval: true, workerData: uint8Array, - transferList: [uint8Array.buffer] + transferList: [uint8Array.buffer], }).on( 'message', (message) => @@ -52,10 +52,10 @@ const meowScript = () => 'meow'; assert.throws(() => new Worker(`${meowScript}`, { eval: true, workerData, - transferList: [] + transferList: [], }), { code: 'ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST', message: 'Object that needs transfer was found in message but not ' + - 'listed in transferList' + 'listed in transferList', }); } diff --git a/test/parallel/test-worker-workerdata-sharedarraybuffer.js b/test/parallel/test-worker-workerdata-sharedarraybuffer.js index 4e3d508ac94941..206bd018211ec6 100644 --- a/test/parallel/test-worker-workerdata-sharedarraybuffer.js +++ b/test/parallel/test-worker-workerdata-sharedarraybuffer.js @@ -19,7 +19,7 @@ const { Worker } = require('worker_threads'); }); `, { eval: true, - workerData: { sharedArrayBuffer } + workerData: { sharedArrayBuffer }, }); w.on('message', common.mustCall(() => { assert.strictEqual(local.toString(), 'Hello world!'); diff --git a/test/parallel/test-wrap-js-stream-exceptions.js b/test/parallel/test-wrap-js-stream-exceptions.js index 1b4d469a758d77..7b4cbde68261b6 100644 --- a/test/parallel/test-wrap-js-stream-exceptions.js +++ b/test/parallel/test-wrap-js-stream-exceptions.js @@ -13,11 +13,11 @@ const socket = new JSStreamWrap(new Duplex({ read: common.mustCall(), write: common.mustCall((buffer, data, cb) => { throw new Error('exception!'); - }) + }), })); socket.end('foo'); socket.on('error', common.expectsError({ name: 'Error', - message: 'write EPROTO' + message: 'write EPROTO', })); diff --git a/test/parallel/test-zlib-brotli.js b/test/parallel/test-zlib-brotli.js index ef31db3dd64ac4..48645e5254e583 100644 --- a/test/parallel/test-zlib-brotli.js +++ b/test/parallel/test-zlib-brotli.js @@ -17,8 +17,8 @@ const sampleBuffer = fixtures.readSync('/pss-vectors.json'); quality++) { const encoded = zlib.brotliCompressSync(sampleBuffer, { params: { - [zlib.constants.BROTLI_PARAM_QUALITY]: quality - } + [zlib.constants.BROTLI_PARAM_QUALITY]: quality, + }, }); sizes.push(encoded.length); } @@ -35,13 +35,13 @@ const sampleBuffer = fixtures.readSync('/pss-vectors.json'); assert.throws(() => { zlib.createBrotliCompress({ params: { - 10000: 0 - } + 10000: 0, + }, }); }, { code: 'ERR_BROTLI_INVALID_PARAM', name: 'RangeError', - message: '10000 is not a valid Brotli parameter' + message: '10000 is not a valid Brotli parameter', }); // Test that accidentally using duplicate keys fails. @@ -49,26 +49,26 @@ const sampleBuffer = fixtures.readSync('/pss-vectors.json'); zlib.createBrotliCompress({ params: { '0': 0, - '00': 0 - } + '00': 0, + }, }); }, { code: 'ERR_BROTLI_INVALID_PARAM', name: 'RangeError', - message: '00 is not a valid Brotli parameter' + message: '00 is not a valid Brotli parameter', }); assert.throws(() => { zlib.createBrotliCompress({ params: { // This is a boolean flag - [zlib.constants.BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING]: 42 - } + [zlib.constants.BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING]: 42, + }, }); }, { code: 'ERR_ZLIB_INITIALIZATION_FAILED', name: 'Error', - message: 'Initialization failed' + message: 'Initialization failed', }); } diff --git a/test/parallel/test-zlib-convenience-methods.js b/test/parallel/test-zlib-convenience-methods.js index 01ec7e211bd5aa..59ee5551608f0b 100644 --- a/test/parallel/test-zlib-convenience-methods.js +++ b/test/parallel/test-zlib-convenience-methods.js @@ -37,7 +37,7 @@ const opts = { }; const optsInfo = { - info: true + info: true, }; for (const [type, expect] of [ @@ -128,6 +128,6 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "callback" argument must be of type function. ' + - 'Received undefined' + 'Received undefined', } ); diff --git a/test/parallel/test-zlib-deflate-constructors.js b/test/parallel/test-zlib-deflate-constructors.js index 492048d3d0a108..dc2b33815c34e1 100644 --- a/test/parallel/test-zlib-deflate-constructors.js +++ b/test/parallel/test-zlib-deflate-constructors.js @@ -19,7 +19,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.chunkSize" property must be of type number. ' + - "Received type string ('test')" + "Received type string ('test')", } ); @@ -29,7 +29,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.chunkSize" is out of range. It must ' + - 'be a finite number. Received -Infinity' + 'be a finite number. Received -Infinity', } ); @@ -39,7 +39,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.chunkSize" is out of range. It must ' + - 'be >= 64. Received 0' + 'be >= 64. Received 0', } ); @@ -53,7 +53,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.windowBits" property must be of type number. ' + - "Received type string ('test')" + "Received type string ('test')", } ); @@ -63,7 +63,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.windowBits" is out of range. It must ' + - 'be a finite number. Received -Infinity' + 'be a finite number. Received -Infinity', } ); @@ -73,7 +73,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.windowBits" is out of range. It must ' + - 'be a finite number. Received Infinity' + 'be a finite number. Received Infinity', } ); @@ -83,7 +83,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.windowBits" is out of range. It must ' + - 'be >= 8 and <= 15. Received 0' + 'be >= 8 and <= 15. Received 0', } ); @@ -94,7 +94,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.level" property must be of type number. ' + - "Received type string ('test')" + "Received type string ('test')", } ); @@ -104,7 +104,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.level" is out of range. It must ' + - 'be a finite number. Received -Infinity' + 'be a finite number. Received -Infinity', } ); @@ -114,7 +114,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.level" is out of range. It must ' + - 'be a finite number. Received Infinity' + 'be a finite number. Received Infinity', } ); @@ -124,7 +124,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.level" is out of range. It must ' + - 'be >= -1 and <= 9. Received -2' + 'be >= -1 and <= 9. Received -2', } ); @@ -135,7 +135,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "level" argument must be of type number. ' + - "Received type string ('test')" + "Received type string ('test')", } ); @@ -145,7 +145,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "level" is out of range. It must ' + - 'be a finite number. Received -Infinity' + 'be a finite number. Received -Infinity', } ); @@ -155,7 +155,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "level" is out of range. It must ' + - 'be a finite number. Received Infinity' + 'be a finite number. Received Infinity', } ); @@ -165,7 +165,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "level" is out of range. It must ' + - 'be >= -1 and <= 9. Received -2' + 'be >= -1 and <= 9. Received -2', } ); @@ -176,7 +176,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.memLevel" property must be of type number. ' + - "Received type string ('test')" + "Received type string ('test')", } ); @@ -186,7 +186,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.memLevel" is out of range. It must ' + - 'be a finite number. Received -Infinity' + 'be a finite number. Received -Infinity', } ); @@ -196,7 +196,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.memLevel" is out of range. It must ' + - 'be a finite number. Received Infinity' + 'be a finite number. Received Infinity', } ); @@ -206,7 +206,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.memLevel" is out of range. It must ' + - 'be >= 1 and <= 9. Received -2' + 'be >= 1 and <= 9. Received -2', } ); @@ -224,7 +224,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.strategy" property must be of type number. ' + - "Received type string ('test')" + "Received type string ('test')", } ); @@ -234,7 +234,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.strategy" is out of range. It must ' + - 'be a finite number. Received -Infinity' + 'be a finite number. Received -Infinity', } ); @@ -244,7 +244,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.strategy" is out of range. It must ' + - 'be a finite number. Received Infinity' + 'be a finite number. Received Infinity', } ); @@ -254,7 +254,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.strategy" is out of range. It must ' + - 'be >= 0 and <= 4. Received -2' + 'be >= 0 and <= 4. Received -2', } ); @@ -265,7 +265,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "strategy" argument must be of type number. ' + - "Received type string ('test')" + "Received type string ('test')", } ); @@ -275,7 +275,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "strategy" is out of range. It must ' + - 'be a finite number. Received -Infinity' + 'be a finite number. Received -Infinity', } ); @@ -285,7 +285,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "strategy" is out of range. It must ' + - 'be a finite number. Received Infinity' + 'be a finite number. Received Infinity', } ); @@ -295,7 +295,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "strategy" is out of range. It must ' + - 'be >= 0 and <= 4. Received -2' + 'be >= 0 and <= 4. Received -2', } ); @@ -307,6 +307,6 @@ assert.throws( name: 'TypeError', message: 'The "options.dictionary" property must be an instance of Buffer' + ', TypedArray, DataView, or ArrayBuffer. Received type string ' + - "('not a buffer')" + "('not a buffer')", } ); diff --git a/test/parallel/test-zlib-deflate-raw-inherits.js b/test/parallel/test-zlib-deflate-raw-inherits.js index 34bf31058a1d6b..ced1e99f00793a 100644 --- a/test/parallel/test-zlib-deflate-raw-inherits.js +++ b/test/parallel/test-zlib-deflate-raw-inherits.js @@ -20,7 +20,7 @@ const read = new Readable({ read() { this.push(Buffer.from('a test string')); this.push(null); - } + }, }); read.pipe(dest); diff --git a/test/parallel/test-zlib-destroy-pipe.js b/test/parallel/test-zlib-destroy-pipe.js index 67821a21b67b01..c30017ff364bb1 100644 --- a/test/parallel/test-zlib-destroy-pipe.js +++ b/test/parallel/test-zlib-destroy-pipe.js @@ -13,7 +13,7 @@ const ws = new Writable({ write: common.mustCall((chunk, enc, cb) => { setImmediate(cb); ts.destroy(); - }) + }), }); const buf = Buffer.allocUnsafe(1024 * 1024 * 20); diff --git a/test/parallel/test-zlib-failed-init.js b/test/parallel/test-zlib-failed-init.js index 95f401a3718f30..0091dc27ca1df5 100644 --- a/test/parallel/test-zlib-failed-init.js +++ b/test/parallel/test-zlib-failed-init.js @@ -11,7 +11,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.chunkSize" is out of range. It must ' + - 'be >= 64. Received 0' + 'be >= 64. Received 0', } ); @@ -21,7 +21,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.windowBits" is out of range. It must ' + - 'be >= 9 and <= 15. Received 0' + 'be >= 9 and <= 15. Received 0', } ); @@ -31,7 +31,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.memLevel" is out of range. It must ' + - 'be >= 1 and <= 9. Received 0' + 'be >= 1 and <= 9. Received 0', } ); diff --git a/test/parallel/test-zlib-flush-drain.js b/test/parallel/test-zlib-flush-drain.js index 6993d2c9fe6594..cdccc239125e60 100644 --- a/test/parallel/test-zlib-flush-drain.js +++ b/test/parallel/test-zlib-flush-drain.js @@ -7,7 +7,7 @@ const bigData = Buffer.alloc(10240, 'x'); const opts = { level: 0, - highWaterMark: 16 + highWaterMark: 16, }; const deflater = zlib.createDeflate(opts); diff --git a/test/parallel/test-zlib-flush-flags.js b/test/parallel/test-zlib-flush-flags.js index 3d8e609adb6269..5c5021daafbace 100644 --- a/test/parallel/test-zlib-flush-flags.js +++ b/test/parallel/test-zlib-flush-flags.js @@ -11,7 +11,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.flush" property must be of type number. ' + - "Received type string ('foobar')" + "Received type string ('foobar')", } ); @@ -21,7 +21,7 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.flush" is out of range. It must ' + - 'be >= 0 and <= 5. Received 10000' + 'be >= 0 and <= 5. Received 10000', } ); @@ -33,7 +33,7 @@ assert.throws( code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options.finishFlush" property must be of type number. ' + - "Received type string ('foobar')" + "Received type string ('foobar')", } ); @@ -43,6 +43,6 @@ assert.throws( code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.finishFlush" is out of range. It must ' + - 'be >= 0 and <= 5. Received 10000' + 'be >= 0 and <= 5. Received 10000', } ); diff --git a/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js b/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js index 477a6c544f2c07..67e9973b7c5bfa 100644 --- a/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js +++ b/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js @@ -40,7 +40,7 @@ zlib.gunzip(data, common.mustCall((err, result) => { common.expectsError({ code: 'Z_DATA_ERROR', name: 'Error', - message: 'unknown compression method' + message: 'unknown compression method', })(err); assert.strictEqual(result, undefined); })); diff --git a/test/parallel/test-zlib-invalid-arg-value-brotli-compress.js b/test/parallel/test-zlib-invalid-arg-value-brotli-compress.js index 688acddd16a136..b9427e60733348 100644 --- a/test/parallel/test-zlib-invalid-arg-value-brotli-compress.js +++ b/test/parallel/test-zlib-invalid-arg-value-brotli-compress.js @@ -11,10 +11,10 @@ const { BrotliCompress, constants } = require('zlib'); const opts = { params: { - [constants.BROTLI_PARAM_MODE]: 'lol' - } + [constants.BROTLI_PARAM_MODE]: 'lol', + }, }; assert.throws(() => BrotliCompress(opts), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); diff --git a/test/parallel/test-zlib-invalid-input.js b/test/parallel/test-zlib-invalid-input.js index 67793984a991c5..3053f45eda69c4 100644 --- a/test/parallel/test-zlib-invalid-input.js +++ b/test/parallel/test-zlib-invalid-input.js @@ -47,7 +47,7 @@ nonStringInputs.forEach(common.mustCall((input) => { zlib.gunzip(input); }, { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); }, nonStringInputs.length)); diff --git a/test/parallel/test-zlib-maxOutputLength.js b/test/parallel/test-zlib-maxOutputLength.js index 9af0b3736f8815..922f1c158b5f22 100644 --- a/test/parallel/test-zlib-maxOutputLength.js +++ b/test/parallel/test-zlib-maxOutputLength.js @@ -8,7 +8,7 @@ const encoded = Buffer.from('G38A+CXCIrFAIAM=', 'base64'); // Async zlib.brotliDecompress(encoded, { maxOutputLength: 64 }, common.expectsError({ code: 'ERR_BUFFER_TOO_LARGE', - message: 'Cannot create a Buffer larger than 64 bytes' + message: 'Cannot create a Buffer larger than 64 bytes', })); // Sync diff --git a/test/parallel/test-zlib-not-string-or-buffer.js b/test/parallel/test-zlib-not-string-or-buffer.js index a0954a0e1eaef7..8b1c32f55c9426 100644 --- a/test/parallel/test-zlib-not-string-or-buffer.js +++ b/test/parallel/test-zlib-not-string-or-buffer.js @@ -24,7 +24,7 @@ const zlib = require('zlib'); name: 'TypeError', message: 'The "buffer" argument must be of type string or an instance ' + 'of Buffer, TypedArray, DataView, or ArrayBuffer.' + - common.invalidArgTypeHelper(input) + common.invalidArgTypeHelper(input), } ); }); diff --git a/test/parallel/test-zlib-object-write.js b/test/parallel/test-zlib-object-write.js index 2be5edab897510..1b8a14b66caf02 100644 --- a/test/parallel/test-zlib-object-write.js +++ b/test/parallel/test-zlib-object-write.js @@ -10,5 +10,5 @@ assert.throws(() => { gunzip.write({}); }, { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }); diff --git a/test/parallel/test-zlib-write-after-close.js b/test/parallel/test-zlib-write-after-close.js index eb8ff4353963d4..2904884edc3182 100644 --- a/test/parallel/test-zlib-write-after-close.js +++ b/test/parallel/test-zlib-write-after-close.js @@ -29,6 +29,6 @@ zlib.gzip('hello', common.mustCall(function(err, out) { unzip.write('asd', common.expectsError({ code: 'ERR_STREAM_DESTROYED', name: 'Error', - message: 'Cannot call write after a stream was destroyed' + message: 'Cannot call write after a stream was destroyed', })); })); diff --git a/test/parallel/test-zlib-zero-windowBits.js b/test/parallel/test-zlib-zero-windowBits.js index a27fd6734a5425..908593a316da8d 100644 --- a/test/parallel/test-zlib-zero-windowBits.js +++ b/test/parallel/test-zlib-zero-windowBits.js @@ -28,6 +28,6 @@ const zlib = require('zlib'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError', message: 'The value of "options.windowBits" is out of range. ' + - 'It must be >= 9 and <= 15. Received 0' + 'It must be >= 9 and <= 15. Received 0', }); } diff --git a/test/pseudo-tty/readline-dumb-tty.js b/test/pseudo-tty/readline-dumb-tty.js index 6b9a3b59ad96e8..b3215415ea3a4e 100644 --- a/test/pseudo-tty/readline-dumb-tty.js +++ b/test/pseudo-tty/readline-dumb-tty.js @@ -7,7 +7,7 @@ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, - output: process.stdout + output: process.stdout, }); rl.write('text'); diff --git a/test/pseudo-tty/repl-dumb-tty.js b/test/pseudo-tty/repl-dumb-tty.js index 8c9b93a9f31ccd..4187f79e374979 100644 --- a/test/pseudo-tty/repl-dumb-tty.js +++ b/test/pseudo-tty/repl-dumb-tty.js @@ -25,7 +25,7 @@ process.stdin.push('.exit\n'); terminal: true, input: stream, output: process.stdout, - useColors: false + useColors: false, }); replServer.on('close', common.mustCall()); diff --git a/test/pseudo-tty/test-assert-no-color.js b/test/pseudo-tty/test-assert-no-color.js index c4e782b560fc41..698d29ab8dbceb 100644 --- a/test/pseudo-tty/test-assert-no-color.js +++ b/test/pseudo-tty/test-assert-no-color.js @@ -15,5 +15,5 @@ assert.throws( '+ {}\n' + '- {\n' + '- foo: \'bar\'\n' + - '- }' + '- }', }); diff --git a/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js b/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js index 1f80ab304d540d..32a56bf2d56cd7 100644 --- a/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js +++ b/test/pseudo-tty/test-set-raw-mode-reset-process-exit.js @@ -10,7 +10,7 @@ child_process.spawnSync(process.execPath, [ const { stdout } = child_process.spawnSync('stty', { stdio: ['inherit', 'pipe', 'inherit'], - encoding: 'utf8' + encoding: 'utf8', }); if (stdout.match(/-echo\b/)) { diff --git a/test/pseudo-tty/test-set-raw-mode-reset-signal.js b/test/pseudo-tty/test-set-raw-mode-reset-signal.js index 8b666f3ee0a8c3..7c4a315c5457e3 100644 --- a/test/pseudo-tty/test-set-raw-mode-reset-signal.js +++ b/test/pseudo-tty/test-set-raw-mode-reset-signal.js @@ -15,7 +15,7 @@ proc.stdout.on('data', common.mustCall(() => { proc.on('exit', common.mustCall(() => { const { stdout } = child_process.spawnSync('stty', { stdio: ['inherit', 'pipe', 'inherit'], - encoding: 'utf8' + encoding: 'utf8', }); if (stdout.match(/-echo\b/)) { diff --git a/test/pseudo-tty/test-set-raw-mode-reset.js b/test/pseudo-tty/test-set-raw-mode-reset.js index 7cd9bba80672fe..28055ab52bb32a 100644 --- a/test/pseudo-tty/test-set-raw-mode-reset.js +++ b/test/pseudo-tty/test-set-raw-mode-reset.js @@ -11,7 +11,7 @@ child_process.spawnSync(process.execPath, [ const { stdout } = child_process.spawnSync('stty', { stdio: ['inherit', 'pipe', 'inherit'], - encoding: 'utf8' + encoding: 'utf8', }); if (stdout.match(/-echo\b/)) { diff --git a/test/pseudo-tty/test-trace-sigint-disabled.js b/test/pseudo-tty/test-trace-sigint-disabled.js index 5dc4dfa9b36afa..fdc7480d83b074 100644 --- a/test/pseudo-tty/test-trace-sigint-disabled.js +++ b/test/pseudo-tty/test-trace-sigint-disabled.js @@ -14,7 +14,7 @@ if (process.env.CHILD === 'true') { ['--trace-sigint', __filename], { env: { ...process.env, CHILD: 'true' }, - stdio: 'inherit' + stdio: 'inherit', }); cp.on('exit', mustCall((code, signal) => { assert.strictEqual(signal, null); diff --git a/test/pseudo-tty/test-trace-sigint-on-idle.js b/test/pseudo-tty/test-trace-sigint-on-idle.js index 5f79cb82fe95db..8d9bbb3a5d2e82 100644 --- a/test/pseudo-tty/test-trace-sigint-on-idle.js +++ b/test/pseudo-tty/test-trace-sigint-on-idle.js @@ -13,7 +13,7 @@ if (process.env.CHILD === 'true') { ['--trace-sigint', __filename], { env: { ...process.env, CHILD: 'true' }, - stdio: ['inherit', 'inherit', 'inherit', 'ipc'] + stdio: ['inherit', 'inherit', 'inherit', 'ipc'], }); cp.on('message', mustCall(() => { setTimeout(() => cp.kill('SIGINT'), platformTimeout(100)); diff --git a/test/pseudo-tty/test-trace-sigint.js b/test/pseudo-tty/test-trace-sigint.js index 8b539bfc88d7b8..cd5f60ecfe4033 100644 --- a/test/pseudo-tty/test-trace-sigint.js +++ b/test/pseudo-tty/test-trace-sigint.js @@ -14,7 +14,7 @@ if (process.env.CHILD === 'true') { ['--trace-sigint', __filename], { env: { ...process.env, CHILD: 'true' }, - stdio: 'inherit' + stdio: 'inherit', }); cp.on('exit', mustCall((code, signal) => { assert.strictEqual(signal, 'SIGINT'); diff --git a/test/pummel/test-crypto-dh-hash-modp18.js b/test/pummel/test-crypto-dh-hash-modp18.js index 06121d1f6dc956..4296155c1d028e 100644 --- a/test/pummel/test-crypto-dh-hash-modp18.js +++ b/test/pummel/test-crypto-dh-hash-modp18.js @@ -35,7 +35,7 @@ const assert = require('assert'); const crypto = require('crypto'); const hashes = { - modp18: 'a870b491bbbec9b131ae9878d07449d32e54f160' + modp18: 'a870b491bbbec9b131ae9878d07449d32e54f160', }; for (const name in hashes) { diff --git a/test/pummel/test-fs-readfile-tostring-fail.js b/test/pummel/test-fs-readfile-tostring-fail.js index 1a1e7d62175638..e0327b1eb4b3df 100644 --- a/test/pummel/test-fs-readfile-tostring-fail.js +++ b/test/pummel/test-fs-readfile-tostring-fail.js @@ -18,7 +18,7 @@ tmpdir.refresh(); const file = path.join(tmpdir.path, 'toobig.txt'); const stream = fs.createWriteStream(file, { - flags: 'a' + flags: 'a', }); stream.on('error', (err) => { throw err; }); @@ -40,7 +40,7 @@ stream.on('finish', common.mustCall(function() { message: 'Cannot create a string longer than ' + `0x${stringLengthHex} characters`, code: 'ERR_STRING_TOO_LONG', - name: 'Error' + name: 'Error', })(err); } assert.strictEqual(buf, undefined); diff --git a/test/pummel/test-heapdump-dns.js b/test/pummel/test-heapdump-dns.js index 675ddc09aca61a..3ed3a7f8987eb5 100644 --- a/test/pummel/test-heapdump-dns.js +++ b/test/pummel/test-heapdump-dns.js @@ -13,6 +13,6 @@ validateSnapshotNodes('Node / ChannelWrap', [ { node_name: 'Node / NodeAresTask::List', edge_name: 'task_list' }, // `Node / ChannelWrap` (C++) -> `ChannelWrap` (JS) { node_name: 'ChannelWrap', edge_name: 'wrapped' }, - ] + ], }, ]); diff --git a/test/pummel/test-heapdump-env.js b/test/pummel/test-heapdump-env.js index 7030271469c512..b3e2fd0f37a43d 100644 --- a/test/pummel/test-heapdump-env.js +++ b/test/pummel/test-heapdump-env.js @@ -18,7 +18,7 @@ validateSnapshotNodes('Node / Environment', [{ { node_name: 'Node / cleanup_hooks', edge_name: 'cleanup_hooks' }, { node_name: 'process', edge_name: 'process_object' }, { node_name: 'Node / IsolateData', edge_name: 'isolate_data' }, - ] + ], }]); console.log(context); // Make sure it's not GC'ed diff --git a/test/pummel/test-heapdump-fs-promise.js b/test/pummel/test-heapdump-fs-promise.js index 181029dd69c11f..1ea9b688541a4b 100644 --- a/test/pummel/test-heapdump-fs-promise.js +++ b/test/pummel/test-heapdump-fs-promise.js @@ -11,6 +11,6 @@ validateSnapshotNodes('Node / FSReqPromise', [ children: [ { node_name: 'FSReqPromise', edge_name: 'wrapped' }, { node_name: 'Float64Array', edge_name: 'stats_field_array' }, - ] + ], }, ]); diff --git a/test/pummel/test-heapdump-http2.js b/test/pummel/test-heapdump-http2.js index 2fa854a91f117d..c6118903cb1c7f 100644 --- a/test/pummel/test-heapdump-http2.js +++ b/test/pummel/test-heapdump-http2.js @@ -29,7 +29,7 @@ server.listen(0, () => { children: [ // current_headers and/or queue could be empty { node_name: 'Http2Stream', edge_name: 'wrapped' }, - ] + ], }, ], { loose: true }); @@ -39,21 +39,21 @@ server.listen(0, () => { children: [ { node_name: 'FileHandle', edge_name: 'wrapped' }, // current_headers could be empty - ] + ], }, ], { loose: true }); state.validateSnapshotNodes('Node / TCPSocketWrap', [ { children: [ { node_name: 'TCP', edge_name: 'wrapped' }, - ] + ], }, ], { loose: true }); state.validateSnapshotNodes('Node / TCPServerWrap', [ { children: [ { node_name: 'TCP', edge_name: 'wrapped' }, - ] + ], }, ], { loose: true }); // `Node / StreamPipe` (C++) -> StreamPipe (JS) @@ -61,7 +61,7 @@ server.listen(0, () => { { children: [ { node_name: 'StreamPipe', edge_name: 'wrapped' }, - ] + ], }, ]); // `Node / Http2Session` (C++) -> Http2Session (JS) @@ -71,11 +71,11 @@ server.listen(0, () => { { node_name: 'Http2Session', edge_name: 'wrapped' }, { node_name: 'Node / nghttp2_memory', edge_name: 'nghttp2_memory' }, { - node_name: 'Node / streams', edge_name: 'streams' + node_name: 'Node / streams', edge_name: 'streams', }, // outstanding_pings, outgoing_buffers, outgoing_storage, // pending_rst_streams could be empty - ] + ], }, ], { loose: true }); })); diff --git a/test/pummel/test-heapdump-inspector.js b/test/pummel/test-heapdump-inspector.js index 9b08e33fdb2bce..9a40a25257e51d 100644 --- a/test/pummel/test-heapdump-inspector.js +++ b/test/pummel/test-heapdump-inspector.js @@ -10,7 +10,7 @@ const inspector = require('inspector'); const snapshotNode = { children: [ { node_name: 'Node / InspectorSession', edge_name: 'session' }, - ] + ], }; // Starts with no JSBindingsConnection (or 1 if coverage enabled). @@ -34,7 +34,7 @@ const snapshotNode = { (edge) => edge.name === 'callback' && (edge.to.type === undefined || // embedded graph edge.to.type === 'closure'), // snapshot - ] + ], }, ]; if (process.env.NODE_V8_COVERAGE) { diff --git a/test/pummel/test-heapdump-tls.js b/test/pummel/test-heapdump-tls.js index a58a543a28d65d..5af385ffd30608 100644 --- a/test/pummel/test-heapdump-tls.js +++ b/test/pummel/test-heapdump-tls.js @@ -29,7 +29,7 @@ const server = net.createServer(common.mustCall((c) => { // `Node / TLSWrap` (C++) -> `TLSWrap` (JS) { node_name: 'TLSWrap', edge_name: 'wrapped' }, // pending_cleartext_input could be empty - ] + ], }, ]); })); diff --git a/test/pummel/test-heapdump-worker.js b/test/pummel/test-heapdump-worker.js index 0e8322affb5d64..71075544865496 100644 --- a/test/pummel/test-heapdump-worker.js +++ b/test/pummel/test-heapdump-worker.js @@ -11,14 +11,14 @@ validateSnapshotNodes('Node / Worker', [ children: [ { node_name: 'Node / MessagePort', edge_name: 'parent_port' }, { node_name: 'Worker', edge_name: 'wrapped' }, - ] + ], }, ]); validateSnapshotNodes('Node / MessagePort', [ { children: [ { node_name: 'Node / MessagePortData', edge_name: 'data' }, - ] + ], }, ], { loose: true }); worker.terminate(); diff --git a/test/pummel/test-heapdump-zlib.js b/test/pummel/test-heapdump-zlib.js index 16e4ede4f916a2..8f515c55901b4c 100644 --- a/test/pummel/test-heapdump-zlib.js +++ b/test/pummel/test-heapdump-zlib.js @@ -12,7 +12,7 @@ validateSnapshotNodes('Node / ZlibStream', [ children: [ { node_name: 'Zlib', edge_name: 'wrapped' }, // No entry for memory because zlib memory is initialized lazily. - ] + ], }, ]); @@ -22,7 +22,7 @@ gzip.write('hello world', common.mustCall(() => { children: [ { node_name: 'Zlib', edge_name: 'wrapped' }, { node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' }, - ] + ], }, ]); })); diff --git a/test/pummel/test-heapsnapshot-near-heap-limit-big.js b/test/pummel/test-heapsnapshot-near-heap-limit-big.js index 14f62e3cbc4069..f153b9eee9f294 100644 --- a/test/pummel/test-heapsnapshot-near-heap-limit-big.js +++ b/test/pummel/test-heapsnapshot-near-heap-limit-big.js @@ -8,7 +8,7 @@ const fixtures = require('../common/fixtures'); const fs = require('fs'); const env = { ...process.env, - NODE_DEBUG_NATIVE: 'diagnostics' + NODE_DEBUG_NATIVE: 'diagnostics', }; if (!common.enoughTestMem) @@ -26,7 +26,7 @@ if (!common.enoughTestMem) env: { ...env, TEST_CHUNK: 2000, - } + }, }); const stderr = child.stderr.toString(); console.log(stderr); diff --git a/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js b/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js index 0ad6a898d126eb..3e63dca71d5559 100644 --- a/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js +++ b/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js @@ -17,7 +17,7 @@ const env = { TEST_ALLOCATION: 50000, TEST_CHUNK: 1000, TEST_CLEAN_INTERVAL: 500, - NODE_DEBUG_NATIVE: 'diagnostics' + NODE_DEBUG_NATIVE: 'diagnostics', }; { diff --git a/test/pummel/test-heapsnapshot-near-heap-limit.js b/test/pummel/test-heapsnapshot-near-heap-limit.js index 6651f2ae9f52d9..b74b0399ff7840 100644 --- a/test/pummel/test-heapsnapshot-near-heap-limit.js +++ b/test/pummel/test-heapsnapshot-near-heap-limit.js @@ -14,7 +14,7 @@ const fixtures = require('../common/fixtures'); const fs = require('fs'); const env = { ...process.env, - NODE_DEBUG_NATIVE: 'diagnostics' + NODE_DEBUG_NATIVE: 'diagnostics', }; { diff --git a/test/pummel/test-http-many-keep-alive-connections.js b/test/pummel/test-http-many-keep-alive-connections.js index 9a7083a8ae66cb..a5b7f34502169d 100644 --- a/test/pummel/test-http-many-keep-alive-connections.js +++ b/test/pummel/test-http-many-keep-alive-connections.js @@ -45,8 +45,8 @@ server.listen(0, function connect() { port: server.address().port, path: '/', headers: { - 'Connection': 'Keep-alive' - } + 'Connection': 'Keep-alive', + }, }, function(res) { res.on('end', function() { if (++responses < expected) { diff --git a/test/pummel/test-http-upload-timeout.js b/test/pummel/test-http-upload-timeout.js index c3ec3ad19d5d37..089b6b9d874ef5 100644 --- a/test/pummel/test-http-upload-timeout.js +++ b/test/pummel/test-http-upload-timeout.js @@ -52,7 +52,7 @@ server.listen(0, '127.0.0.1', function() { const request = http.request({ port: server.address().port, method: 'POST', - path: '/' + path: '/', }); function ping() { diff --git a/test/pummel/test-https-large-response.js b/test/pummel/test-https-large-response.js index acf442d2541d1a..174a63b0338ab2 100644 --- a/test/pummel/test-https-large-response.js +++ b/test/pummel/test-https-large-response.js @@ -30,7 +30,7 @@ const https = require('https'); const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; process.stdout.write('build body...'); @@ -46,7 +46,7 @@ const server = https.createServer(options, common.mustCall(function(req, res) { server.listen(0, common.mustCall(function() { https.get({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function(res) { console.log('response!'); diff --git a/test/pummel/test-https-no-reader.js b/test/pummel/test-https-no-reader.js index 63db032d0b6144..942e7ccdc9815c 100644 --- a/test/pummel/test-https-no-reader.js +++ b/test/pummel/test-https-no-reader.js @@ -30,7 +30,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readKey('rsa_private.pem'), - cert: fixtures.readKey('rsa_cert.crt') + cert: fixtures.readKey('rsa_cert.crt'), }; const buf = Buffer.allocUnsafe(1024 * 1024); @@ -47,7 +47,7 @@ server.listen(0, function() { const req = https.request({ method: 'POST', port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function(res) { res.read(0); diff --git a/test/pummel/test-keep-alive.js b/test/pummel/test-keep-alive.js index 896f0a1f68d28f..89a5ebdc86f362 100644 --- a/test/pummel/test-keep-alive.js +++ b/test/pummel/test-keep-alive.js @@ -37,7 +37,7 @@ const body = 'hello world\n'; const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Length': body.length, - 'Content-Type': 'text/plain' + 'Content-Type': 'text/plain', }); res.write(body); res.end(); diff --git a/test/pummel/test-regress-GH-892.js b/test/pummel/test-regress-GH-892.js index d5e8cc0215635c..a72b1afb62cc60 100644 --- a/test/pummel/test-regress-GH-892.js +++ b/test/pummel/test-regress-GH-892.js @@ -78,7 +78,7 @@ function makeRequest() { const serverOptions = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; let uploadCount = 0; diff --git a/test/pummel/test-tls-server-large-request.js b/test/pummel/test-tls-server-large-request.js index 7537ca813af41c..158017ef2f02b9 100644 --- a/test/pummel/test-tls-server-large-request.js +++ b/test/pummel/test-tls-server-large-request.js @@ -33,7 +33,7 @@ const request = Buffer.from('ABCD'.repeat(1024 * 256 - 1)); // 1mb const options = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; class Mediator extends stream.Writable { @@ -62,7 +62,7 @@ const server = tls.Server(options, common.mustCall(function(socket) { server.listen(0, common.mustCall(() => { const client1 = tls.connect({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { client1.end(request); })); diff --git a/test/pummel/test-tls-throttle.js b/test/pummel/test-tls-throttle.js index da675204a1ec5c..9c87b430a6ef7d 100644 --- a/test/pummel/test-tls-throttle.js +++ b/test/pummel/test-tls-throttle.js @@ -37,7 +37,7 @@ process.stdout.write('done\n'); const options = { key: fixtures.readKey('agent2-key.pem'), - cert: fixtures.readKey('agent2-cert.pem') + cert: fixtures.readKey('agent2-cert.pem'), }; const server = tls.Server(options, common.mustCall(function(socket) { @@ -49,7 +49,7 @@ let recvCount = 0; server.listen(0, function() { const client = tls.connect({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }); client.on('data', function(d) { diff --git a/test/pummel/test-webcrypto-derivebits-pbkdf2.js b/test/pummel/test-webcrypto-derivebits-pbkdf2.js index 745071f3458aba..40e6a3a7c4fa3d 100644 --- a/test/pummel/test-webcrypto-derivebits-pbkdf2.js +++ b/test/pummel/test-webcrypto-derivebits-pbkdf2.js @@ -45,7 +45,7 @@ const kPasswords = { const kSalts = { short: '4e61436c', long: '536f6469756d2043686c6f7269646520636f6d706f756e64', - empty: '' + empty: '', }; const kDerivations = { @@ -57,7 +57,7 @@ const kDerivations = { '1000': 'aaec5a976d4d35cb2024486fc9f9bb9aa' + '3eae7cef2bce62664b5b3751cf50ff1', '100000': '6f5ea3c6c6f5e4833467b47c3a671e6' + - '5714e87071bd1e36d716f846b5cd28980' + '5714e87071bd1e36d716f846b5cd28980', }, 'SHA-512': { '1': '69f4d5cef5c7d8ba938e880388c8f63b6b2' + @@ -65,7 +65,7 @@ const kDerivations = { '1000': '865c5945e11f5bf3ddf002e7cb1748f6' + '224d2671e806dad4aaf090a04367da29', '100000': '483ba7f2e2fe382cf61d20b29812e2' + - 'd49610a60041ae40ecf9fc7ef138e93876' + 'd49610a60041ae40ecf9fc7ef138e93876', }, 'SHA-1': { '1': '4624dbd21373ee5659c125b184eedaa26a3' + @@ -73,7 +73,7 @@ const kDerivations = { '1000': '5388ea5e62e1b557981abe5ce4132127' + '58aa6a9d2c5bf08c019d459dba666b90', '100000': 'f58f435fbc5c05865c914fd972108a' + - '09457d5f9a48f14e75e4cc02d98983038a' + '09457d5f9a48f14e75e4cc02d98983038a', }, 'SHA-256': { '1': 'c6bc55a404adcea36a1ab56798085e0aaf6' + @@ -81,8 +81,8 @@ const kDerivations = { '1000': '4e6ca57957439be3a75370424225e221' + '1d55f05af00561df3f3efee9116bc34c', '100000': 'ab25796598e74b29c324f5ba4d90ea' + - '7dc89fc6891041b4d56c94156505f722c0' - } + '7dc89fc6891041b4d56c94156505f722c0', + }, }, long: { 'SHA-384': { @@ -91,7 +91,7 @@ const kDerivations = { '1000': 'a310ef3c6b3a95e6d8ca6644e3dcfd88' + '222a59fe8e00c52d6a12631d82c1d24b', '100000': '2c8c6674c879cf1850bc9b7fbdcc6e' + - 'a7abb0a1522196a866875305dea57486f3' + 'a7abb0a1522196a866875305dea57486f3', }, 'SHA-512': { '1': '5777027aff4051fb9b43c1f1ef0463bd677' + @@ -99,7 +99,7 @@ const kDerivations = { '1000': '9c17fe96895eadbfd1cc095fc1bb834f' + '28e5ccc9ec96ca814cff941a4bf40727', '100000': 'b479c9715c421638dce0a705fc0b7b' + - 'a7d56fa3063188063580e070dff1db497c' + 'a7d56fa3063188063580e070dff1db497c', }, 'SHA-1': { '1': '576f7c165825bef9ef14b4bc2c82469d1e4' + @@ -107,7 +107,7 @@ const kDerivations = { '1000': '89d3b27b5f6e8af015f2f87cf368a143' + '8a206c4ecf5fe681fc3bf94c56213ef6', '100000': '1e39e8bf6676fcd3156655457afa14' + - 'bee771dbcbfcd07241c7cee209a7cb1fe9' + 'bee771dbcbfcd07241c7cee209a7cb1fe9', }, 'SHA-256': { '1': '12b90f594f0908cf912d655c948f9c2a1ea' + @@ -115,8 +115,8 @@ const kDerivations = { '1000': 'b1a7b7dc20df174a4a0e410dbfaf03b4' + 'c375c450a89d7a9ed349b4e52e64dfd8', '100000': 'd4594d8a1b59520a48878922a65d66' + - '3d28f6a5fa49e931d300d8f9baf93d0aeb' - } + '3d28f6a5fa49e931d300d8f9baf93d0aeb', + }, }, empty: { 'SHA-384': { @@ -125,7 +125,7 @@ const kDerivations = { '1000': 'aeb5f97d6627eebcde6b139a00895500' + '30f7401c67e01c057a3338175e3f3a17', '100000': 'd7687df6c781dc88d64ef9cbaf95d3' + - 'd5d1155f66b230239e6e81c1550c8840cf' + 'd5d1155f66b230239e6e81c1550c8840cf', }, 'SHA-512': { '1': '8f7b7d459c752f64bf12be625b65d496ac2' + @@ -133,7 +133,7 @@ const kDerivations = { '1000': 'b5ac720b7abe0832fc51a31b1ec5673b' + 'eb1e41840adfd3d606e8638f4006eb48', '100000': 'ba1a0f36bad771526564051eb9ca20' + - '7da19b62e53762349976a9a3d1b0ef7e20' + '7da19b62e53762349976a9a3d1b0ef7e20', }, 'SHA-1': { '1': 'c0cffb0ce5db351faa24dad5902583cfc30' + @@ -141,7 +141,7 @@ const kDerivations = { '1000': '736f3c3d6ebcc2a7b970403e2696c0eb' + '4cd1770f55f196fc7089e666c11f77da', '100000': '1c5095ac9a7bd410ef0f72c993eca9' + - '1bb0e571e9b2fbab704f8c131191fad16c' + '1bb0e571e9b2fbab704f8c131191fad16c', }, 'SHA-256': { '1': '019e54ab42f00485d3aa1b26fcde21ae5f5' + @@ -149,9 +149,9 @@ const kDerivations = { '1000': 'b9d2f2217b4ee5a8bf0345f36b2c9887' + '33f503a975dfeac7b7135f54a5f29971', '100000': 'a7a2869829797807b3e576c17878b4' + - '66449e89e60447d541775a96eb7c1a5ded' - } - } + '66449e89e60447d541775a96eb7c1a5ded', + }, + }, }, long: { short: { @@ -161,7 +161,7 @@ const kDerivations = { '1000': 'faa442fbabf4058cc65368b53d7ec511' + '3c09ea7e5e3743312f4bebedd980ba37', '100000': 'f62ae6c7871b181aa71232f5eb8837' + - '2498ef32ac0a7d715119e8f052eb102d29' + '2498ef32ac0a7d715119e8f052eb102d29', }, 'SHA-512': { '1': '3e9c12b3f6dfb6441594ec7063fca962ffd' + @@ -169,7 +169,7 @@ const kDerivations = { '1000': 'f0928f50a155f26a8c9c1bc7f3b5cb53' + '1c53a8f51040c9ce5fc79d430ff0c0f4', '100000': '974acfbb0f0f20c81ec92829f38c3d' + - 'af086a7df58b912b856d1f5ecc9355ef1b' + 'af086a7df58b912b856d1f5ecc9355ef1b', }, 'SHA-1': { '1': '8ae72f94e6fcd54fcbfca66200a211a51b2' + @@ -177,7 +177,7 @@ const kDerivations = { '1000': '53b42161134e15c871abd71aba1390d0' + '1f4c6a940caaf5c179258d8f1b1d680b', '100000': 'a7fda4c79dd3ba1a875f65e9248b21' + - '0899ca0814ae38995d8ce5a53560cbac31' + '0899ca0814ae38995d8ce5a53560cbac31', }, 'SHA-256': { '1': 'ffa1e9a727a92c27ae6f74b1c7978f9e1af' + @@ -185,8 +185,8 @@ const kDerivations = { '1000': 'eeeb7714420a00b18acec2b5979d1da6' + '1373202b7f8ba71b086293aab859e0a0', '100000': 'deac70cbe3f1720e353b4e8016ddb5' + - '9475efb70b6a2385e735d2d6ea6d624a4d' - } + '9475efb70b6a2385e735d2d6ea6d624a4d', + }, }, long: { 'SHA-384': { @@ -195,7 +195,7 @@ const kDerivations = { '1000': '35658551f0ec13398a7b45e0261cfd65' + '4c1e52411e6e457dee68f4aeabe925a7', '100000': '1abab5f1e461df378b88c0a22be76e' + - 'f2f1627df74ac7cbfb84bdccb354bc8889' + 'f2f1627df74ac7cbfb84bdccb354bc8889', }, 'SHA-512': { '1': 'de4afbc0add3e4d32f4bc6e122a88ae44a2' + @@ -203,7 +203,7 @@ const kDerivations = { '1000': '43e12024c4d354727f7e58842ccb6033' + 'a161d60dc5ae516f076e4a58a1880d38', '100000': 'f9a92384a4eadfc3560649b37fb676' + - 'e83c453cbbd99f80bba6f0a10ebd150b52' + 'e83c453cbbd99f80bba6f0a10ebd150b52', }, 'SHA-1': { '1': '1d104ea5d235006a12a80f71b80ee528048' + @@ -211,7 +211,7 @@ const kDerivations = { '1000': '6e90c86ee07b873e965071025673ff05' + '429f678c30f91b37e1e2da512036d320', '100000': '141030763bf983c8564d5d4c935fe3' + - 'ca3549608159ac1934c1599040668c2363' + 'ca3549608159ac1934c1599040668c2363', }, 'SHA-256': { '1': 'fd5caeb8b3abe589bc159c4e51f800570e7' + @@ -219,8 +219,8 @@ const kDerivations = { '1000': '3fd587c94ba946b8b9dccddd2a5b74f6' + '778d4f61e691f83ac47a2fa9580bfdf8', '100000': '11992d8b813311244c544b62292945' + - 'e208d403cebd6b9552a1a562065d9958ea' - } + 'e208d403cebd6b9552a1a562065d9958ea', + }, }, empty: { 'SHA-384': { @@ -229,7 +229,7 @@ const kDerivations = { '1000': 'f9ca148b0c041890bff8831db6174719' + '7e94ce68f190edf269694b4d644861ca', '100000': '1749dfcd77e5258519ea2231ba2cd6' + - '543b073339ac9b1545bb643153faf6d17b' + '543b073339ac9b1545bb643153faf6d17b', }, 'SHA-512': { '1': 'd1bfa1a6b8a977839f8c3f9d52dd02104e2' + @@ -237,7 +237,7 @@ const kDerivations = { '1000': '457a7955ebecec71a51efb6237e5b1d6' + '2f4deab5c93d7b3d11d1e70faffa417e', '100000': 'e805ac9cc1d8412c42446d237d1b50' + - '4f9540b362bd1b75e451531e853e24753d' + '4f9540b362bd1b75e451531e853e24753d', }, 'SHA-1': { '1': 'a46a62986d9c3909f41014dd72cfe34a261' + @@ -245,7 +245,7 @@ const kDerivations = { '1000': 'e7375de5036766c40cb85f43b53fce4f' + 'fa402ab6be3571007ef5d55453fd7f0a', '100000': '7a403d9a13aed8164e9c072c545462' + - '251fd942f1736a6bf03ce1c88330048e04' + '251fd942f1736a6bf03ce1c88330048e04', }, 'SHA-256': { '1': '4f510c5181ac5c2c5fd4bd141f9712495be' + @@ -253,9 +253,9 @@ const kDerivations = { '1000': '7e66c84bea888f92c348d9145585186c' + 'ae472b12fba7f0ad28179575c1aa815a', '100000': '5f1a6ac4a56d9796a7309a78daaaf9' + - '18badaf5ed1eecc3f0b8a3a44c3d38d654' - } - } + '18badaf5ed1eecc3f0b8a3a44c3d38d654', + }, + }, }, // empty: { // short: { @@ -422,7 +422,7 @@ async function testDeriveBits( name: 'PBKDF2', salt: Buffer.from(kSalts[saltSize], 'hex'), hash, - iterations + iterations, }; const bits = await subtle.deriveBits(algorithm, baseKeys[size], 256); @@ -443,21 +443,21 @@ async function testDeriveBitsBadLengths( name: 'PBKDF2', salt: Buffer.from(kSalts[saltSize], 'hex'), iterations, - hash + hash, }; return Promise.all([ assert.rejects( subtle.deriveBits(algorithm, baseKeys[size], 0), { - message: /length cannot be zero/ + message: /length cannot be zero/, }), assert.rejects( subtle.deriveBits(algorithm, baseKeys[size], null), { - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', }), assert.rejects( subtle.deriveBits(algorithm, baseKeys[size], 15), { - message: /length must be a multiple of 8/ + message: /length must be a multiple of 8/, }), ]); } @@ -476,18 +476,18 @@ async function testDeriveBitsBadHash( subtle.deriveBits( { ...algorithm, - hash: hash.substring(0, 3) + hash.substring(4) + hash: hash.substring(0, 3) + hash.substring(4), }, baseKeys[size], 256), { - message: /Unrecognized name/ + message: /Unrecognized name/, }), assert.rejects( subtle.deriveBits( { ...algorithm, - hash: 'HKDF' + hash: 'HKDF', }, baseKeys[size], 256), { - message: /Unrecognized name/ + message: /Unrecognized name/, }), ]); } @@ -502,12 +502,12 @@ async function testDeriveBitsBadUsage( name: 'PBKDF2', salt: Buffer.from(kSalts[saltSize], 'hex'), iterations, - hash + hash, }; return assert.rejects( subtle.deriveBits(algorithm, noBits[size], 256), { - message: /baseKey does not have deriveBits usage/ + message: /baseKey does not have deriveBits usage/, }); } @@ -524,7 +524,7 @@ async function testDeriveKey( name: 'PBKDF2', salt: Buffer.from(kSalts[saltSize], 'hex'), hash, - iterations + iterations, }; const key = await subtle.deriveKey( @@ -558,7 +558,7 @@ async function testDeriveKeyBadHash( subtle.deriveKey( { ...algorithm, - hash: hash.substring(0, 3) + hash.substring(4) + hash: hash.substring(0, 3) + hash.substring(4), }, baseKeys[size], keyType, @@ -569,7 +569,7 @@ async function testDeriveKeyBadHash( subtle.deriveKey( { ...algorithm, - hash: 'HKDF' + hash: 'HKDF', }, baseKeys[size], keyType, @@ -591,12 +591,12 @@ async function testDeriveKeyBadUsage( name: 'PBKDF2', salt: Buffer.from(kSalts[saltSize], 'hex'), iterations, - hash + hash, }; return assert.rejects( subtle.deriveKey(algorithm, noKey[size], keyType, true, usages), { - message: /baseKey does not have deriveKey usage/ + message: /baseKey does not have deriveKey usage/, }); } @@ -612,12 +612,12 @@ async function testWrongKeyType( name: 'PBKDF2', salt: Buffer.from(kSalts[saltSize], 'hex'), iterations, - hash + hash, }; return assert.rejects( subtle.deriveKey(algorithm, wrongKey, keyType, true, usages), { - message: /Key algorithm mismatch/ + message: /Key algorithm mismatch/, }); } @@ -626,7 +626,7 @@ async function testWrongKeyType( baseKeys, noBits, noKey, - wrongKey + wrongKey, } = await setupBaseKeys(); const variations = []; diff --git a/test/pummel/test-worker-take-heapsnapshot.js b/test/pummel/test-worker-take-heapsnapshot.js index 71f1782fe58d1d..41c796b735225c 100644 --- a/test/pummel/test-worker-take-heapsnapshot.js +++ b/test/pummel/test-worker-take-heapsnapshot.js @@ -15,7 +15,7 @@ const { once } = require('events'); { children: [ { node_name: 'Node / MessagePortData', edge_name: 'data' }, - ] + ], }, ], { loose: true }); await w.terminate(); diff --git a/test/report/test-report-config.js b/test/report/test-report-config.js index a8c0f70691e63f..dce58c5bfcd954 100644 --- a/test/report/test-report-config.js +++ b/test/report/test-report-config.js @@ -76,13 +76,13 @@ if (!common.isWindows) { process.report.signal = 'foo'; }, { code: 'ERR_UNKNOWN_SIGNAL', - message: 'Unknown signal: foo' + message: 'Unknown signal: foo', }); assert.throws(() => { process.report.signal = 'sigusr1'; }, { code: 'ERR_UNKNOWN_SIGNAL', - message: 'Unknown signal: sigusr1 (signals must use all capital letters)' + message: 'Unknown signal: sigusr1 (signals must use all capital letters)', }); assert.strictEqual(process.report.signal, 'SIGUSR2'); process.report.signal = 'SIGUSR1'; diff --git a/test/sequential/test-child-process-exit.js b/test/sequential/test-child-process-exit.js index 318b6451dd4e30..54dc6c1c90f984 100644 --- a/test/sequential/test-child-process-exit.js +++ b/test/sequential/test-child-process-exit.js @@ -40,7 +40,7 @@ if (gen === maxGen) { } const child = ch.spawn(process.execPath, [__filename, gen + 1], { - stdio: [ 'ignore', 'pipe', 'ignore' ] + stdio: [ 'ignore', 'pipe', 'ignore' ], }); assert.ok(!child.stdin); assert.ok(child.stdout); diff --git a/test/sequential/test-cluster-inspect-brk.js b/test/sequential/test-cluster-inspect-brk.js index fbae27f9ba4eb4..c512a3b0e958cb 100644 --- a/test/sequential/test-cluster-inspect-brk.js +++ b/test/sequential/test-cluster-inspect-brk.js @@ -14,7 +14,7 @@ if (cluster.isPrimary) { cluster.setupPrimary({ execArgv: execArgv, - stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe'] + stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe'], }); const worker = cluster.fork(); diff --git a/test/sequential/test-cpu-prof-default.js b/test/sequential/test-cpu-prof-default.js index 12c4bc05bb9c3c..efd929469a6a32 100644 --- a/test/sequential/test-cpu-prof-default.js +++ b/test/sequential/test-cpu-prof-default.js @@ -15,7 +15,7 @@ const { spawnSync } = require('child_process'); const tmpdir = require('../common/tmpdir'); const { getCpuProfiles, - env + env, } = require('../common/cpu-prof'); { @@ -25,7 +25,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-dir-absolute.js b/test/sequential/test-cpu-prof-dir-absolute.js index ad0842dbc4c4fc..4a4cf46f32e55b 100644 --- a/test/sequential/test-cpu-prof-dir-absolute.js +++ b/test/sequential/test-cpu-prof-dir-absolute.js @@ -16,7 +16,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); // relative --cpu-prof-dir @@ -32,7 +32,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-dir-and-name.js b/test/sequential/test-cpu-prof-dir-and-name.js index 7ce775ebc16973..eb5fcae53b10fd 100644 --- a/test/sequential/test-cpu-prof-dir-and-name.js +++ b/test/sequential/test-cpu-prof-dir-and-name.js @@ -16,7 +16,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); { @@ -34,7 +34,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-dir-relative.js b/test/sequential/test-cpu-prof-dir-relative.js index 2d679959efdebd..1953d11bd9cb99 100644 --- a/test/sequential/test-cpu-prof-dir-relative.js +++ b/test/sequential/test-cpu-prof-dir-relative.js @@ -16,7 +16,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); // relative --cpu-prof-dir @@ -31,7 +31,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-dir-worker.js b/test/sequential/test-cpu-prof-dir-worker.js index fe72af7416d813..ab6996f829d6a9 100644 --- a/test/sequential/test-cpu-prof-dir-worker.js +++ b/test/sequential/test-cpu-prof-dir-worker.js @@ -16,7 +16,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - getFrames + getFrames, } = require('../common/cpu-prof'); // --cpu-prof-dir with worker @@ -31,7 +31,7 @@ const { fixtures.path('workload', 'fibonacci-worker.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-drained.js b/test/sequential/test-cpu-prof-drained.js index 5be4d1a919eec0..d71255a6a75fb5 100644 --- a/test/sequential/test-cpu-prof-drained.js +++ b/test/sequential/test-cpu-prof-drained.js @@ -16,7 +16,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); { @@ -28,7 +28,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-exit.js b/test/sequential/test-cpu-prof-exit.js index 34b1acff4b8f99..403af352dfeea5 100644 --- a/test/sequential/test-cpu-prof-exit.js +++ b/test/sequential/test-cpu-prof-exit.js @@ -15,7 +15,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); { @@ -27,7 +27,7 @@ const { fixtures.path('workload', 'fibonacci-exit.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 55) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-invalid-options.js b/test/sequential/test-cpu-prof-invalid-options.js index b5f7619cdac0d8..61946dc56dc011 100644 --- a/test/sequential/test-cpu-prof-invalid-options.js +++ b/test/sequential/test-cpu-prof-invalid-options.js @@ -12,7 +12,7 @@ const { spawnSync } = require('child_process'); const tmpdir = require('../common/tmpdir'); const { kCpuProfInterval, - env + env, } = require('../common/cpu-prof'); // --cpu-prof-name without --cpu-prof @@ -24,7 +24,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); const stderr = output.stderr.toString().trim(); if (output.status !== 9) { @@ -45,7 +45,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); const stderr = output.stderr.toString().trim(); if (output.status !== 9) { @@ -66,7 +66,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); const stderr = output.stderr.toString().trim(); if (output.status !== 9) { diff --git a/test/sequential/test-cpu-prof-kill.js b/test/sequential/test-cpu-prof-kill.js index cee66a62569bc8..8d37e7fbfa53b2 100644 --- a/test/sequential/test-cpu-prof-kill.js +++ b/test/sequential/test-cpu-prof-kill.js @@ -15,7 +15,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); { @@ -27,7 +27,7 @@ const { fixtures.path('workload', 'fibonacci-sigint.js'), ], { cwd: tmpdir.path, - env + env, }); if (!common.isWindows) { if (output.signal !== 'SIGINT') { diff --git a/test/sequential/test-cpu-prof-name.js b/test/sequential/test-cpu-prof-name.js index 58d9a0ec15862f..6ede26a3900e52 100644 --- a/test/sequential/test-cpu-prof-name.js +++ b/test/sequential/test-cpu-prof-name.js @@ -16,7 +16,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); // --cpu-prof-name @@ -32,7 +32,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-worker-argv.js b/test/sequential/test-cpu-prof-worker-argv.js index ad88a2eeb08f0d..37af0b95b7ea42 100644 --- a/test/sequential/test-cpu-prof-worker-argv.js +++ b/test/sequential/test-cpu-prof-worker-argv.js @@ -14,7 +14,7 @@ const tmpdir = require('../common/tmpdir'); const { getCpuProfiles, kCpuProfInterval, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); { @@ -25,8 +25,8 @@ const { cwd: tmpdir.path, env: { ...process.env, - CPU_PROF_INTERVAL: kCpuProfInterval - } + CPU_PROF_INTERVAL: kCpuProfInterval, + }, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-crypto-timing-safe-equal.js b/test/sequential/test-crypto-timing-safe-equal.js index a8bd3abf4cf1ae..23496d8d1ccd99 100644 --- a/test/sequential/test-crypto-timing-safe-equal.js +++ b/test/sequential/test-crypto-timing-safe-equal.js @@ -37,7 +37,7 @@ assert.throws( { code: 'ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH', name: 'RangeError', - message: 'Input buffers must have the same byte length' + message: 'Input buffers must have the same byte length', } ); diff --git a/test/sequential/test-diagnostic-dir-cpu-prof.js b/test/sequential/test-diagnostic-dir-cpu-prof.js index 396a6ca7de0595..0482811d49674b 100644 --- a/test/sequential/test-diagnostic-dir-cpu-prof.js +++ b/test/sequential/test-diagnostic-dir-cpu-prof.js @@ -17,7 +17,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); // Test --diagnostic-dir changes the default for --cpu-prof @@ -34,7 +34,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -63,7 +63,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-diagnostic-dir-heap-prof.js b/test/sequential/test-diagnostic-dir-heap-prof.js index 10ce58f72b1d4b..ef3f164b982f32 100644 --- a/test/sequential/test-diagnostic-dir-heap-prof.js +++ b/test/sequential/test-diagnostic-dir-heap-prof.js @@ -53,7 +53,7 @@ const TEST_ALLOCATION = kHeapProfInterval * 2; const env = { ...process.env, TEST_ALLOCATION, - NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' + NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER', }; function getHeapProfiles(dir) { @@ -76,7 +76,7 @@ function getHeapProfiles(dir) { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -104,7 +104,7 @@ function getHeapProfiles(dir) { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-gc-http-client.js b/test/sequential/test-gc-http-client.js index 2eea09652a50d9..8f39890df2254e 100644 --- a/test/sequential/test-gc-http-client.js +++ b/test/sequential/test-gc-http-client.js @@ -31,7 +31,7 @@ function getall() { const req = http.get({ hostname: 'localhost', pathname: '/', - port: server.address().port + port: server.address().port, }, cb); count++; diff --git a/test/sequential/test-heap-prof.js b/test/sequential/test-heap-prof.js index cf70fa926091a6..3eaf30d314ad62 100644 --- a/test/sequential/test-heap-prof.js +++ b/test/sequential/test-heap-prof.js @@ -63,7 +63,7 @@ const TEST_ALLOCATION = kHeapProfInterval * 2; const env = { ...process.env, TEST_ALLOCATION, - NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' + NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER', }; // Test --heap-prof without --heap-prof-interval. Here we just verify that @@ -75,7 +75,7 @@ const env = { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -97,7 +97,7 @@ const env = { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -119,7 +119,7 @@ const env = { fixtures.path('workload', 'allocation-exit.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 55) { console.log(output.stderr.toString()); @@ -140,7 +140,7 @@ const env = { fixtures.path('workload', 'allocation-sigint.js'), ], { cwd: tmpdir.path, - env + env, }); if (!common.isWindows) { if (output.signal !== 'SIGINT') { @@ -162,8 +162,8 @@ const env = { cwd: tmpdir.path, env: { ...process.env, - HEAP_PROF_INTERVAL: '128' - } + HEAP_PROF_INTERVAL: '128', + }, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -183,7 +183,7 @@ const env = { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); const stderr = output.stderr.toString().trim(); if (output.status !== 9) { @@ -204,7 +204,7 @@ const env = { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); const stderr = output.stderr.toString().trim(); if (output.status !== 9) { @@ -225,7 +225,7 @@ const env = { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); const stderr = output.stderr.toString().trim(); if (output.status !== 9) { @@ -251,7 +251,7 @@ const env = { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -274,7 +274,7 @@ const env = { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -300,7 +300,7 @@ const env = { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -328,7 +328,7 @@ const env = { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -351,7 +351,7 @@ const env = { fixtures.path('workload', 'allocation-worker.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-heapdump.js b/test/sequential/test-heapdump.js index 61a089dc677b70..e64f191854b24f 100644 --- a/test/sequential/test-heapdump.js +++ b/test/sequential/test-heapdump.js @@ -30,7 +30,7 @@ process.chdir(tmpdir.path); name: 'TypeError', message: 'The "path" argument must be of type string or an instance of ' + 'Buffer or URL.' + - common.invalidArgTypeHelper(i) + common.invalidArgTypeHelper(i), }); }); diff --git a/test/sequential/test-http-econnrefused.js b/test/sequential/test-http-econnrefused.js index 5650e7430859ca..a1f97ee5638dd3 100644 --- a/test/sequential/test-http-econnrefused.js +++ b/test/sequential/test-http-econnrefused.js @@ -107,7 +107,7 @@ function ping() { const opt = { port: common.PORT, path: '/ping', - method: 'POST' + method: 'POST', }; const req = http.request(opt, function(res) { diff --git a/test/sequential/test-http-keep-alive-large-write.js b/test/sequential/test-http-keep-alive-large-write.js index 4119c2353daa53..3132d6b6a7463c 100644 --- a/test/sequential/test-http-keep-alive-large-write.js +++ b/test/sequential/test-http-keep-alive-large-write.js @@ -17,7 +17,7 @@ const server = http.createServer(common.mustCall((req, res) => { res.writeHead(200, { 'Content-Type': 'application/octet-stream', 'Content-Length': content.length.toString(), - 'Vary': 'Accept-Encoding' + 'Vary': 'Accept-Encoding', }); socket = res.socket; @@ -36,7 +36,7 @@ server.on('timeout', () => { server.listen(0, common.mustCall(() => { http.get({ path: '/', - port: server.address().port + port: server.address().port, }, (res) => { res.once('data', () => { socket._onTimeout(); diff --git a/test/sequential/test-http-keepalive-maxsockets.js b/test/sequential/test-http-keepalive-maxsockets.js index 9c98a140f6a134..57cb3d34e8a93b 100644 --- a/test/sequential/test-http-keepalive-maxsockets.js +++ b/test/sequential/test-http-keepalive-maxsockets.js @@ -37,7 +37,7 @@ server.listen(0, function() { const agent = http.Agent({ keepAlive: true, maxSockets: 5, - maxFreeSockets: 2 + maxFreeSockets: 2, }); let closed = false; @@ -85,7 +85,7 @@ server.listen(0, function() { http.request({ port: server.address().port, path: `/${i}`, - agent: agent + agent: agent, }, function(res) { let data = ''; res.setEncoding('ascii'); diff --git a/test/sequential/test-http-max-sockets.js b/test/sequential/test-http-max-sockets.js index 24629448f7ac77..e10d59f7444462 100644 --- a/test/sequential/test-http-max-sockets.js +++ b/test/sequential/test-http-max-sockets.js @@ -46,7 +46,7 @@ server.listen(common.PORT, '127.0.0.1', function() { for (let i = 0; i < N; i++) { const options = { host: '127.0.0.1', - port: common.PORT + port: common.PORT, }; const req = http.get(options, function(res) { diff --git a/test/sequential/test-http-server-keep-alive-timeout-slow-server.js b/test/sequential/test-http-server-keep-alive-timeout-slow-server.js index 1543c1415fa5e9..547aac9ff935ca 100644 --- a/test/sequential/test-http-server-keep-alive-timeout-slow-server.js +++ b/test/sequential/test-http-server-keep-alive-timeout-slow-server.js @@ -18,7 +18,7 @@ server.keepAliveTimeout = common.platformTimeout(200); const agent = new http.Agent({ keepAlive: true, - maxSockets: 1 + maxSockets: 1, }); function request(path, callback) { diff --git a/test/sequential/test-http2-max-session-memory.js b/test/sequential/test-http2-max-session-memory.js index 9b77a45c3227fd..2655c5934554af 100644 --- a/test/sequential/test-http2-max-session-memory.js +++ b/test/sequential/test-http2-max-session-memory.js @@ -34,7 +34,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM' + message: 'Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM', })); req.on('close', common.mustCall(() => { server.close(); diff --git a/test/sequential/test-http2-timeout-large-write-file.js b/test/sequential/test-http2-timeout-large-write-file.js index 520958bd57f6d4..06c28db8e2d9e5 100644 --- a/test/sequential/test-http2-timeout-large-write-file.js +++ b/test/sequential/test-http2-timeout-large-write-file.js @@ -37,13 +37,13 @@ process.on('beforeExit', () => fs.closeSync(fd)); const server = http2.createSecureServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }); server.on('stream', common.mustCall((stream) => { stream.respondWithFD(fd, { 'Content-Type': 'application/octet-stream', 'Content-Length': content.length.toString(), - 'Vary': 'Accept-Encoding' + 'Vary': 'Accept-Encoding', }); stream.end(); })); diff --git a/test/sequential/test-http2-timeout-large-write.js b/test/sequential/test-http2-timeout-large-write.js index 73114776df0a0e..9e36a231672dd7 100644 --- a/test/sequential/test-http2-timeout-large-write.js +++ b/test/sequential/test-http2-timeout-large-write.js @@ -26,7 +26,7 @@ let didReceiveData = false; const server = http2.createSecureServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }); server.on('stream', common.mustCall((stream) => { const content = Buffer.alloc(writeSize, 0x44); @@ -34,7 +34,7 @@ server.on('stream', common.mustCall((stream) => { stream.respond({ 'Content-Type': 'application/octet-stream', 'Content-Length': content.length.toString(), - 'Vary': 'Accept-Encoding' + 'Vary': 'Accept-Encoding', }); stream.write(content); diff --git a/test/sequential/test-https-server-keep-alive-timeout.js b/test/sequential/test-https-server-keep-alive-timeout.js index 5ded520dc7aaf8..d0e29ad28500dc 100644 --- a/test/sequential/test-https-server-keep-alive-timeout.js +++ b/test/sequential/test-https-server-keep-alive-timeout.js @@ -13,7 +13,7 @@ const tests = []; const serverOptions = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; function test(fn) { @@ -45,7 +45,7 @@ test(function serverKeepAliveTimeoutWithPipeline(cb) { const options = { port: server.address().port, allowHalfOpen: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; const c = tls.connect(options, () => { c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); @@ -68,7 +68,7 @@ test(function serverNoEndKeepAliveTimeoutWithPipeline(cb) { const options = { port: server.address().port, allowHalfOpen: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; const c = tls.connect(options, () => { c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); diff --git a/test/sequential/test-inspector-console.js b/test/sequential/test-inspector-console.js index 33cd913efb2cec..7cf23d9d82c421 100644 --- a/test/sequential/test-inspector-console.js +++ b/test/sequential/test-inspector-console.js @@ -27,7 +27,7 @@ async function runTest() { assert.strictEqual(msg.params.type, 'log'); assert.deepStrictEqual(msg.params.args, [{ type: 'string', - value: 'hello world' + value: 'hello world', }]); assert.strictEqual(out, ''); diff --git a/test/sequential/test-inspector-contexts.js b/test/sequential/test-inspector-contexts.js index 9cdf2d0017c4be..34a1a1bcd97aa2 100644 --- a/test/sequential/test-inspector-contexts.js +++ b/test/sequential/test-inspector-contexts.js @@ -84,7 +84,7 @@ async function testContextCreatedAndDestroyed() { vm.runInNewContext('1 + 1', {}, { contextName: 'Custom context', - contextOrigin: 'https://origin.example' + contextOrigin: 'https://origin.example', }); const contextCreated = await vmContextCreatedPromise; diff --git a/test/sequential/test-inspector-enabled.js b/test/sequential/test-inspector-enabled.js index f14e7c17d817c5..7305785a3d32fe 100644 --- a/test/sequential/test-inspector-enabled.js +++ b/test/sequential/test-inspector-enabled.js @@ -22,7 +22,7 @@ assert( const args = ['--inspect', '-e', script]; const child = spawn(process.execPath, args, { stdio: 'inherit', - env: { ...process.env, NODE_V8_COVERAGE: '' } + env: { ...process.env, NODE_V8_COVERAGE: '' }, }); child.on('exit', (code, signal) => { process.exit(code || signal); diff --git a/test/sequential/test-inspector-open.js b/test/sequential/test-inspector-open.js index 190a99e7282e52..6853b98989be8b 100644 --- a/test/sequential/test-inspector-open.js +++ b/test/sequential/test-inspector-open.js @@ -103,7 +103,7 @@ function beChild() { assert.throws(() => { inspector.open(0, false, undefined); }, { - code: 'ERR_INSPECTOR_ALREADY_ACTIVATED' + code: 'ERR_INSPECTOR_ALREADY_ACTIVATED', }); } else if (msg.args[0] === kReOpen) { inspector.open(0, false, undefined); diff --git a/test/sequential/test-inspector-port-cluster.js b/test/sequential/test-inspector-port-cluster.js index 510249b739dfb7..de5484e8c5e784 100644 --- a/test/sequential/test-inspector-port-cluster.js +++ b/test/sequential/test-inspector-port-cluster.js @@ -20,7 +20,7 @@ let offset = 0; function testRunnerMain() { let defaultPortCase = spawnPrimary({ execArgv: ['--inspect'], - workers: [{ expectedPort: 9230 }] + workers: [{ expectedPort: 9230 }], }); spawnPrimary({ @@ -30,7 +30,7 @@ function testRunnerMain() { { expectedPort: 1024 }, { expectedPort: 1025 }, { expectedPort: 1026 }, - ] + ], }); let port = debuggerPort + offset++ * 5; @@ -41,35 +41,35 @@ function testRunnerMain() { { expectedPort: port + 1 }, { expectedPort: port + 2 }, { expectedPort: port + 3 }, - ] + ], }); port = debuggerPort + offset++ * 5; spawnPrimary({ execArgv: ['--inspect', `--inspect-port=${port}`], - workers: [{ expectedPort: port + 1 }] + workers: [{ expectedPort: port + 1 }], }); port = debuggerPort + offset++ * 5; spawnPrimary({ execArgv: ['--inspect', `--debug-port=${port}`], - workers: [{ expectedPort: port + 1 }] + workers: [{ expectedPort: port + 1 }], }); port = debuggerPort + offset++ * 5; spawnPrimary({ execArgv: [`--inspect=0.0.0.0:${port}`], - workers: [{ expectedPort: port + 1, expectedHost: '0.0.0.0' }] + workers: [{ expectedPort: port + 1, expectedHost: '0.0.0.0' }], }); port = debuggerPort + offset++ * 5; spawnPrimary({ execArgv: [`--inspect=127.0.0.1:${port}`], - workers: [{ expectedPort: port + 1, expectedHost: '127.0.0.1' }] + workers: [{ expectedPort: port + 1, expectedHost: '127.0.0.1' }], }); if (common.hasIPv6) { @@ -77,14 +77,14 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=[::]:${port}`], - workers: [{ expectedPort: port + 1, expectedHost: '::' }] + workers: [{ expectedPort: port + 1, expectedHost: '::' }], }); port = debuggerPort + offset++ * 5; spawnPrimary({ execArgv: [`--inspect=[::1]:${port}`], - workers: [{ expectedPort: port + 1, expectedHost: '::1' }] + workers: [{ expectedPort: port + 1, expectedHost: '::1' }], }); } @@ -96,7 +96,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: port + 2 }, - workers: [{ expectedPort: port + 2 }] + workers: [{ expectedPort: port + 2 }], }); port = debuggerPort + offset++ * 5; @@ -107,7 +107,7 @@ function testRunnerMain() { workers: [ { expectedPort: port + 2 }, { expectedPort: port + 4 }, - ] + ], }); port = debuggerPort + offset++ * 5; @@ -115,7 +115,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'string' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -123,7 +123,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'null' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -131,7 +131,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'bignumber' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -139,7 +139,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'negativenumber' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -147,7 +147,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'bignumberfunc' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -155,7 +155,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'strfunc' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -165,7 +165,7 @@ function testRunnerMain() { clusterSettings: { inspectPort: port, execArgv: ['--inspect'] }, workers: [ { expectedPort: port }, - ] + ], }); port = debuggerPort + offset++ * 5; @@ -177,7 +177,7 @@ function testRunnerMain() { { expectedInitialPort: 0 }, { expectedInitialPort: 0 }, { expectedInitialPort: 0 }, - ] + ], }); port = debuggerPort + offset++ * 5; @@ -189,7 +189,7 @@ function testRunnerMain() { { expectedInitialPort: 0 }, { expectedInitialPort: 0 }, { expectedInitialPort: 0 }, - ] + ], }); defaultPortCase.then(() => { @@ -199,7 +199,7 @@ function testRunnerMain() { clusterSettings: { inspectPort: port + 2 }, workers: [ { expectedInitialPort: port + 2 }, - ] + ], }); }); } @@ -331,7 +331,7 @@ function spawnPrimary({ execArgv, workers, clusterSettings = {} }) { workers: JSON.stringify(workers), clusterSettings: JSON.stringify(clusterSettings), testProcess: true }, - execArgv: execArgv.concat(['--expose-internals']) + execArgv: execArgv.concat(['--expose-internals']), }).on('exit', common.mustCall((code, signal) => { checkExitCode(code, signal); resolve(); diff --git a/test/sequential/test-inspector-runtime-evaluate-with-timeout.js b/test/sequential/test-inspector-runtime-evaluate-with-timeout.js index 84dff6cdd9c3ed..66d3479cc2802a 100644 --- a/test/sequential/test-inspector-runtime-evaluate-with-timeout.js +++ b/test/sequential/test-inspector-runtime-evaluate-with-timeout.js @@ -14,11 +14,11 @@ common.skipIfInspectorDisabled(); await assert.rejects( session.post('Runtime.evaluate', { expression: 'for(;;);', - timeout: 0 + timeout: 0, }), { code: 'ERR_INSPECTOR_COMMAND', - message: 'Inspector error -32000: Execution was terminated' + message: 'Inspector error -32000: Execution was terminated', } ); session.disconnect(); diff --git a/test/sequential/test-inspector.js b/test/sequential/test-inspector.js index 84e0bb1c5e0c44..6fc31dc4b1dd8d 100644 --- a/test/sequential/test-inspector.js +++ b/test/sequential/test-inspector.js @@ -108,8 +108,8 @@ async function testBreakpoint(session) { 'objectId': scopeId, 'ownProperties': false, 'accessorPropertiesOnly': false, - 'generatePreview': true - } + 'generatePreview': true, + }, }); assertScopeValues(response, { t: 1001, k: 1 }); @@ -121,8 +121,8 @@ async function testBreakpoint(session) { 'includeCommandLineAPI': true, 'silent': false, 'returnByValue': false, - 'generatePreview': true - } + 'generatePreview': true, + }, }); const expectedEvaluation = 1002; assert.strictEqual( @@ -133,8 +133,8 @@ async function testBreakpoint(session) { result = (await session.send({ 'method': 'Runtime.evaluate', 'params': { - 'expression': '5 * 5' - } + 'expression': '5 * 5', + }, })).result; const expectedResult = 25; assert.strictEqual( @@ -155,8 +155,8 @@ async function testI18NCharacters(session) { 'includeCommandLineAPI': true, 'silent': false, 'returnByValue': false, - 'generatePreview': true - } + 'generatePreview': true, + }, }); await session.waitForConsoleOutput('log', [chars]); } @@ -174,8 +174,8 @@ async function testCommandLineAPI(session) { { 'method': 'Runtime.evaluate', 'params': { 'expression': 'typeof require("fs").readFile === "function"', - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.strictEqual(result.result.value, true); @@ -189,8 +189,8 @@ async function testCommandLineAPI(session) { 'typeof require.extensions === "object"', 'typeof require.cache === "object"', ].join(' && '), - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.strictEqual(result.result.value, true); @@ -205,8 +205,8 @@ async function testCommandLineAPI(session) { require(${testModuleStr}), { old: 'yes' } ) === require(${testModuleStr})`, - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.strictEqual(result.result.value, true); @@ -217,8 +217,8 @@ async function testCommandLineAPI(session) { 'expression': `JSON.stringify( require.cache[${testModuleStr}].exports )`, - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.deepStrictEqual(JSON.parse(result.result.value), @@ -228,8 +228,8 @@ async function testCommandLineAPI(session) { { 'method': 'Runtime.evaluate', 'params': { 'expression': `delete require.cache[${testModuleStr}]`, - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.strictEqual(result.result.value, true); @@ -238,8 +238,8 @@ async function testCommandLineAPI(session) { { 'method': 'Runtime.evaluate', 'params': { 'expression': `JSON.stringify(require(${testModuleStr}))`, - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.deepStrictEqual(JSON.parse(result.result.value), {}); @@ -248,8 +248,8 @@ async function testCommandLineAPI(session) { { 'method': 'Runtime.evaluate', 'params': { 'expression': `JSON.stringify(require(${printAModuleStr}))`, - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.deepStrictEqual(JSON.parse(result.result.value), {}); @@ -263,13 +263,13 @@ async function testCommandLineAPI(session) { require.cache[${printAModuleStr}].parent, parentId: require.cache[${testModuleStr}].parent.id, })`, - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.deepStrictEqual(JSON.parse(result.result.value), { parentsEqual: true, - parentId: '' + parentId: '', }); // The `require` in the module shadows the command line API's `require` result = await session.send( @@ -280,8 +280,8 @@ async function testCommandLineAPI(session) { require(${printBModuleStr}), require.cache[${printBModuleStr}].parent.id )`, - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.notStrictEqual(result.result.value, diff --git a/test/sequential/test-module-loading.js b/test/sequential/test-module-loading.js index 6fb24f2f0210a9..d383712b8d3b90 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -122,7 +122,7 @@ assert.throws( code: 'MODULE_NOT_FOUND', message: /packages[/\\]missing-main-no-index[/\\]doesnotexist\.js'\. Please.+package\.json.+valid "main"/, path: /fixtures[/\\]packages[/\\]missing-main-no-index[/\\]package\.json/, - requestPath: /^\.\.[/\\]fixtures[/\\]packages[/\\]missing-main-no-index$/ + requestPath: /^\.\.[/\\]fixtures[/\\]packages[/\\]missing-main-no-index$/, } ); @@ -181,7 +181,7 @@ assert.strictEqual(require('../fixtures/registerExt.hello.world').test, console.error('load custom file types that return non-strings'); require.extensions['.test'] = function(module) { module.exports = { - custom: 'passed' + custom: 'passed', }; }; @@ -256,7 +256,7 @@ assert.throws( assert.deepStrictEqual(json, { name: 'package-name', version: '1.2.3', - main: 'package-main-module' + main: 'package-main-module', }); } @@ -278,21 +278,21 @@ assert.throws( assert.deepStrictEqual(children, { 'common/index.js': { - 'common/tmpdir.js': {} + 'common/tmpdir.js': {}, }, 'fixtures/not-main-module.js': {}, 'fixtures/a.js': { 'fixtures/b/c.js': { 'fixtures/b/d.js': {}, - 'fixtures/b/package/index.js': {} - } + 'fixtures/b/package/index.js': {}, + }, }, 'fixtures/foo': {}, 'fixtures/nested-index/one/index.js': { - 'fixtures/nested-index/one/hello.js': {} + 'fixtures/nested-index/one/hello.js': {}, }, 'fixtures/nested-index/two/index.js': { - 'fixtures/nested-index/two/hello.js': {} + 'fixtures/nested-index/two/hello.js': {}, }, 'fixtures/nested-index/three.js': {}, 'fixtures/nested-index/three/index.js': {}, @@ -301,13 +301,13 @@ assert.throws( 'fixtures/packages/main-index/package-main-module/index.js': {}, 'fixtures/packages/missing-main/index.js': {}, 'fixtures/cycles/root.js': { - 'fixtures/cycles/folder/foo.js': {} + 'fixtures/cycles/folder/foo.js': {}, }, 'fixtures/node_modules/foo.js': { 'fixtures/node_modules/baz/index.js': { 'fixtures/node_modules/bar.js': {}, - 'fixtures/node_modules/baz/node_modules/asdf.js': {} - } + 'fixtures/node_modules/baz/node_modules/asdf.js': {}, + }, }, 'fixtures/path.js': {}, 'fixtures/registerExt.test': {}, @@ -322,10 +322,10 @@ assert.throws( 'fixtures/module-load-order/file9/index.reg2': {}, 'fixtures/module-require/parent/index.js': { 'fixtures/module-require/child/index.js': { - 'fixtures/module-require/child/node_modules/target.js': {} - } + 'fixtures/module-require/child/node_modules/target.js': {}, + }, }, - 'fixtures/packages/main/package.json': {} + 'fixtures/packages/main/package.json': {}, }); } diff --git a/test/sequential/test-net-GH-5504.js b/test/sequential/test-net-GH-5504.js index ebe987d0443b6c..3bdd76b6260f8e 100644 --- a/test/sequential/test-net-GH-5504.js +++ b/test/sequential/test-net-GH-5504.js @@ -61,7 +61,7 @@ function client() { const net = require('net'); const client = net.connect({ host: common.localhostIPv4, - port: common.PORT + port: common.PORT, }, function() { client.destroy(); }); @@ -73,8 +73,8 @@ function parent() { const s = spawn(node, [__filename, 'server'], { env: Object.assign(process.env, { - NODE_DEBUG: 'net' - }) + NODE_DEBUG: 'net', + }), }); wrap(s.stderr, process.stderr, 'SERVER 2>'); diff --git a/test/sequential/test-net-connect-local-error.js b/test/sequential/test-net-connect-local-error.js index 030c4de750cb4d..6702c2fb6c0f97 100644 --- a/test/sequential/test-net-connect-local-error.js +++ b/test/sequential/test-net-connect-local-error.js @@ -10,7 +10,7 @@ const expectedErrorCodes = ['ECONNREFUSED', 'EADDRINUSE']; const optionsIPv4 = { port: common.PORT, localPort: common.PORT + 1, - localAddress: common.localhostIPv4 + localAddress: common.localhostIPv4, }; const optionsIPv6 = { diff --git a/test/sequential/test-net-listen-shared-ports.js b/test/sequential/test-net-listen-shared-ports.js index e902d5387d6915..34091cba15cac6 100644 --- a/test/sequential/test-net-listen-shared-ports.js +++ b/test/sequential/test-net-listen-shared-ports.js @@ -55,7 +55,7 @@ if (cluster.isPrimary) { server1.listen({ host: 'localhost', port: common.PORT, - exclusive: false + exclusive: false, }, common.mustCall(function() { server2.listen({ port: common.PORT + 1, exclusive: true }, common.mustCall(function() { diff --git a/test/sequential/test-next-tick-error-spin.js b/test/sequential/test-next-tick-error-spin.js index 071a017877217a..d3ee6dbd01c6d8 100644 --- a/test/sequential/test-next-tick-error-spin.js +++ b/test/sequential/test-next-tick-error-spin.js @@ -26,7 +26,7 @@ const assert = require('assert'); if (process.argv[2] !== 'child') { const spawn = require('child_process').spawn; const child = spawn(process.execPath, [__filename, 'child'], { - stdio: 'pipe'// 'inherit' + stdio: 'pipe', // 'inherit' }); const timer = setTimeout(function() { throw new Error('child is hung'); diff --git a/test/sequential/test-perf-hooks.js b/test/sequential/test-perf-hooks.js index d0ee0f5aad04c8..457a6197cd9697 100644 --- a/test/sequential/test-perf-hooks.js +++ b/test/sequential/test-perf-hooks.js @@ -50,7 +50,7 @@ checkNodeTiming({ bootstrapComplete: { around: inited, delay: 2500 }, environment: { around: 0 }, loopStart: -1, - loopExit: -1 + loopExit: -1, }); setTimeout(() => { @@ -64,7 +64,7 @@ setTimeout(() => { bootstrapComplete: { around: inited, delay: 2500 }, environment: { around: 0 }, loopStart: { around: inited, delay: 2500 }, - loopExit: -1 + loopExit: -1, }); }, 1000); @@ -79,6 +79,6 @@ process.on('exit', () => { bootstrapComplete: { around: inited, delay: 2500 }, environment: { around: 0 }, loopStart: { around: inited, delay: 2500 }, - loopExit: { around: performance.now() } + loopExit: { around: performance.now() }, }); }); diff --git a/test/sequential/test-performance-eventloopdelay.js b/test/sequential/test-performance-eventloopdelay.js index f262e9de3fe6cb..60f9cb8734b98f 100644 --- a/test/sequential/test-performance-eventloopdelay.js +++ b/test/sequential/test-performance-eventloopdelay.js @@ -4,7 +4,7 @@ const common = require('../common'); const assert = require('assert'); const { - monitorEventLoopDelay + monitorEventLoopDelay, } = require('perf_hooks'); const { sleep } = require('internal/util'); @@ -24,7 +24,7 @@ const { sleep } = require('internal/util'); () => monitorEventLoopDelay(i), { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); }); @@ -34,7 +34,7 @@ const { sleep } = require('internal/util'); () => monitorEventLoopDelay({ resolution: i }), { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); }); @@ -44,7 +44,7 @@ const { sleep } = require('internal/util'); () => monitorEventLoopDelay({ resolution: i }), { name: 'RangeError', - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', } ); }); @@ -82,7 +82,7 @@ const { sleep } = require('internal/util'); () => histogram.percentile(i), { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); }); @@ -91,7 +91,7 @@ const { sleep } = require('internal/util'); () => histogram.percentile(i), { name: 'RangeError', - code: 'ERR_INVALID_ARG_VALUE' + code: 'ERR_INVALID_ARG_VALUE', } ); }); diff --git a/test/sequential/test-pipe.js b/test/sequential/test-pipe.js index c3e0ddef9fe57d..a35bcaab0df3a0 100644 --- a/test/sequential/test-pipe.js +++ b/test/sequential/test-pipe.js @@ -97,7 +97,7 @@ function startClient() { port: common.PORT, method: 'GET', path: '/', - headers: { 'content-length': buffer.length } + headers: { 'content-length': buffer.length }, }, common.mustCall((res) => { res.setEncoding('utf8'); res.on('data', common.mustCall((string) => { diff --git a/test/sequential/test-repl-timeout-throw.js b/test/sequential/test-repl-timeout-throw.js index f788ab295ba9eb..9c53f54b629162 100644 --- a/test/sequential/test-repl-timeout-throw.js +++ b/test/sequential/test-repl-timeout-throw.js @@ -5,7 +5,7 @@ const assert = require('assert'); const spawn = require('child_process').spawn; const child = spawn(process.execPath, [ '-i' ], { - stdio: [null, null, 2] + stdio: [null, null, 2], }); let stdout = ''; diff --git a/test/sequential/test-tls-connect.js b/test/sequential/test-tls-connect.js index 5cfec7ed04707d..189b9afa6352bb 100644 --- a/test/sequential/test-tls-connect.js +++ b/test/sequential/test-tls-connect.js @@ -55,7 +55,7 @@ const tls = require('tls'); cert: cert, key: key, port: common.PORT, - ciphers: 'rick-128-roll' + ciphers: 'rick-128-roll', }, common.mustNotCall()); }, /no cipher match/i); } diff --git a/test/sequential/test-tls-lookup.js b/test/sequential/test-tls-lookup.js index dcdd9724e3c070..c57cd3d42bd890 100644 --- a/test/sequential/test-tls-lookup.js +++ b/test/sequential/test-tls-lookup.js @@ -10,14 +10,14 @@ const tls = require('tls'); const opts = { host: 'localhost', port: common.PORT, - lookup: input + lookup: input, }; assert.throws(() => { tls.connect(opts); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -27,7 +27,7 @@ function connectDoesNotThrow(input) { const opts = { host: 'localhost', port: common.PORT, - lookup: input + lookup: input, }; tls.connect(opts); diff --git a/test/sequential/test-tls-psk-client.js b/test/sequential/test-tls-psk-client.js index af9629dab9dc23..b19919c417e836 100644 --- a/test/sequential/test-tls-psk-client.js +++ b/test/sequential/test-tls-psk-client.js @@ -76,10 +76,10 @@ function runClient(message, cb) { if (hint === null || hint === IDENTITY) { return { identity: IDENTITY, - psk: Buffer.from(KEY, 'hex') + psk: Buffer.from(KEY, 'hex'), }; } - } + }, }); s.on('secureConnect', common.mustCall(() => { let data = ''; diff --git a/test/sequential/test-tls-session-timeout.js b/test/sequential/test-tls-session-timeout.js index 86a29eed46fe73..45c82dbac58901 100644 --- a/test/sequential/test-tls-session-timeout.js +++ b/test/sequential/test-tls-session-timeout.js @@ -84,7 +84,7 @@ function doTest() { '-sess_out', sessionFileName, ]; const client = spawn(common.opensslCli, flags, { - stdio: ['ignore', 'pipe', 'ignore'] + stdio: ['ignore', 'pipe', 'ignore'], }); let clientOutput = ''; diff --git a/test/sequential/test-util-debug.js b/test/sequential/test-util-debug.js index f8be25f6f880b8..6d1e0aae02f8a5 100644 --- a/test/sequential/test-util-debug.js +++ b/test/sequential/test-util-debug.js @@ -63,8 +63,8 @@ function test(environ, shouldWrite, section, forceColors = false) { const child = spawn(process.execPath, [__filename, 'child', section], { env: Object.assign(process.env, { NODE_DEBUG: environ, - FORCE_COLOR: forceColors ? 'true' : 'false' - }) + FORCE_COLOR: forceColors ? 'true' : 'false', + }), }); if (shouldWrite) { @@ -115,7 +115,7 @@ function child(section) { const tty = require('tty'); // Make sure we check for colors, no matter of the stream's default. Object.defineProperty(process.stderr, 'hasColors', { - value: tty.WriteStream.prototype.hasColors + value: tty.WriteStream.prototype.hasColors, }); // eslint-disable-next-line no-restricted-syntax const debug = util.debuglog(section, common.mustCall((cb) => { diff --git a/test/sequential/test-vm-timeout-escape-promise-module-2.js b/test/sequential/test-vm-timeout-escape-promise-module-2.js index 6a9d09890ddef0..7038c65e218ae3 100644 --- a/test/sequential/test-vm-timeout-escape-promise-module-2.js +++ b/test/sequential/test-vm-timeout-escape-promise-module-2.js @@ -31,12 +31,12 @@ assert.rejects(async () => { { context: vm.createContext({ hrtime, - loop - }, { microtaskMode: 'afterEvaluate' }) + loop, + }, { microtaskMode: 'afterEvaluate' }), }); await module.link(common.mustNotCall()); await module.evaluate({ timeout: 10 }); }, { code: 'ERR_SCRIPT_EXECUTION_TIMEOUT', - message: 'Script execution timed out after 10ms' + message: 'Script execution timed out after 10ms', }); diff --git a/test/tick-processor/test-tick-processor-builtin.js b/test/tick-processor/test-tick-processor-builtin.js index 1f38abe08c32e2..f0eb1d515e3b4a 100644 --- a/test/tick-processor/test-tick-processor-builtin.js +++ b/test/tick-processor/test-tick-processor-builtin.js @@ -17,5 +17,5 @@ base.runTest({ this.ts = Date.now(); setImmediate(function() { new f(); }); }; - f();` + f();`, }); diff --git a/test/tick-processor/test-tick-processor-cpp-core.js b/test/tick-processor/test-tick-processor-cpp-core.js index e76d99ab09db7b..d29bc23e2640d5 100644 --- a/test/tick-processor/test-tick-processor-cpp-core.js +++ b/test/tick-processor/test-tick-processor-cpp-core.js @@ -17,5 +17,5 @@ base.runTest({ require('vm').createContext({}); setImmediate(function() { f(); }); }; - f();` + f();`, }); diff --git a/test/tick-processor/test-tick-processor-polyfill-brokenfile.js b/test/tick-processor/test-tick-processor-polyfill-brokenfile.js index 98cbf5bb414789..14405453bcff19 100644 --- a/test/tick-processor/test-tick-processor-polyfill-brokenfile.js +++ b/test/tick-processor/test-tick-processor-polyfill-brokenfile.js @@ -39,7 +39,7 @@ const proc = spawn(process.execPath, [ '--prof', '-pe', code, ], { - stdio: ['ignore', 'pipe', 'inherit'] + stdio: ['ignore', 'pipe', 'inherit'], }); let ticks = ''; diff --git a/test/tick-processor/test-tick-processor-preprocess-flag.js b/test/tick-processor/test-tick-processor-preprocess-flag.js index 8b1ec9920f47ed..b0f5012fa7b0cc 100644 --- a/test/tick-processor/test-tick-processor-preprocess-flag.js +++ b/test/tick-processor/test-tick-processor-preprocess-flag.js @@ -18,5 +18,5 @@ base.runTest({ setImmediate(function() { f(); }); }; f();`, - profProcessFlags: ['--preprocess'] + profProcessFlags: ['--preprocess'], }); diff --git a/test/tick-processor/test-tick-processor-unknown.js b/test/tick-processor/test-tick-processor-unknown.js index f894ae919acf66..0364df9c8a456f 100644 --- a/test/tick-processor/test-tick-processor-unknown.js +++ b/test/tick-processor/test-tick-processor-unknown.js @@ -24,5 +24,5 @@ base.runTest({ } setImmediate(function() { f(); }); }; - f();` + f();`, }); diff --git a/test/tick-processor/tick-processor-base.js b/test/tick-processor/tick-processor-base.js index d9f23ae7d768f5..91307d16928889 100644 --- a/test/tick-processor/tick-processor-base.js +++ b/test/tick-processor/tick-processor-base.js @@ -17,7 +17,7 @@ function runTest(test) { '--prof', '-pe', test.code, ], { - stdio: [ 'ignore', 'pipe', 'inherit' ] + stdio: [ 'ignore', 'pipe', 'inherit' ], }); let ticks = ''; @@ -39,7 +39,7 @@ function match(pattern, parent, ticks, flags = []) { ...flags, LOG_FILE, ], { - stdio: [ 'ignore', 'pipe', 'inherit' ] + stdio: [ 'ignore', 'pipe', 'inherit' ], }); let out = ''; diff --git a/test/tick-processor/util.js b/test/tick-processor/util.js index d25a2a7dcb132e..6d118b7c38bc66 100644 --- a/test/tick-processor/util.js +++ b/test/tick-processor/util.js @@ -6,7 +6,7 @@ const { isSunOS, isAIX, isLinuxPPCBE, - isFreeBSD + isFreeBSD, } = require('../common'); module.exports = { @@ -14,5 +14,5 @@ module.exports = { isSunOS || isAIX || isLinuxPPCBE || - isFreeBSD + isFreeBSD, }; diff --git a/test/wasi/test-wasi-initialize-validation.js b/test/wasi/test-wasi-initialize-validation.js index 79b0bd8485a483..03b0b1467d7d23 100644 --- a/test/wasi/test-wasi-initialize-validation.js +++ b/test/wasi/test-wasi-initialize-validation.js @@ -18,7 +18,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); () => { wasi.initialize(); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance" argument must be of type object/ + message: /"instance" argument must be of type object/, } ); } @@ -34,7 +34,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); () => { wasi.initialize(instance); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance\.exports" property must be of type object/ + message: /"instance\.exports" property must be of type object/, } ); } @@ -54,7 +54,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); () => { wasi.initialize(instance); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance\.exports\._initialize" property must be of type function/ + message: /"instance\.exports\._initialize" property must be of type function/, } ); } @@ -72,13 +72,13 @@ const bufferSource = fixtures.readSync('simple.wasm'); _initialize() {}, memory: new Uint8Array(), }; - } + }, }); assert.throws( () => { wasi.initialize(instance); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance\.exports\._start" property must be undefined/ + message: /"instance\.exports\._start" property must be undefined/, } ); } @@ -90,13 +90,13 @@ const bufferSource = fixtures.readSync('simple.wasm'); const instance = await WebAssembly.instantiate(wasm); Object.defineProperty(instance, 'exports', { - get() { return { _initialize() {} }; } + get() { return { _initialize() {} }; }, }); assert.throws( () => { wasi.initialize(instance); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance\.exports\.memory" property must be of type object/ + message: /"instance\.exports\.memory" property must be of type object/, } ); } @@ -113,7 +113,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); _initialize() {}, memory: {}, }; - } + }, }); // The error message is a little white lie because any object // with a .buffer property of type ArrayBuffer is accepted, @@ -122,7 +122,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); () => { wasi.initialize(instance); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance\.exports\.memory\.buffer" property must be an WebAssembly\.Memory/ + message: /"instance\.exports\.memory\.buffer" property must be an WebAssembly\.Memory/, } ); } @@ -140,7 +140,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); _initialize() {}, memory: { buffer: new ArrayBuffer(0) }, }; - } + }, }); wasi.initialize(instance); } @@ -179,16 +179,16 @@ const bufferSource = fixtures.readSync('simple.wasm'); get() { return { _initialize() {}, - memory: new WebAssembly.Memory({ initial: 1 }) + memory: new WebAssembly.Memory({ initial: 1 }), }; - } + }, }); wasi.initialize(instance); assert.throws( () => { wasi.initialize(instance); }, { code: 'ERR_WASI_ALREADY_STARTED', - message: /^WASI instance has already started$/ + message: /^WASI instance has already started$/, } ); } diff --git a/test/wasi/test-wasi-not-started.js b/test/wasi/test-wasi-not-started.js index 0dde5495112497..28da4fa41b657f 100644 --- a/test/wasi/test-wasi-not-started.js +++ b/test/wasi/test-wasi-not-started.js @@ -8,7 +8,7 @@ if (process.argv[2] === 'wasi-child') { const { WASI } = require('wasi'); const wasi = new WASI({ - args: ['foo', '-bar', '--baz=value'] + args: ['foo', '-bar', '--baz=value'], }); const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; @@ -21,7 +21,7 @@ if (process.argv[2] === 'wasi-child') { }, { name: 'Error', code: 'ERR_WASI_NOT_STARTED', - message: 'wasi.start() has not been called' + message: 'wasi.start() has not been called', }); } else { const assert = require('assert'); @@ -32,7 +32,7 @@ if (process.argv[2] === 'wasi-child') { __filename, 'wasi-child', ], { - env: { ...process.env, NODE_DEBUG_NATIVE: 'wasi' } + env: { ...process.env, NODE_DEBUG_NATIVE: 'wasi' }, }); assert.strictEqual(child.signal, null); assert.strictEqual(child.status, 0); diff --git a/test/wasi/test-wasi-start-validation.js b/test/wasi/test-wasi-start-validation.js index 5c6a1ede5d4fd7..6dac6dd69950a2 100644 --- a/test/wasi/test-wasi-start-validation.js +++ b/test/wasi/test-wasi-start-validation.js @@ -18,7 +18,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); () => { wasi.start(); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance" argument must be of type object/ + message: /"instance" argument must be of type object/, } ); } @@ -34,7 +34,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); () => { wasi.start(instance); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance\.exports" property must be of type object/ + message: /"instance\.exports" property must be of type object/, } ); } @@ -54,7 +54,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); () => { wasi.start(instance); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance\.exports\._start" property must be of type function/ + message: /"instance\.exports\._start" property must be of type function/, } ); } @@ -72,13 +72,13 @@ const bufferSource = fixtures.readSync('simple.wasm'); _initialize() {}, memory: new Uint8Array(), }; - } + }, }); assert.throws( () => { wasi.start(instance); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance\.exports\._initialize" property must be undefined/ + message: /"instance\.exports\._initialize" property must be undefined/, } ); } @@ -90,13 +90,13 @@ const bufferSource = fixtures.readSync('simple.wasm'); const instance = await WebAssembly.instantiate(wasm); Object.defineProperty(instance, 'exports', { - get() { return { _start() {} }; } + get() { return { _start() {} }; }, }); assert.throws( () => { wasi.start(instance); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance\.exports\.memory" property must be of type object/ + message: /"instance\.exports\.memory" property must be of type object/, } ); } @@ -113,7 +113,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); _start() {}, memory: {}, }; - } + }, }); // The error message is a little white lie because any object // with a .buffer property of type ArrayBuffer is accepted, @@ -122,7 +122,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); () => { wasi.start(instance); }, { code: 'ERR_INVALID_ARG_TYPE', - message: /"instance\.exports\.memory\.buffer" property must be an WebAssembly\.Memory/ + message: /"instance\.exports\.memory\.buffer" property must be an WebAssembly\.Memory/, } ); } @@ -140,7 +140,7 @@ const bufferSource = fixtures.readSync('simple.wasm'); _start() {}, memory: { buffer: new ArrayBuffer(0) }, }; - } + }, }); wasi.start(instance); } @@ -179,16 +179,16 @@ const bufferSource = fixtures.readSync('simple.wasm'); get() { return { _start() {}, - memory: new WebAssembly.Memory({ initial: 1 }) + memory: new WebAssembly.Memory({ initial: 1 }), }; - } + }, }); wasi.start(instance); assert.throws( () => { wasi.start(instance); }, { code: 'ERR_WASI_ALREADY_STARTED', - message: /^WASI instance has already started$/ + message: /^WASI instance has already started$/, } ); } diff --git a/test/wasi/test-wasi-symlinks.js b/test/wasi/test-wasi-symlinks.js index 7dd9ae746b0886..f74d5f98549c04 100644 --- a/test/wasi/test-wasi-symlinks.js +++ b/test/wasi/test-wasi-symlinks.js @@ -14,8 +14,8 @@ if (process.argv[2] === 'wasi-child') { args: [], env: process.env, preopens: { - '/sandbox': process.argv[4] - } + '/sandbox': process.argv[4], + }, }); const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; const modulePath = path.join(wasmDir, `${process.argv[3]}.wasm`); diff --git a/test/wasi/test-wasi.js b/test/wasi/test-wasi.js index 26002a7e5536ed..1361f8cd14eccd 100644 --- a/test/wasi/test-wasi.js +++ b/test/wasi/test-wasi.js @@ -19,8 +19,8 @@ if (process.argv[2] === 'wasi-child') { env: process.env, preopens: { '/sandbox': fixtures.path('wasi'), - '/tmp': tmpdir.path - } + '/tmp': tmpdir.path, + }, }); const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; const modulePath = path.join(wasmDir, `${process.argv[3]}.wasm`); @@ -42,8 +42,8 @@ if (process.argv[2] === 'wasi-child') { env: { ...process.env, NODE_DEBUG_NATIVE: 'wasi', - NODE_PLATFORM: process.platform - } + NODE_PLATFORM: process.platform, + }, }; if (options.stdin !== undefined) @@ -91,7 +91,7 @@ if (process.argv[2] === 'wasi-child') { runWASI({ test: 'read_file', stdout: `hello from input.txt${EOL}` }); runWASI({ test: 'read_file_twice', - stdout: `hello from input.txt${EOL}hello from input.txt${EOL}` + stdout: `hello from input.txt${EOL}hello from input.txt${EOL}`, }); runWASI({ test: 'stat' }); runWASI({ test: 'write_file' }); diff --git a/tools/build-addons.js b/tools/build-addons.js index 1d4bcbc917972c..d2523e85da9362 100644 --- a/tools/build-addons.js +++ b/tools/build-addons.js @@ -34,7 +34,7 @@ async function runner(directoryQueue) { await execFile(process.execPath, [nodeGyp, 'rebuild', `--directory=${dir}`], { stdio: 'inherit', - env: { ...process.env, MAKEFLAGS: '-j1' } + env: { ...process.env, MAKEFLAGS: '-j1' }, }); // We buffer the output and print it out once the process is done in order diff --git a/tools/doc/addon-verify.js b/tools/doc/addon-verify.js index 8093439d6d925c..01c4f88c01782c 100644 --- a/tools/doc/addon-verify.js +++ b/tools/doc/addon-verify.js @@ -70,7 +70,7 @@ ${files[name].replace( return { path: resolve(dir, name), name: name, - content: files[name] + content: files[name], }; }); @@ -83,8 +83,8 @@ ${files[name].replace( sources: files.map(({ name }) => name), includes: ['../common.gypi'], }, - ] - }) + ], + }), }); mkdir(dir, () => { diff --git a/tools/doc/allhtml.js b/tools/doc/allhtml.js index fad74e59d5cb2e..97eca4e912e0aa 100644 --- a/tools/doc/allhtml.js +++ b/tools/doc/allhtml.js @@ -22,7 +22,7 @@ let apicontent = ''; // are added to this list to prevent dupes. const seen = { 'all.html': true, - 'index.html': true + 'index.html': true, }; for (const link of toc.match(//g)) { diff --git a/tools/doc/alljson.js b/tools/doc/alljson.js index 0d697dde01d091..45082a2787a4c7 100644 --- a/tools/doc/alljson.js +++ b/tools/doc/alljson.js @@ -20,14 +20,14 @@ const results = { modules: [], classes: [], globals: [], - methods: [] + methods: [], }; // Identify files that should be skipped. As files are processed, they // are added to this list to prevent dupes. const seen = { 'all.json': true, - 'index.json': true + 'index.json': true, }; // Extract (and concatenate) the selected data from each document. diff --git a/tools/doc/html.js b/tools/doc/html.js index 901976a8c915fc..a2dc8d36de1ea9 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -35,7 +35,7 @@ const typeParser = require('./type-parser.js'); const { highlight, getLanguage } = require('highlight.js'); module.exports = { - toHTML, firstHeader, preprocessText, preprocessElements, buildToc + toHTML, firstHeader, preprocessText, preprocessElements, buildToc, }; const docPath = path.resolve(__dirname, '..', '..', 'doc'); @@ -286,7 +286,7 @@ function preprocessElements({ filename }) { (noLinking ? '' : '') + `${prefix} ${number}${noLinking ? '' : ''}` - .replace(/\n/g, ' ') + .replace(/\n/g, ' '), }); // Remove prefix and number from text diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 4fd91f4b478149..1253fe30da9053 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -10,7 +10,7 @@ const jsPrimitives = { number: 'Number', string: 'String', symbol: 'Symbol', - undefined: 'Undefined' + undefined: 'Undefined', }; const jsGlobalObjectsUrl = `${jsDocPrefix}Reference/Global_Objects/`; diff --git a/tools/eslint-rules/alphabetize-errors.js b/tools/eslint-rules/alphabetize-errors.js index b2dcacbb866816..8d25f7973d62a6 100644 --- a/tools/eslint-rules/alphabetize-errors.js +++ b/tools/eslint-rules/alphabetize-errors.js @@ -26,7 +26,7 @@ module.exports = { const message = [prefix, prev, opStr, curr].join(''); context.report({ node, message }); } - } + }, }; - } + }, }; diff --git a/tools/eslint-rules/async-iife-no-unused-result.js b/tools/eslint-rules/async-iife-no-unused-result.js index bb089de8832d88..901ebca9cd2252 100644 --- a/tools/eslint-rules/async-iife-no-unused-result.js +++ b/tools/eslint-rules/async-iife-no-unused-result.js @@ -13,7 +13,7 @@ const message = module.exports = { meta: { - fixable: 'code' + fixable: 'code', }, create: function(context) { let hasCommonModule = false; @@ -31,10 +31,10 @@ module.exports = { fix: (fixer) => { if (hasCommonModule) return fixer.insertTextAfter(node, '.then(common.mustCall())'); - } + }, }); } - } + }, }; - } + }, }; diff --git a/tools/eslint-rules/crypto-check.js b/tools/eslint-rules/crypto-check.js index 4704b550a360e9..5a55c3c38df4e5 100644 --- a/tools/eslint-rules/crypto-check.js +++ b/tools/eslint-rules/crypto-check.js @@ -77,7 +77,7 @@ module.exports = function(context) { if (beforeAllChecks) { context.report({ node: requireNode, - message: msg + message: msg, }); } }); @@ -108,7 +108,7 @@ module.exports = function(context) { '}' ); } - } + }, }); }); } @@ -117,10 +117,10 @@ module.exports = function(context) { 'CallExpression': (node) => testCryptoUsage(node), 'IfStatement:exit': (node) => testIfStatement(node), 'MemberExpression:exit': (node) => testMemberExpression(node), - 'Program:exit': () => reportIfMissingCheck() + 'Program:exit': () => reportIfMissingCheck(), }; }; module.exports.meta = { - fixable: 'code' + fixable: 'code', }; diff --git a/tools/eslint-rules/documented-errors.js b/tools/eslint-rules/documented-errors.js index dad60367cd958a..17bd2221097085 100644 --- a/tools/eslint-rules/documented-errors.js +++ b/tools/eslint-rules/documented-errors.js @@ -34,7 +34,7 @@ module.exports = { `doc/api/errors.md does not have an anchor for "${code}"`; context.report({ node, message }); } - } + }, }; - } + }, }; diff --git a/tools/eslint-rules/eslint-check.js b/tools/eslint-rules/eslint-check.js index 0edf7d2899cbf9..018fe4115c1064 100644 --- a/tools/eslint-rules/eslint-check.js +++ b/tools/eslint-rules/eslint-check.js @@ -46,7 +46,7 @@ module.exports = function(context) { '\ncommon.skipIfEslintMissing();' ); } - } + }, }); }); } @@ -55,10 +55,10 @@ module.exports = function(context) { return { 'CallExpression': (node) => testEslintUsage(context, node), 'MemberExpression': (node) => checkMemberExpression(context, node), - 'Program:exit': () => reportIfMissing(context) + 'Program:exit': () => reportIfMissing(context), }; }; module.exports.meta = { - fixable: 'code' + fixable: 'code', }; diff --git a/tools/eslint-rules/inspector-check.js b/tools/eslint-rules/inspector-check.js index bb5dc27bff5cef..9f34c32e3158e4 100644 --- a/tools/eslint-rules/inspector-check.js +++ b/tools/eslint-rules/inspector-check.js @@ -47,7 +47,7 @@ module.exports = function(context) { '\ncommon.skipIfInspectorDisabled();' ); } - } + }, }); }); } @@ -56,10 +56,10 @@ module.exports = function(context) { return { 'CallExpression': (node) => testInspectorUsage(context, node), 'MemberExpression': (node) => checkMemberExpression(context, node), - 'Program:exit': () => reportIfMissing(context) + 'Program:exit': () => reportIfMissing(context), }; }; module.exports.meta = { - fixable: 'code' + fixable: 'code', }; diff --git a/tools/eslint-rules/lowercase-name-for-primitive.js b/tools/eslint-rules/lowercase-name-for-primitive.js index 274dcd1c9dce6e..6783825567ca3a 100644 --- a/tools/eslint-rules/lowercase-name-for-primitive.js +++ b/tools/eslint-rules/lowercase-name-for-primitive.js @@ -43,17 +43,17 @@ module.exports = function(context) { node, `'${lowercaseName}'` ); - } + }, }); } } return { - [astSelector]: (node) => checkNamesArgument(node) + [astSelector]: (node) => checkNamesArgument(node), }; }; module.exports.meta = { - fixable: 'code' + fixable: 'code', }; diff --git a/tools/eslint-rules/no-unescaped-regexp-dot.js b/tools/eslint-rules/no-unescaped-regexp-dot.js index e9349713bfa3fa..180f7be080dbf3 100644 --- a/tools/eslint-rules/no-unescaped-regexp-dot.js +++ b/tools/eslint-rules/no-unescaped-regexp-dot.js @@ -19,7 +19,7 @@ module.exports = function(context) { context.report({ node, loc: sourceCode.getLocFromIndex(indexOfDot), - message: 'Unescaped dot character in regular expression' + message: 'Unescaped dot character in regular expression', }); } @@ -125,6 +125,6 @@ module.exports = function(context) { 'CallExpression': checkRegExpStart, 'NewExpression': checkRegExpStart, 'CallExpression:exit': checkRegExpEnd, - 'NewExpression:exit': checkRegExpEnd + 'NewExpression:exit': checkRegExpEnd, }; }; diff --git a/tools/eslint-rules/non-ascii-character.js b/tools/eslint-rules/non-ascii-character.js index f9ee24273fdcb6..1d401671d6cb84 100644 --- a/tools/eslint-rules/non-ascii-character.js +++ b/tools/eslint-rules/non-ascii-character.js @@ -21,7 +21,7 @@ const suggestions = { '”': '"', '«': '"', '»': '"', - '—': '-' + '—': '-', }; module.exports = (context) => { @@ -50,6 +50,6 @@ module.exports = (context) => { }; return { - Program: (node) => reportIfError(node, context.getSourceCode()) + Program: (node) => reportIfError(node, context.getSourceCode()), }; }; diff --git a/tools/eslint-rules/prefer-assert-iferror.js b/tools/eslint-rules/prefer-assert-iferror.js index 63430d70af93e4..ad86a50cd6b05c 100644 --- a/tools/eslint-rules/prefer-assert-iferror.js +++ b/tools/eslint-rules/prefer-assert-iferror.js @@ -9,7 +9,7 @@ const utils = require('./rules-utils.js'); module.exports = { meta: { - fixable: 'code' + fixable: 'code', }, create(context) { const sourceCode = context.getSourceCode(); @@ -55,10 +55,10 @@ module.exports = { `assert.ifError(${argument});` ); } - } + }, }); } - } + }, }; - } + }, }; diff --git a/tools/eslint-rules/prefer-assert-methods.js b/tools/eslint-rules/prefer-assert-methods.js index 0b82e9984a0693..d1091d688ad839 100644 --- a/tools/eslint-rules/prefer-assert-methods.js +++ b/tools/eslint-rules/prefer-assert-methods.js @@ -16,7 +16,7 @@ const preferredAssertMethod = { '===': 'strictEqual', '!==': 'notStrictEqual', '==': 'equal', - '!=': 'notEqual' + '!=': 'notEqual', }; module.exports = function(context) { @@ -36,13 +36,13 @@ module.exports = function(context) { node, `assert.${assertMethod}(${left}, ${right});` ); - } + }, }); } - } + }, }; }; module.exports.meta = { - fixable: 'code' + fixable: 'code', }; diff --git a/tools/eslint-rules/prefer-common-mustnotcall.js b/tools/eslint-rules/prefer-common-mustnotcall.js index ef3c5fb729f31f..2b04806d6a01e9 100644 --- a/tools/eslint-rules/prefer-common-mustnotcall.js +++ b/tools/eslint-rules/prefer-common-mustnotcall.js @@ -25,6 +25,6 @@ module.exports = function(context) { [arg0Selector]: report, // Catch common.mustCall(fn, 0) - [arg1Selector]: report + [arg1Selector]: report, }; }; diff --git a/tools/eslint-rules/prefer-common-mustsucceed.js b/tools/eslint-rules/prefer-common-mustsucceed.js index 433e8c7610f253..49795f2559fb19 100644 --- a/tools/eslint-rules/prefer-common-mustsucceed.js +++ b/tools/eslint-rules/prefer-common-mustsucceed.js @@ -61,6 +61,6 @@ module.exports = (context) => { } } } - } + }, }; }; diff --git a/tools/eslint-rules/prefer-primordials.js b/tools/eslint-rules/prefer-primordials.js index 02b00a7e3b1f12..bc461e4f56e4b7 100644 --- a/tools/eslint-rules/prefer-primordials.js +++ b/tools/eslint-rules/prefer-primordials.js @@ -63,8 +63,8 @@ const identifierSelector = module.exports = { meta: { messages: { - error: 'Use `const { {{name}} } = primordials;` instead of the global.' - } + error: 'Use `const { {{name}} } = primordials;` instead of the global.', + }, }, create(context) { const globalScope = context.getSourceCode().scopeManager.globalScope; @@ -111,8 +111,8 @@ module.exports = { node, messageId: 'error', data: { - name: getReportName({ into, parentName, name }) - } + name: getReportName({ into, parentName, name }), + }, }); } return; @@ -124,8 +124,8 @@ module.exports = { node, messageId: 'error', data: { - name: getReportName({ into, parentName, name }) - } + name: getReportName({ into, parentName, name }), + }, }); } }, @@ -144,10 +144,10 @@ module.exports = { messageId: 'error', data: { name: toPrimordialsName(obj, prop), - } + }, }); } - } + }, }; - } + }, }; diff --git a/tools/eslint-rules/prefer-util-format-errors.js b/tools/eslint-rules/prefer-util-format-errors.js index 407b6e20dd23ea..91021dc4c7272d 100644 --- a/tools/eslint-rules/prefer-util-format-errors.js +++ b/tools/eslint-rules/prefer-util-format-errors.js @@ -33,7 +33,7 @@ module.exports = { }); if (hasSequentialParams) context.report(msg, errMsg); - } + }, }; - } + }, }; diff --git a/tools/eslint-rules/require-common-first.js b/tools/eslint-rules/require-common-first.js index 4096ee27710781..2f9f504bad3266 100644 --- a/tools/eslint-rules/require-common-first.js +++ b/tools/eslint-rules/require-common-first.js @@ -55,7 +55,7 @@ module.exports = function(context) { { moduleName: requiredModule } ); } - } + }, }; if (isESM) { diff --git a/tools/eslint-rules/required-modules.js b/tools/eslint-rules/required-modules.js index 06c998c7f5a182..1602a34fe5eba0 100644 --- a/tools/eslint-rules/required-modules.js +++ b/tools/eslint-rules/required-modules.js @@ -66,7 +66,7 @@ module.exports = function(context) { ); }); } - } + }, }; if (isESM) { @@ -95,7 +95,7 @@ module.exports.meta = { schema: [{ 'type': 'object', 'additionalProperties': { - 'type': 'string' + 'type': 'string', }, }], }; diff --git a/tools/license2rtf.js b/tools/license2rtf.js index 817da81d7a6ada..aa5ddc4a2c587d 100644 --- a/tools/license2rtf.js +++ b/tools/license2rtf.js @@ -62,7 +62,7 @@ class ParagraphParser extends Stream { this.paragraph = { li: '', inLicenseBlock: this.blockIsLicenseBlock, - lines: [] + lines: [], }; } diff --git a/tools/node-lint-md-cli-rollup/rollup.config.js b/tools/node-lint-md-cli-rollup/rollup.config.js index 654f033cf65b8d..a02b6a81613c1a 100644 --- a/tools/node-lint-md-cli-rollup/rollup.config.js +++ b/tools/node-lint-md-cli-rollup/rollup.config.js @@ -40,10 +40,10 @@ module.exports = { 'fsevents = require(\'fsevents\');', 'fsevents = undefined;' ); } - } + }, }, json({ - preferConst: true + preferConst: true, }), nodeResolve(), // tells Rollup how to find date-fns in node_modules commonjs(), // Converts date-fns to ES modules @@ -53,7 +53,7 @@ module.exports = { const banner = '// Don\'t change this file manually,\n' + '// it is generated from tools/node-lint-md-cli-rollup'; return code.replace('\'use strict\';', '\'use strict\';\n\n' + banner); - } + }, }, - ] + ], }; diff --git a/tools/update-authors.js b/tools/update-authors.js index 312f253c4854e5..8636117d7d1dd6 100755 --- a/tools/update-authors.js +++ b/tools/update-authors.js @@ -18,7 +18,7 @@ const log = spawn( 'git', // Inspect author name/email and body. ['log', '--reverse', '--format=Author: %aN <%aE>\n%b'], { - stdio: ['inherit', 'pipe', 'inherit'] + stdio: ['inherit', 'pipe', 'inherit'], }); const rl = readline.createInterface({ input: log.stdout }); @@ -48,13 +48,13 @@ const mailmap = new CaseIndifferentMap(); // Replaced Name } else if (match = line.match(/^([^<]+)\s+(<[^>]+>)\s+(<[^>]+>)$/)) { mailmap.set(match[3], { - author: match[1], email: match[2] + author: match[1], email: match[2], }); // Replaced Name Original Name } else if (match = line.match(/^([^<]+)\s+(<[^>]+>)\s+([^<]+)\s+(<[^>]+>)$/)) { mailmap.set(match[3] + '\0' + match[4], { - author: match[1], email: match[2] + author: match[1], email: match[2], }); } else { console.warn('Unknown .mailmap format:', line); From 24b5deef6ea3f53cb562dc06b0bde3ecaa2f2857 Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Tue, 18 May 2021 13:45:17 +0800 Subject: [PATCH 2/3] fixup --- test/parallel/test-process-setgroups.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-process-setgroups.js b/test/parallel/test-process-setgroups.js index 1c4a0ab41628b5..71f70c1cda5e33 100644 --- a/test/parallel/test-process-setgroups.js +++ b/test/parallel/test-process-setgroups.js @@ -53,6 +53,6 @@ assert.throws(() => { process.setgroups([1, 'fhqwhgadshgnsdhjsdbkhsdabkfabkveyb']); }, { code: 'ERR_UNKNOWN_CREDENTIAL', - message: 'Group identifier does not exist:' + + message: 'Group identifier does not exist: ' + 'fhqwhgadshgnsdhjsdbkhsdabkfabkveyb', }); From 944a47d514772c3ae29ab7f33cd5c45a47d680db Mon Sep 17 00:00:00 2001 From: Rongjian Zhang Date: Tue, 18 May 2021 16:37:34 +0800 Subject: [PATCH 3/3] fixup --- test/message/esm_display_syntax_error_import.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/message/esm_display_syntax_error_import.out b/test/message/esm_display_syntax_error_import.out index 8f94e4a5cf16eb..c971a47aee6990 100644 --- a/test/message/esm_display_syntax_error_import.out +++ b/test/message/esm_display_syntax_error_import.out @@ -1,5 +1,5 @@ file:///*/test/message/esm_display_syntax_error_import.mjs:5 - notfound + notfound, ^^^^^^^^ SyntaxError: The requested module '../fixtures/es-module-loaders/module-named-exports.mjs' does not provide an export named 'notfound' at ModuleJob._instantiate (node:internal/modules/esm/module_job:*:*)