diff --git a/.eslintrc.js b/.eslintrc.js index f020dce888c458..abf72cd44f0df4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -149,7 +149,11 @@ module.exports = { // http://eslint.org/docs/rules/#stylistic-issues' 'block-spacing': 'error', 'brace-style': ['error', '1tbs', { allowSingleLine: true }], - 'comma-dangle': ['error', 'only-multiline'], + 'comma-dangle': ['error', { + 'arrays': 'always-multiline', + 'objects': 'always-multiline', + 'functions': 'never', + }], 'comma-spacing': 'error', 'comma-style': 'error', 'computed-property-spacing': 'error', diff --git a/benchmark/_http-benchmarkers.js b/benchmark/_http-benchmarkers.js index 76e02504b27ec1..456c6be39ec461 100644 --- a/benchmark/_http-benchmarkers.js +++ b/benchmark/_http-benchmarkers.js @@ -25,7 +25,7 @@ class AutocannonBenchmarker { '-c', options.connections, '-j', '-n', - `http://127.0.0.1:${options.port}${options.path}` + `http://127.0.0.1:${options.port}${options.path}`, ]; const child = child_process.spawn(this.executable, args); return child; @@ -59,7 +59,7 @@ class WrkBenchmarker { '-d', options.duration, '-c', options.connections, '-t', 8, - `http://127.0.0.1:${options.port}${options.path}` + `http://127.0.0.1:${options.port}${options.path}`, ]; const child = child_process.spawn(this.executable, args); return child; @@ -96,7 +96,7 @@ class TestDoubleBenchmarker { const child = child_process.fork(this.executable, { silent: true, - env + env, }); return child; } @@ -168,7 +168,7 @@ const http_benchmarkers = [ new WrkBenchmarker(), new AutocannonBenchmarker(), new TestDoubleBenchmarker(), - new H2LoadBenchmarker() + new H2LoadBenchmarker(), ]; const benchmarkers = {}; @@ -186,7 +186,7 @@ exports.run = function(options, callback) { path: '/', connections: 100, duration: 5, - benchmarker: exports.default_http_benchmarker + benchmarker: exports.default_http_benchmarker, }, options); if (!options.benchmarker) { callback(new Error('Could not locate required http benchmarker. See ' + diff --git a/benchmark/arrays/var-int.js b/benchmark/arrays/var-int.js index e36a909a3b9e76..426db3973c50ce 100644 --- a/benchmark/arrays/var-int.js +++ b/benchmark/arrays/var-int.js @@ -12,9 +12,9 @@ const bench = common.createBenchmark(main, { 'Int32Array', 'Uint32Array', 'Float32Array', - 'Float64Array' + 'Float64Array', ], - n: [25] + n: [25], }); function main({ type, n }) { diff --git a/benchmark/arrays/zero-float.js b/benchmark/arrays/zero-float.js index 073460e0efb8fc..a1b03550345609 100644 --- a/benchmark/arrays/zero-float.js +++ b/benchmark/arrays/zero-float.js @@ -12,9 +12,9 @@ const bench = common.createBenchmark(main, { 'Int32Array', 'Uint32Array', 'Float32Array', - 'Float64Array' + 'Float64Array', ], - n: [25] + n: [25], }); function main({ type, n }) { diff --git a/benchmark/arrays/zero-int.js b/benchmark/arrays/zero-int.js index 78fd34ae6c0bf4..f4b3f9aa5c6663 100644 --- a/benchmark/arrays/zero-int.js +++ b/benchmark/arrays/zero-int.js @@ -12,9 +12,9 @@ const bench = common.createBenchmark(main, { 'Int32Array', 'Uint32Array', 'Float32Array', - 'Float64Array' + 'Float64Array', ], - n: [25] + n: [25], }); function main({ type, n }) { diff --git a/benchmark/assert/deepequal-buffer.js b/benchmark/assert/deepequal-buffer.js index 9556a81ec3b151..685396a3042379 100644 --- a/benchmark/assert/deepequal-buffer.js +++ b/benchmark/assert/deepequal-buffer.js @@ -9,8 +9,8 @@ const bench = common.createBenchmark(main, { 'deepEqual', 'deepStrictEqual', 'notDeepEqual', - 'notDeepStrictEqual' - ] + 'notDeepStrictEqual', + ], }); function main({ len, n, method }) { diff --git a/benchmark/assert/deepequal-map.js b/benchmark/assert/deepequal-map.js index bdd3c5c6b8c514..0c87de1fa1f5ef 100644 --- a/benchmark/assert/deepequal-map.js +++ b/benchmark/assert/deepequal-map.js @@ -23,7 +23,7 @@ const bench = common.createBenchmark(main, { 'notDeepEqual_mixed', 'notDeepStrictEqual_mixed', 'notDeepEqual_looseMatches', - ] + ], }); function benchmark(method, n, values, values2) { diff --git a/benchmark/assert/deepequal-object.js b/benchmark/assert/deepequal-object.js index 4c95006b3b8bc7..87ca15b00f814c 100644 --- a/benchmark/assert/deepequal-object.js +++ b/benchmark/assert/deepequal-object.js @@ -10,8 +10,8 @@ const bench = common.createBenchmark(main, { 'deepEqual', 'deepStrictEqual', 'notDeepEqual', - 'notDeepStrictEqual' - ] + 'notDeepStrictEqual', + ], }); function createObj(source, add = '') { @@ -20,8 +20,8 @@ function createObj(source, add = '') { nope: { bar: `123${add}`, a: [1, 2, 3], - baz: n - } + baz: n, + }, })); } diff --git a/benchmark/assert/deepequal-prims-and-objs-big-array-set.js b/benchmark/assert/deepequal-prims-and-objs-big-array-set.js index 90dbf1059361a5..fd6c5499ab1ecb 100644 --- a/benchmark/assert/deepequal-prims-and-objs-big-array-set.js +++ b/benchmark/assert/deepequal-prims-and-objs-big-array-set.js @@ -11,7 +11,7 @@ const primValues = { 'boolean': true, 'object': { 0: 'a' }, 'array': [1, 2, 3], - 'new-array': new Array([1, 2, 3]) + 'new-array': new Array([1, 2, 3]), }; const bench = common.createBenchmark(main, { @@ -26,8 +26,8 @@ const bench = common.createBenchmark(main, { 'deepEqual_Set', 'deepStrictEqual_Set', 'notDeepEqual_Set', - 'notDeepStrictEqual_Set' - ] + 'notDeepStrictEqual_Set', + ], }); function run(fn, n, actual, expected) { diff --git a/benchmark/assert/deepequal-prims-and-objs-big-loop.js b/benchmark/assert/deepequal-prims-and-objs-big-loop.js index ec51201d51839d..70c9f7d7cbe3de 100644 --- a/benchmark/assert/deepequal-prims-and-objs-big-loop.js +++ b/benchmark/assert/deepequal-prims-and-objs-big-loop.js @@ -10,7 +10,7 @@ const primValues = { 'boolean': true, 'object': { 0: 'a' }, 'array': [1, 2, 3], - 'new-array': new Array([1, 2, 3]) + 'new-array': new Array([1, 2, 3]), }; const bench = common.createBenchmark(main, { @@ -20,8 +20,8 @@ const bench = common.createBenchmark(main, { 'deepEqual', 'deepStrictEqual', 'notDeepEqual', - 'notDeepStrictEqual' - ] + 'notDeepStrictEqual', + ], }); function main({ n, primitive, method }) { diff --git a/benchmark/assert/deepequal-set.js b/benchmark/assert/deepequal-set.js index e70ddf10e93626..c060504028ac9e 100644 --- a/benchmark/assert/deepequal-set.js +++ b/benchmark/assert/deepequal-set.js @@ -23,7 +23,7 @@ const bench = common.createBenchmark(main, { 'notDeepEqual_mixed', 'notDeepStrictEqual_mixed', 'notDeepEqual_looseMatches', - ] + ], }); function benchmark(method, n, values, values2) { diff --git a/benchmark/assert/deepequal-typedarrays.js b/benchmark/assert/deepequal-typedarrays.js index 50e6e525b20a0c..79a5755319f0be 100644 --- a/benchmark/assert/deepequal-typedarrays.js +++ b/benchmark/assert/deepequal-typedarrays.js @@ -19,9 +19,9 @@ const bench = common.createBenchmark(main, { 'deepEqual', 'deepStrictEqual', 'notDeepEqual', - 'notDeepStrictEqual' + 'notDeepStrictEqual', ], - len: [1e6] + len: [1e6], }); function main({ type, n, len, method }) { diff --git a/benchmark/assert/throws.js b/benchmark/assert/throws.js index 2409d19206e353..98a9b34b58ef7d 100644 --- a/benchmark/assert/throws.js +++ b/benchmark/assert/throws.js @@ -9,8 +9,8 @@ const bench = common.createBenchmark(main, { 'doesNotThrow', 'throws', 'throws_TypeError', - 'throws_RegExp' - ] + 'throws_RegExp', + ], }); function main({ n, method }) { diff --git a/benchmark/async_hooks/gc-tracking.js b/benchmark/async_hooks/gc-tracking.js index d74b2bac463e28..8ca6c1e8b65dca 100644 --- a/benchmark/async_hooks/gc-tracking.js +++ b/benchmark/async_hooks/gc-tracking.js @@ -7,9 +7,9 @@ const bench = common.createBenchmark(main, { method: [ 'trackingEnabled', 'trackingDisabled', - ] + ], }, { - flags: ['--expose-gc'] + flags: ['--expose-gc'], }); function endAfterGC(n) { diff --git a/benchmark/buffers/buffer-base64-encode.js b/benchmark/buffers/buffer-base64-encode.js index d8b601bbd181f4..7b69375c1c5ab7 100644 --- a/benchmark/buffers/buffer-base64-encode.js +++ b/benchmark/buffers/buffer-base64-encode.js @@ -24,7 +24,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { len: [64 * 1024 * 1024], - n: [32] + n: [32], }); function main({ n, len }) { diff --git a/benchmark/buffers/buffer-bytelength.js b/benchmark/buffers/buffer-bytelength.js index fa8852a233ea88..70ad701a50f312 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: [1, 2, 4, 16, 64, 256], // x16 - n: [5e6] + n: [5e6], }); // 16 chars each @@ -12,7 +12,7 @@ const chars = [ 'hello brendan!!!', // 1 byte 'ΰαβγδεζηθικλμνξο', // 2 bytes '挰挱挲挳挴挵挶挷挸挹挺挻挼挽挾挿', // 3 bytes - '𠜎𠜱𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎𠸏𠹷𠺝𠺢' // 4 bytes + '𠜎𠜱𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎𠸏𠹷𠺝𠺢', // 4 bytes ]; function main({ n, len, encoding }) { diff --git a/benchmark/buffers/buffer-compare-instance-method.js b/benchmark/buffers/buffer-compare-instance-method.js index a3433803b79537..8dff512aadb8f3 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, 1024, 4096, 16386], args: [1, 2, 3, 4, 5], - millions: [1] + millions: [1], }); function main({ millions, size, args }) { diff --git a/benchmark/buffers/buffer-compare-offset.js b/benchmark/buffers/buffer-compare-offset.js index 551fcd2f0cec37..88b96230a3eda3 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, 1024, 4096, 16386], - millions: [1] + millions: [1], }); function compareUsingSlice(b0, b1, len, iter) { diff --git a/benchmark/buffers/buffer-compare.js b/benchmark/buffers/buffer-compare.js index f7abb4b3d94ffa..b94f74db3bafb2 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, 1024, 4096, 16386], - millions: [1] + millions: [1], }); function main({ millions, size }) { diff --git a/benchmark/buffers/buffer-concat.js b/benchmark/buffers/buffer-concat.js index 3f9cffc06a6a7e..9f469a89906408 100644 --- a/benchmark/buffers/buffer-concat.js +++ b/benchmark/buffers/buffer-concat.js @@ -5,7 +5,7 @@ const bench = common.createBenchmark(main, { pieces: [1, 4, 16], pieceSize: [1, 16, 256], withTotalLength: [0, 1], - n: [1024] + n: [1024], }); function main({ n, pieces, pieceSize, withTotalLength }) { diff --git a/benchmark/buffers/buffer-creation.js b/benchmark/buffers/buffer-creation.js index a7b340131eb8aa..061953f4d8be45 100644 --- a/benchmark/buffers/buffer-creation.js +++ b/benchmark/buffers/buffer-creation.js @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, { 'slow', 'buffer()'], len: [10, 1024, 2048, 4096, 8192], - n: [1024] + n: [1024], }); function main({ len, n, type }) { diff --git a/benchmark/buffers/buffer-fill.js b/benchmark/buffers/buffer-fill.js index 590946bce96544..e162429549b644 100644 --- a/benchmark/buffers/buffer-fill.js +++ b/benchmark/buffers/buffer-fill.js @@ -12,10 +12,10 @@ const bench = common.createBenchmark(main, { 'fill("t", "utf8")', 'fill("t", 0, "utf8")', 'fill("t", 0)', - 'fill(Buffer.alloc(1), 0)' + 'fill(Buffer.alloc(1), 0)', ], size: [2 ** 8, 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 6f2358bcf296ab..15d456f40fa1f3 100644 --- a/benchmark/buffers/buffer-from.js +++ b/benchmark/buffers/buffer-from.js @@ -12,10 +12,10 @@ const bench = common.createBenchmark(main, { 'string', 'string-utf8', 'string-base64', - 'object' + 'object', ], len: [10, 2048], - n: [2048] + n: [2048], }); function main({ len, n, source }) { diff --git a/benchmark/buffers/buffer-hex.js b/benchmark/buffers/buffer-hex.js index 4d87313961aa67..78ce5ecdc5ac75 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: [0, 1, 64, 1024], - n: [1e7] + n: [1e7], }); function main({ len, n }) { diff --git a/benchmark/buffers/buffer-indexof-number.js b/benchmark/buffers/buffer-indexof-number.js index 91bff0d54bb7eb..dd9a25f6c81d45 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: [1e7] + n: [1e7], }); function main({ n, value }) { diff --git a/benchmark/buffers/buffer-indexof.js b/benchmark/buffers/buffer-indexof.js index c98d15320aaaae..92534ab9d11649 100644 --- a/benchmark/buffers/buffer-indexof.js +++ b/benchmark/buffers/buffer-indexof.js @@ -18,14 +18,14 @@ const searchStrings = [ 'Soo--oop', 'aaaaaaaaaaaaaaaaa', 'venture to go near the house till she had brought herself down to', - ' to the Caterpillar' + ' to the Caterpillar', ]; const bench = common.createBenchmark(main, { search: searchStrings, encoding: ['undefined', 'utf8', 'ucs2', 'binary'], type: ['buffer', 'string'], - iter: [100000] + iter: [100000], }); function main({ iter, search, encoding, type }) { diff --git a/benchmark/buffers/buffer-iterate.js b/benchmark/buffers/buffer-iterate.js index 7a275b0bcb8182..d5e1e1c8287680 100644 --- a/benchmark/buffers/buffer-iterate.js +++ b/benchmark/buffers/buffer-iterate.js @@ -7,13 +7,13 @@ const bench = common.createBenchmark(main, { size: [16, 512, 1024, 4096, 16386], type: ['fast', 'slow'], 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 7a820465bd5d6b..3d3f9ca8d63be7 100644 --- a/benchmark/buffers/buffer-normalize-encoding.js +++ b/benchmark/buffers/buffer-normalize-encoding.js @@ -25,11 +25,11 @@ const bench = common.createBenchmark(main, { 'utf16le', 'UTF16LE', 'utf8', - '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 e105642972d857..b350db2ed5ee33 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: ['BE', 'LE'], value: ['zero', 'big', 'small', 'inf', 'nan'], - millions: [1] + millions: [1], }); function main({ millions, type, endian, value }) { diff --git a/benchmark/buffers/buffer-read-with-byteLength.js b/benchmark/buffers/buffer-read-with-byteLength.js index 1858c4fd965e26..2a286b3d55d5dc 100644 --- a/benchmark/buffers/buffer-read-with-byteLength.js +++ b/benchmark/buffers/buffer-read-with-byteLength.js @@ -5,14 +5,14 @@ const types = [ 'IntBE', 'IntLE', 'UIntBE', - 'UIntLE' + 'UIntLE', ]; const bench = common.createBenchmark(main, { buffer: ['fast', 'slow'], type: types, millions: [1], - byteLength: [1, 2, 3, 4, 5, 6] + byteLength: [1, 2, 3, 4, 5, 6], }); function main({ millions, buf, type, byteLength }) { diff --git a/benchmark/buffers/buffer-read.js b/benchmark/buffers/buffer-read.js index 88a46cb29079f6..7658d230389c9d 100644 --- a/benchmark/buffers/buffer-read.js +++ b/benchmark/buffers/buffer-read.js @@ -15,13 +15,13 @@ const types = [ 'FloatLE', 'FloatBE', 'DoubleLE', - 'DoubleBE' + 'DoubleBE', ]; const bench = common.createBenchmark(main, { buffer: ['fast', 'slow'], type: types, - millions: [1] + millions: [1], }); function main({ millions, buf, type }) { diff --git a/benchmark/buffers/buffer-slice.js b/benchmark/buffers/buffer-slice.js index 2e52475da91866..a3362e532ec49b 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: [1024] + n: [1024], }); const buf = Buffer.allocUnsafe(1024); diff --git a/benchmark/buffers/buffer-swap.js b/benchmark/buffers/buffer-swap.js index 8f6e1f51d3a0f2..c512588cb3395d 100644 --- a/benchmark/buffers/buffer-swap.js +++ b/benchmark/buffers/buffer-swap.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { aligned: ['true', 'false'], method: ['swap16', 'swap32', 'swap64'/*, 'htons', 'htonl', 'htonll'*/], len: [8, 64, 128, 256, 512, 768, 1024, 1536, 2056, 4096, 8192], - n: [5e7] + n: [5e7], }); // 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 71936fb622eae6..948dbed5ab96d9 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, 10, 256, 4 * 1024] + len: [0, 10, 256, 4 * 1024], }); function main({ n, len }) { diff --git a/benchmark/buffers/buffer-tostring.js b/benchmark/buffers/buffer-tostring.js index b2a14d8aec55ce..fc4cf510a8a3d8 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', 'binary', 'hex', 'UCS-2'], args: [0, 1, 2, 3], len: [0, 1, 64, 1024], - n: [1e7] + n: [1e7], }); function main({ encoding, args, len, n }) { diff --git a/benchmark/buffers/buffer-write-string.js b/benchmark/buffers/buffer-write-string.js index 37d4fda52c04e3..a4c71ecf57ecea 100644 --- a/benchmark/buffers/buffer-write-string.js +++ b/benchmark/buffers/buffer-write-string.js @@ -3,11 +3,11 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { encoding: [ - '', 'utf8', 'ascii', 'hex', 'UCS-2', 'utf16le', 'latin1', 'binary' + '', 'utf8', 'ascii', 'hex', 'UCS-2', 'utf16le', 'latin1', 'binary', ], args: [ '', 'offset', 'offset+length' ], len: [10, 2048], - n: [1e7] + n: [1e7], }); function main({ len, n, encoding, args }) { diff --git a/benchmark/buffers/buffer-write.js b/benchmark/buffers/buffer-write.js index 42ea9aa093cb88..4f23a03eb4957f 100644 --- a/benchmark/buffers/buffer-write.js +++ b/benchmark/buffers/buffer-write.js @@ -19,13 +19,13 @@ const types = [ 'FloatLE', 'FloatBE', 'DoubleLE', - 'DoubleBE' + 'DoubleBE', ]; const bench = common.createBenchmark(main, { buffer: ['fast', 'slow'], type: types, - millions: [1] + millions: [1], }); const INT8 = 0x7f; @@ -49,14 +49,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({ millions, buf, type }) { diff --git a/benchmark/buffers/buffer-zero.js b/benchmark/buffers/buffer-zero.js index 1263732dce8e43..d550b86c76840f 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: [1024], - 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 ee5acfb1c1f72c..4e203b0e52ba42 100644 --- a/benchmark/buffers/dataview-set.js +++ b/benchmark/buffers/dataview-set.js @@ -15,12 +15,12 @@ const types = [ 'Float32LE', 'Float32BE', 'Float64LE', - 'Float64BE' + 'Float64BE', ]; const bench = common.createBenchmark(main, { type: types, - millions: [1] + millions: [1], }); const INT8 = 0x7f; @@ -36,7 +36,7 @@ const mod = { setInt32: INT32, setUint8: UINT8, setUint16: UINT16, - setUint32: UINT32 + setUint32: UINT32, }; function main({ millions, type }) { diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js index a891026b86971f..42998386b2d3b1 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 3971eb8b39663e..dbca37bf725cc6 100644 --- a/benchmark/child_process/child-process-read-ipc.js +++ b/benchmark/child_process/child-process-read-ipc.js @@ -13,9 +13,9 @@ if (process.argv[2] === 'child') { const bench = common.createBenchmark(main, { len: [ 64, 256, 1024, 4096, 16384, 65536, - 65536 << 4, 65536 << 8 + 65536 << 4, 65536 << 8, ], - 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 0ff08af79483b8..38dd073a6e2a0a 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 62f46fb4c0e8b4..68c57f3c89c364 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 90ae7f9fb0b677..1b37a35a174cac 100644 --- a/benchmark/cluster/echo.js +++ b/benchmark/cluster/echo.js @@ -7,7 +7,7 @@ if (cluster.isMaster) { workers: [1], payload: ['string', 'object'], sendsPerBroadcast: [1, 10], - n: [1e5] + n: [1e5], }); function main({ n, workers, sendsPerBroadcast, payload }) { diff --git a/benchmark/common.js b/benchmark/common.js index 148f51830f7b8d..ec6f813774ca77 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -137,7 +137,7 @@ Benchmark.prototype._run = function() { process.send({ type: 'config', name: this.name, - queueLength: this.queue.length + queueLength: this.queue.length, }); } @@ -160,7 +160,7 @@ Benchmark.prototype._run = function() { const child = child_process.fork(require.main.filename, childArgs, { env: childEnv, - execArgv: self.flags.concat(process.execArgv) + execArgv: self.flags.concat(process.execArgv), }); child.on('message', sendResult); child.on('close', function(code) { @@ -239,6 +239,6 @@ Benchmark.prototype.report = function(rate, elapsed) { conf: this.config, rate: rate, time: elapsed[0] + elapsed[1] / 1e9, - type: 'report' + type: 'report', }); }; diff --git a/benchmark/compare.js b/benchmark/compare.js index e7866b60e36418..f1953e962158bb 100644 --- a/benchmark/compare.js +++ b/benchmark/compare.js @@ -69,7 +69,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', function(data) { diff --git a/benchmark/crypto/aes-gcm-throughput.js b/benchmark/crypto/aes-gcm-throughput.js index 5c1e71e7280575..6084d352146dbd 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 64f6ff7b7292be..0b66dc650a0a5d 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { cipher: [ 'AES192', 'AES256' ], type: ['asc', 'utf', 'buf'], len: [2, 1024, 102400, 1024 * 1024], - api: ['legacy', 'stream'] + api: ['legacy', 'stream'], }); function main({ api, cipher, type, len, writes }) { diff --git a/benchmark/crypto/get-ciphers.js b/benchmark/crypto/get-ciphers.js index d4c10a2427d360..d53eb77869612f 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 faaa12a9e5d484..cf176b63e7bf9c 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 934e7a0b11bdae..07024fa2bba0b5 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/rsa-encrypt-decrypt-throughput.js b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js index 40b69c31f977ca..e0870a29cf6ca3 100644 --- a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js +++ b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js @@ -19,7 +19,7 @@ keylen_list.forEach(function(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 3a0373b57d0bba..8f88d16868c4b7 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/dgram/array-vs-concat.js b/benchmark/dgram/array-vs-concat.js index a7843a9c7f7c28..c32e46822e01ca 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 ee74c584e45278..46f44acebcb8d8 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 8a2df9ac67c1b6..3c07e149866de6 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 0bf650d265c177..a7a76eebefd985 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/dns/lookup.js b/benchmark/dns/lookup.js index 3cc228c5669265..54f0fdb2a81b3f 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 c889b35442d046..84ee3130a77aa9 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 a00b50137c1af3..321cb3e759574e 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'], - millions: [100] + millions: [100], }); function oldStyleDefaults(x, y) { diff --git a/benchmark/es/destructuring-bench.js b/benchmark/es/destructuring-bench.js index 2168940bdc44f0..77d913e2b935c4 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'], - millions: [100] + millions: [100], }); function runSwapManual(millions) { diff --git a/benchmark/es/destructuring-object-bench.js b/benchmark/es/destructuring-object-bench.js index a84977c59bc2cd..60ef36d8fcd611 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'], - millions: [100] + millions: [100], }); function runNormal(millions) { diff --git a/benchmark/es/foreach-bench.js b/benchmark/es/foreach-bench.js index e9179ed8dedb6d..058404421faefb 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], - millions: [5] + millions: [5], }); function useFor(millions, items, count) { diff --git a/benchmark/es/map-bench.js b/benchmark/es/map-bench.js index 445031aa9831de..280815ae463226 100644 --- a/benchmark/es/map-bench.js +++ b/benchmark/es/map-bench.js @@ -6,9 +6,9 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { method: [ 'object', 'nullProtoObject', 'nullProtoLiteralObject', 'storageObject', - 'fakeMap', 'map' + 'fakeMap', 'map', ], - millions: [1] + millions: [1], }); function runObject(millions) { @@ -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 6ad766f10f16f6..9095170946d99c 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'], - millions: [100] + millions: [100], }); function copyArguments() { diff --git a/benchmark/es/spread-assign.js b/benchmark/es/spread-assign.js index 00c634ff879501..ed8fdb683d5b15 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], - millions: [1] + millions: [1], }); function main({ millions, context, count, rest, method }) { diff --git a/benchmark/es/spread-bench.js b/benchmark/es/spread-bench.js index 067299cd650919..c880872263e24e 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], - millions: [5] + millions: [5], }); function makeTest(count, rest) { diff --git a/benchmark/fixtures/simple-http-server.js b/benchmark/fixtures/simple-http-server.js index d2eda0c085c9f2..5668c90b13062e 100644 --- a/benchmark/fixtures/simple-http-server.js +++ b/benchmark/fixtures/simple-http-server.js @@ -84,7 +84,7 @@ module.exports = http.createServer(function(req, res) { default: res.writeHead(200, { 'Content-Type': 'text/plain', - 'Transfer-Encoding': 'chunked' + 'Transfer-Encoding': 'chunked', }); } req.pipe(res); @@ -117,12 +117,12 @@ module.exports = http.createServer(function(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/url-inputs.js b/benchmark/fixtures/url-inputs.js index 7b1983f6faa590..d43ca399bd700b 100644 --- a/benchmark/fixtures/url-inputs.js +++ b/benchmark/fixtures/url-inputs.js @@ -12,7 +12,7 @@ exports.urls = { ws: 'ws://localhost:9229/f46db715-70df-43ad-a359-7f9949f39868', javascript: 'javascript:alert("node is awesome");', percent: 'https://%E4%BD%A0/foo', - dot: 'https://example.org/./a/../b/./c' + dot: 'https://example.org/./a/../b/./c', }; exports.searchParams = { @@ -26,5 +26,5 @@ exports.searchParams = { 'foo=ghi&foo=jkl&foo=mno&foo=pqr&foo=stu&foo=vwxyz', manypairs: 'a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z', manyblankpairs: '&&&&&&&&&&&&&&&&&&&&&&&&', - altspaces: 'foo+bar=baz+quux&xyzzy+thud=quuy+quuz&abc=def+ghi' + altspaces: 'foo+bar=baz+quux&xyzzy+thud=quuy+quuz&abc=def+ghi', }; diff --git a/benchmark/fs/bench-stat-promise.js b/benchmark/fs/bench-stat-promise.js index b0317455728b46..2c801a8ef66ea5 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 8a401ae0b9d857..56256d29cd3f52 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.js b/benchmark/fs/bench-statSync.js index bd8754a6c3d0e3..84bbf5a630aa45 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 3af80132725ec0..323bf5a184619d 100644 --- a/benchmark/fs/read-stream-throughput.js +++ b/benchmark/fs/read-stream-throughput.js @@ -13,7 +13,7 @@ let encodingType, encoding, size, filesize; const bench = common.createBenchmark(main, { encodingType: ['buf', 'asc', 'utf'], filesize: [1000 * 1024 * 1024], - size: [1024, 4096, 65535, 1024 * 1024] + size: [1024, 4096, 65535, 1024 * 1024], }); function main(conf) { @@ -42,7 +42,7 @@ function runTest() { assert(fs.statSync(filename).size === filesize); const rs = fs.createReadStream(filename, { highWaterMark: size, - encoding: encoding + encoding: encoding, }); rs.on('open', function() { diff --git a/benchmark/fs/readFileSync.js b/benchmark/fs/readFileSync.js index c28adeb229b358..c83198dc6429b7 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 be3b7fd057bbe0..3f0a6308338a9c 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(conf) { diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js index 282b4ac7621340..00fdc6f80fcf90 100644 --- a/benchmark/fs/readfile.js +++ b/benchmark/fs/readfile.js @@ -13,7 +13,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/write-stream-throughput.js b/benchmark/fs/write-stream-throughput.js index 60ad47bc4eabe1..da950e46232c3b 100644 --- a/benchmark/fs/write-stream-throughput.js +++ b/benchmark/fs/write-stream-throughput.js @@ -10,7 +10,7 @@ const fs = require('fs'); 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/http/check_invalid_header_char.js b/benchmark/http/check_invalid_header_char.js index c70b0d39db2ffc..3547a2c0125f1e 100644 --- a/benchmark/http/check_invalid_header_char.js +++ b/benchmark/http/check_invalid_header_char.js @@ -18,12 +18,12 @@ const groupedInputs = { 'sessionid=; Path=/', 'text/html; charset=utf-8', 'text/html; charset=utf-8', '10', 'W/"a-eda64de5"', 'OK', 'Express', 'Express', 'X-HTTP-Method-Override', 'sessionid=; Path=/', - 'application/json' + 'application/json', ], // 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 = [ @@ -45,7 +45,7 @@ const inputs = [ // Invalid '中文呢', // unicode 'foo\nbar', - '\x7F' + '\x7F', ]; const bench = common.createBenchmark(main, { diff --git a/benchmark/http/check_is_http_token.js b/benchmark/http/check_is_http_token.js index c16993819be93b..eab075249e6f80 100644 --- a/benchmark/http/check_is_http_token.js +++ b/benchmark/http/check_is_http_token.js @@ -35,7 +35,7 @@ const bench = common.createBenchmark(main, { '中文呢', // unicode '((((())))', // invalid ':alternate-protocol', // fast bailout - 'alternate-protocol:' // slow bailout + 'alternate-protocol:', // slow bailout ], n: [1e6], }); diff --git a/benchmark/http/chunked.js b/benchmark/http/chunked.js index 5615395ee0b175..743729188c6bfb 100644 --- a/benchmark/http/chunked.js +++ b/benchmark/http/chunked.js @@ -13,7 +13,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1, 4, 8, 16], len: [1, 64, 256], - c: [100] + c: [100], }); function main({ len, n, c }) { @@ -33,7 +33,7 @@ function main({ len, n, c }) { server.listen(common.PORT, function() { bench.http({ - connections: c + connections: c, }, function() { server.close(); }); diff --git a/benchmark/http/client-request-body.js b/benchmark/http/client-request-body.js index 49bb9130ae3a8a..6f5cd63d4f7a9c 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(function(req, res) { diff --git a/benchmark/http/cluster.js b/benchmark/http/cluster.js index 56393fa1ab0518..16a2fc5fab0ca4 100644 --- a/benchmark/http/cluster.js +++ b/benchmark/http/cluster.js @@ -8,7 +8,7 @@ if (cluster.isMaster) { // unicode confuses ab on os x. type: ['bytes', 'buffer'], len: [4, 1024, 102400], - c: [50, 500] + c: [50, 500], }); } else { const port = parseInt(process.env.PORT || PORT); @@ -31,7 +31,7 @@ function main({ type, len, c }) { bench.http({ path: path, - connections: c + connections: c, }, function() { w1.destroy(); w2.destroy(); diff --git a/benchmark/http/create-clientrequest.js b/benchmark/http/create-clientrequest.js index 97316a7e800419..dbd13baed6de23 100644 --- a/benchmark/http/create-clientrequest.js +++ b/benchmark/http/create-clientrequest.js @@ -5,7 +5,7 @@ const ClientRequest = require('http').ClientRequest; const bench = common.createBenchmark(main, { len: [1, 8, 16, 32, 64, 128], - n: [1e6] + n: [1e6], }); function main({ len, n }) { diff --git a/benchmark/http/end-vs-write-end.js b/benchmark/http/end-vs-write-end.js index f839e5c3cd9ed9..fb4b4d612d93b7 100644 --- a/benchmark/http/end-vs-write-end.js +++ b/benchmark/http/end-vs-write-end.js @@ -14,7 +14,7 @@ const bench = common.createBenchmark(main, { type: ['asc', 'utf', 'buf'], len: [64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024], c: [100], - method: ['write', 'end'] + method: ['write', 'end'], }); function main({ len, type, method, c }) { @@ -49,7 +49,7 @@ function main({ len, type, method, c }) { server.listen(common.PORT, function() { bench.http({ - connections: c + connections: c, }, function() { server.close(); }); diff --git a/benchmark/http/http_server_for_chunky_client.js b/benchmark/http/http_server_for_chunky_client.js index 1e5a4583669c0f..6938c9a80fb487 100644 --- a/benchmark/http/http_server_for_chunky_client.js +++ b/benchmark/http/http_server_for_chunky_client.js @@ -15,7 +15,7 @@ var server; server = http.createServer(function(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/set-header.js b/benchmark/http/set-header.js index f0987f2cc77150..74b5d1bb4b029c 100644 --- a/benchmark/http/set-header.js +++ b/benchmark/http/set-header.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const PORT = common.PORT; const bench = common.createBenchmark(main, { - res: ['normal', 'setHeader', 'setHeaderWH'] + res: ['normal', 'setHeader', 'setHeaderWH'], }); const type = 'bytes'; @@ -24,7 +24,7 @@ function main({ res }) { bench.http({ path: path, - connections: c + connections: c, }, function() { server.close(); }); diff --git a/benchmark/http/set_header.js b/benchmark/http/set_header.js index 22de61b3f847a3..4129e4fee0cee7 100644 --- a/benchmark/http/set_header.js +++ b/benchmark/http/set_header.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { 'Content-Type', 'Content-Length', 'Connection', - 'Transfer-Encoding' + 'Transfer-Encoding', ], n: [1e6], }); diff --git a/benchmark/http/simple.js b/benchmark/http/simple.js index 6d1851c45e17b2..78a6d6a7d836a1 100644 --- a/benchmark/http/simple.js +++ b/benchmark/http/simple.js @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, { len: [4, 1024, 102400], chunks: [1, 4], c: [50, 500], - chunkedEnc: [1, 0] + chunkedEnc: [1, 0], }); function main({ type, len, chunks, c, chunkedEnc, res }) { @@ -18,7 +18,7 @@ function main({ type, len, chunks, c, chunkedEnc, res }) { bench.http({ path: path, - connections: c + connections: c, }, function() { server.close(); }); diff --git a/benchmark/http/upgrade.js b/benchmark/http/upgrade.js index 6b39323396a2e3..8d2e540ef814cd 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/headers.js b/benchmark/http2/headers.js index ad1eb50007a92d..1aa54c17aebcf4 100644 --- a/benchmark/http2/headers.js +++ b/benchmark/http2/headers.js @@ -6,13 +6,13 @@ const PORT = common.PORT; const bench = common.createBenchmark(main, { n: [1e3], nheaders: [0, 10, 100, 1000], - benchmarker: ['h2load'] + benchmarker: ['h2load'], }, { flags: ['--no-warnings', '--expose-http2'] }); function main({ n, nheaders }) { const http2 = require('http2'); const server = http2.createServer({ - maxHeaderListPairs: 20000 + maxHeaderListPairs: 20000, }); const headersObject = { @@ -22,7 +22,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 (var i = 0; i < nheaders; i++) { @@ -35,7 +35,7 @@ function main({ n, nheaders }) { }); server.listen(PORT, () => { const client = http2.connect(`http://localhost:${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 fa7b2fbd16b3e6..ed4cc33260545e 100644 --- a/benchmark/http2/respond-with-fd.js +++ b/benchmark/http2/respond-with-fd.js @@ -10,7 +10,7 @@ const bench = common.createBenchmark(main, { requests: [100, 1000, 10000, 100000, 1000000], streams: [100, 200, 1000], clients: [1, 2], - benchmarker: ['h2load'] + benchmarker: ['h2load'], }, { flags: ['--no-warnings', '--expose-http2'] }); function main({ requests, streams, clients }) { @@ -30,7 +30,7 @@ function main({ requests, streams, clients }) { requests, maxConcurrentStreams: streams, clients, - threads: clients + threads: clients, }, () => server.close()); }); diff --git a/benchmark/http2/simple.js b/benchmark/http2/simple.js index cf017e6735411e..ee38d53850e063 100644 --- a/benchmark/http2/simple.js +++ b/benchmark/http2/simple.js @@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, { requests: [100, 1000, 10000, 100000], streams: [100, 200, 1000], clients: [1, 2], - benchmarker: ['h2load'] + benchmarker: ['h2load'], }, { flags: ['--no-warnings', '--expose-http2'] }); function main({ requests, streams, clients }) { @@ -27,7 +27,7 @@ function main({ requests, streams, clients }) { requests, maxConcurrentStreams: streams, clients, - threads: clients + threads: clients, }, () => { server.close(); }); }); } diff --git a/benchmark/http2/write.js b/benchmark/http2/write.js index 6fcb1254ca3f05..652d6bcbde88b2 100644 --- a/benchmark/http2/write.js +++ b/benchmark/http2/write.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { streams: [100, 200, 1000], length: [64 * 1024, 128 * 1024, 256 * 1024, 1024 * 1024], size: [100000], - benchmarker: ['h2load'] + benchmarker: ['h2load'], }, { flags: ['--no-warnings', '--expose-http2'] }); function main({ streams, length, size }) { diff --git a/benchmark/misc/arguments.js b/benchmark/misc/arguments.js index 2e5df6188b07f5..d789814f1d7e07 100644 --- a/benchmark/misc/arguments.js +++ b/benchmark/misc/arguments.js @@ -7,12 +7,12 @@ const methods = [ 'restAndSpread', 'argumentsAndApply', 'restAndApply', - 'predefined' + 'predefined', ]; 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 8c3281cc407363..f50a9c2b6d1ba1 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/function_call/index.js b/benchmark/misc/function_call/index.js index 28561bc48cd7c3..fab7d2008ff2bf 100644 --- a/benchmark/misc/function_call/index.js +++ b/benchmark/misc/function_call/index.js @@ -28,7 +28,7 @@ assert(js() === cxx()); const bench = common.createBenchmark(main, { type: ['js', 'cxx'], - millions: [1, 10, 50] + millions: [1, 10, 50], }); function main({ millions, type }) { diff --git a/benchmark/misc/object-property-bench.js b/benchmark/misc/object-property-bench.js index 3a181ed0a540f8..17fb96b9ca1fc2 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'], - millions: [1000] + millions: [1000], }); function runProperty(n) { diff --git a/benchmark/misc/punycode.js b/benchmark/misc/punycode.js index 369adcf17d3973..37f57ef1ffdb28 100644 --- a/benchmark/misc/punycode.js +++ b/benchmark/misc/punycode.js @@ -32,8 +32,8 @@ const bench = common.createBenchmark(main, { 'éire.icom.museum', 'איקו״ם.ישראל.museum', '日本.icom.museum', - 'الأردن.icom.museum' - ] + 'الأردن.icom.museum', + ], }); function usingPunycode(val) { diff --git a/benchmark/misc/startup.js b/benchmark/misc/startup.js index 703146f081b3c6..81ba377c4797ae 100644 --- a/benchmark/misc/startup.js +++ b/benchmark/misc/startup.js @@ -5,7 +5,7 @@ const path = require('path'); const emptyJsFile = path.resolve(__dirname, '../../test/fixtures/semicolon.js'); const bench = common.createBenchmark(startNode, { - dur: [1] + dur: [1], }); function startNode({ dur }) { diff --git a/benchmark/misc/util-extend-vs-object-assign.js b/benchmark/misc/util-extend-vs-object-assign.js index 149619f6e1dea3..8cb1d3336a300c 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.js b/benchmark/module/module-loader.js index 58d4dcf81c9316..8ec0caf3c1f1b2 100644 --- a/benchmark/module/module-loader.js +++ b/benchmark/module/module-loader.js @@ -9,7 +9,7 @@ const benchmarkDirectory = path.join(tmpdir.path, 'nodejs-benchmark-module'); const bench = common.createBenchmark(main, { thousands: [50], fullPath: ['true', 'false'], - useCache: ['true', 'false'] + useCache: ['true', 'false'], }); function main({ thousands, fullPath, useCache }) { diff --git a/benchmark/net/net-s2c.js b/benchmark/net/net-s2c.js index 2ddf8fd6c5ff67..92bba8eaa14a83 100644 --- a/benchmark/net/net-s2c.js +++ b/benchmark/net/net-s2c.js @@ -7,7 +7,7 @@ const PORT = common.PORT; const bench = common.createBenchmark(main, { len: [102400, 1024 * 1024 * 16], type: ['utf', 'asc', 'buf'], - dur: [5] + dur: [5], }); var chunk; diff --git a/benchmark/net/net-wrap-js-stream-passthrough.js b/benchmark/net/net-wrap-js-stream-passthrough.js index 05a66f4e7ab783..0ce908cffc3876 100644 --- a/benchmark/net/net-wrap-js-stream-passthrough.js +++ b/benchmark/net/net-wrap-js-stream-passthrough.js @@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, { type: ['utf', 'asc', 'buf'], dur: [5], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); var chunk; diff --git a/benchmark/net/tcp-raw-c2s.js b/benchmark/net/tcp-raw-c2s.js index 4b6dd9c3f2b145..1b75a3d29d685a 100644 --- a/benchmark/net/tcp-raw-c2s.js +++ b/benchmark/net/tcp-raw-c2s.js @@ -11,7 +11,7 @@ const util = require('util'); const bench = common.createBenchmark(main, { len: [102400, 1024 * 1024 * 16], type: ['utf', 'asc', 'buf'], - dur: [5] + dur: [5], }); const { TCP, constants: TCPConstants } = process.binding('tcp_wrap'); diff --git a/benchmark/net/tcp-raw-pipe.js b/benchmark/net/tcp-raw-pipe.js index dfde3d40b50b55..7ba4051757e6bc 100644 --- a/benchmark/net/tcp-raw-pipe.js +++ b/benchmark/net/tcp-raw-pipe.js @@ -11,7 +11,7 @@ const util = require('util'); const bench = common.createBenchmark(main, { len: [102400, 1024 * 1024 * 16], type: ['utf', 'asc', 'buf'], - dur: [5] + dur: [5], }); function fail(err, syscall) { diff --git a/benchmark/net/tcp-raw-s2c.js b/benchmark/net/tcp-raw-s2c.js index fe0bffd8127ec7..6ef6bdf38a860c 100644 --- a/benchmark/net/tcp-raw-s2c.js +++ b/benchmark/net/tcp-raw-s2c.js @@ -11,7 +11,7 @@ const util = require('util'); const bench = common.createBenchmark(main, { len: [102400, 1024 * 1024 * 16], type: ['utf', 'asc', 'buf'], - dur: [5] + dur: [5], }); const { TCP, constants: TCPConstants } = process.binding('tcp_wrap'); diff --git a/benchmark/os/cpus.js b/benchmark/os/cpus.js index da158a1b061c7f..2f019d583afa37 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 2cd38316b24bdd..8105b511b95b77 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/path/basename-posix.js b/benchmark/path/basename-posix.js index 20b734703f0746..6094d8a054e658 100644 --- a/benchmark/path/basename-posix.js +++ b/benchmark/path/basename-posix.js @@ -13,9 +13,9 @@ const bench = common.createBenchmark(main, { 'foo/bar.', ['foo/bar.', '.'].join('|'), '/foo/bar/baz/asdf/quux.html', - ['/foo/bar/baz/asdf/quux.html', '.html'].join('|') + ['/foo/bar/baz/asdf/quux.html', '.html'].join('|'), ], - n: [1e6] + n: [1e6], }); function main({ n, pathext }) { diff --git a/benchmark/path/basename-win32.js b/benchmark/path/basename-win32.js index 937dc6f6948c5d..7c203ea1bf1e91 100644 --- a/benchmark/path/basename-win32.js +++ b/benchmark/path/basename-win32.js @@ -13,9 +13,9 @@ const bench = common.createBenchmark(main, { 'foo\\bar.', ['foo\\bar.', '.'].join('|'), '\\foo\\bar\\baz\\asdf\\quux.html', - ['\\foo\\bar\\baz\\asdf\\quux.html', '.html'].join('|') + ['\\foo\\bar\\baz\\asdf\\quux.html', '.html'].join('|'), ], - n: [1e6] + n: [1e6], }); function main({ n, pathext }) { diff --git a/benchmark/path/dirname-posix.js b/benchmark/path/dirname-posix.js index a045125f43c730..940d831420c420 100644 --- a/benchmark/path/dirname-posix.js +++ b/benchmark/path/dirname-posix.js @@ -10,9 +10,9 @@ const bench = common.createBenchmark(main, { '/foo/bar', 'foo', 'foo/bar', - '/foo/bar/baz/asdf/quux' + '/foo/bar/baz/asdf/quux', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/dirname-win32.js b/benchmark/path/dirname-win32.js index f47abdd37910e2..92115214a032b6 100644 --- a/benchmark/path/dirname-win32.js +++ b/benchmark/path/dirname-win32.js @@ -10,9 +10,9 @@ const bench = common.createBenchmark(main, { 'C:\\foo\\bar', 'foo', 'foo\\bar', - 'D:\\foo\\bar\\baz\\asdf\\quux' + 'D:\\foo\\bar\\baz\\asdf\\quux', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/extname-posix.js b/benchmark/path/extname-posix.js index 3dde5e99005d72..5e7cfd376c1caf 100644 --- a/benchmark/path/extname-posix.js +++ b/benchmark/path/extname-posix.js @@ -13,9 +13,9 @@ const bench = common.createBenchmark(main, { 'foo/bar/..baz.quux', 'foo/bar/...baz.quux', '/foo/bar/baz/asdf/quux', - '/foo/bar/baz/asdf/quux.foobarbazasdfquux' + '/foo/bar/baz/asdf/quux.foobarbazasdfquux', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/extname-win32.js b/benchmark/path/extname-win32.js index 55602df34b4a24..416d93f8118159 100644 --- a/benchmark/path/extname-win32.js +++ b/benchmark/path/extname-win32.js @@ -13,9 +13,9 @@ const bench = common.createBenchmark(main, { 'foo\\bar\\..baz.quux', 'foo\\bar\\...baz.quux', 'D:\\foo\\bar\\baz\\asdf\\quux', - '\\foo\\bar\\baz\\asdf\\quux.foobarbazasdfquux' + '\\foo\\bar\\baz\\asdf\\quux.foobarbazasdfquux', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/format-posix.js b/benchmark/path/format-posix.js index aa92c06a4d5b2f..94323c13b62151 100644 --- a/benchmark/path/format-posix.js +++ b/benchmark/path/format-posix.js @@ -4,9 +4,9 @@ const { posix } = require('path'); const bench = common.createBenchmark(main, { props: [ - ['/', '/home/user/dir', 'index.html', '.html', 'index'].join('|') + ['/', '/home/user/dir', 'index.html', '.html', 'index'].join('|'), ], - n: [1e7] + n: [1e7], }); function main({ n, props }) { diff --git a/benchmark/path/format-win32.js b/benchmark/path/format-win32.js index 5921f95cf12064..1df3010fe2241c 100644 --- a/benchmark/path/format-win32.js +++ b/benchmark/path/format-win32.js @@ -4,9 +4,9 @@ const { win32 } = require('path'); const bench = common.createBenchmark(main, { props: [ - ['C:\\', 'C:\\path\\dir', 'index.html', '.html', 'index'].join('|') + ['C:\\', 'C:\\path\\dir', 'index.html', '.html', 'index'].join('|'), ], - n: [1e7] + n: [1e7], }); function main({ n, props }) { diff --git a/benchmark/path/isAbsolute-posix.js b/benchmark/path/isAbsolute-posix.js index 42994840487c68..ba32b44c1886b5 100644 --- a/benchmark/path/isAbsolute-posix.js +++ b/benchmark/path/isAbsolute-posix.js @@ -8,9 +8,9 @@ const bench = common.createBenchmark(main, { '.', '/foo/bar', '/baz/..', - 'bar/baz' + 'bar/baz', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/isAbsolute-win32.js b/benchmark/path/isAbsolute-win32.js index 350e99d48b74a5..40660c803b2a14 100644 --- a/benchmark/path/isAbsolute-win32.js +++ b/benchmark/path/isAbsolute-win32.js @@ -9,9 +9,9 @@ const bench = common.createBenchmark(main, { '//server', 'C:\\baz\\..', 'C:baz\\..', - 'bar\\baz' + 'bar\\baz', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/join-posix.js b/benchmark/path/join-posix.js index f06f74ad37fc46..b55ddec553f419 100644 --- a/benchmark/path/join-posix.js +++ b/benchmark/path/join-posix.js @@ -4,9 +4,9 @@ const { posix } = require('path'); const bench = common.createBenchmark(main, { paths: [ - ['/foo', 'bar', '', 'baz/asdf', 'quux', '..'].join('|') + ['/foo', 'bar', '', 'baz/asdf', 'quux', '..'].join('|'), ], - n: [1e6] + n: [1e6], }); function main({ n, paths }) { diff --git a/benchmark/path/join-win32.js b/benchmark/path/join-win32.js index 2fa29f8ebfd356..67ec9055ff9262 100644 --- a/benchmark/path/join-win32.js +++ b/benchmark/path/join-win32.js @@ -4,9 +4,9 @@ const { win32 } = require('path'); const bench = common.createBenchmark(main, { paths: [ - ['C:\\foo', 'bar', '', 'baz\\asdf', 'quux', '..'].join('|') + ['C:\\foo', 'bar', '', 'baz\\asdf', 'quux', '..'].join('|'), ], - n: [1e6] + n: [1e6], }); function main({ n, paths }) { diff --git a/benchmark/path/makeLong-win32.js b/benchmark/path/makeLong-win32.js index 4314692eefab5e..80cc7473a1d0bc 100644 --- a/benchmark/path/makeLong-win32.js +++ b/benchmark/path/makeLong-win32.js @@ -7,9 +7,9 @@ const bench = common.createBenchmark(main, { 'foo\\bar', 'C:\\foo', '\\\\foo\\bar', - '\\\\?\\foo' + '\\\\?\\foo', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/normalize-posix.js b/benchmark/path/normalize-posix.js index 84ac8d2c7c89d2..538a6eb0f7ca4a 100644 --- a/benchmark/path/normalize-posix.js +++ b/benchmark/path/normalize-posix.js @@ -9,9 +9,9 @@ const bench = common.createBenchmark(main, { '/../', '/foo', '/foo/bar', - '/foo/bar//baz/asdf/quux/..' + '/foo/bar//baz/asdf/quux/..', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/normalize-win32.js b/benchmark/path/normalize-win32.js index 9b983eb9686580..86425c9e998d82 100644 --- a/benchmark/path/normalize-win32.js +++ b/benchmark/path/normalize-win32.js @@ -9,9 +9,9 @@ const bench = common.createBenchmark(main, { 'C:\\..\\', 'C:\\foo', 'C:\\foo\\bar', - 'C:\\foo\\bar\\\\baz\\asdf\\quux\\..' + 'C:\\foo\\bar\\\\baz\\asdf\\quux\\..', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/parse-posix.js b/benchmark/path/parse-posix.js index dd1153d3c68b7e..1d50fc1a3bf545 100644 --- a/benchmark/path/parse-posix.js +++ b/benchmark/path/parse-posix.js @@ -10,9 +10,9 @@ const bench = common.createBenchmark(main, { '/foo/bar.baz', 'foo/.bar.baz', 'foo/bar', - '/foo/bar/baz/asdf/.quux' + '/foo/bar/baz/asdf/.quux', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/parse-win32.js b/benchmark/path/parse-win32.js index 8c4f06272f4b05..3d1e07142dfb2b 100644 --- a/benchmark/path/parse-win32.js +++ b/benchmark/path/parse-win32.js @@ -11,9 +11,9 @@ const bench = common.createBenchmark(main, { 'E:\\foo\\bar.baz', 'foo\\.bar.baz', 'foo\\bar', - '\\foo\\bar\\baz\\asdf\\.quux' + '\\foo\\bar\\baz\\asdf\\.quux', ], - n: [1e6] + n: [1e6], }); function main({ n, path }) { diff --git a/benchmark/path/relative-posix.js b/benchmark/path/relative-posix.js index 70a0e434d98313..906e5ad4fe535c 100644 --- a/benchmark/path/relative-posix.js +++ b/benchmark/path/relative-posix.js @@ -10,9 +10,9 @@ const bench = common.createBenchmark(main, { ['/var', '/bin'].join('|'), ['/foo/bar/baz/quux', '/'].join('|'), ['/foo/bar/baz/quux', '/foo/bar/baz/quux'].join('|'), - ['/foo/bar/baz/quux', '/var/log'].join('|') + ['/foo/bar/baz/quux', '/var/log'].join('|'), ], - n: [1e6] + n: [1e6], }); function main({ n, paths }) { diff --git a/benchmark/path/relative-win32.js b/benchmark/path/relative-win32.js index 4a97e82e028a0c..9fb0094166fe43 100644 --- a/benchmark/path/relative-win32.js +++ b/benchmark/path/relative-win32.js @@ -8,9 +8,9 @@ const bench = common.createBenchmark(main, { ['C:\\', 'D:\\'].join('|'), ['C:\\foo\\bar\\baz', 'C:\\foo\\bar\\baz'].join('|'), ['C:\\foo\\BAR\\BAZ', 'C:\\foo\\bar\\baz'].join('|'), - ['C:\\foo\\bar\\baz\\quux', 'C:\\'].join('|') + ['C:\\foo\\bar\\baz\\quux', 'C:\\'].join('|'), ], - n: [1e6] + n: [1e6], }); function main({ n, paths }) { diff --git a/benchmark/path/resolve-posix.js b/benchmark/path/resolve-posix.js index 91f4c1da102a5c..839386fd852b29 100644 --- a/benchmark/path/resolve-posix.js +++ b/benchmark/path/resolve-posix.js @@ -7,9 +7,9 @@ const bench = common.createBenchmark(main, { '', ['', ''].join('|'), ['foo/bar', '/tmp/file/', '..', 'a/../subfile'].join('|'), - ['a/b/c/', '../../..'].join('|') + ['a/b/c/', '../../..'].join('|'), ], - n: [1e6] + n: [1e6], }); function main({ n, paths }) { diff --git a/benchmark/path/resolve-win32.js b/benchmark/path/resolve-win32.js index 1047da5184b528..fc8cf05b235727 100644 --- a/benchmark/path/resolve-win32.js +++ b/benchmark/path/resolve-win32.js @@ -7,9 +7,9 @@ const bench = common.createBenchmark(main, { '', ['', ''].join('|'), ['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'].join('|'), - ['c:/blah\\blah', 'd:/games', 'c:../a'].join('|') + ['c:/blah\\blah', 'd:/games', 'c:../a'].join('|'), ], - n: [1e6] + n: [1e6], }); function main({ n, paths }) { diff --git a/benchmark/process/bench-hrtime.js b/benchmark/process/bench-hrtime.js index 9152a32b22d213..0a82eaa525ceef 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'] + type: ['raw', 'diff'], }); function main({ n, type }) { diff --git a/benchmark/process/memoryUsage.js b/benchmark/process/memoryUsage.js index f9b969ab885d8b..2a8eca7027eedb 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 d759b955c429fe..bde272e3a8aad5 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, { - millions: [4] + millions: [4], }); function main({ millions }) { diff --git a/benchmark/process/next-tick-breadth.js b/benchmark/process/next-tick-breadth.js index aebd623869b577..bda7d1e5f845a2 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, { - millions: [4] + millions: [4], }); function main({ millions }) { diff --git a/benchmark/process/next-tick-depth-args.js b/benchmark/process/next-tick-depth-args.js index 1c1b95bdc84bd1..6914946dd1bff2 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, { - millions: [12] + millions: [12], }); process.maxTickDepth = Infinity; diff --git a/benchmark/process/next-tick-depth.js b/benchmark/process/next-tick-depth.js index 99fc83c3772276..49496abb89c1df 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, { - millions: [12] + millions: [12], }); process.maxTickDepth = Infinity; diff --git a/benchmark/process/next-tick-exec-args.js b/benchmark/process/next-tick-exec-args.js index 9e8ff73838460a..23a958c8d4ff34 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, { - millions: [5] + millions: [5], }); function main({ millions }) { diff --git a/benchmark/process/next-tick-exec.js b/benchmark/process/next-tick-exec.js index a8897cd7456476..1b9589a9c3afb9 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, { - millions: [5] + millions: [5], }); function main({ millions }) { diff --git a/benchmark/querystring/querystring-stringify.js b/benchmark/querystring/querystring-stringify.js index cd1debd4df622d..46917c439a9deb 100644 --- a/benchmark/querystring/querystring-stringify.js +++ b/benchmark/querystring/querystring-stringify.js @@ -12,18 +12,18 @@ 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', + }, }; const input = inputs[type]; diff --git a/benchmark/querystring/querystring-unescapebuffer.js b/benchmark/querystring/querystring-unescapebuffer.js index 4f73ed024b11b1..39dd085eda938c 100644 --- a/benchmark/querystring/querystring-unescapebuffer.js +++ b/benchmark/querystring/querystring-unescapebuffer.js @@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, { 'there is nothing to unescape here', 'there%20are%20several%20spaces%20that%20need%20to%20be%20unescaped', 'there%2Qare%0-fake%escaped values in%%%%this%9Hstring', - '%20%21%22%23%24%25%26%27%28%29%2A%2B%2C%2D%2E%2F%30%31%32%33%34%35%36%37' + '%20%21%22%23%24%25%26%27%28%29%2A%2B%2C%2D%2E%2F%30%31%32%33%34%35%36%37', ], n: [10e6], }); diff --git a/benchmark/streams/pipe-object-mode.js b/benchmark/streams/pipe-object-mode.js index d52b2238780ccb..e0d5631d2ffc1c 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 4baeeb2d2e7706..be9ac982d90279 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-bigread.js b/benchmark/streams/readable-bigread.js index 62d1af874fb22a..0358b32077ae43 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: [100e1] + n: [100e1], }); function main({ n }) { diff --git a/benchmark/streams/readable-bigunevenread.js b/benchmark/streams/readable-bigunevenread.js index e13769189a69da..a6a4d3790a7b3c 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: [100e1] + n: [100e1], }); function main({ n }) { diff --git a/benchmark/streams/readable-boundaryread.js b/benchmark/streams/readable-boundaryread.js index 835c7d18b51285..299cafe996f4ae 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 3c177ec4c39988..f51ee864a4e638 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 f8b501ab4729ec..a50a0c60ae4574 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: [100e1] + n: [100e1], }); function main({ n }) { diff --git a/benchmark/streams/transform-creation.js b/benchmark/streams/transform-creation.js index abfab0c8e25321..ee04e8c458f335 100644 --- a/benchmark/streams/transform-creation.js +++ b/benchmark/streams/transform-creation.js @@ -4,7 +4,7 @@ const Transform = require('stream').Transform; const inherits = require('util').inherits; const bench = common.createBenchmark(main, { - n: [1e6] + n: [1e6], }); function MyTransform() { diff --git a/benchmark/streams/writable-manywrites.js b/benchmark/streams/writable-manywrites.js index 6fcb07e849d615..affbe0afba7a1a 100644 --- a/benchmark/streams/writable-manywrites.js +++ b/benchmark/streams/writable-manywrites.js @@ -4,7 +4,7 @@ const common = require('../common'); const Writable = require('stream').Writable; const bench = common.createBenchmark(main, { - n: [2e6] + n: [2e6], }); function main({ n }) { diff --git a/benchmark/string_decoder/string-decoder-create.js b/benchmark/string_decoder/string-decoder-create.js index 386f99e7c0ee6f..6c234377f1bbc8 100644 --- a/benchmark/string_decoder/string-decoder-create.js +++ b/benchmark/string_decoder/string-decoder-create.js @@ -4,9 +4,9 @@ const StringDecoder = require('string_decoder').StringDecoder; const bench = common.createBenchmark(main, { encoding: [ - 'ascii', 'utf8', 'utf-8', 'base64', 'ucs2', 'UTF-8', 'AscII', 'UTF-16LE' + '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 95baa893bbbf94..f67c9e70f5fa09 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'; @@ -54,7 +54,7 @@ function main({ encoding, inLen, chunkLen, n }) { } str = Buffer.concat([ str, - buf.slice(start % buf.length, end % buf.length) + buf.slice(start % buf.length, end % buf.length), ]); } } diff --git a/benchmark/timers/immediate.js b/benchmark/timers/immediate.js index 7ddb5cb05af40d..e86e148752fae2 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, { thousands: [5000], - type: ['depth', 'depth1', 'breadth', 'breadth1', 'breadth4', 'clear'] + type: ['depth', 'depth1', 'breadth', 'breadth1', 'breadth4', 'clear'], }); function main({ thousands, type }) { diff --git a/benchmark/timers/set-immediate-breadth-args.js b/benchmark/timers/set-immediate-breadth-args.js index d5b5a9878066db..725afceb55b848 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, { - millions: [5] + millions: [5], }); function main({ millions }) { diff --git a/benchmark/timers/set-immediate-breadth.js b/benchmark/timers/set-immediate-breadth.js index 4f7d2cd2761334..eacdb0b61cea2c 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, { - millions: [10] + millions: [10], }); function main({ millions }) { diff --git a/benchmark/timers/set-immediate-depth-args.js b/benchmark/timers/set-immediate-depth-args.js index aa5ec95f7dad30..1658d456df130f 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, { - millions: [5] + millions: [5], }); function main({ millions }) { diff --git a/benchmark/tls/convertprotocols.js b/benchmark/tls/convertprotocols.js index 9f4969344d1bcd..01ef7b6df93b1a 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/throughput.js b/benchmark/tls/throughput.js index 1ca52ad9496237..d479b2b2816876 100644 --- a/benchmark/tls/throughput.js +++ b/benchmark/tls/throughput.js @@ -3,7 +3,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { dur: [5], type: ['buf', 'asc', 'utf'], - size: [2, 1024, 1024 * 1024] + size: [2, 1024, 1024 * 1024], }); const path = require('path'); @@ -36,7 +36,7 @@ function main({ dur, type, size }) { key: fs.readFileSync(`${cert_dir}/test_key.pem`), cert: fs.readFileSync(`${cert_dir}/test_cert.pem`), ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ], - ciphers: 'AES256-GCM-SHA384' + ciphers: 'AES256-GCM-SHA384', }; server = tls.createServer(options, onConnection); diff --git a/benchmark/tls/tls-connect.js b/benchmark/tls/tls-connect.js index 524d7468d000a1..b61aeacc730a9c 100644 --- a/benchmark/tls/tls-connect.js +++ b/benchmark/tls/tls-connect.js @@ -6,7 +6,7 @@ const tls = require('tls'); const common = require('../common.js'); const bench = common.createBenchmark(main, { concurrency: [1, 10], - dur: [5] + dur: [5], }); var clientConn = 0; @@ -23,7 +23,7 @@ function main(conf) { key: fs.readFileSync(`${cert_dir}/test_key.pem`), cert: fs.readFileSync(`${cert_dir}/test_cert.pem`), ca: [ fs.readFileSync(`${cert_dir}/test_ca.pem`) ], - ciphers: 'AES256-GCM-SHA384' + ciphers: 'AES256-GCM-SHA384', }; const server = tls.createServer(options, onConnection); @@ -44,7 +44,7 @@ function onConnection(conn) { function makeConnection() { const options = { port: common.PORT, - rejectUnauthorized: false + rejectUnauthorized: false, }; var conn = tls.connect(options, function() { clientConn++; diff --git a/benchmark/url/legacy-vs-whatwg-url-get-prop.js b/benchmark/url/legacy-vs-whatwg-url-get-prop.js index 2cc3ab8c75e65c..d244530e35b6d2 100644 --- a/benchmark/url/legacy-vs-whatwg-url-get-prop.js +++ b/benchmark/url/legacy-vs-whatwg-url-get-prop.js @@ -8,7 +8,7 @@ const inputs = require('../fixtures/url-inputs.js').urls; const bench = common.createBenchmark(main, { type: Object.keys(inputs), method: ['legacy', 'whatwg'], - n: [1e5] + n: [1e5], }); // At the time of writing, when using a passed property name to index @@ -25,7 +25,7 @@ function useLegacy(n, input) { port: obj.port, pathname: obj.pathname, search: obj.search, - hash: obj.hash + hash: obj.hash, }; // It's necessary to assign the values to an object // to avoid loop invariant code motion. @@ -54,7 +54,7 @@ function useWHATWG(n, input) { port: obj.port, pathname: obj.pathname, search: obj.search, - hash: obj.hash + hash: obj.hash, }; bench.start(); for (var i = 0; i < n; i += 1) { diff --git a/benchmark/url/legacy-vs-whatwg-url-parse.js b/benchmark/url/legacy-vs-whatwg-url-parse.js index 2be55e17cc354b..28f7af21f7d4aa 100644 --- a/benchmark/url/legacy-vs-whatwg-url-parse.js +++ b/benchmark/url/legacy-vs-whatwg-url-parse.js @@ -8,7 +8,7 @@ const inputs = require('../fixtures/url-inputs.js').urls; const bench = common.createBenchmark(main, { type: Object.keys(inputs), method: ['legacy', 'whatwg'], - n: [1e5] + n: [1e5], }); function useLegacy(n, input) { diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js index e915ceb54f917f..dcb1f24f97779f 100644 --- a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js +++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js @@ -7,7 +7,7 @@ const inputs = require('../fixtures/url-inputs.js').searchParams; const bench = common.createBenchmark(main, { type: Object.keys(inputs), 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 8fe3e546f0780d..4c1bf026769545 100644 --- a/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js +++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js @@ -7,7 +7,7 @@ const inputs = require('../fixtures/url-inputs.js').searchParams; const bench = common.createBenchmark(main, { type: Object.keys(inputs), 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 017ec4328c590b..f45825b87a55fd 100644 --- a/benchmark/url/legacy-vs-whatwg-url-serialize.js +++ b/benchmark/url/legacy-vs-whatwg-url-serialize.js @@ -8,7 +8,7 @@ const inputs = require('../fixtures/url-inputs.js').urls; const bench = common.createBenchmark(main, { type: Object.keys(inputs), method: ['legacy', 'whatwg'], - n: [1e5] + n: [1e5], }); function useLegacy(n, input, prop) { diff --git a/benchmark/url/url-format.js b/benchmark/url/url-format.js index 14696af8e31c3f..ad1948bfdfc0ff 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 83f626ccdadfe3..5d01c614ac0b41 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 48978574ea24ec..449e34f6c1d75a 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 cae2ef5df61956..ce42a4b681dae3 100644 --- a/benchmark/url/url-searchparams-iteration.js +++ b/benchmark/url/url-searchparams-iteration.js @@ -5,7 +5,7 @@ const { URLSearchParams } = require('url'); const bench = common.createBenchmark(main, { method: ['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 0cf66dabbc36dc..c208902e398470 100644 --- a/benchmark/url/url-searchparams-read.js +++ b/benchmark/url/url-searchparams-read.js @@ -5,7 +5,7 @@ const { URLSearchParams } = require('url'); const bench = common.createBenchmark(main, { method: ['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 fe152bf823468f..83adbd0442f2db 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 91abe8d67351c7..dfff523e8d8668 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 c1e3d4a0b85cec..6b1a823ee647d0 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 inputs = { 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, { input: Object.keys(inputs), to: ['ascii', 'unicode'], - n: [5e6] + n: [5e6], }); function main({ n, to, input }) { diff --git a/benchmark/url/whatwg-url-properties.js b/benchmark/url/whatwg-url-properties.js index f526c07f139be9..32947921fcdd67 100644 --- a/benchmark/url/whatwg-url-properties.js +++ b/benchmark/url/whatwg-url-properties.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { prop: ['href', 'origin', 'protocol', 'username', 'password', 'host', 'hostname', 'port', 'pathname', 'search', 'searchParams', 'hash'], - n: [3e5] + n: [3e5], }); function setAndGet(n, url, prop, alternative) { @@ -39,7 +39,7 @@ const alternatives = { port: '23', pathname: '/aaa/bbb', search: '?k=99', - hash: '#abcd' + hash: '#abcd', }; function getAlternative(prop) { diff --git a/benchmark/util/format.js b/benchmark/util/format.js index 042b8a93ccfcf2..a92ae0b5fc8f75 100644 --- a/benchmark/util/format.js +++ b/benchmark/util/format.js @@ -17,7 +17,7 @@ const inputs = { const bench = common.createBenchmark(main, { n: [4e6], - 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 8b3c54aeb942fe..b44b53d7ec3e13 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.js b/benchmark/util/inspect.js index 35253ac96682eb..8010ff236477ba 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: [2e6], @@ -23,9 +23,9 @@ const bench = common.createBenchmark(main, { 'Array', 'TypedArray', 'TypedArray_extra', - 'Number' + '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 96eab1912d0761..68f281e657341e 100644 --- a/benchmark/util/normalize-encoding.js +++ b/benchmark/util/normalize-encoding.js @@ -7,7 +7,7 @@ const groupedInputs = { group_common: ['undefined', 'utf8', 'utf-8', 'base64', 'binary', 'latin1'], group_upper: ['UTF-8', 'UTF8', 'UCS2', 'UTF-16LE', 'UTF16LE', 'BASE64'], group_uncommon: [ 'foo', '1', 'false', 'undefined', '[]'], - group_misc: ['', 'utf16le', 'usc2', 'hex', 'HEX', 'BINARY'] + group_misc: ['', 'utf16le', 'usc2', 'hex', 'HEX', 'BINARY'], }; const inputs = [ @@ -19,9 +19,9 @@ const inputs = [ const bench = common.createBenchmark(main, { input: inputs.concat(Object.keys(groupedInputs)), - n: [1e7] + n: [1e7], }, { - flags: '--expose-internals' + flags: '--expose-internals', }); function getInput(input) { diff --git a/benchmark/util/type-check.js b/benchmark/util/type-check.js index e1d1ac553fedcf..672b7209cc2fd7 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: [5e6] + n: [5e6], }, { - flags: ['--expose-internals'] + flags: ['--expose-internals'], }); function main({ type, argument, version, n }) { diff --git a/benchmark/v8/get-stats.js b/benchmark/v8/get-stats.js index 84a0655f5db4fa..44177d2ff6f378 100644 --- a/benchmark/v8/get-stats.js +++ b/benchmark/v8/get-stats.js @@ -6,9 +6,9 @@ const v8 = require('v8'); const bench = common.createBenchmark(main, { method: [ 'getHeapStatistics', - 'getHeapSpaceStatistics' + 'getHeapSpaceStatistics', ], - n: [1e6] + n: [1e6], }); function main({ method, n }) { diff --git a/benchmark/vm/run-in-context.js b/benchmark/vm/run-in-context.js index 9b57067a19c9ac..2c8f6d19fed955 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 0754287376d58c..d665c63028758a 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/zlib/creation.js b/benchmark/zlib/creation.js index 4984bf1a86b755..7378a5d99f00b2 100644 --- a/benchmark/zlib/creation.js +++ b/benchmark/zlib/creation.js @@ -4,10 +4,10 @@ const zlib = require('zlib'); const bench = common.createBenchmark(main, { type: [ - 'Deflate', 'DeflateRaw', 'Inflate', 'InflateRaw', 'Gzip', 'Gunzip', 'Unzip' + 'Deflate', 'DeflateRaw', 'Inflate', 'InflateRaw', 'Gzip', 'Gunzip', 'Unzip', ], 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 5e86d659803747..4cfc7dc50cf87b 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/doc/api/assert.md b/doc/api/assert.md index 5ca1f0830853b8..9d7c641a9574bc 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -163,18 +163,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); @@ -577,18 +577,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); @@ -911,7 +911,7 @@ assert.throws( }, { name: 'TypeError', - message: 'Wrong value' + message: 'Wrong value', // Note that only properties on the error object will be tested! } ); diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index bb739d3a0b363c..39748459e0a397 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -104,7 +104,7 @@ const async_hooks = require('async_hooks'); const asyncHook = async_hooks.createHook({ init(asyncId, type, triggerAsyncId, resource) { }, - destroy(asyncId) { } + destroy(asyncId) { }, }); ``` @@ -266,7 +266,7 @@ async_hooks.createHook({ const eid = async_hooks.executionAsyncId(); fs.writeSync( 1, `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\n`); - } + }, }).enable(); require('net').createServer((conn) => {}).listen(8080); diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 57a0f9296a46d9..d6c218e85f91b1 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -210,7 +210,7 @@ const defaults = { maxBuffer: 200 * 1024, killSignal: 'SIGTERM', cwd: null, - env: null + env: null, }; ``` @@ -433,7 +433,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, }; ``` @@ -558,7 +558,7 @@ const { spawn } = require('child_process'); const subprocess = spawn(process.argv[0], ['child_program.js'], { detached: true, - stdio: 'ignore' + stdio: 'ignore', }); subprocess.unref(); @@ -574,7 +574,7 @@ const err = fs.openSync('./out.log', 'a'); const subprocess = spawn('prg', [], { detached: true, - stdio: [ 'ignore', out, err ] + stdio: [ 'ignore', out, err ], }); subprocess.unref(); @@ -1042,9 +1042,9 @@ const subprocess = spawn( '-c', `node -e "setInterval(() => { console.log(process.pid, 'is alive') - }, 500);"` + }, 500);"`, ], { - stdio: ['inherit', 'inherit', 'inherit'] + stdio: ['inherit', 'inherit', 'inherit'], } ); @@ -1327,8 +1327,8 @@ const subprocess = child_process.spawn('ls', { stdio: [ 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 - ] + fs.openSync('err.out', 'w'), // Direct child's stderr to a file + ], }); assert.strictEqual(subprocess.stdio[0], null); diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 08a669e4fa0f1f..cfbc9c230059b5 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -763,12 +763,12 @@ const cluster = require('cluster'); cluster.setupMaster({ exec: 'worker.js', args: ['--use', 'https'], - silent: true + silent: true, }); cluster.fork(); // https worker cluster.setupMaster({ exec: 'worker.js', - args: ['--use', 'http'] + args: ['--use', 'http'], }); cluster.fork(); // http worker ``` diff --git a/doc/api/dgram.md b/doc/api/dgram.md index 9209b83a120247..454fe580ed25a6 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -198,7 +198,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/dns.md b/doc/api/dns.md index fa7c34f654d011..d4cf880f42e82f 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -120,7 +120,7 @@ section if a custom port is used. '4.4.4.4', '2001:4860:4860::8888', '4.4.4.4:1053', - '[2001:4860:4860::8888]:1053' + '[2001:4860:4860::8888]:1053', ] ``` @@ -559,7 +559,7 @@ dns.setServers([ '4.4.4.4', '[2001:4860:4860::8888]', '4.4.4.4:1053', - '[2001:4860:4860::8888]:1053' + '[2001:4860:4860::8888]:1053', ]); ``` diff --git a/doc/api/esm.md b/doc/api/esm.md index adde6a199fd068..c5fc2f62380724 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -125,7 +125,7 @@ export async function resolve(specifier, defaultResolver) { return { url: new URL(specifier, parentModuleURL).href, - format: 'esm' + format: 'esm', }; } ``` @@ -168,7 +168,7 @@ export function resolve(specifier, parentModuleURL = baseURL, defaultResolve) { if (builtins.includes(specifier)) { return { url: specifier, - format: 'builtin' + format: 'builtin', }; } if (/^\.{0,2}[/]/.test(specifier) !== true && !specifier.startsWith('file:')) { @@ -185,7 +185,7 @@ export function resolve(specifier, parentModuleURL = baseURL, defaultResolve) { } return { url: resolved.href, - format: 'esm' + format: 'esm', }; } ``` @@ -213,7 +213,7 @@ export async function dynamicInstantiate(url) { execute: (exports) => { // get and set functions provided for pre-allocated export names exports.customExportName.set('value'); - } + }, }; } ``` diff --git a/doc/api/fs.md b/doc/api/fs.md index f33bbe47851b58..fa239f8f4df5fb 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1231,7 +1231,7 @@ const defaults = { fd: null, mode: 0o666, autoClose: true, - highWaterMark: 64 * 1024 + highWaterMark: 64 * 1024, }; ``` @@ -1302,7 +1302,7 @@ const defaults = { encoding: 'utf8', fd: null, mode: 0o666, - autoClose: true + autoClose: true, }; ``` diff --git a/doc/api/http.md b/doc/api/http.md index 91309e79fdbace..41133538b0c5b5 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -101,7 +101,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 }); @@ -368,7 +368,7 @@ proxy.listen(1337, '127.0.0.1', () => { port: 1337, hostname: '127.0.0.1', method: 'CONNECT', - path: 'www.google.com:80' + path: 'www.google.com:80', }; const req = http.request(options); @@ -415,7 +415,7 @@ const http = require('http'); const options = { hostname: '127.0.0.1', port: 8080, - path: '/length_request' + path: '/length_request', }; // Make a request @@ -502,8 +502,8 @@ srv.listen(1337, '127.0.0.1', () => { hostname: '127.0.0.1', headers: { 'Connection': 'Upgrade', - 'Upgrade': 'websocket' - } + 'Upgrade': 'websocket', + }, }; const req = http.request(options); @@ -1879,7 +1879,7 @@ Example: ```js const postData = querystring.stringify({ - 'msg': 'Hello World!' + 'msg': 'Hello World!', }); const options = { @@ -1889,8 +1889,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 94f25377d0acbf..26cedb5a27fadf 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -33,7 +33,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)); @@ -41,7 +41,7 @@ server.on('stream', (stream, headers) => { // stream is a Duplex stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end('

Hello World

'); }); @@ -64,7 +64,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)); @@ -237,7 +237,7 @@ session.on('stream', (stream, headers, flags) => { // ... stream.respond({ ':status': 200, - 'content-type': 'text/plain' + 'content-type': 'text/plain', }); stream.write('hello '); stream.end('world'); @@ -258,7 +258,7 @@ const server = http2.createServer(); server.on('stream', (stream, headers) => { stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end('

Hello World

'); }); @@ -697,7 +697,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]: '/' }); @@ -1210,7 +1210,7 @@ server.on('stream', (stream) => { stream.respond({ ':status': 200 }, { getTrailers(trailers) { trailers.ABC = 'some value to send'; - } + }, }); stream.end('some data'); }); @@ -1254,7 +1254,7 @@ server.on('stream', (stream) => { const headers = { 'content-length': stat.size, 'last-modified': stat.mtime.toUTCString(), - 'content-type': 'text/plain' + 'content-type': 'text/plain', }; stream.respondWithFD(fd, headers); stream.on('close', () => fs.closeSync(fd)); @@ -1294,12 +1294,12 @@ server.on('stream', (stream) => { const headers = { 'content-length': stat.size, 'last-modified': stat.mtime.toUTCString(), - 'content-type': 'text/plain' + 'content-type': 'text/plain', }; stream.respondWithFD(fd, headers, { getTrailers(trailers) { trailers.ABC = 'some value to send'; - } + }, }); stream.on('close', () => fs.closeSync(fd)); @@ -1500,7 +1500,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(); @@ -1510,7 +1510,7 @@ server.on('stream', (stream, headers, flags) => { // ... stream.respond({ [HTTP2_HEADER_STATUS]: 200, - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', }); stream.write('hello '); stream.end('world'); @@ -1595,7 +1595,7 @@ const { HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS, - HTTP2_HEADER_CONTENT_TYPE + HTTP2_HEADER_CONTENT_TYPE, } = http2.constants; const options = getOptionsSomehow(); @@ -1607,7 +1607,7 @@ server.on('stream', (stream, headers, flags) => { // ... stream.respond({ [HTTP2_HEADER_STATUS]: 200, - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', }); stream.write('hello '); stream.end('world'); @@ -1726,7 +1726,7 @@ const server = http2.createServer(); server.on('stream', (stream, headers) => { stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end('

Hello World

'); }); @@ -1811,7 +1811,7 @@ const http2 = require('http2'); 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 @@ -1820,7 +1820,7 @@ const server = http2.createSecureServer(options); server.on('stream', (stream, headers) => { stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end('

Hello World

'); }); @@ -1994,7 +1994,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); @@ -2069,7 +2069,7 @@ const server = http2.createServer({ paddingStrategy: http2.constants.PADDING_STRATEGY_CALLBACK, selectPadding(frameLen, maxFrameLen) { return maxFrameLen; - } + }, }); ``` @@ -2199,7 +2199,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) => { @@ -2275,7 +2275,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 8c95487cb5b760..861b669c624462 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -78,7 +78,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) => { @@ -95,7 +95,7 @@ const fs = require('fs'); const options = { pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - passphrase: 'sample' + passphrase: 'sample', }; https.createServer(options, (req, res) => { @@ -186,7 +186,7 @@ const options = { hostname: 'encrypted.google.com', port: 443, path: '/', - method: 'GET' + method: 'GET', }; const req = https.request(options, (res) => { @@ -212,7 +212,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); @@ -233,7 +233,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 50f1f595129050..c2a9f83cec460e 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -2331,7 +2331,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 489659001ce9b9..e593560c9eb3e4 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -270,7 +270,7 @@ shown below. server.listen({ host: 'localhost', port: 80, - exclusive: true + exclusive: true, }); ``` diff --git a/doc/api/os.md b/doc/api/os.md index 40dd948d730ffb..3790039ddd7e80 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -81,8 +81,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', @@ -92,8 +92,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', @@ -103,8 +103,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', @@ -114,8 +114,8 @@ The properties included on each object include: nice: 0, sys: 19430, idle: 1070905480, - irq: 20 - } + irq: 20, + }, }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', @@ -125,8 +125,8 @@ The properties included on each object include: nice: 20, sys: 40900, idle: 1070842510, - irq: 0 - } + irq: 0, + }, }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', @@ -136,8 +136,8 @@ The properties included on each object include: nice: 0, sys: 34360, idle: 1070888000, - irq: 10 - } + irq: 10, + }, }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', @@ -147,8 +147,8 @@ The properties included on each object include: nice: 0, sys: 55410, idle: 1071129970, - irq: 880 - } + irq: 880, + }, }, { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', @@ -158,9 +158,9 @@ The properties included on each object include: nice: 1480, sys: 34920, idle: 1072572010, - irq: 30 - } - } + irq: 30, + }, + }, ] ``` diff --git a/doc/api/path.md b/doc/api/path.md index 5cfeba53402e10..d24b513a4dfba2 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -213,7 +213,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' @@ -223,7 +223,7 @@ path.format({ path.format({ root: '/', base: 'file.txt', - ext: 'ignored' + ext: 'ignored', }); // Returns: '/file.txt' @@ -231,7 +231,7 @@ path.format({ path.format({ root: '/', name: 'file', - ext: '.txt' + ext: '.txt', }); // Returns: '/file.txt' ``` @@ -241,7 +241,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 4e31a247859550..6823e945c25b48 100644 --- a/doc/api/perf_hooks.md +++ b/doc/api/perf_hooks.md @@ -207,7 +207,7 @@ event type in order for the timing details to be accessed. ```js const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); function someFunction() { @@ -432,7 +432,7 @@ added: v8.5.0 ```js const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const obs = new PerformanceObserver((list, observer) => { @@ -534,7 +534,7 @@ every `PerformanceEntry` instance: ```js const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const obs = new PerformanceObserver((list, observer) => { @@ -549,7 +549,7 @@ for (let n = 0; n < 3; n++) ```js const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const obs = new PerformanceObserver((list, observer) => { @@ -574,7 +574,7 @@ to execute the callback). const async_hooks = require('async_hooks'); const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const set = new Set(); @@ -593,7 +593,7 @@ const hook = async_hooks.createHook({ `Timeout-${id}-Init`, `Timeout-${id}-Destroy`); } - } + }, }); hook.enable(); @@ -618,7 +618,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 2bd7a119bf8d6c..5ecc14e1762e54 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -713,7 +713,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 2d6731ddb2ad4b..0c1427b0883e05 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -18,7 +18,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) => { @@ -381,7 +381,7 @@ instance. const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, - output: process.stdout + output: process.stdout, }); ``` @@ -488,7 +488,7 @@ const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, - prompt: 'OHAI> ' + prompt: 'OHAI> ', }); rl.prompt(); @@ -521,7 +521,7 @@ const fs = require('fs'); const rl = readline.createInterface({ input: fs.createReadStream('sample.txt'), - crlfDelay: Infinity + crlfDelay: Infinity, }); rl.on('line', (line) => { diff --git a/doc/api/repl.md b/doc/api/repl.md index 873e7449f53065..d0aff9d7558ea8 100644 --- a/doc/api/repl.md +++ b/doc/api/repl.md @@ -125,7 +125,7 @@ const r = repl.start('> '); Object.defineProperty(r.context, 'm', { configurable: false, enumerable: true, - value: msg + value: msg, }); ``` @@ -339,7 +339,7 @@ replServer.defineCommand('sayhello', { this.clearBufferedCommand(); console.log(`Hello, ${name}!`); this.displayPrompt(); - } + }, }); replServer.defineCommand('saybye', function saybye() { console.log('Goodbye!'); @@ -535,7 +535,7 @@ let connections = 0; repl.start({ prompt: 'Node.js via stdin> ', input: process.stdin, - output: process.stdout + output: process.stdout, }); net.createServer((socket) => { @@ -543,7 +543,7 @@ net.createServer((socket) => { repl.start({ prompt: 'Node.js via Unix socket> ', input: socket, - output: socket + output: socket, }).on('exit', () => { socket.end(); }); @@ -554,7 +554,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 5db990d4d2cc3d..d144734019c6d7 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1369,7 +1369,7 @@ const { Writable } = require('stream'); const myWritable = new Writable({ write(chunk, encoding, callback) { // ... - } + }, }); ``` @@ -1441,7 +1441,7 @@ const myWritable = new Writable({ }, writev(chunks, callback) { // ... - } + }, }); ``` @@ -1561,7 +1561,7 @@ const myWritable = new Writable({ } else { callback(); } - } + }, }); ``` @@ -1689,7 +1689,7 @@ const { Readable } = require('stream'); const myReadable = new Readable({ read(size) { // ... - } + }, }); ``` @@ -1838,7 +1838,7 @@ const myReadable = new Readable({ return; } // do some work - } + }, }); ``` @@ -1951,7 +1951,7 @@ const myDuplex = new Duplex({ }, write(chunk, encoding, callback) { // ... - } + }, }); ``` @@ -2022,7 +2022,7 @@ const myTransform = new Transform({ // Push the data onto the readable queue. callback(null, '0'.repeat(data.length % 2) + data); - } + }, }); myTransform.setEncoding('ascii'); @@ -2102,7 +2102,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 0cfab387f20657..be1c778e1b3c9d 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -886,7 +886,7 @@ const options = { cert: fs.readFileSync('client-cert.pem'), // Necessary only if the server uses the self-signed certificate - ca: [ fs.readFileSync('server-cert.pem') ] + ca: [ fs.readFileSync('server-cert.pem') ], }; const socket = tls.connect(8000, options, () => { @@ -911,7 +911,7 @@ const tls = require('tls'); const fs = require('fs'); const options = { - pfx: fs.readFileSync('client.pfx') + pfx: fs.readFileSync('client.pfx'), }; const socket = tls.connect(8000, options, () => { @@ -1155,7 +1155,7 @@ const options = { requestCert: true, // This is necessary only if the client uses the 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 2c12e9ac29352f..4356bd0c039ef8 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -422,7 +422,7 @@ with [`JSON.stringify()`][]. ```js const myURLs = [ new URL('https://www.example.com'), - new URL('https://test.example.org') + new URL('https://test.example.org'), ]; console.log(JSON.stringify(myURLs)); // Prints ["https://www.example.com/","https://test.example.org/"] @@ -522,7 +522,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' ] @@ -553,7 +553,7 @@ let params; params = new URLSearchParams([ ['user', 'abc'], ['query', 'first'], - ['query', 'second'] + ['query', 'second'], ]); console.log(params.toString()); // Prints 'user=abc&query=first&query=second' @@ -578,7 +578,7 @@ console.log(params.toString()); // Each key-value pair must have exactly two elements new URLSearchParams([ - ['user', 'abc', 'error'] + ['user', 'abc', 'error'], ]); // Throws TypeError [ERR_INVALID_TUPLE]: // Each query pair must be an iterable [name, value] tuple @@ -955,8 +955,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 47d685b0cacd89..93e5b7452cef45 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -455,7 +455,7 @@ const o = { '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']]), }; console.log(util.inspect(o, { compact: true, breakLength: 80 })); @@ -557,7 +557,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/vm.md b/doc/api/vm.md index 12e35e9f727d3e..e7af5285706da7 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -447,7 +447,7 @@ const vm = require('vm'); const sandbox = { animal: 'cat', - count: 2 + count: 2, }; const script = new vm.Script('count += 1; name = "kitty";'); @@ -712,7 +712,7 @@ const vm = require('vm'); const sandbox = { animal: 'cat', - count: 2 + count: 2, }; vm.runInNewContext('count += 1; name = "kitty"', sandbox); diff --git a/doc/guides/using-internal-errors.md b/doc/guides/using-internal-errors.md index c03f44623a0f7f..eadebc827c2bde 100644 --- a/doc/guides/using-internal-errors.md +++ b/doc/guides/using-internal-errors.md @@ -104,7 +104,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 a6482c607893ca..d2fece006968c1 100644 --- a/doc/guides/writing-and-running-benchmarks.md +++ b/doc/guides/writing-and-running-benchmarks.md @@ -383,12 +383,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. @@ -431,7 +431,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { kb: [64, 128, 256, 1024], - connections: [100, 500] + connections: [100, 500], }); function main(conf) { diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md index 28a062d8b79aca..3fa73cca6a1e10 100644 --- a/doc/guides/writing-tests.md +++ b/doc/guides/writing-tests.md @@ -39,7 +39,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 @@ -167,7 +167,7 @@ const server = http.createServer(function(req, res) { }).listen(0, function() { const options = { agent: null, - port: this.address().port + port: this.address().port, }; http.get(options, function(res) { response++; @@ -189,7 +189,7 @@ const server = http.createServer(common.mustCall(function(req, res) { })).listen(0, function() { const options = { agent: null, - port: this.address().port + port: this.address().port, }; http.get(options, common.mustCall(function(res) { res.resume(); diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 4d5fc7d2ede323..58dbcab7cc507a 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -142,7 +142,7 @@ Agent.prototype.addRequest = function addRequest(req, options, port/*legacy*/, options = { host: options, port, - localAddress + localAddress, }; } @@ -357,5 +357,5 @@ function handleSocketCreation(request, informRequest) { module.exports = { Agent, - globalAgent: new Agent() + globalAgent: new Agent(), }; diff --git a/lib/_http_client.js b/lib/_http_client.js index 727dc649c016ae..89c0a0900240de 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -31,7 +31,7 @@ const { debug, freeParser, httpSocketSetup, - parsers + parsers, } = require('_http_common'); const { OutgoingMessage } = require('_http_outgoing'); const Agent = require('_http_agent'); @@ -727,5 +727,5 @@ ClientRequest.prototype.clearTimeout = function clearTimeout(cb) { }; module.exports = { - ClientRequest + ClientRequest, }; diff --git a/lib/_http_common.js b/lib/_http_common.js index ffb90407c62175..a13ac2621012f4 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -29,7 +29,7 @@ const incoming = require('_http_incoming'); const { IncomingMessage, readStart, - readStop + readStop, } = incoming; const debug = require('util').debuglog('http'); @@ -264,5 +264,5 @@ module.exports = { httpSocketSetup, methods, parsers, - kIncomingMessage + kIncomingMessage, }; diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index a84cb64bdb8144..6e57bcf3f93b13 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -304,5 +304,5 @@ IncomingMessage.prototype._dump = function _dump() { module.exports = { IncomingMessage, readStart, - readStop + readStop, }; diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 985b74679c0027..8fabcefe143cc6 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -128,7 +128,7 @@ Object.defineProperty(OutgoingMessage.prototype, '_headers', { headers[name.toLowerCase()] = [name, val[name]]; } } - } + }, }); Object.defineProperty(OutgoingMessage.prototype, '_headerNames', { @@ -159,7 +159,7 @@ Object.defineProperty(OutgoingMessage.prototype, '_headerNames', { header[0] = val[keys[i]]; } } - } + }, }); @@ -300,7 +300,7 @@ function _storeHeader(firstLine, headers) { expect: false, trailer: false, upgrade: false, - header: firstLine + header: firstLine, }; var field; @@ -611,7 +611,7 @@ OutgoingMessage.prototype._implicitHeader = function _implicitHeader() { Object.defineProperty(OutgoingMessage.prototype, 'headersSent', { configurable: true, enumerable: true, - get: function() { return !!this._header; } + get: function() { return !!this._header; }, }); @@ -878,5 +878,5 @@ OutgoingMessage.prototype.pipe = function pipe() { }; module.exports = { - OutgoingMessage + OutgoingMessage, }; diff --git a/lib/_http_server.js b/lib/_http_server.js index 1b9b4677d50ba2..1a6f1bd7888661 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -34,13 +34,13 @@ const { chunkExpression, httpSocketSetup, kIncomingMessage, - _checkInvalidHeaderChar: checkInvalidHeaderChar + _checkInvalidHeaderChar: checkInvalidHeaderChar, } = require('_http_common'); const { OutgoingMessage } = require('_http_outgoing'); const { outHeadersKey, ondrain } = require('internal/http'); const { defaultTriggerAsyncIdScope, - getOrSetAsyncId + getOrSetAsyncId, } = require('internal/async_hooks'); const { IncomingMessage } = require('_http_incoming'); const errors = require('internal/errors'); @@ -111,7 +111,7 @@ const STATUS_CODES = { 508: 'Loop Detected', 509: 'Bandwidth Limit Exceeded', 510: 'Not Extended', // RFC 2774 - 511: 'Network Authentication Required' // RFC 6585 + 511: 'Network Authentication Required', // RFC 6585 }; const kOnExecute = HTTPParser.kOnExecute | 0; @@ -361,7 +361,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); state.onEnd = socketOnEnd.bind(undefined, server, socket, parser, state); @@ -708,5 +708,5 @@ module.exports = { Server, ServerResponse, _connectionListener: connectionListener, - kServerResponse + kServerResponse, }; diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js index 59ce83292789b5..f6ebf329e8f906 100644 --- a/lib/_stream_duplex.js +++ b/lib/_stream_duplex.js @@ -71,7 +71,7 @@ Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { enumerable: false, get() { return this._writableState.highWaterMark; - } + }, }); Object.defineProperty(Duplex.prototype, 'writableBuffer', { @@ -81,7 +81,7 @@ Object.defineProperty(Duplex.prototype, 'writableBuffer', { enumerable: false, get: function() { return this._writableState && this._writableState.getBuffer(); - } + }, }); Object.defineProperty(Duplex.prototype, 'writableLength', { @@ -91,7 +91,7 @@ Object.defineProperty(Duplex.prototype, 'writableLength', { enumerable: false, get() { return this._writableState.length; - } + }, }); // the no-half-open enforcer @@ -133,7 +133,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { // managing destroyed this._readableState.destroyed = value; this._writableState.destroyed = value; - } + }, }); Duplex.prototype._destroy = function(err, cb) { diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index ba231ccda903c1..7f30af7cbeba8c 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -171,7 +171,7 @@ Object.defineProperty(Readable.prototype, 'destroyed', { // backward compatibility, the user is explicitly // managing destroyed this._readableState.destroyed = value; - } + }, }); Readable.prototype.destroy = destroyImpl.destroy; @@ -931,7 +931,7 @@ Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { enumerable: false, get: function() { return this._readableState.highWaterMark; - } + }, }); Object.defineProperty(Readable.prototype, 'readableBuffer', { @@ -941,7 +941,7 @@ Object.defineProperty(Readable.prototype, 'readableBuffer', { enumerable: false, get: function() { return this._readableState && this._readableState.buffer; - } + }, }); Object.defineProperty(Readable.prototype, 'readableFlowing', { @@ -956,7 +956,7 @@ Object.defineProperty(Readable.prototype, 'readableFlowing', { if (this._readableState) { this._readableState.flowing = state; } - } + }, }); // exposed for testing purposes only. @@ -969,7 +969,7 @@ Object.defineProperty(Readable.prototype, 'readableLength', { enumerable: false, get() { return this._readableState.length; - } + }, }); // Pluck off n bytes from an array of buffers. diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js index a9fcddda2d9c83..1f8fbc78477564 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -108,7 +108,7 @@ function Transform(options) { transforming: false, writecb: null, writechunk: null, - writeencoding: null + writeencoding: null, }; // start out asking for a readable event once data is transformed. diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 2b7658813599e5..1156a31b3d94bb 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -158,7 +158,7 @@ Object.defineProperty(WritableState.prototype, 'buffer', { get: internalUtil.deprecate(function() { return this.getBuffer(); }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + - 'instead.', 'DEP0003') + 'instead.', 'DEP0003'), }); // Test _writableState for inheritance to account for Duplex streams, @@ -174,7 +174,7 @@ if (typeof Symbol === 'function' && Symbol.hasInstance) { return false; return object && object._writableState instanceof WritableState; - } + }, }); } else { realHasInstance = function(object) { @@ -320,7 +320,7 @@ Object.defineProperty(Writable.prototype, 'writableBuffer', { enumerable: false, get: function() { return this._writableState && this._writableState.getBuffer(); - } + }, }); function decodeChunk(state, chunk, encoding) { @@ -339,7 +339,7 @@ Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { enumerable: false, get: function() { return this._writableState.highWaterMark; - } + }, }); // if we're already writing something, then just put this @@ -370,7 +370,7 @@ function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { encoding, isBuf, callback: cb, - next: null + next: null, }; if (last) { last.next = state.lastBufferedRequest; @@ -581,7 +581,7 @@ Object.defineProperty(Writable.prototype, 'writableLength', { enumerable: false, get() { return this._writableState.length; - } + }, }); function needFinish(state) { @@ -675,7 +675,7 @@ Object.defineProperty(Writable.prototype, 'destroyed', { // backward compatibility, the user is explicitly // managing destroyed this._writableState.destroyed = value; - } + }, }); Writable.prototype.destroy = destroyImpl.destroy; diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index c4725642707180..e36a8ee5263388 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -36,7 +36,7 @@ const tls_wrap = process.binding('tls_wrap'); const { TCP, constants: TCPConstants } = process.binding('tcp_wrap'); const { Pipe, constants: PipeConstants } = process.binding('pipe_wrap'); const { - SecureContext: NativeSecureContext + SecureContext: NativeSecureContext, } = process.binding('crypto'); const errors = require('internal/errors'); const kConnectOptions = Symbol('connect-options'); @@ -316,7 +316,7 @@ function TLSSocket(socket, opts) { handle: this._wrapHandle(wrap), allowHalfOpen: socket && socket.allowHalfOpen, readable: false, - writable: false + writable: false, }); // Proxy for API compatibility @@ -343,7 +343,7 @@ var proxiedMethods = [ 'setSimultaneousAccepts', 'setBlocking', // PipeWrap - 'setPendingInstances' + 'setPendingInstances', ]; // Proxy HandleWrap, PipeWrap and TCPWrap methods @@ -437,7 +437,7 @@ function defineHandleReading(socket, handle) { }, set: (value) => { socket[kRes].reading = value; - } + }, }); } @@ -770,7 +770,7 @@ function tlsConnectionListener(rawSocket) { handshakeTimeout: this[kHandshakeTimeout], NPNProtocols: this.NPNProtocols, ALPNProtocols: this.ALPNProtocols, - SNICallback: this[kSNICallback] || SNICallback + SNICallback: this[kSNICallback] || SNICallback, }); socket.on('secure', onSocketSecure); @@ -878,7 +878,7 @@ function Server(options, listener) { secureOptions: this.secureOptions, honorCipherOrder: this.honorCipherOrder, crl: this.crl, - sessionIdContext: this.sessionIdContext + sessionIdContext: this.sessionIdContext, }); this._sharedCreds = sharedCreds; @@ -914,7 +914,7 @@ exports.createServer = function(options, listener) { Server.prototype._getServerData = function() { return { - ticketKeys: this.getTicketKeys().toString('hex') + ticketKeys: this.getTicketKeys().toString('hex'), }; }; @@ -1102,7 +1102,7 @@ exports.connect = function(...args /* [port,] [host,] [options,] [cb] */) { rejectUnauthorized: '0' !== process.env.NODE_TLS_REJECT_UNAUTHORIZED, ciphers: tls.DEFAULT_CIPHERS, checkServerIdentity: tls.checkServerIdentity, - minDHSize: 1024 + minDHSize: 1024, }; options = util._extend(defaults, options || {}); @@ -1127,7 +1127,7 @@ exports.connect = function(...args /* [port,] [host,] [options,] [cb] */) { session: options.session, NPNProtocols: options.NPNProtocols, ALPNProtocols: options.ALPNProtocols, - requestOCSP: options.requestOCSP + requestOCSP: options.requestOCSP, }); socket[kConnectOptions] = options; @@ -1142,7 +1142,7 @@ exports.connect = function(...args /* [port,] [host,] [options,] [cb] */) { host: options.host, family: options.family, localAddress: options.localAddress, - lookup: options.lookup + lookup: options.lookup, }; socket.connect(connectOpt, socket._start); } diff --git a/lib/assert.js b/lib/assert.js index 67c658d9e68bb3..e48a8418207c53 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -23,7 +23,7 @@ const { Buffer } = require('buffer'); const { isDeepEqual, - isDeepStrictEqual + isDeepStrictEqual, } = require('internal/util/comparisons'); const { AssertionError, TypeError, errorCache } = require('internal/errors'); const { openSync, closeSync, readSync } = require('fs'); @@ -43,7 +43,7 @@ const meta = [ '\\u000f', '\\u0010', '\\u0011', '\\u0012', '\\u0013', '\\u0014', '\\u0015', '\\u0016', '\\u0017', '\\u0018', '\\u0019', '\\u001a', '\\u001b', '\\u001c', '\\u001d', - '\\u001e', '\\u001f' + '\\u001e', '\\u001f', ]; const escapeFn = (str) => meta[str.charCodeAt(0)]; @@ -101,7 +101,7 @@ function fail(actual, expected, message, operator, stackStartFn) { expected, message, operator, - stackStartFn: stackStartFn || fail + stackStartFn: stackStartFn || fail, }); } @@ -237,7 +237,7 @@ function innerOk(args, fn) { expected: true, message, operator: '==', - stackStartFn: fn + stackStartFn: fn, }); err.generatedMessage = generatedMessage; throw err; @@ -261,7 +261,7 @@ assert.equal = function equal(actual, expected, message) { expected, message, operator: '==', - stackStartFn: equal + stackStartFn: equal, }); } }; @@ -276,7 +276,7 @@ assert.notEqual = function notEqual(actual, expected, message) { expected, message, operator: '!=', - stackStartFn: notEqual + stackStartFn: notEqual, }); } }; @@ -289,7 +289,7 @@ assert.deepEqual = function deepEqual(actual, expected, message) { expected, message, operator: 'deepEqual', - stackStartFn: deepEqual + stackStartFn: deepEqual, }); } }; @@ -302,7 +302,7 @@ assert.notDeepEqual = function notDeepEqual(actual, expected, message) { expected, message, operator: 'notDeepEqual', - stackStartFn: notDeepEqual + stackStartFn: notDeepEqual, }); } }; @@ -316,7 +316,7 @@ assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { message, operator: 'deepStrictEqual', stackStartFn: deepStrictEqual, - errorDiff: this === strict ? ERR_DIFF_EQUAL : ERR_DIFF_DEACTIVATED + errorDiff: this === strict ? ERR_DIFF_EQUAL : ERR_DIFF_DEACTIVATED, }); } }; @@ -330,7 +330,7 @@ function notDeepStrictEqual(actual, expected, message) { message, operator: 'notDeepStrictEqual', stackStartFn: notDeepStrictEqual, - errorDiff: this === strict ? ERR_DIFF_NOT_EQUAL : ERR_DIFF_DEACTIVATED + errorDiff: this === strict ? ERR_DIFF_NOT_EQUAL : ERR_DIFF_DEACTIVATED, }); } } @@ -343,7 +343,7 @@ assert.strictEqual = function strictEqual(actual, expected, message) { message, operator: 'strictEqual', stackStartFn: strictEqual, - errorDiff: this === strict ? ERR_DIFF_EQUAL : ERR_DIFF_DEACTIVATED + errorDiff: this === strict ? ERR_DIFF_EQUAL : ERR_DIFF_DEACTIVATED, }); } }; @@ -356,7 +356,7 @@ assert.notStrictEqual = function notStrictEqual(actual, expected, message) { message, operator: 'notStrictEqual', stackStartFn: notStrictEqual, - errorDiff: this === strict ? ERR_DIFF_NOT_EQUAL : ERR_DIFF_DEACTIVATED + errorDiff: this === strict ? ERR_DIFF_NOT_EQUAL : ERR_DIFF_DEACTIVATED, }); } }; @@ -369,7 +369,7 @@ function compareExceptionKey(actual, expected, key, msg) { message: msg || `${key}: expected ${inspect(expected[key])}, ` + `not ${inspect(actual[key])}`, operator: 'throws', - stackStartFn: assert.throws + stackStartFn: assert.throws, }); } } @@ -445,7 +445,7 @@ assert.throws = function throws(block, error, message) { expected: error, operator: 'throws', message: `Missing expected exception${details}`, - stackStartFn: throws + stackStartFn: throws, }); } if (error && expectedException(actual, error, message) === false) { @@ -470,7 +470,7 @@ assert.doesNotThrow = function doesNotThrow(block, error, message) { expected: error, operator: 'doesNotThrow', message: `Got unwanted exception${details}\n${actual && actual.message}`, - stackStartFn: doesNotThrow + stackStartFn: doesNotThrow, }); } throw actual; @@ -494,7 +494,7 @@ assert.ifError = function ifError(err) { expected: null, operator: 'ifError', message, - stackStartFn: ifError + stackStartFn: ifError, }); // Make sure we actually have a stack trace! @@ -532,6 +532,6 @@ assert.strict = Object.assign(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 ae8dc939ce26ee..8ec0b005bd477e 100644 --- a/lib/async_hooks.js +++ b/lib/async_hooks.js @@ -28,7 +28,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 diff --git a/lib/buffer.js b/lib/buffer.js index 593e10d74147bd..a5f1818afedcc1 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -35,20 +35,20 @@ const { swap32: _swap32, swap64: _swap64, kMaxLength, - kStringMaxLength + kStringMaxLength, } = process.binding('buffer'); const { isAnyArrayBuffer } = process.binding('util'); const { customInspectSymbol, normalizeEncoding, - kIsEncodingSymbol + kIsEncodingSymbol, } = require('internal/util'); const { isArrayBufferView, - isUint8Array + isUint8Array, } = require('internal/util/types'); const { - pendingDeprecation + pendingDeprecation, } = process.binding('config'); const errors = require('internal/errors'); @@ -76,13 +76,13 @@ const constants = Object.defineProperties({}, { 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; @@ -171,7 +171,7 @@ function Buffer(arg, encodingOrOffset, length) { Object.defineProperty(Buffer, Symbol.species, { enumerable: false, configurable: true, - get() { return FastBuffer; } + get() { return FastBuffer; }, }); /** @@ -549,7 +549,7 @@ Object.defineProperty(Buffer.prototype, 'parent', { if (!(this instanceof Buffer)) return undefined; return this.buffer; - } + }, }); Object.defineProperty(Buffer.prototype, 'offset', { enumerable: true, @@ -557,7 +557,7 @@ Object.defineProperty(Buffer.prototype, 'offset', { if (!(this instanceof Buffer)) return undefined; return this.byteOffset; - } + }, }); function stringSlice(buf, encoding, start, end) { @@ -1059,7 +1059,7 @@ let transcode; if (process.binding('config').hasIntl) { const { icuErrName, - transcode: _transcode + transcode: _transcode, } = process.binding('icu'); // Transcodes the Buffer from one encoding to another, returning a new @@ -1093,11 +1093,11 @@ module.exports = exports = { // Legacy kMaxLength, - kStringMaxLength + kStringMaxLength, }; Object.defineProperty(exports, 'constants', { configurable: false, enumerable: true, - value: constants + value: constants, }); diff --git a/lib/child_process.js b/lib/child_process.js index b190d9c70a1b43..e8d46ba88e183a 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -23,7 +23,7 @@ const util = require('util'); const { - deprecate, convertToValidSignal, getSystemErrorName + deprecate, convertToValidSignal, getSystemErrorName, } = require('internal/util'); const { isUint8Array } = require('internal/util/types'); const { createPromise, @@ -36,7 +36,7 @@ const child_process = require('internal/child_process'); const { _validateStdio, setupChannel, - ChildProcess + ChildProcess, } = child_process; exports.ChildProcess = ChildProcess; @@ -134,7 +134,7 @@ function normalizeExecArgs(command, options, callback) { return { file: command, options: options, - callback: callback + callback: callback, }; } @@ -165,7 +165,7 @@ const customPromiseExecFunction = (orig) => { Object.defineProperty(exports.exec, util.promisify.custom, { enumerable: false, - value: customPromiseExecFunction(exports.exec) + value: customPromiseExecFunction(exports.exec), }); exports.execFile = function(file /*, args, options, callback*/) { @@ -178,7 +178,7 @@ exports.execFile = function(file /*, args, options, callback*/) { killSignal: 'SIGTERM', cwd: null, env: null, - shell: false + shell: false, }; // Parse the optional positional parameters. @@ -218,7 +218,7 @@ exports.execFile = function(file /*, args, options, callback*/) { uid: options.uid, shell: options.shell, windowsHide: !!options.windowsHide, - windowsVerbatimArguments: !!options.windowsVerbatimArguments + windowsVerbatimArguments: !!options.windowsVerbatimArguments, }); var encoding; @@ -365,7 +365,7 @@ exports.execFile = function(file /*, args, options, callback*/) { Object.defineProperty(exports.execFile, util.promisify.custom, { enumerable: false, - value: customPromiseExecFunction(exports.execFile) + value: customPromiseExecFunction(exports.execFile), }); const _deprecatedCustomFds = deprecate( @@ -519,7 +519,7 @@ function normalizeSpawnArguments(file, args, options) { file: file, args: args, options: options, - envPairs: envPairs + envPairs: envPairs, }; } @@ -541,7 +541,7 @@ var spawn = exports.spawn = function(/*file, args, options*/) { envPairs: opts.envPairs, stdio: options.stdio, uid: options.uid, - gid: options.gid + gid: options.gid, }); return child; diff --git a/lib/console.js b/lib/console.js index b77832b9876735..c2a0b452ba8148 100644 --- a/lib/console.js +++ b/lib/console.js @@ -46,7 +46,7 @@ function Console(stdout, stderr, ignoreErrors = true) { var prop = { writable: true, enumerable: false, - configurable: true + configurable: true, }; prop.value = stdout; Object.defineProperty(this, '_stdout', prop); @@ -186,7 +186,7 @@ Console.prototype.timeEnd = function timeEnd(label = 'default') { Console.prototype.trace = function trace(...args) { const err = { name: 'Trace', - message: util.format.apply(null, args) + message: util.format.apply(null, args), }; Error.captureStackTrace(err, trace); this.error(err.stack); diff --git a/lib/crypto.js b/lib/crypto.js index 0156fe6f09c51e..71c3aefa6b2228 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -26,7 +26,7 @@ const { assertCrypto, - deprecate + deprecate, } = require('internal/util'); assertCrypto(); @@ -34,7 +34,7 @@ const errors = require('internal/errors'); const constants = process.binding('constants').crypto; const { fipsMode, - fipsForced + fipsForced, } = process.binding('config'); const { getFipsCrypto, @@ -43,16 +43,16 @@ const { const { randomBytes, randomFill, - randomFillSync + randomFillSync, } = require('internal/crypto/random'); const { pbkdf2, - pbkdf2Sync + pbkdf2Sync, } = require('internal/crypto/pbkdf2'); const { DiffieHellman, DiffieHellmanGroup, - ECDH + ECDH, } = require('internal/crypto/diffiehellman'); const { Cipher, @@ -62,15 +62,15 @@ const { privateDecrypt, privateEncrypt, publicDecrypt, - publicEncrypt + publicEncrypt, } = require('internal/crypto/cipher'); const { Sign, - Verify + Verify, } = require('internal/crypto/sig'); const { Hash, - Hmac + Hmac, } = require('internal/crypto/hash'); const { getCiphers, @@ -80,7 +80,7 @@ const { setDefaultEncoding, setEngine, timingSafeEqual, - toBuf + toBuf, } = require('internal/crypto/util'); const Certificate = require('internal/crypto/certificate'); @@ -179,7 +179,7 @@ module.exports = exports = { Hash, Hmac, Sign, - Verify + Verify, }; function setFipsDisabled() { @@ -205,7 +205,7 @@ Object.defineProperties(exports, { get: !fipsMode ? getFipsDisabled : fipsForced ? getFipsForced : getFipsCrypto, set: !fipsMode ? setFipsDisabled : - fipsForced ? setFipsForced : setFipsCrypto + fipsForced ? setFipsForced : setFipsCrypto, }, DEFAULT_ENCODING: { enumerable: true, @@ -213,12 +213,12 @@ Object.defineProperties(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, }, // Legacy API @@ -228,7 +228,7 @@ Object.defineProperties(exports, { get: deprecate(() => { return require('tls').createSecureContext; }, 'crypto.createCredentials is deprecated. ' + - 'Use tls.createSecureContext instead.', 'DEP0010') + 'Use tls.createSecureContext instead.', 'DEP0010'), }, Credentials: { configurable: true, @@ -236,6 +236,6 @@ Object.defineProperties(exports, { get: deprecate(function() { return require('tls').SecureContext; }, 'crypto.Credentials is deprecated. ' + - 'Use tls.SecureContext instead.', 'DEP0011') - } + 'Use tls.SecureContext instead.', 'DEP0011'), + }, }); diff --git a/lib/dgram.js b/lib/dgram.js index a31384a586f4c1..a40cce8c2b003d 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -30,7 +30,7 @@ const { isUint8Array } = require('internal/util/types'); const EventEmitter = require('events'); const { defaultTriggerAsyncIdScope, - symbols: { async_id_symbol } + symbols: { async_id_symbol }, } = require('internal/async_hooks'); const { UV_UDP_REUSEADDR } = process.binding('constants').os; const { nextTick } = require('internal/process/next_tick'); @@ -259,7 +259,7 @@ Socket.prototype.bind = function(port_, address_ /*, callback*/) { port: port, addressType: this.type, fd: -1, - flags: flags + flags: flags, }, onHandle); } else { if (!this._handle) @@ -703,5 +703,5 @@ Socket.prototype.getSendBufferSize = function() { module.exports = { _createSocketHandle, createSocket, - Socket + Socket, }; diff --git a/lib/dns.js b/lib/dns.js index 51c144f4e394eb..e6b6f9953de4e6 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -58,7 +58,7 @@ function onlookupall(err, addresses) { const addr = addresses[i]; addresses[i] = { address: addr, - family: family || (isIPv4(addr) ? 4 : 6) + family: family || (isIPv4(addr) ? 4 : 6), }; } @@ -340,7 +340,7 @@ const resolverKeys = [ 'resolvePtr', 'resolveNaptr', 'resolveSoa', - 'reverse' + 'reverse', ]; function setExportsFunctions() { @@ -391,7 +391,7 @@ module.exports = { NOTINITIALIZED: 'ENOTINITIALIZED', LOADIPHLPAPI: 'ELOADIPHLPAPI', ADDRGETNETWORKPARAMS: 'EADDRGETNETWORKPARAMS', - CANCELLED: 'ECANCELLED' + CANCELLED: 'ECANCELLED', }; setExportsFunctions(); diff --git a/lib/domain.js b/lib/domain.js index be109c9ce056bd..2d60cc229f1e33 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -41,7 +41,7 @@ Object.defineProperty(process, 'domain', { }, set: function(arg) { return _domain[0] = arg; - } + }, }); const pairing = new Map(); @@ -74,7 +74,7 @@ const asyncHook = createHook({ }, destroy(asyncId) { pairing.delete(asyncId); // cleaning up - } + }, }); // When domains are in use, they claim full ownership of the @@ -349,7 +349,7 @@ function intercepted(_this, self, cb, fnargs) { util._extend(er, { domainBound: cb, domainThrown: false, - domain: self + domain: self, }); self.emit('error', er); return; diff --git a/lib/events.js b/lib/events.js index 1c697943371ace..bb3a95e12eeef4 100644 --- a/lib/events.js +++ b/lib/events.js @@ -62,7 +62,7 @@ Object.defineProperty(EventEmitter, 'defaultMaxListeners', { arg); } defaultMaxListeners = arg; - } + }, }); EventEmitter.init = function() { diff --git a/lib/fs.js b/lib/fs.js index afbc412058ba27..d86f414d63ce12 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -59,7 +59,7 @@ const { validateOffsetLengthRead, validateOffsetLengthWrite, validatePath, - validateUint32 + validateUint32, } = internalFS; const { CHAR_FORWARD_SLASH, @@ -69,7 +69,7 @@ const { Object.defineProperty(exports, 'constants', { configurable: false, enumerable: true, - value: constants + value: constants, }); const kMinPoolSpace = 128; @@ -207,7 +207,7 @@ Object.defineProperty(fs.exists, internalUtil.promisify.custom, { const promise = createPromise(); fs.exists(path, (exists) => promiseResolve(promise, exists)); return promise; - } + }, }); // fs.existsSync never throws, it only returns true or false. @@ -1446,7 +1446,7 @@ fs.watchFile = function(filename, options, listener) { // a little on the slow side but let's stick with it for now to keep // behavioral changes to a minimum. interval: 5007, - persistent: true + persistent: true, }; if (options !== null && typeof options === 'object') { @@ -1867,7 +1867,7 @@ fs.mkdtempSync = function(prefix, options) { // Define copyFile() flags. Object.defineProperties(fs.constants, { - COPYFILE_EXCL: { enumerable: true, value: constants.UV_FS_COPYFILE_EXCL } + COPYFILE_EXCL: { enumerable: true, value: constants.UV_FS_COPYFILE_EXCL }, }); @@ -2271,5 +2271,5 @@ Object.defineProperty(fs, 'SyncWriteStream', { get: internalUtil.deprecate(() => SyncWriteStream, 'fs.SyncWriteStream is deprecated.', 'DEP0061'), set: internalUtil.deprecate((val) => { SyncWriteStream = val; }, - 'fs.SyncWriteStream is deprecated.', 'DEP0061') + 'fs.SyncWriteStream is deprecated.', 'DEP0061'), }); diff --git a/lib/fs/promises.js b/lib/fs/promises.js index 8cbcd963c772c8..0415592270be30 100644 --- a/lib/fs/promises.js +++ b/lib/fs/promises.js @@ -8,7 +8,7 @@ const { O_SYMLINK, O_WRONLY, S_IFMT, - S_IFREG + S_IFREG, } = process.binding('constants').fs; const binding = process.binding('fs'); const { Buffer, kMaxLength } = require('buffer'); @@ -31,7 +31,7 @@ const { validateOffsetLengthRead, validateOffsetLengthWrite, validatePath, - validateUint32 + validateUint32, } = require('internal/fs'); const pathModule = require('path'); @@ -503,5 +503,5 @@ module.exports = { mkdtemp, writeFile, appendFile, - readFile + readFile, }; diff --git a/lib/http.js b/lib/http.js index 701a5ccb86cc21..313be3ebd20089 100644 --- a/lib/http.js +++ b/lib/http.js @@ -57,5 +57,5 @@ module.exports = { ServerResponse: server.ServerResponse, createServer, get, - request + request, }; diff --git a/lib/http2.js b/lib/http2.js index de06de1cc414cb..ab9e33b2a2a859 100644 --- a/lib/http2.js +++ b/lib/http2.js @@ -15,7 +15,7 @@ const { createSecureServer, connect, Http2ServerRequest, - Http2ServerResponse + Http2ServerResponse, } = require('internal/http2/core'); module.exports = { @@ -27,5 +27,5 @@ module.exports = { createSecureServer, connect, Http2ServerResponse, - Http2ServerRequest + Http2ServerRequest, }; diff --git a/lib/https.js b/lib/https.js index 84ddeb5036a900..123410a74b4eb8 100644 --- a/lib/https.js +++ b/lib/https.js @@ -29,7 +29,7 @@ const util = require('util'); const { Agent: HttpAgent } = require('_http_agent'); const { Server: HttpServer, - _connectionListener + _connectionListener, } = require('_http_server'); const { ClientRequest } = require('_http_client'); const { inherits } = util; @@ -114,7 +114,7 @@ function createConnection(port, host, options) { if (session) { debug('reuse session for %j', options._agentKey); options = util._extend({ - session: session + session: session, }, options); } } @@ -149,7 +149,7 @@ function Agent(options) { this._sessionCache = { map: {}, - list: [] + list: [], }; } inherits(Agent, HttpAgent); @@ -287,5 +287,5 @@ module.exports = { Server, createServer, get, - request + request, }; diff --git a/lib/inspector.js b/lib/inspector.js index 5206024f7b9fe7..a2cba9b1fe0cfd 100644 --- a/lib/inspector.js +++ b/lib/inspector.js @@ -94,5 +94,5 @@ module.exports = { open: (port, host, wait) => open(port, host, !!wait), close: process._debugEnd, url: url, - Session + Session, }; diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index 44be2990d6a5d8..ead2439fc72914 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -59,7 +59,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, }; @@ -184,7 +184,7 @@ function emitHookFactory(symbol, name) { // Set the name property of the anonymous function as it looks good in the // stack trace. Object.defineProperty(fn, 'name', { - value: name + value: name, }); return fn; } @@ -428,7 +428,7 @@ module.exports = { symbols: { async_id_symbol, trigger_async_id_symbol, init_symbol, before_symbol, after_symbol, destroy_symbol, - promise_resolve_symbol + promise_resolve_symbol, }, enableHooks, disableHooks, diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index f85e557d5efdf8..919af4123e1e20 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -47,7 +47,7 @@ NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START, NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END, NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START, - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END + NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END, } = perf.constants; _process.setup_hrtime(); @@ -85,7 +85,7 @@ Object.defineProperty(process, 'argv0', { enumerable: true, configurable: false, - value: process.argv[0] + value: process.argv[0], }); process.argv[0] = process.execPath; @@ -253,7 +253,7 @@ value: moduleLoadList, configurable: true, enumerable: true, - writable: false + writable: false, }); { @@ -310,7 +310,7 @@ value: 'global', writable: false, enumerable: false, - configurable: true + configurable: true, }); global.process = process; const util = NativeModule.require('util'); @@ -327,7 +327,7 @@ configurable: true, writable: true, enumerable: true, - value: value + value: value, }); }, `'${name}' is deprecated, use 'global'`, 'DEP0016'); } @@ -336,13 +336,13 @@ GLOBAL: { configurable: true, get: makeGetter('GLOBAL'), - set: makeSetter('GLOBAL') + set: makeSetter('GLOBAL'), }, root: { configurable: true, get: makeGetter('root'), - set: makeSetter('root') - } + set: makeSetter('root'), + }, }); // This, as side effect, removes `setupBufferJS` from the buffer binding, @@ -372,7 +372,7 @@ Object.defineProperty(global, 'console', { configurable: true, enumerable: false, - value: wrappedConsole + value: wrappedConsole, }); setupInspector(originalConsole, wrappedConsole, Module); } @@ -384,14 +384,14 @@ value: URL, writable: true, configurable: true, - enumerable: false + enumerable: false, }, URLSearchParams: { value: URLSearchParams, writable: true, configurable: true, - enumerable: false - } + enumerable: false, + }, }); } @@ -437,7 +437,7 @@ clearAsyncIdStack, hasAsyncIdStack, afterHooksExist, - emitAfter + emitAfter, } = NativeModule.require('internal/async_hooks'); process._fatalException = function(er) { @@ -507,7 +507,7 @@ Object.defineProperty(process.versions, name, { writable: false, enumerable: true, - value: version + value: version, }); } } @@ -673,7 +673,7 @@ NativeModule.wrapper = [ '(function (exports, require, module, internalBinding, process) {', - '\n});' + '\n});', ]; NativeModule.prototype.compile = function() { @@ -686,7 +686,7 @@ const fn = runInThisContext(source, { filename: this.filename, lineOffset: 0, - displayErrors: true + displayErrors: true, }); const requireFn = this.id.startsWith('internal/deps/') ? NativeModule.requireForDeps : diff --git a/lib/internal/buffer.js b/lib/internal/buffer.js index b5da69a5b3e27b..2e39b344758e99 100644 --- a/lib/internal/buffer.js +++ b/lib/internal/buffer.js @@ -792,6 +792,6 @@ module.exports = { writeFloatLE: bigEndian ? writeFloatBackwards : writeFloatForwards, writeFloatBE: bigEndian ? writeFloatForwards : writeFloatBackwards, writeDoubleLE: bigEndian ? writeDoubleBackwards : writeDoubleForwards, - writeDoubleBE: bigEndian ? writeDoubleForwards : writeDoubleBackwards - } + writeDoubleBE: bigEndian ? writeDoubleForwards : writeDoubleBackwards, + }, }; diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 58bb46e8a27a0e..23135396394dce 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -26,7 +26,7 @@ const { UV_ENFILE, UV_ENOENT, UV_ENOSYS, - UV_ESRCH + UV_ESRCH, } = process.binding('uv'); const errnoException = errors.errnoException; @@ -46,7 +46,7 @@ const handleConversion = { got: function(message, handle, emit) { emit(handle); - } + }, }, 'net.Server': { @@ -61,7 +61,7 @@ const handleConversion = { server.listen(handle, function() { emit(server); }); - } + }, }, 'net.Socket': { @@ -127,12 +127,12 @@ const handleConversion = { // add socket to connections list var socketList = getSocketList('got', this, message.key); socketList.add({ - socket: socket + socket: socket, }); } emit(socket); - } + }, }, 'dgram.Native': { @@ -144,7 +144,7 @@ const handleConversion = { got: function(message, handle, emit) { emit(handle); - } + }, }, 'dgram.Socket': { @@ -162,8 +162,8 @@ const handleConversion = { socket.bind(handle, function() { emit(socket); }); - } - } + }, + }, }; @@ -443,7 +443,7 @@ function setupChannel(target, channel) { Object.defineProperty(target, '_channel', { get() { return target.channel; }, set(val) { target.channel = val; }, - enumerable: true + enumerable: true, }); target._handleQueue = null; @@ -622,7 +622,7 @@ function setupChannel(target, channel) { message = { cmd: 'NODE_HANDLE', type: null, - msg: message + msg: message, }; if (handle instanceof net.Socket) { @@ -852,7 +852,7 @@ function _validateStdio(stdio, sync) { var a = { type: 'pipe', readable: i === 0, - writable: i !== 0 + writable: i !== 0, }; if (!sync) @@ -875,17 +875,17 @@ function _validateStdio(stdio, sync) { acc.push({ type: 'pipe', handle: ipc, - ipc: true + ipc: true, }); } else if (stdio === 'inherit') { acc.push({ type: 'inherit', - fd: i + fd: i, }); } else if (typeof stdio === 'number' || typeof stdio.fd === 'number') { acc.push({ 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)) { @@ -896,7 +896,7 @@ function _validateStdio(stdio, sync) { acc.push({ type: 'wrap', wrapType: getHandleWrapType(handle), - handle: handle + handle: handle, }); } else if (isUint8Array(stdio) || typeof stdio === 'string') { if (!sync) { @@ -965,5 +965,5 @@ module.exports = { ChildProcess, setupChannel, _validateStdio, - spawnSync + spawnSync, }; diff --git a/lib/internal/cluster/child.js b/lib/internal/cluster/child.js index 40c1a12327558f..4e64590a50b654 100644 --- a/lib/internal/cluster/child.js +++ b/lib/internal/cluster/child.js @@ -21,7 +21,7 @@ cluster._setupWorker = function() { const worker = new Worker({ id: +process.env.NODE_UNIQUE_ID | 0, process: process, - state: 'online' + state: 'online', }); cluster.worker = worker; @@ -69,7 +69,7 @@ cluster._getServer = function(obj, options, cb) { const message = util._extend({ act: 'queryServer', index: indexes[indexesKey], - data: null + data: null, }, options); message.address = address; diff --git a/lib/internal/cluster/master.js b/lib/internal/cluster/master.js index 3c6a398f117433..ca1ab188f9445f 100644 --- a/lib/internal/cluster/master.js +++ b/lib/internal/cluster/master.js @@ -33,7 +33,7 @@ var initialized = false; // XXX(bnoordhuis) Fold cluster.schedulingPolicy into cluster.settings? var schedulingPolicy = { 'none': SCHED_NONE, - 'rr': SCHED_RR + 'rr': SCHED_RR, }[process.env.NODE_CLUSTER_SCHED_POLICY]; if (schedulingPolicy === undefined) { @@ -49,7 +49,7 @@ cluster.setupMaster = function(options) { args: process.argv.slice(2), exec: process.argv[1], execArgv: process.execArgv, - silent: false + silent: false, }; util._extend(settings, cluster.settings); util._extend(settings, options || {}); @@ -136,7 +136,7 @@ function createWorkerProcess(id, env) { execArgv: execArgv, stdio: cluster.settings.stdio, gid: cluster.settings.gid, - uid: cluster.settings.uid + uid: cluster.settings.uid, }); } @@ -167,7 +167,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) { @@ -320,7 +320,7 @@ function queryServer(worker, message) { errno: errno, key: key, ack: message.seq, - data: handles[key].data + data: handles[key].data, }, reply); if (errno) @@ -335,7 +335,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 ba72ff90945d3c..3e186fe3ebc15d 100644 --- a/lib/internal/cluster/utils.js +++ b/lib/internal/cluster/utils.js @@ -4,7 +4,7 @@ const util = require('util'); module.exports = { sendHelper, internal, - handles: {} // Used in tests. + handles: {}, // Used in tests. }; const callbacks = {}; diff --git a/lib/internal/crypto/certificate.js b/lib/internal/crypto/certificate.js index b6b6ef8f5f6dd0..7a4f683ed7e37c 100644 --- a/lib/internal/crypto/certificate.js +++ b/lib/internal/crypto/certificate.js @@ -3,14 +3,14 @@ const { certExportChallenge, certExportPublicKey, - certVerifySpkac + certVerifySpkac, } = process.binding('crypto'); const errors = require('internal/errors'); const { isArrayBufferView } = require('internal/util/types'); const { - toBuf + toBuf, } = require('internal/crypto/util'); function verifySpkac(spkac) { diff --git a/lib/internal/crypto/cipher.js b/lib/internal/crypto/cipher.js index 5426c7e6edeed7..0175bdfe13473d 100644 --- a/lib/internal/crypto/cipher.js +++ b/lib/internal/crypto/cipher.js @@ -2,14 +2,14 @@ const { RSA_PKCS1_OAEP_PADDING, - RSA_PKCS1_PADDING + RSA_PKCS1_PADDING, } = process.binding('constants').crypto; const errors = require('internal/errors'); const { getDefaultEncoding, - toBuf + toBuf, } = require('internal/crypto/util'); const { isArrayBufferView } = require('internal/util/types'); @@ -19,7 +19,7 @@ const { privateDecrypt: _privateDecrypt, privateEncrypt: _privateEncrypt, publicDecrypt: _publicDecrypt, - publicEncrypt: _publicEncrypt + publicEncrypt: _publicEncrypt, } = process.binding('crypto'); const assert = require('assert'); diff --git a/lib/internal/crypto/diffiehellman.js b/lib/internal/crypto/diffiehellman.js index 687bae83fdecbb..8e78fb877e7e7e 100644 --- a/lib/internal/crypto/diffiehellman.js +++ b/lib/internal/crypto/diffiehellman.js @@ -5,17 +5,17 @@ const errors = require('internal/errors'); const { isArrayBufferView } = require('internal/util/types'); const { getDefaultEncoding, - toBuf + toBuf, } = require('internal/crypto/util'); const { DiffieHellman: _DiffieHellman, DiffieHellmanGroup: _DiffieHellmanGroup, - ECDH: _ECDH + ECDH: _ECDH, } = process.binding('crypto'); const { POINT_CONVERSION_COMPRESSED, POINT_CONVERSION_HYBRID, - POINT_CONVERSION_UNCOMPRESSED + POINT_CONVERSION_UNCOMPRESSED, } = process.binding('constants').crypto; const DH_GENERATOR = 2; @@ -57,7 +57,7 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) { Object.defineProperty(this, 'verifyError', { enumerable: true, value: this._handle.verifyError, - writable: false + writable: false, }); } @@ -69,7 +69,7 @@ function DiffieHellmanGroup(name) { Object.defineProperty(this, 'verifyError', { enumerable: true, value: this._handle.verifyError, - writable: false + writable: false, }); } @@ -216,5 +216,5 @@ ECDH.prototype.getPublicKey = function getPublicKey(encoding, format) { module.exports = { DiffieHellman, DiffieHellmanGroup, - ECDH + ECDH, }; diff --git a/lib/internal/crypto/hash.js b/lib/internal/crypto/hash.js index 952cc34d21b129..8e2636b2cd9f46 100644 --- a/lib/internal/crypto/hash.js +++ b/lib/internal/crypto/hash.js @@ -2,12 +2,12 @@ const { Hash: _Hash, - Hmac: _Hmac + Hmac: _Hmac, } = process.binding('crypto'); const { getDefaultEncoding, - toBuf + toBuf, } = require('internal/crypto/util'); const { Buffer } = require('buffer'); @@ -27,7 +27,7 @@ function Hash(algorithm, options) { throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'algorithm', 'string'); this._handle = new _Hash(algorithm); this[kState] = { - [kFinalized]: false + [kFinalized]: false, }; LazyTransform.call(this, options); } @@ -87,7 +87,7 @@ function Hmac(hmac, key, options) { this._handle = new _Hmac(); this._handle.init(hmac, toBuf(key)); this[kState] = { - [kFinalized]: false + [kFinalized]: false, }; LazyTransform.call(this, options); } @@ -118,5 +118,5 @@ Hmac.prototype._transform = Hash.prototype._transform; module.exports = { Hash, - Hmac + Hmac, }; diff --git a/lib/internal/crypto/pbkdf2.js b/lib/internal/crypto/pbkdf2.js index e967e0a7945fc6..aa9c7d2578612b 100644 --- a/lib/internal/crypto/pbkdf2.js +++ b/lib/internal/crypto/pbkdf2.js @@ -3,14 +3,14 @@ const errors = require('internal/errors'); const { getDefaultEncoding, - toBuf + toBuf, } = require('internal/crypto/util'); const { isArrayBufferView } = require('internal/util/types'); const { - PBKDF2 + PBKDF2, } = process.binding('crypto'); const { - INT_MAX + INT_MAX, } = process.binding('constants').crypto; function pbkdf2(password, salt, iterations, keylen, digest, callback) { @@ -94,5 +94,5 @@ function _pbkdf2(password, salt, iterations, keylen, digest, callback) { module.exports = { pbkdf2, - pbkdf2Sync + pbkdf2Sync, }; diff --git a/lib/internal/crypto/random.js b/lib/internal/crypto/random.js index 9ffaa4de76f652..2fe5abc82fbfc7 100644 --- a/lib/internal/crypto/random.js +++ b/lib/internal/crypto/random.js @@ -4,7 +4,7 @@ const errors = require('internal/errors'); const { isArrayBufferView } = require('internal/util/types'); const { randomBytes: _randomBytes, - randomFill: _randomFill + randomFill: _randomFill, } = process.binding('crypto'); const { kMaxLength } = require('buffer'); @@ -101,5 +101,5 @@ function randomFill(buf, offset, size, cb) { module.exports = { randomBytes, randomFill, - randomFillSync + randomFillSync, }; diff --git a/lib/internal/crypto/sig.js b/lib/internal/crypto/sig.js index 9f1938290f70cf..0ce051da11ba3e 100644 --- a/lib/internal/crypto/sig.js +++ b/lib/internal/crypto/sig.js @@ -3,15 +3,15 @@ const errors = require('internal/errors'); const { Sign: _Sign, - Verify: _Verify + Verify: _Verify, } = process.binding('crypto'); const { RSA_PSS_SALTLEN_AUTO, - RSA_PKCS1_PADDING + RSA_PKCS1_PADDING, } = process.binding('constants').crypto; const { getDefaultEncoding, - toBuf + toBuf, } = require('internal/crypto/util'); const { isArrayBufferView } = require('internal/util/types'); const { Writable } = require('stream'); @@ -152,5 +152,5 @@ Verify.prototype.verify = function verify(options, signature, sigEncoding) { module.exports = { Sign, - Verify + Verify, }; diff --git a/lib/internal/crypto/util.js b/lib/internal/crypto/util.js index ac01a447bc4324..78789070881f0d 100644 --- a/lib/internal/crypto/util.js +++ b/lib/internal/crypto/util.js @@ -5,21 +5,21 @@ const { getCurves: _getCurves, getHashes: _getHashes, setEngine: _setEngine, - timingSafeEqual: _timingSafeEqual + timingSafeEqual: _timingSafeEqual, } = process.binding('crypto'); const { - ENGINE_METHOD_ALL + ENGINE_METHOD_ALL, } = process.binding('constants').crypto; const errors = require('internal/errors'); const { Buffer } = require('buffer'); const { cachedResult, - filterDuplicateStrings + filterDuplicateStrings, } = require('internal/util'); const { - isArrayBufferView + isArrayBufferView, } = require('internal/util/types'); var defaultEncoding = 'buffer'; @@ -87,5 +87,5 @@ module.exports = { setDefaultEncoding, setEngine, timingSafeEqual, - toBuf + toBuf, }; diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index fa178f3a8c7caa..40ef46726d623f 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -12,17 +12,17 @@ const kEncoder = Symbol('encoder'); const { getConstructorOf, - customInspectSymbol: inspect + customInspectSymbol: inspect, } = require('internal/util'); const { isArrayBufferView } = require('internal/util/types'); const { - isArrayBuffer + isArrayBuffer, } = process.binding('util'); const { - encodeUtf8String + encodeUtf8String, } = process.binding('buffer'); var Buffer; @@ -264,7 +264,7 @@ const encodings = new Map([ ['windows-949', 'euc-kr'], ['utf-16be', 'utf-16be'], ['utf-16le', 'utf-16le'], - ['utf-16', 'utf-16le'] + ['utf-16', 'utf-16le'], ]); // Unfortunately, String.prototype.trim also removes non-ascii whitespace, @@ -318,7 +318,7 @@ class TextEncoder { return opts.stylize('[Object]', 'special'); var ctor = getConstructorOf(this); var obj = Object.create({ - constructor: ctor === null ? TextEncoder : ctor + constructor: ctor === null ? TextEncoder : ctor, }); obj.encoding = this.encoding; // Lazy to avoid circular dependency @@ -332,7 +332,7 @@ Object.defineProperties( 'encoding': { enumerable: true }, [Symbol.toStringTag]: { configurable: true, - value: 'TextEncoder' + value: 'TextEncoder', } }); const { hasConverter, TextDecoder } = @@ -349,7 +349,7 @@ function makeTextDecoderICU() { const { decode: _decode, getConverter, - hasConverter + hasConverter, } = process.binding('icu'); class TextDecoder { @@ -520,7 +520,7 @@ function makeTextDecoderJS() { return opts.stylize('[Object]', 'special'); var ctor = getConstructorOf(this); var obj = Object.create({ - constructor: ctor === null ? TextDecoder : ctor + constructor: ctor === null ? TextDecoder : ctor, }); obj.encoding = this.encoding; obj.fatal = this.fatal; @@ -531,15 +531,15 @@ function makeTextDecoderJS() { } // Lazy to avoid circular dependency return require('util').inspect(obj, opts); - } + }, })); Object.defineProperties(TextDecoder.prototype, { decode: { enumerable: true }, [inspect]: { enumerable: false }, [Symbol.toStringTag]: { configurable: true, - value: 'TextDecoder' - } + value: 'TextDecoder', + }, }); } @@ -547,5 +547,5 @@ module.exports = { getEncodingFromLabel, hasTextDecoder, TextDecoder, - TextEncoder + TextEncoder, }; diff --git a/lib/internal/errors.js b/lib/internal/errors.js index a4a79d671e4938..6db3a5afe03797 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -23,7 +23,7 @@ const { errmap, UV_EAI_MEMORY, UV_EAI_NODATA, - UV_EAI_NONAME + UV_EAI_NONAME, } = process.binding('uv'); const { kMaxLength } = process.binding('buffer'); const { defineProperty } = Object; @@ -55,7 +55,7 @@ function makeNodeError(Base) { configurable: true, enumerable: false, value: key, - writable: true + writable: true, }); } @@ -68,7 +68,7 @@ function makeNodeError(Base) { configurable: true, enumerable: true, value, - writable: true + writable: true, }); } @@ -81,7 +81,7 @@ function makeNodeError(Base) { configurable: true, enumerable: true, value, - writable: true + writable: true, }); } }; @@ -102,7 +102,7 @@ function makeNodeErrorWithCode(Base, key) { configurable: true, enumerable: true, value, - writable: true + writable: true, }); } @@ -115,7 +115,7 @@ function makeNodeErrorWithCode(Base, key) { configurable: true, enumerable: true, value, - writable: true + writable: true, }); } }; @@ -160,7 +160,7 @@ class SystemError extends makeNodeError(Error) { Object.defineProperty(this, kInfo, { configurable: false, enumerable: false, - value: context + value: context, }); } @@ -328,7 +328,7 @@ class AssertionError extends Error { message, operator, stackStartFn, - errorDiff = 0 + errorDiff = 0, } = options; if (message != null) { @@ -395,7 +395,7 @@ function internalAssert(condition, message) { message, actual: false, expected: true, - operator: '==' + operator: '==', }); } } @@ -577,7 +577,7 @@ module.exports = exports = { SystemError, codes, E, // This is exported only to facilitate testing. - errorCache: new Map() // This is in here only to facilitate testing. + errorCache: new Map(), // This is in here only to facilitate testing. }; // To declare an error message, use the E(sym, val) function above. The sym diff --git a/lib/internal/fs.js b/lib/internal/fs.js index 04844248b0b8e0..b0ab9547fe1d73 100644 --- a/lib/internal/fs.js +++ b/lib/internal/fs.js @@ -26,7 +26,7 @@ const { S_IFREG, S_IFSOCK, UV_FS_SYMLINK_DIR, - UV_FS_SYMLINK_JUNCTION + UV_FS_SYMLINK_JUNCTION, } = process.binding('constants').fs; const { statValues } = process.binding('fs'); @@ -422,5 +422,5 @@ module.exports = { validateOffsetLengthRead, validateOffsetLengthWrite, validatePath, - validateUint32 + validateUint32, }; diff --git a/lib/internal/http.js b/lib/internal/http.js index 2b9c948aeefb30..3ae95b056fec4a 100644 --- a/lib/internal/http.js +++ b/lib/internal/http.js @@ -24,5 +24,5 @@ function ondrain() { module.exports = { outHeadersKey: Symbol('outHeadersKey'), ondrain, - utcDate + utcDate, }; diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index 9670843176b77e..293744d7bd0752 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -30,7 +30,7 @@ const { HTTP_STATUS_CONTINUE, HTTP_STATUS_EXPECTATION_FAILED, HTTP_STATUS_METHOD_NOT_ALLOWED, - HTTP_STATUS_OK + HTTP_STATUS_OK, } = constants; let statusMessageWarned = false; @@ -206,7 +206,7 @@ const proxySocketHandler = { ref[prop] = value; return true; } - } + }, }; class Http2ServerRequest extends Readable { @@ -634,7 +634,7 @@ class Http2ServerResponse extends Stream { headers[HTTP2_HEADER_STATUS] = state.statusCode; const options = { endStream: state.ending, - getTrailers: (trailers) => Object.assign(trailers, this[kTrailers]) + getTrailers: (trailers) => Object.assign(trailers, this[kTrailers]), }; this[kStream].respond(headers, options); } @@ -657,7 +657,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 71bb55ee23c89f..b1dabd36ed2af7 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -52,14 +52,14 @@ const { sessionName, toHeaderObject, updateOptionsBuffer, - updateSettingsBuffer + updateSettingsBuffer, } = require('internal/http2/util'); const { kTimeout, setUnrefTimeout, validateTimerDuration, - refreshFnSymbol + refreshFnSymbol, } = require('internal/timers'); const { ShutdownWrap, WriteWrap } = process.binding('stream_wrap'); @@ -101,7 +101,7 @@ const { paddingBuffer, PADDING_BUF_FRAME_LENGTH, PADDING_BUF_MAX_PAYLOAD_LENGTH, - PADDING_BUF_RETURN_VALUE + PADDING_BUF_RETURN_VALUE, } = binding; const { @@ -146,7 +146,7 @@ const { HTTP_STATUS_SWITCHING_PROTOCOLS, STREAM_OPTION_EMPTY_PAYLOAD, - STREAM_OPTION_GET_TRAILERS + STREAM_OPTION_GET_TRAILERS, } = constants; const STREAM_FLAGS_PENDING = 0x0; @@ -673,7 +673,7 @@ const proxySocketHandler = { session[kSocket][prop] = value; return true; } - } + }, }; // pingCallback() returns a function that is invoked when an HTTP2 PING @@ -848,7 +848,7 @@ class Http2Session extends EventEmitter { pendingStreams: new Set(), pendingAck: 0, writeQueueSize: 0, - originSet: undefined + originSet: undefined, }; this[kEncrypted] = undefined; @@ -993,7 +993,7 @@ class Http2Session extends EventEmitter { destroyed: this.destroyed, state: this.state, localSettings: this.localSettings, - remoteSettings: this.remoteSettings + remoteSettings: this.remoteSettings, }; return `Http2Session ${util.format(obj)}`; } @@ -1490,7 +1490,7 @@ class Http2Stream extends Duplex { this[kState] = { flags: STREAM_FLAGS_PENDING, rstCode: NGHTTP2_NO_ERROR, - writeQueueSize: 0 + writeQueueSize: 0, }; this.on('resume', streamOnResume); @@ -1532,7 +1532,7 @@ class Http2Stream extends Duplex { destroyed: this.destroyed, state: this.state, readableState: this._readableState, - writableState: this._writableState + writableState: this._writableState, }; return `Http2Stream ${util.format(obj)}`; } @@ -1952,7 +1952,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 @@ -2001,7 +2001,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 @@ -2448,7 +2448,7 @@ const setTimeout = { } } return this; - } + }, }; Object.defineProperty(Http2Stream.prototype, 'setTimeout', setTimeout); Object.defineProperty(Http2Session.prototype, 'setTimeout', setTimeout); @@ -2697,7 +2697,7 @@ Object.defineProperty(connect, promisify.custom, { options, () => promiseResolve(promise, server)); return promise; - } + }, }); function createSecureServer(options, handler) { @@ -2777,7 +2777,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 1411ab7cf72ad7..ec169796360f4f 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -61,7 +61,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 @@ -72,7 +72,7 @@ const kValidPseudoHeaders = new Set([ HTTP2_HEADER_METHOD, HTTP2_HEADER_AUTHORITY, HTTP2_HEADER_SCHEME, - HTTP2_HEADER_PATH + HTTP2_HEADER_PATH, ]); // This set contains headers that are permitted to have only a single @@ -115,7 +115,7 @@ const kSingleValueHeaders = new Set([ HTTP2_HEADER_TK, HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS, HTTP2_HEADER_USER_AGENT, - HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS + HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS, ]); // The HTTP methods in this set are specifically defined as assigning no @@ -125,7 +125,7 @@ const kSingleValueHeaders = new Set([ const kNoPayloadMethods = new Set([ HTTP2_METHOD_DELETE, HTTP2_METHOD_GET, - HTTP2_METHOD_HEAD + HTTP2_METHOD_HEAD, ]); // The following ArrayBuffer instances are used to share memory more efficiently @@ -288,7 +288,7 @@ function getSettings(session, remote) { initialWindowSize: settingsBuffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE], maxFrameSize: settingsBuffer[IDX_SETTINGS_MAX_FRAME_SIZE], maxConcurrentStreams: settingsBuffer[IDX_SETTINGS_MAX_CONCURRENT_STREAMS], - maxHeaderListSize: settingsBuffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE] + maxHeaderListSize: settingsBuffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE], }; } @@ -347,7 +347,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], }; } @@ -359,7 +359,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], }; } @@ -573,5 +573,5 @@ module.exports = { sessionName, toHeaderObject, updateOptionsBuffer, - updateSettingsBuffer + updateSettingsBuffer, }; 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/loader/CreateDynamicModule.js b/lib/internal/loader/CreateDynamicModule.js index f2596de04bfcb3..c64427cb15a804 100644 --- a/lib/internal/loader/CreateDynamicModule.js +++ b/lib/internal/loader/CreateDynamicModule.js @@ -53,7 +53,7 @@ const createDynamicModule = (exports, url = '', evaluate) => { module.instantiate(); return { module, - reflect + reflect, }; }; diff --git a/lib/internal/loader/DefaultResolve.js b/lib/internal/loader/DefaultResolve.js index d815be87dd8954..7fc610d76a41be 100644 --- a/lib/internal/loader/DefaultResolve.js +++ b/lib/internal/loader/DefaultResolve.js @@ -44,14 +44,14 @@ const extensionFormatMap = { '.mjs': 'esm', '.json': 'json', '.node': 'addon', - '.js': 'cjs' + '.js': 'cjs', }; function resolve(specifier, parentURL) { if (NativeModule.nonInternalExists(specifier)) { return { url: specifier, - format: 'builtin' + format: 'builtin', }; } @@ -68,7 +68,7 @@ function resolve(specifier, parentURL) { if (!preserveSymlinks) { const real = realpathSync(getPathFromURL(url), { - [internalFS.realpathCacheKey]: realpathCache + [internalFS.realpathCacheKey]: realpathCache, }); const old = url; url = getURLFromFilePath(real); diff --git a/lib/internal/loader/Translators.js b/lib/internal/loader/Translators.js index 18b1b12fd15854..51d6c1907ebf01 100644 --- a/lib/internal/loader/Translators.js +++ b/lib/internal/loader/Translators.js @@ -25,7 +25,7 @@ translators.set('esm', async (url) => { debug(`Translating StandardModule ${url}`); return { module: new ModuleWrap(internalCJSModule.stripShebang(source), url), - reflect: undefined + reflect: undefined, }; }); diff --git a/lib/internal/module.js b/lib/internal/module.js index 6e2fb15268ffe4..3a67dba1dd9799 100644 --- a/lib/internal/module.js +++ b/lib/internal/module.js @@ -103,7 +103,7 @@ const builtinLibs = [ 'assert', 'async_hooks', 'buffer', 'child_process', 'cluster', 'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'http2', 'https', 'net', 'os', 'path', 'perf_hooks', 'punycode', 'querystring', 'readline', 'repl', - 'stream', 'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib' + 'stream', 'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib', ]; if (typeof process.binding('inspector').connect === 'function') { @@ -138,14 +138,14 @@ function addBuiltinLibsToObject(object) { get: () => lib, set: setReal, configurable: true, - enumerable: false + enumerable: false, }); return lib; }, set: setReal, configurable: true, - enumerable: false + enumerable: false, }); }); } @@ -156,5 +156,5 @@ module.exports = exports = { makeRequireFunction, requireDepth: 0, stripBOM, - stripShebang + stripShebang, }; diff --git a/lib/internal/net.js b/lib/internal/net.js index 9c2602b79e9208..a763feda47c97e 100644 --- a/lib/internal/net.js +++ b/lib/internal/net.js @@ -53,5 +53,5 @@ module.exports = { isIPv6, isLegalPort, makeSyncWrite, - normalizedArgsSymbol: Symbol('normalizedArgs') + normalizedArgsSymbol: Symbol('normalizedArgs'), }; diff --git a/lib/internal/os.js b/lib/internal/os.js index 74ed6e767ee16d..96d4b1bea2c5ee 100644 --- a/lib/internal/os.js +++ b/lib/internal/os.js @@ -37,5 +37,5 @@ function countOnes(bitsString) { } module.exports = { - getCIDRSuffix + getCIDRSuffix, }; diff --git a/lib/internal/process.js b/lib/internal/process.js index 3de3ae1603deb5..b137606ae8473f 100644 --- a/lib/internal/process.js +++ b/lib/internal/process.js @@ -51,14 +51,14 @@ function setup_cpuUsage() { 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], }; // Ensure that a previously passed in value is valid. Currently, the native @@ -99,7 +99,7 @@ function setup_hrtime() { return [ hrValues[0] * 0x100000000 + hrValues[1], - hrValues[2] + hrValues[2], ]; }; } @@ -114,7 +114,7 @@ function setupMemoryUsage() { rss: memValues[0], heapTotal: memValues[1], heapUsed: memValues[2], - external: memValues[3] + external: memValues[3], }; }; } @@ -281,5 +281,5 @@ module.exports = { setupSignalHandlers, setupChannel, setupRawDebug, - setupUncaughtExceptionCapture + setupUncaughtExceptionCapture, }; diff --git a/lib/internal/process/modules.js b/lib/internal/process/modules.js index f89278ddaa2d52..11728aa5139fdd 100644 --- a/lib/internal/process/modules.js +++ b/lib/internal/process/modules.js @@ -2,7 +2,7 @@ const { setImportModuleDynamicallyCallback, - setInitializeImportMetaObjectCallback + setInitializeImportMetaObjectCallback, } = internalBinding('module_wrap'); const { getURLFromFilePath } = require('internal/url'); diff --git a/lib/internal/process/next_tick.js b/lib/internal/process/next_tick.js index f95d9cc1b82ebf..4f31f11f7b9954 100644 --- a/lib/internal/process/next_tick.js +++ b/lib/internal/process/next_tick.js @@ -14,7 +14,7 @@ function setupNextTick() { emitBefore, emitAfter, emitDestroy, - symbols: { async_id_symbol, trigger_async_id_symbol } + symbols: { async_id_symbol, trigger_async_id_symbol }, } = require('internal/async_hooks'); const promises = require('internal/process/promises'); const errors = require('internal/errors'); @@ -26,7 +26,7 @@ function setupNextTick() { // runMicrotasks is used to run V8's micro task queue. const [ tickInfo, - runMicrotasks + runMicrotasks, ] = process._setupNextTick(_tickCallback); // *Must* match Environment::TickInfo::Fields in src/env.h. diff --git a/lib/internal/process/promises.js b/lib/internal/process/promises.js index a1c7331a0d98ba..156718920ed6fc 100644 --- a/lib/internal/process/promises.js +++ b/lib/internal/process/promises.js @@ -8,7 +8,7 @@ const asyncHandledRejections = []; let lastPromiseId = 0; module.exports = { - emitPromiseRejectionWarnings + emitPromiseRejectionWarnings, }; process._setupPromises(unhandledRejection, handledRejection); @@ -17,7 +17,7 @@ function unhandledRejection(promise, reason) { maybeUnhandledPromises.set(promise, { reason, uid: ++lastPromiseId, - warned: false + warned: false, }); pendingUnhandledRejections.push(promise); return true; diff --git a/lib/internal/process/stdio.js b/lib/internal/process/stdio.js index 45568ae631698b..386d63037b2265 100644 --- a/lib/internal/process/stdio.js +++ b/lib/internal/process/stdio.js @@ -51,7 +51,7 @@ function setupStdio() { stdin = new tty.ReadStream(fd, { highWaterMark: 0, readable: true, - writable: false + writable: false, }); break; @@ -72,13 +72,13 @@ function setupStdio() { stdin = new net.Socket({ handle: process.channel, readable: true, - writable: false + writable: false, }); } else { stdin = new net.Socket({ fd: fd, readable: true, - writable: false + writable: false, }); } // Make sure the stdin can't be `.end()`-ed @@ -118,19 +118,19 @@ function setupStdio() { Object.defineProperty(process, 'stdout', { configurable: true, enumerable: true, - get: getStdout + get: getStdout, }); Object.defineProperty(process, 'stderr', { configurable: true, enumerable: true, - get: getStderr + get: getStderr, }); Object.defineProperty(process, 'stdin', { configurable: true, enumerable: true, - get: getStdin + get: getStdin, }); process.openStdin = function() { @@ -164,7 +164,7 @@ function createWritableStdioStream(fd) { stream = new net.Socket({ fd: fd, readable: false, - writable: true + writable: true, }); stream._type = 'pipe'; break; diff --git a/lib/internal/querystring.js b/lib/internal/querystring.js index d1684418097100..7e7f0912419f1f 100644 --- a/lib/internal/querystring.js +++ b/lib/internal/querystring.js @@ -20,10 +20,10 @@ const isHexTable = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // ... 256 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ... 256 ]; module.exports = { hexTable, - isHexTable + isHexTable, }; diff --git a/lib/internal/readline.js b/lib/internal/readline.js index 979e62090b3b1d..58dce0e291d8f4 100644 --- a/lib/internal/readline.js +++ b/lib/internal/readline.js @@ -169,7 +169,7 @@ function* emitKeys(stream) { name: undefined, ctrl: false, meta: false, - shift: false + shift: false, }; if (ch === kEscape) { @@ -431,5 +431,5 @@ module.exports = { getStringWidth, isFullWidthCodePoint, stripVTControlCharacters, - CSI + CSI, }; diff --git a/lib/internal/repl.js b/lib/internal/repl.js index 4c4e3c8cb4e275..bd335a68326b7a 100644 --- a/lib/internal/repl.js +++ b/lib/internal/repl.js @@ -28,7 +28,7 @@ function createRepl(env, opts, cb) { ignoreUndefined: false, terminal: process.stdout.isTTY, useGlobal: true, - breakEvalOnSigint: true + breakEvalOnSigint: true, }, opts); if (parseInt(env.NODE_NO_READLINE)) { @@ -43,7 +43,7 @@ function createRepl(env, opts, cb) { opts.replMode = { 'strict': REPL.REPL_MODE_STRICT, - 'sloppy': REPL.REPL_MODE_SLOPPY + 'sloppy': REPL.REPL_MODE_SLOPPY, }[String(env.NODE_REPL_MODE).toLowerCase().trim()]; if (opts.replMode === undefined) { diff --git a/lib/internal/repl/await.js b/lib/internal/repl/await.js index dfd4e9308594c1..868158d1a6d877 100644 --- a/lib/internal/repl/await.js +++ b/lib/internal/repl/await.js @@ -45,7 +45,7 @@ const visitorsWithoutAncestors = { } walk.base.VariableDeclaration(node, state, c); - } + }, }; const visitors = {}; @@ -90,7 +90,7 @@ function processTopLevelAwait(src) { wrappedArray[node.end - 1] += str; }, containsAwait: false, - containsReturn: false + containsReturn: false, }; walk.recursive(body, state, visitors); @@ -124,5 +124,5 @@ function processTopLevelAwait(src) { } module.exports = { - processTopLevelAwait + processTopLevelAwait, }; diff --git a/lib/internal/safe_globals.js b/lib/internal/safe_globals.js index ad58fa662b53ef..4357f8a14afc29 100644 --- a/lib/internal/safe_globals.js +++ b/lib/internal/safe_globals.js @@ -2,7 +2,7 @@ const copyProps = (unsafe, safe) => { for (const key of [...Object.getOwnPropertyNames(unsafe), - ...Object.getOwnPropertySymbols(unsafe) + ...Object.getOwnPropertySymbols(unsafe), ]) { if (!Object.getOwnPropertyDescriptor(safe, key)) { Object.defineProperty( diff --git a/lib/internal/socket_list.js b/lib/internal/socket_list.js index dd30e9450950e2..f0589d36d831ee 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', callback); } getConnections(callback) { this._request({ cmd: 'NODE_SOCKET_GET_COUNT', - key: this.key + key: this.key, }, 'NODE_SOCKET_COUNT', function(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, }); } @@ -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/streams/destroy.js b/lib/internal/streams/destroy.js index 985332ac4607a8..2c17f1217b982c 100644 --- a/lib/internal/streams/destroy.js +++ b/lib/internal/streams/destroy.js @@ -68,5 +68,5 @@ function emitErrorNT(self, err) { module.exports = { destroy, - undestroy + undestroy, }; diff --git a/lib/internal/streams/lazy_transform.js b/lib/internal/streams/lazy_transform.js index 80e0bacf29df7c..5cac028af5fd3d 100644 --- a/lib/internal/streams/lazy_transform.js +++ b/lib/internal/streams/lazy_transform.js @@ -35,7 +35,7 @@ function makeSetter(name) { value: val, enumerable: true, configurable: true, - writable: true + writable: true, }); }; } @@ -45,18 +45,18 @@ Object.defineProperties(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, }, _transformState: { get: makeGetter('_transformState'), set: makeSetter('_transformState'), configurable: true, - enumerable: true - } + enumerable: true, + }, }); diff --git a/lib/internal/streams/state.js b/lib/internal/streams/state.js index cca79c93de49b5..92d2d679361df5 100644 --- a/lib/internal/streams/state.js +++ b/lib/internal/streams/state.js @@ -22,5 +22,5 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) { } module.exports = { - getHighWaterMark + getHighWaterMark, }; diff --git a/lib/internal/timers.js b/lib/internal/timers.js index 8c1a87a65f4725..368fbf7c748942 100644 --- a/lib/internal/timers.js +++ b/lib/internal/timers.js @@ -4,7 +4,7 @@ const { getDefaultTriggerAsyncId, newAsyncId, initHooksExist, - emitInit + emitInit, } = require('internal/async_hooks'); // Symbols for storing async id state. const async_id_symbol = Symbol('asyncId'); @@ -27,7 +27,7 @@ module.exports = { initAsyncResource, refreshFnSymbol, setUnrefTimeout, - validateTimerDuration + validateTimerDuration, }; var timers; diff --git a/lib/internal/tls.js b/lib/internal/tls.js index 6d367dbf285ff7..2bc7ae573a864f 100644 --- a/lib/internal/tls.js +++ b/lib/internal/tls.js @@ -24,5 +24,5 @@ function parseCertString(s) { } module.exports = { - parseCertString + parseCertString, }; diff --git a/lib/internal/trace_events_async_hooks.js b/lib/internal/trace_events_async_hooks.js index 704da98e14412b..18cacbbed84369 100644 --- a/lib/internal/trace_events_async_hooks.js +++ b/lib/internal/trace_events_async_hooks.js @@ -58,7 +58,7 @@ const hook = async_hooks.createHook({ // cleanup asyncId to type map typeMemory.delete(asyncId); - } + }, }); diff --git a/lib/internal/url.js b/lib/internal/url.js index 0bdfc4783e65f3..ca4a1687cedf33 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -3,7 +3,7 @@ const util = require('util'); const { hexTable, - isHexTable + isHexTable, } = require('internal/querystring'); const { getConstructorOf, removeColors } = require('internal/util'); @@ -34,7 +34,7 @@ const { kPathStart, kPort, kQuery, - kSchemeStart + kSchemeStart, } = process.binding('url'); const context = Symbol('context'); @@ -337,7 +337,7 @@ class URL { var ctor = getConstructorOf(this); var obj = Object.create({ - constructor: ctor === null ? URL : ctor + constructor: ctor === null ? URL : ctor, }); obj.href = this.href; @@ -375,7 +375,7 @@ Object.defineProperties(URL.prototype, { fragment: true, unicode: false, search: true, - auth: true + auth: true, }, options); const ctx = this[context]; var ret = ctx.scheme; @@ -402,11 +402,11 @@ Object.defineProperties(URL.prototype, { if (options.fragment && ctx.fragment !== null) ret += `#${ctx.fragment}`; return ret; - } + }, }, [Symbol.toStringTag]: { configurable: true, - value: 'URL' + value: 'URL', }, toString: { // https://heycam.github.io/webidl/#es-stringifier @@ -416,7 +416,7 @@ Object.defineProperties(URL.prototype, { // eslint-disable-next-line func-name-matching value: function toString() { return this[kFormat]({}); - } + }, }, href: { enumerable: true, @@ -428,7 +428,7 @@ Object.defineProperties(URL.prototype, { // toUSVString is not needed. input = `${input}`; parse(this, input); - } + }, }, origin: { // readonly enumerable: true, @@ -455,7 +455,7 @@ Object.defineProperties(URL.prototype, { return serializeTupleOrigin(ctx.scheme, ctx.host, ctx.port); } return kOpaqueOrigin; - } + }, }, protocol: { enumerable: true, @@ -475,7 +475,7 @@ Object.defineProperties(URL.prototype, { } _parse(scheme, kSchemeStart, null, ctx, onParseProtocolComplete.bind(this)); - } + }, }, username: { enumerable: true, @@ -496,7 +496,7 @@ Object.defineProperties(URL.prototype, { } ctx.username = encodeAuth(username); ctx.flags |= URL_FLAGS_HAS_USERNAME; - } + }, }, password: { enumerable: true, @@ -517,7 +517,7 @@ Object.defineProperties(URL.prototype, { } ctx.password = encodeAuth(password); ctx.flags |= URL_FLAGS_HAS_PASSWORD; - } + }, }, host: { enumerable: true, @@ -538,7 +538,7 @@ Object.defineProperties(URL.prototype, { return; } _parse(host, kHost, null, ctx, onParseHostComplete.bind(this)); - } + }, }, hostname: { enumerable: true, @@ -555,7 +555,7 @@ Object.defineProperties(URL.prototype, { return; } _parse(host, kHostname, null, ctx, onParseHostnameComplete.bind(this)); - } + }, }, port: { enumerable: true, @@ -575,7 +575,7 @@ Object.defineProperties(URL.prototype, { return; } _parse(port, kPort, null, ctx, onParsePortComplete.bind(this)); - } + }, }, pathname: { enumerable: true, @@ -595,7 +595,7 @@ Object.defineProperties(URL.prototype, { return; _parse(path, kPathStart, null, this[context], onParsePathComplete.bind(this)); - } + }, }, search: { enumerable: true, @@ -621,14 +621,14 @@ Object.defineProperties(URL.prototype, { } } initSearchParams(this[searchParams], search); - } + }, }, searchParams: { // readonly enumerable: true, configurable: true, get() { return this[searchParams]; - } + }, }, hash: { enumerable: true, @@ -652,7 +652,7 @@ Object.defineProperties(URL.prototype, { ctx.fragment = ''; ctx.flags |= URL_FLAGS_HAS_FRAGMENT; _parse(hash, kFragment, null, ctx, onParseHashComplete.bind(this)); - } + }, }, toJSON: { writable: true, @@ -661,8 +661,8 @@ Object.defineProperties(URL.prototype, { // eslint-disable-next-line func-name-matching value: function toJSON() { return this[kFormat]({}); - } - } + }, + }, }); function update(url, params) { @@ -798,7 +798,7 @@ const noEscape = [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 - 0x4F 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 0x50 - 0x5F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 - 0x6F - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 // 0x70 - 0x7F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, // 0x70 - 0x7F ]; // Special version of hexTable that uses `+` for U+0020 SPACE. @@ -889,7 +889,7 @@ function defineIDLClass(proto, classStr, obj) { writable: false, enumerable: false, configurable: true, - value: classStr + value: classStr, }); // https://heycam.github.io/webidl/#es-operations @@ -898,7 +898,7 @@ function defineIDLClass(proto, classStr, obj) { writable: true, enumerable: true, configurable: true, - value: obj[key] + value: obj[key], }); } for (const key of Object.getOwnPropertySymbols(obj)) { @@ -906,7 +906,7 @@ function defineIDLClass(proto, classStr, obj) { writable: true, enumerable: false, configurable: true, - value: obj[key] + value: obj[key], }); } } @@ -1172,14 +1172,14 @@ defineIDLClass(URLSearchParams.prototype, 'URLSearchParams', { } return serializeParams(this[searchParams]); - } + }, }); // https://heycam.github.io/webidl/#es-iterable-entries Object.defineProperty(URLSearchParams.prototype, Symbol.iterator, { writable: true, configurable: true, - value: URLSearchParams.prototype.entries + value: URLSearchParams.prototype.entries, }); // https://heycam.github.io/webidl/#dfn-default-iterator-object @@ -1188,7 +1188,7 @@ function createSearchParamsIterator(target, kind) { iterator[context] = { target, kind, - index: 0 + index: 0, }; return iterator; } @@ -1206,14 +1206,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, }; } @@ -1232,7 +1232,7 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', { return { value: result, - done: false + done: false, }; }, [util.inspect.custom](recurseTimes, ctx) { @@ -1249,7 +1249,7 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', { const { target, kind, - index + index, } = this[context]; const output = target[searchParams].slice(index).reduce((prev, cur, i) => { const key = i % 2 === 0; @@ -1271,7 +1271,7 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', { outputStr = ` ${outputStrs.join(', ')}`; } return `${this[Symbol.toStringTag]} {${outputStr} }`; - } + }, }); function domainToASCII(domain) { @@ -1301,7 +1301,7 @@ function urlToOptions(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); @@ -1422,5 +1422,5 @@ module.exports = { domainToUnicode, urlToOptions, formatSymbol: kFormat, - searchParamsSymbol: searchParams + searchParamsSymbol: searchParams, }; diff --git a/lib/internal/util.js b/lib/internal/util.js index b144063ee50100..53f3c9b269f2fd 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -10,7 +10,7 @@ const { promiseReject, setHiddenValue, arrow_message_private_symbol: kArrowMessagePrivateSymbolIndex, - decorated_private_symbol: kDecoratedPrivateSymbolIndex + decorated_private_symbol: kDecoratedPrivateSymbolIndex, } = process.binding('util'); const { errmap } = process.binding('uv'); @@ -196,7 +196,7 @@ function createClassWrapper(type) { // Mask the wrapper function name and length values Object.defineProperties(fn, { name: { value: type.name }, - length: { value: type.length } + length: { value: type.length }, }); Object.setPrototypeOf(fn, type); fn.prototype = type.prototype; @@ -301,7 +301,7 @@ function promisify(original) { fn); } Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true + value: fn, enumerable: false, writable: false, configurable: true, }); return fn; } @@ -334,7 +334,7 @@ function promisify(original) { Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); Object.defineProperty(fn, kCustomPromisifiedSymbol, { - value: fn, enumerable: false, writable: false, configurable: true + value: fn, enumerable: false, writable: false, configurable: true, }); return Object.defineProperties( fn, @@ -394,5 +394,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('node.isEncoding') + kIsEncodingSymbol: Symbol('node.isEncoding'), }; diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index 1145bc7d9971ba..ae4cacfcb70fe9 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -231,7 +231,7 @@ function keyCheck(val1, val2, strict, memos, lengthA, lengthB) { memos = { val1: new Map(), val2: new Map(), - position: 0 + position: 0, }; } else { // We prevent up to two map.has(x) calls by directly retrieving the value @@ -512,5 +512,5 @@ function isDeepStrictEqual(val1, val2) { module.exports = { isDeepEqual, - isDeepStrictEqual + isDeepStrictEqual, }; diff --git a/lib/internal/util/inspector.js b/lib/internal/util/inspector.js index 634d3302333584..09baf93815d455 100644 --- a/lib/internal/util/inspector.js +++ b/lib/internal/util/inspector.js @@ -21,5 +21,5 @@ function sendInspectorCommand(cb, onError) { } module.exports = { - sendInspectorCommand + sendInspectorCommand, }; diff --git a/lib/internal/util/types.js b/lib/internal/util/types.js index c990bea6db4605..cc4cebec159fa3 100644 --- a/lib/internal/util/types.js +++ b/lib/internal/util/types.js @@ -32,5 +32,5 @@ function isUint8Array(value) { module.exports = { isArrayBufferView, isTypedArray, - isUint8Array + isUint8Array, }; diff --git a/lib/internal/v8_prof_processor.js b/lib/internal/v8_prof_processor.js index 0d9cfd6df4d12a..50b7436c5c3c02 100644 --- a/lib/internal/v8_prof_processor.js +++ b/lib/internal/v8_prof_processor.js @@ -14,7 +14,7 @@ const scriptFiles = [ 'internal/deps/v8/tools/arguments', 'internal/deps/v8/tools/tickprocessor', 'internal/deps/v8/tools/SourceMap', - 'internal/deps/v8/tools/tickprocessor-driver' + 'internal/deps/v8/tools/tickprocessor-driver', ]; var script = ''; diff --git a/lib/internal/vm/Module.js b/lib/internal/vm/Module.js index a8fb7303aec131..b60a886e4c8c61 100644 --- a/lib/internal/vm/Module.js +++ b/lib/internal/vm/Module.js @@ -77,7 +77,7 @@ class Module { const wrap = new ModuleWrap(src, url, { [kParsingContext]: context, lineOffset: options.lineOffset, - columnOffset: options.columnOffset + columnOffset: options.columnOffset, }); wrapMap.set(this, wrap); @@ -201,5 +201,5 @@ class Module { } module.exports = { - Module + Module, }; diff --git a/lib/module.js b/lib/module.js index be49fa8e8d7e99..0da7f3c8064d2a 100644 --- a/lib/module.js +++ b/lib/module.js @@ -32,7 +32,7 @@ const internalFS = require('internal/fs'); const path = require('path'); const { internalModuleReadJSON, - internalModuleStat + internalModuleStat, } = process.binding('fs'); const { safeGetenv } = process.binding('util'); const internalModule = require('internal/module'); @@ -108,7 +108,7 @@ Module.wrap = function(script) { Module.wrapper = [ '(function (exports, require, module, __filename, __dirname) { ', - '\n});' + '\n});', ]; const debug = util.debuglog('module'); @@ -182,7 +182,7 @@ function tryFile(requestPath, isMain) { function toRealPath(requestPath) { return fs.realpathSync(requestPath, { - [internalFS.realpathCacheKey]: realpathCache + [internalFS.realpathCacheKey]: realpathCache, }); } @@ -634,7 +634,7 @@ Module.prototype._compile = function(content, filename) { var compiledWrapper = vm.runInThisContext(wrapper, { filename: filename, lineOffset: 0, - displayErrors: true + displayErrors: true, }); var inspectorWrapper = null; diff --git a/lib/net.js b/lib/net.js index 9ff26c74515eaa..1cd919917e48ec 100644 --- a/lib/net.js +++ b/lib/net.js @@ -31,13 +31,13 @@ const { isIPv6, isLegalPort, normalizedArgsSymbol, - makeSyncWrite + makeSyncWrite, } = require('internal/net'); const assert = require('assert'); const { UV_EADDRINUSE, UV_EINVAL, - UV_EOF + UV_EOF, } = process.binding('uv'); const { Buffer } = require('buffer'); @@ -50,7 +50,7 @@ const { ShutdownWrap, WriteWrap } = process.binding('stream_wrap'); const { newAsyncId, defaultTriggerAsyncIdScope, - symbols: { async_id_symbol } + symbols: { async_id_symbol }, } = require('internal/async_hooks'); const { nextTick } = require('internal/process/next_tick'); const errors = require('internal/errors'); @@ -69,7 +69,7 @@ const { kTimeout, setUnrefTimeout, validateTimerDuration, - refreshFnSymbol + refreshFnSymbol, } = require('internal/timers'); function noop() {} @@ -455,7 +455,7 @@ Socket.prototype.address = function() { Object.defineProperty(Socket.prototype, '_connecting', { get: function() { return this.connecting; - } + }, }); @@ -472,7 +472,7 @@ Object.defineProperty(Socket.prototype, 'readyState', { } else { return 'closed'; } - } + }, }); @@ -481,7 +481,7 @@ Object.defineProperty(Socket.prototype, 'bufferSize', { if (this._handle) { return this[kLastWriteQueueSize] + this.writableLength; } - } + }, }); @@ -661,7 +661,7 @@ function protoGetter(name, callback) { Object.defineProperty(Socket.prototype, name, { configurable: false, enumerable: true, - get: callback + get: callback, }); } @@ -1078,7 +1078,7 @@ function lookupAndConnect(self, options) { var dnsopts = { family: options.family, - hints: options.hints || 0 + hints: options.hints || 0, }; if (process.platform !== 'win32' && @@ -1243,7 +1243,7 @@ function Server(options, connectionListener) { set: internalUtil.deprecate((val) => (this._connections = val), 'Server.connections property is deprecated.', 'DEP0020'), - configurable: true, enumerable: false + configurable: true, enumerable: false, }); this[async_id_symbol] = -1; @@ -1414,7 +1414,7 @@ function listenInCluster(server, address, port, addressType, port: port, addressType: addressType, fd: fd, - flags: 0 + flags: 0, }; // Get the master's server handle, and listen on it @@ -1531,7 +1531,7 @@ Object.defineProperty(Server.prototype, 'listening', { return !!this._handle; }, configurable: true, - enumerable: true + enumerable: true, }); Server.prototype.address = function() { @@ -1568,7 +1568,7 @@ function onconnection(err, clientHandle) { var socket = new Socket({ handle: clientHandle, allowHalfOpen: self.allowHalfOpen, - pauseOnCreate: self.pauseOnConnect + pauseOnCreate: self.pauseOnConnect, }); socket.readable = socket.writable = true; diff --git a/lib/os.js b/lib/os.js index eb13139dba9a9c..337c90472adc1b 100644 --- a/lib/os.js +++ b/lib/os.js @@ -41,7 +41,7 @@ const { getTotalMem, getUserInfo: _getUserInfo, getUptime, - isBigEndian + isBigEndian, } = process.binding('os'); function getCheckedFunction(fn) { @@ -98,8 +98,8 @@ function addCPUInfo() { nice: cpuValues[c + 2], sys: cpuValues[c + 3], idle: cpuValues[c + 4], - irq: cpuValues[c + 5] - } + irq: cpuValues[c + 5], + }, }; } } @@ -180,20 +180,20 @@ module.exports = exports = { getNetworkInterfaces: deprecate(getInterfaceAddresses, getNetworkInterfacesDepMsg, 'DEP0023'), - tmpDir: deprecate(tmpdir, tmpDirDeprecationMsg, 'DEP0022') + tmpDir: deprecate(tmpdir, tmpDirDeprecationMsg, 'DEP0022'), }; Object.defineProperties(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 098416adfe1a3a..b3dded75415f88 100644 --- a/lib/path.js +++ b/lib/path.js @@ -1128,7 +1128,7 @@ const win32 = { sep: '\\', delimiter: ';', win32: null, - posix: null + posix: null, }; @@ -1586,7 +1586,7 @@ const posix = { sep: '/', delimiter: ':', win32: null, - posix: null + posix: null, }; diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index 025fa9edd06de1..39a68a2510e09d 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -9,7 +9,7 @@ const { setupObservers, timeOrigin, timerify, - constants + constants, } = process.binding('performance'); const { @@ -33,7 +33,7 @@ const { NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START, NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END, NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START, - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END + NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END, } = constants; const { AsyncResource } = require('async_hooks'); @@ -67,7 +67,7 @@ const observerableTypes = [ 'measure', 'gc', 'function', - 'http2' + 'http2', ]; const IDX_STREAM_STATS_ID = 0; @@ -240,7 +240,7 @@ class PerformanceNodeTiming { moduleLoadStart: this.moduleLoadStart, moduleLoadEnd: this.moduleLoadEnd, preloadModuleLoadStart: this.preloadModuleLoadStart, - preloadModuleLoadEnd: this.preloadModuleLoadEnd + preloadModuleLoadEnd: this.preloadModuleLoadEnd, }; } } @@ -258,13 +258,13 @@ class PerformanceObserverEntryList { [kEntries]: { writable: true, enumerable: false, - value: {} + value: {}, }, [kCount]: { writable: true, enumerable: false, - value: 0 - } + value: 0, + }, }); L.init(this[kEntries]); } @@ -329,28 +329,28 @@ class PerformanceObserver extends AsyncResource { [kTypes]: { enumerable: false, writable: true, - value: {} + value: {}, }, [kCallback]: { enumerable: false, writable: true, - value: callback + value: callback, }, [kBuffer]: { enumerable: false, writable: true, - value: new PerformanceObserverEntryList() + value: new PerformanceObserverEntryList(), }, [kBuffering]: { enumerable: false, writable: true, - value: false + value: false, }, [kQueued]: { enumerable: false, writable: true, - value: false - } + value: false, + }, }); } @@ -399,7 +399,7 @@ class Performance extends PerformanceObserverEntryList { constructor() { super(); this[kIndex] = { - [kMarks]: new Set() + [kMarks]: new Set(), }; this[kMaxCount] = kDefaultMaxCount; this[kInsertEntry](nodeTiming); @@ -530,21 +530,21 @@ class Performance extends PerformanceObserverEntryList { enumerable: false, configurable: true, writable: false, - value: ret + value: ret, }); Object.defineProperties(ret, { [kTimerified]: { enumerable: false, configurable: true, writable: false, - value: ret + value: ret, }, name: { enumerable: false, configurable: true, writable: false, - value: `timerified ${fn.name}` - } + value: `timerified ${fn.name}`, + }, }); return ret; } @@ -552,7 +552,7 @@ class Performance extends PerformanceObserverEntryList { [kInspect]() { return { timeOrigin, - nodeTiming + nodeTiming, }; } } @@ -661,11 +661,11 @@ function sortedInsert(list, entry) { module.exports = { performance, - PerformanceObserver + PerformanceObserver, }; Object.defineProperty(module.exports, 'constants', { configurable: false, enumerable: true, - value: constants + value: constants, }); diff --git a/lib/querystring.js b/lib/querystring.js index ec6ad51a89177e..efd9e38d7827a5 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -27,7 +27,7 @@ const { Buffer } = require('buffer'); const errors = require('internal/errors'); const { hexTable, - isHexTable + isHexTable, } = require('internal/querystring'); const QueryString = module.exports = { unescapeBuffer, @@ -41,7 +41,7 @@ const QueryString = module.exports = { encode: stringify, parse, - decode: parse + decode: parse, }; const unhexTable = [ @@ -60,7 +60,7 @@ const unhexTable = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // ... 255 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 255 ]; // a safe fast alternative to decodeURIComponent function unescapeBuffer(s, decodeSpaces) { @@ -129,7 +129,7 @@ const noEscape = [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 80 - 95 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0 // 112 - 127 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, // 112 - 127 ]; // QueryString.escape() replaces encodeURIComponent() // http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.4 diff --git a/lib/readline.js b/lib/readline.js index 15933e69302d84..35b375009e1b91 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -37,7 +37,7 @@ const { emitKeys, getStringWidth, isFullWidthCodePoint, - stripVTControlCharacters + stripVTControlCharacters, } = require('internal/readline'); const { @@ -45,7 +45,7 @@ const { kClearToBeginning, kClearToEnd, kClearLine, - kClearScreenDown + kClearScreenDown, } = CSI; const kHistorySize = 30; @@ -231,7 +231,7 @@ Object.defineProperty(Interface.prototype, 'columns', { if (this.output && this.output.columns) columns = this.output.columns; return columns; - } + }, }); Interface.prototype.setPrompt = function(prompt) { @@ -1138,5 +1138,5 @@ module.exports = { createInterface, cursorTo, emitKeypressEvents, - moveCursor + moveCursor, }; diff --git a/lib/repl.js b/lib/repl.js index 8201630c3a6389..4df83bd0f75793 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -69,7 +69,7 @@ const GLOBAL_OBJECT_PROPERTIES = [ 'isFinite', 'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'Object', 'Function', 'Array', 'String', 'Boolean', 'Number', 'Date', 'RegExp', 'Error', 'EvalError', 'RangeError', - 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', 'Math', 'JSON' + 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError', 'Math', 'JSON', ]; const GLOBAL_OBJECT_PROPERTY_MAP = {}; for (var n = 0; n < GLOBAL_OBJECT_PROPERTIES.length; n++) { @@ -238,7 +238,7 @@ function REPLServer(prompt, } script = vm.createScript(code, { filename: file, - displayErrors: true + displayErrors: true, }); } catch (e) { debug('parse error %j', code, e); @@ -293,7 +293,7 @@ function REPLServer(prompt, try { const scriptOptions = { displayErrors: false, - breakOnSigint: self.breakEvalOnSigint + breakOnSigint: self.breakEvalOnSigint, }; if (self.useGlobal) { @@ -431,7 +431,7 @@ function REPLServer(prompt, 'REPLServer.bufferedCommand is deprecated', 'DEP0074'), set: util.deprecate((val) => self[kBufferedCommandSymbol] = val, 'REPLServer.bufferedCommand is deprecated', 'DEP0074'), - enumerable: true + enumerable: true, }); // Figure out which "complete" function to use. @@ -449,7 +449,7 @@ function REPLServer(prompt, completer: self.completer, terminal: options.terminal, historySize: options.historySize, - prompt + prompt, }); this.commands = Object.create(null); @@ -766,7 +766,7 @@ REPLServer.prototype.createContext = function() { Object.defineProperty(context, 'console', { configurable: true, enumerable: true, - value: _console + value: _console, }); var names = Object.getOwnPropertyNames(global); @@ -808,7 +808,7 @@ REPLServer.prototype.resetContext = function() { this.underscoreAssigned = true; this.outputStream.write('Expression assignment to _ now disabled.\n'); } - } + }, }); // Allow REPL extensions to extend the new context @@ -899,7 +899,7 @@ function getGlobalLexicalScopeNames(contextId) { return sendInspectorCommand((session) => { let names = []; session.post('Runtime.globalLexicalScopeNames', { - executionContextId: contextId + executionContextId: contextId, }, (error, result) => { if (!error) names = result.names; }); @@ -1281,7 +1281,7 @@ function _memory(cmd) { self.lines.level.push({ line: self.lines.length - 1, depth: depth, - isFunction: /\bfunction\b/.test(cmd) + isFunction: /\bfunction\b/.test(cmd), }); } else if (depth < 0) { // Going... up. @@ -1326,7 +1326,7 @@ function addStandardGlobals(completionGroups, filter) { 'debugger', 'default', 'delete', 'do', 'else', 'export', 'false', 'finally', 'for', 'function', 'if', 'import', 'in', 'instanceof', 'let', 'new', 'null', 'return', 'switch', 'this', 'throw', 'true', 'try', - 'typeof', 'undefined', 'var', 'void', 'while', 'with', 'yield' + 'typeof', 'undefined', 'var', 'void', 'while', 'with', 'yield', ]); } } @@ -1347,7 +1347,7 @@ function defineDefaultCommands(repl) { action: function() { this.clearBufferedCommand(); this.displayPrompt(); - } + }, }); var clearMessage; @@ -1365,14 +1365,14 @@ function defineDefaultCommands(repl) { this.resetContext(); } this.displayPrompt(); - } + }, }); repl.defineCommand('exit', { help: 'Exit the repl', action: function() { this.close(); - } + }, }); repl.defineCommand('help', { @@ -1391,7 +1391,7 @@ function defineDefaultCommands(repl) { this.outputStream.write(line); } this.displayPrompt(); - } + }, }); repl.defineCommand('save', { @@ -1404,7 +1404,7 @@ function defineDefaultCommands(repl) { this.outputStream.write('Failed to save:' + file + '\n'); } this.displayPrompt(); - } + }, }); repl.defineCommand('load', { @@ -1430,7 +1430,7 @@ function defineDefaultCommands(repl) { this.outputStream.write('Failed to load:' + file + '\n'); } this.displayPrompt(); - } + }, }); repl.defineCommand('editor', { @@ -1440,7 +1440,7 @@ function defineDefaultCommands(repl) { _turnOnEditorMode(this); this.outputStream.write( '// Entering editor mode (^D to finish, ^C to cancel)\n'); - } + }, }); } diff --git a/lib/string_decoder.js b/lib/string_decoder.js index 18097be0e6dd08..0935263591ea30 100644 --- a/lib/string_decoder.js +++ b/lib/string_decoder.js @@ -31,7 +31,7 @@ const { kSize, decode, flush, - encodings + encodings, } = internalBinding('string_decoder'); const internalUtil = require('internal/util'); const errors = require('internal/errors'); @@ -96,14 +96,14 @@ Object.defineProperties(StringDecoder.prototype, { get() { return this[kNativeDecoder].subarray(kIncompleteCharactersStart, kIncompleteCharactersEnd); - } + }, }, lastNeed: { configurable: true, enumerable: true, get() { return this[kNativeDecoder][kMissingBytes]; - } + }, }, lastTotal: { configurable: true, @@ -111,8 +111,8 @@ Object.defineProperties(StringDecoder.prototype, { get() { return this[kNativeDecoder][kBufferedBytes] + this[kNativeDecoder][kMissingBytes]; - } - } + }, + }, }); exports.StringDecoder = StringDecoder; diff --git a/lib/timers.js b/lib/timers.js index 2744f231b5c131..bcef06d1fa659a 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -31,7 +31,7 @@ const { trigger_async_id_symbol, Timeout, initAsyncResource, - validateTimerDuration + validateTimerDuration, } = require('internal/timers'); const internalUtil = require('internal/util'); const { createPromise, promiseResolve } = process.binding('util'); @@ -44,7 +44,7 @@ const { // The needed emit*() functions. emitBefore, emitAfter, - emitDestroy + emitDestroy, } = require('internal/async_hooks'); // *Must* match Environment::ImmediateInfo::Fields in src/env.h. diff --git a/lib/tls.js b/lib/tls.js index 96b6ec8d340e2f..79aa1727608285 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -247,7 +247,7 @@ class SecurePair extends EventEmitter { this.encrypted = socket1; this.cleartext = new exports.TLSSocket(socket2, Object.assign({ - secureContext, isServer, requestCert, rejectUnauthorized + secureContext, isServer, requestCert, rejectUnauthorized, }, options)); this.cleartext.once('secure', () => this.emit('secure')); } diff --git a/lib/tty.js b/lib/tty.js index 79e61e981b5a07..c992d239039b99 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -55,7 +55,7 @@ function ReadStream(fd, options) { highWaterMark: 0, readable: true, writable: false, - handle: tty + handle: tty, }, options); net.Socket.call(this, options); @@ -86,7 +86,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/url.js b/lib/url.js index ab4b2b4647edd2..7d0bff3c937066 100644 --- a/lib/url.js +++ b/lib/url.js @@ -36,7 +36,7 @@ const { URLSearchParams, domainToASCII, domainToUnicode, - formatSymbol + formatSymbol, } = require('internal/url'); // Original url.parse() API @@ -71,12 +71,12 @@ const hostnameMaxLen = 255; // protocols that can allow "unsafe" and "unwise" chars. const unsafeProtocol = { 'javascript': true, - 'javascript:': true + 'javascript:': true, }; // protocols that never have a hostname. const hostlessProtocol = { 'javascript': true, - 'javascript:': true + 'javascript:': true, }; // protocols that always contain a // bit. const slashedProtocol = { @@ -89,7 +89,7 @@ const slashedProtocol = { 'gopher': true, 'gopher:': true, 'file': true, - 'file:': true + 'file:': true, }; const querystring = require('querystring'); @@ -454,7 +454,7 @@ const escapedCodes = [ /*90 - 99*/ '', '', '%5C', '', '%5E', '', '%60', '', '', '', /*100 - 109*/ '', '', '', '', '', '', '', '', '', '', /*110 - 119*/ '', '', '', '', '', '', '', '', '', '', - /*120 - 125*/ '', '', '', '%7B', '%7C', '%7D' + /*120 - 125*/ '', '', '', '%7B', '%7C', '%7D', ]; // Automatically escape all delimiters and unwise characters from RFC 2396. @@ -904,7 +904,7 @@ const noEscapeAuth = [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40 - 0x4F 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 0x50 - 0x5F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60 - 0x6F - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0 // 0x70 - 0x7F + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, // 0x70 - 0x7F ]; function encodeAuth(str) { @@ -974,5 +974,5 @@ module.exports = { URL, URLSearchParams, domainToASCII, - domainToUnicode + domainToUnicode, }; diff --git a/lib/util.js b/lib/util.js index df117782ca962c..3af2d7b39acccc 100644 --- a/lib/util.js +++ b/lib/util.js @@ -45,11 +45,11 @@ const { } = process.binding('util'); const { - isTypedArray + isTypedArray, } = require('internal/util/types'); const { - isDeepStrictEqual + isDeepStrictEqual, } = require('internal/util/comparisons'); const { @@ -60,7 +60,7 @@ const { isError, promisify, join, - removeColors + removeColors, } = require('internal/util'); const inspectDefaultOptions = Object.seal({ @@ -71,7 +71,7 @@ const inspectDefaultOptions = Object.seal({ showProxy: false, maxArrayLength: 100, breakLength: 60, - compact: true + compact: true, }); const propertyIsEnumerable = Object.prototype.propertyIsEnumerable; @@ -106,7 +106,7 @@ const meta = [ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', - '', '', '', '', '', '', '', '\\\\' + '', '', '', '', '', '', '', '\\\\', ]; const escapeFn = (str) => meta[str.charCodeAt(0)]; @@ -283,7 +283,7 @@ function inspect(value, opts) { maxArrayLength: inspectDefaultOptions.maxArrayLength, breakLength: inspectDefaultOptions.breakLength, indentationLvl: 0, - compact: inspectDefaultOptions.compact + compact: inspectDefaultOptions.compact, }; // Legacy... if (arguments.length > 2) { @@ -318,7 +318,7 @@ Object.defineProperty(inspect, 'defaultOptions', { throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'options', 'Object'); } return _extend(inspectDefaultOptions, options); - } + }, }); // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics @@ -335,7 +335,7 @@ inspect.colors = Object.assign(Object.create(null), { 'green': [32, 39], 'magenta': [35, 39], 'red': [31, 39], - 'yellow': [33, 39] + 'yellow': [33, 39], }); // Don't use 'blue' not visible on cmd.exe @@ -351,7 +351,7 @@ inspect.styles = Object.assign(Object.create(null), { 'symbol': 'green', 'date': 'magenta', // "name": intentionally not styling - 'regexp': 'red' + 'regexp': 'red', }); function stylizeWithColor(str, styleType) { @@ -387,7 +387,7 @@ function formatValue(ctx, value, recurseTimes, ln) { ctx.indentationLvl += 2; const res = [ formatValue(ctx, proxy[0], recurseTimes), - formatValue(ctx, proxy[1], recurseTimes) + formatValue(ctx, proxy[1], recurseTimes), ]; ctx.indentationLvl -= 2; const str = reduceToSingleString(ctx, res, '', ['[', ']']); @@ -776,7 +776,7 @@ function formatTypedArray(ctx, value, recurseTimes, keys) { 'length', 'byteLength', 'byteOffset', - 'buffer' + 'buffer', ]; for (i = 0; i < extraKeys.length; i++) { const str = formatValue(ctx, value[extraKeys[i]], recurseTimes); @@ -1162,5 +1162,5 @@ module.exports = exports = { 'DEP0026'), puts: deprecate(puts, 'util.puts is deprecated. Use console.log instead.', - 'DEP0027') + 'DEP0027'), }; diff --git a/lib/v8.js b/lib/v8.js index fffd18bf1beb84..f64fb60a93f117 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -18,7 +18,7 @@ const { Buffer } = require('buffer'); const errors = require('internal/errors'); const { Serializer: _Serializer, - Deserializer: _Deserializer + Deserializer: _Deserializer, } = process.binding('serdes'); const { copy } = process.binding('buffer'); const { objectToString } = require('internal/util'); @@ -54,7 +54,7 @@ const { kSpaceSizeIndex, kSpaceUsedSizeIndex, kSpaceAvailableSizeIndex, - kPhysicalSpaceSizeIndex + kPhysicalSpaceSizeIndex, } = process.binding('v8'); const kNumberOfHeapSpaces = kHeapSpaces.length; @@ -85,7 +85,7 @@ function getHeapStatistics() { 'heap_size_limit': buffer[kHeapSizeLimitIndex], 'malloced_memory': buffer[kMallocedMemoryIndex], 'peak_malloced_memory': buffer[kPeakMallocedMemoryIndex], - 'does_zap_garbage': buffer[kDoesZapGarbageIndex] + 'does_zap_garbage': buffer[kDoesZapGarbageIndex], }; } @@ -101,7 +101,7 @@ function getHeapSpaceStatistics() { space_size: buffer[propertyOffset + kSpaceSizeIndex], space_used_size: buffer[propertyOffset + kSpaceUsedSizeIndex], space_available_size: buffer[propertyOffset + kSpaceAvailableSizeIndex], - physical_space_size: buffer[propertyOffset + kPhysicalSpaceSizeIndex] + physical_space_size: buffer[propertyOffset + kPhysicalSpaceSizeIndex], }; } @@ -223,5 +223,5 @@ module.exports = exports = { DefaultSerializer, DefaultDeserializer, deserialize, - serialize + serialize, }; diff --git a/lib/vm.js b/lib/vm.js index 78a2de16d38603..7090f454ff0059 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -89,7 +89,7 @@ function getContextOptions(options) { if (options) { const contextOptions = { name: options.contextName, - origin: options.contextOrigin + origin: options.contextOrigin, }; validateString(contextOptions.name, 'options.contextName'); validateString(contextOptions.origin, 'options.contextOrigin'); @@ -113,7 +113,7 @@ function createContext(sandbox, options) { } options = { name: options.name, - origin: options.origin + origin: options.origin, }; if (options.name === undefined) { options.name = `VM Context ${defaultContextNameIndex++}`; @@ -124,7 +124,7 @@ function createContext(sandbox, options) { validateString(options.origin, 'options.origin'); } else { options = { - name: `VM Context ${defaultContextNameIndex++}` + name: `VM Context ${defaultContextNameIndex++}`, }; } makeContext(sandbox, options); @@ -157,11 +157,11 @@ function runInContext(code, contextifiedSandbox, options) { if (typeof options === 'string') { options = { filename: options, - [kParsingContext]: contextifiedSandbox + [kParsingContext]: contextifiedSandbox, }; } else { options = Object.assign({}, options, { - [kParsingContext]: contextifiedSandbox + [kParsingContext]: contextifiedSandbox, }); } return createScript(code, options) @@ -174,7 +174,7 @@ function runInNewContext(code, sandbox, options) { } sandbox = createContext(sandbox, getContextOptions(options)); options = Object.assign({}, options, { - [kParsingContext]: sandbox + [kParsingContext]: sandbox, }); return createScript(code, options).runInNewContext(sandbox, options); } diff --git a/lib/zlib.js b/lib/zlib.js index 0fba957c09d371..8c3483afcf74de 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -30,7 +30,7 @@ const binding = process.binding('zlib'); const assert = require('assert').ok; const { Buffer, - kMaxLength + kMaxLength, } = require('buffer'); const constants = process.binding('constants').zlib; @@ -39,7 +39,7 @@ const { Z_MIN_CHUNK, Z_MIN_WINDOWBITS, Z_MAX_WINDOWBITS, Z_MIN_LEVEL, Z_MAX_LEVEL, Z_MIN_MEMLEVEL, Z_MAX_MEMLEVEL, Z_DEFAULT_CHUNK, Z_DEFAULT_COMPRESSION, Z_DEFAULT_STRATEGY, Z_DEFAULT_WINDOWBITS, Z_DEFAULT_MEMLEVEL, Z_FIXED, - DEFLATE, DEFLATERAW, INFLATE, INFLATERAW, GZIP, GUNZIP, UNZIP + DEFLATE, DEFLATERAW, INFLATE, INFLATERAW, GZIP, GUNZIP, UNZIP, } = constants; const { inherits } = require('util'); @@ -53,7 +53,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, }; const ckeys = Object.keys(codes); @@ -310,7 +310,7 @@ Object.defineProperty(Zlib.prototype, '_closed', { enumerable: true, get() { return !this._handle; - } + }, }); Zlib.prototype.params = function params(level, strategy, callback) { @@ -676,7 +676,7 @@ function createProperty(ctor) { enumerable: true, value: function(options) { return new ctor(options); - } + }, }; } @@ -704,7 +704,7 @@ module.exports = { gunzip: createConvenienceMethod(Gunzip, false), gunzipSync: createConvenienceMethod(Gunzip, true), inflateRaw: createConvenienceMethod(InflateRaw, false), - inflateRawSync: createConvenienceMethod(InflateRaw, true) + inflateRawSync: createConvenienceMethod(InflateRaw, true), }; Object.defineProperties(module.exports, { @@ -718,13 +718,13 @@ Object.defineProperties(module.exports, { constants: { configurable: false, enumerable: true, - value: constants + value: constants, }, codes: { enumerable: true, writable: false, - value: Object.freeze(codes) - } + value: Object.freeze(codes), + }, }); // These should be considered deprecated @@ -733,6 +733,6 @@ const bkeys = Object.keys(constants); for (var bk = 0; bk < bkeys.length; bk++) { var bkey = bkeys[bk]; Object.defineProperty(module.exports, bkey, { - enumerable: true, value: constants[bkey], writable: false + enumerable: true, value: constants[bkey], writable: false, }); } diff --git a/test/addons-napi/test_array/test.js b/test/addons-napi/test_array/test.js index 75c181d9da8269..61147f5b82c7b0 100644 --- a/test/addons-napi/test_array/test.js +++ b/test/addons-napi/test_array/test.js @@ -15,8 +15,8 @@ const array = [ [ 'world', 'node', - 'abi' - ] + 'abi', + ], ]; assert.throws( diff --git a/test/addons-napi/test_async/test-async-hooks.js b/test/addons-napi/test_async/test-async-hooks.js index db6e0cbd1679e6..956d210f3f0832 100644 --- a/test/addons-napi/test_async/test-async-hooks.js +++ b/test/addons-napi/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' }; @@ -55,6 +55,6 @@ process.on('exit', () => { { type: 'before', id: testId }, { type: 'complete' }, { type: 'after', id: testId }, - { type: 'destroy', id: testId } + { type: 'destroy', id: testId }, ]); }); diff --git a/test/addons-napi/test_callback_scope/test-async-hooks.js b/test/addons-napi/test_callback_scope/test-async-hooks.js index 1a11bf60398f9b..4981f4c6e029b2 100644 --- a/test/addons-napi/test_callback_scope/test-async-hooks.js +++ b/test/addons-napi/test_callback_scope/test-async-hooks.js @@ -21,7 +21,7 @@ async_hooks.createHook({ after: common.mustCall((id) => { assert.strictEqual(id, 1000); insideHook = false; - }) + }), }).enable(); runInCallbackScope({}, 1000, 1000, () => { diff --git a/test/addons-napi/test_error/test.js b/test/addons-napi/test_error/test.js index d5c92cb4c3cd2e..2449d76de89d7d 100644 --- a/test/addons-napi/test_error/test.js +++ b/test/addons-napi/test_error/test.js @@ -64,21 +64,21 @@ common.expectsError( () => test_error.throwErrorCode(), { code: 'ERR_TEST_CODE', - message: 'Error [error]' + message: 'Error [error]', }); common.expectsError( () => test_error.throwRangeErrorCode(), { code: 'ERR_TEST_CODE', - message: 'RangeError [range error]' + message: 'RangeError [range error]', }); common.expectsError( () => test_error.throwTypeErrorCode(), { code: 'ERR_TEST_CODE', - message: 'TypeError [type error]' + message: 'TypeError [type error]', }); let error = test_error.createError(); diff --git a/test/addons-napi/test_general/test.js b/test/addons-napi/test_general/test.js index fa6240d384a0fd..9b73db2b288a47 100644 --- a/test/addons-napi/test_general/test.js +++ b/test/addons-napi/test_general/test.js @@ -48,7 +48,7 @@ assert.strictEqual(release, process.release.name); new Object(), true, undefined, - Symbol() + Symbol(), ].forEach((val) => { assert.strictEqual(test_general.testNapiTypeof(val), typeof val); }); diff --git a/test/addons-napi/test_general/testInstanceOf.js b/test/addons-napi/test_general/testInstanceOf.js index 3b37188ab4d20c..1beb726e349449 100644 --- a/test/addons-napi/test_general/testInstanceOf.js +++ b/test/addons-napi/test_general/testInstanceOf.js @@ -71,7 +71,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/addons-napi/test_object/test.js b/test/addons-napi/test_object/test.js index 8e44a1b5ed647f..14cb9b3092039a 100644 --- a/test/addons-napi/test_object/test.js +++ b/test/addons-napi/test_object/test.js @@ -9,11 +9,11 @@ const test_object = require(`./build/${common.buildType}/test_object`); const object = { hello: 'world', array: [ - 1, 94, 'str', 12.321, { test: 'obj in arr' } + 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'); @@ -89,7 +89,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 }); @@ -105,7 +105,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)); diff --git a/test/addons/async-hooks-promise/test.js b/test/addons/async-hooks-promise/test.js index a6c48e94a34f07..c67834130cf351 100644 --- a/test/addons/async-hooks-promise/test.js +++ b/test/addons/async-hooks-promise/test.js @@ -28,7 +28,7 @@ let pwrap = null; const hook1 = async_hooks.createHook({ init(id, type, tid, resource) { pwrap = resource; - } + }, }).enable(); // Check that the internal field returns the same PromiseWrap passed to init(). diff --git a/test/addons/async-resource/test.js b/test/addons/async-resource/test.js index f19ad58637f187..897e82407c68ff 100644 --- a/test/addons/async-resource/test.js +++ b/test/addons/async-resource/test.js @@ -36,7 +36,7 @@ async_hooks.createHook({ destroy(id) { if (bindingUids.includes(id)) destroy++; - } + }, }).enable(); for (const call of [binding.callViaFunction, @@ -51,7 +51,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/openssl-client-cert-engine/test.js b/test/addons/openssl-client-cert-engine/test.js index 1c0e4564a5c3e9..c102b01838cc55 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, (req, res) => { @@ -40,7 +40,7 @@ const server = https.createServer(serverOptions, (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(function(response) { diff --git a/test/addons/repl-domain-abort/test.js b/test/addons/repl-domain-abort/test.js index 2049fe6e6a23f5..7f8f266a78bbfa 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/async-hooks/init-hooks.js b/test/async-hooks/init-hooks.js index e43761df623dc4..f8beadeb4e644d 100644 --- a/test/async-hooks/init-hooks.js +++ b/test/async-hooks/init-hooks.js @@ -26,7 +26,7 @@ class ActivityCollector { onafter, ondestroy, logid = null, - logtype = null + logtype = null, } = {}) { this._start = start; this._allowNoInit = allowNoInit; @@ -45,7 +45,7 @@ class ActivityCollector { init: this._init.bind(this), before: this._before.bind(this), after: this._after.bind(this), - destroy: this._destroy.bind(this) + destroy: this._destroy.bind(this), }); } @@ -177,7 +177,7 @@ class ActivityCollector { triggerAsyncId, // 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 + handleIsObject: handle instanceof Object, }; this._stamp(activity, 'init'); this._activities.set(uid, activity); @@ -221,7 +221,7 @@ exports = module.exports = function initHooks({ ondestroy, allowNoInit, logid, - logtype + logtype, } = {}) { return new ActivityCollector(process.hrtime(), { oninit, @@ -230,6 +230,6 @@ exports = module.exports = function initHooks({ ondestroy, allowNoInit, logid, - logtype + logtype, }); }; diff --git a/test/async-hooks/test-callback-error.js b/test/async-hooks/test-callback-error.js index 450f34bee1021a..e5c29d5b357ef9 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.emitBefore(); @@ -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; @@ -64,7 +64,7 @@ assert.ok(!arg); // Ref: https://github.com/nodejs/node/pull/13559 const opts = { execArgv: ['--abort-on-uncaught-exception'], - silent: true + silent: true, }; const child = fork(__filename, ['test_callback_abort'], opts); diff --git a/test/async-hooks/test-disable-in-init.js b/test/async-hooks/test-disable-in-init.js index b7ab31e6d97dc2..bb89eb792ac92a 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 69b6667edb674c..59626c5010f6e4 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) => { common.expectsError(() => new Foo(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); }); diff --git a/test/async-hooks/test-emit-before-after.js b/test/async-hooks/test-emit-before-after.js index e7744eb4b7bdf0..8411a27df11380 100644 --- a/test/async-hooks/test-emit-before-after.js +++ b/test/async-hooks/test-emit-before-after.js @@ -19,7 +19,7 @@ assert.ok(!process.argv[2]); const c1 = spawnSync(process.execPath, [ - '--expose-internals', __filename, 'test_invalid_async_id' + '--expose-internals', __filename, 'test_invalid_async_id', ]); assert.strictEqual( c1.stderr.toString().split(/[\r\n]+/g)[0], @@ -27,7 +27,7 @@ assert.strictEqual( assert.strictEqual(c1.status, 1); const c2 = spawnSync(process.execPath, [ - '--expose-internals', __filename, 'test_invalid_trigger_id' + '--expose-internals', __filename, 'test_invalid_trigger_id', ]); assert.strictEqual( c2.stderr.toString().split(/[\r\n]+/g)[0], @@ -45,7 +45,7 @@ async_hooks.emitAfter(expectedId); initHooks({ onbefore: common.mustCall((id) => assert.strictEqual(id, expectedId)), onafter: common.mustCall((id) => assert.strictEqual(id, expectedId)), - allowNoInit: true + allowNoInit: true, }).enable(); async_hooks.emitInit(expectedId, expectedType, expectedTriggerId); diff --git a/test/async-hooks/test-emit-init.js b/test/async-hooks/test-emit-init.js index f5d5687cb4d11d..7f250af9a30605 100644 --- a/test/async-hooks/test-emit-init.js +++ b/test/async-hooks/test-emit-init.js @@ -18,7 +18,7 @@ const hooks1 = initHooks({ assert.strictEqual(type, expectedType); assert.strictEqual(triggerAsyncId, expectedTriggerId); assert.strictEqual(resource.key, expectedResource.key); - }) + }), }); hooks1.enable(); @@ -38,7 +38,7 @@ assert.ok(!process.argv[2]); const c1 = spawnSync(process.execPath, [ - '--expose-internals', __filename, 'test_invalid_async_id' + '--expose-internals', __filename, 'test_invalid_async_id', ]); assert.strictEqual( c1.stderr.toString().split(/[\r\n]+/g)[0], @@ -46,7 +46,7 @@ assert.strictEqual( assert.strictEqual(c1.status, 1); const c2 = spawnSync(process.execPath, [ - '--expose-internals', __filename, 'test_invalid_trigger_id' + '--expose-internals', __filename, 'test_invalid_trigger_id', ]); assert.strictEqual( c2.stderr.toString().split(/[\r\n]+/g)[0], @@ -54,7 +54,7 @@ assert.strictEqual( assert.strictEqual(c2.status, 1); const c3 = spawnSync(process.execPath, [ - '--expose-internals', __filename, 'test_invalid_trigger_id_negative' + '--expose-internals', __filename, 'test_invalid_trigger_id_negative', ]); assert.strictEqual( c3.stderr.toString().split(/[\r\n]+/g)[0], @@ -73,7 +73,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 e4be9f9f87e3eb..8b582a4a2236c4 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-graph.http.js b/test/async-hooks/test-graph.http.js index eea72ca3bac72c..ed957757316f42 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(function() { 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 26fe1ce41e955c..7fd8035ac1e9ea 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.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + key: fixtures.readSync('test_key.pem'), }) .on('listening', common.mustCall(onlistening)) .on('secureConnection', common.mustCall(onsecureConnection)) diff --git a/test/async-hooks/test-internal-nexttick-default-trigger.js b/test/async-hooks/test-internal-nexttick-default-trigger.js index ed541868542206..1cf7715ef21ef6 100644 --- a/test/async-hooks/test-internal-nexttick-default-trigger.js +++ b/test/async-hooks/test-internal-nexttick-default-trigger.js @@ -36,12 +36,12 @@ process.on('exit', function() { 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'); checkInvocations(as[1], { - init: 1, before: 1, after: 1, destroy: 1 + init: 1, before: 1, after: 1, destroy: 1, }, 'when process exits'); checkInvocations(as[2], { - 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 79cf1ab689e997..2fb224f4ccd535 100644 --- a/test/async-hooks/test-tlswrap.js +++ b/test/async-hooks/test-tlswrap.js @@ -21,7 +21,7 @@ hooks.enable(); const server = tls .createServer({ cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + key: fixtures.readSync('test_key.pem'), }) .on('listening', common.mustCall(onlistening)) .on('secureConnection', common.mustCall(onsecureConnection)) diff --git a/test/async-hooks/verify-graph.js b/test/async-hooks/verify-graph.js index 95c55c15958b2c..3be300fef18e3b 100644 --- a/test/async-hooks/verify-graph.js +++ b/test/async-hooks/verify-graph.js @@ -74,7 +74,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/dns.js b/test/common/dns.js index 07f84d7a3703c1..7680d881f1ad51 100644 --- a/test/common/dns.js +++ b/test/common/dns.js @@ -13,11 +13,11 @@ const types = { PTR: 12, MX: 15, TXT: 16, - ANY: 255 + ANY: 255, }; const classes = { - IN: 1 + IN: 1, }; // Naïve DNS parser/serializer. @@ -34,7 +34,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, }; } else { // Pointer to another part of the packet. @@ -43,7 +43,7 @@ function readDomainFromPacket(buffer, offset) { const pointeeOffset = buffer.readUInt16BE(offset) &~ 0xC000; return { nread: 2, - domain: readDomainFromPacket(buffer, pointeeOffset) + domain: readDomainFromPacket(buffer, pointeeOffset), }; } } @@ -60,7 +60,7 @@ function parseDNSPacket(buffer) { ['questions', buffer.readUInt16BE(4)], ['answers', buffer.readUInt16BE(6)], ['authorityAnswers', buffer.readUInt16BE(8)], - ['additionalRecords', buffer.readUInt16BE(10)] + ['additionalRecords', buffer.readUInt16BE(10)], ]; let offset = 12; @@ -185,7 +185,7 @@ function writeDomainName(domain) { assert(label.length < 64); return Buffer.concat([ Buffer.from([label.length]), - Buffer.from(label, 'ascii') + Buffer.from(label, 'ascii'), ]); }).concat([Buffer.alloc(1)])); } @@ -208,7 +208,7 @@ function writeDNSPacket(parsed) { buffers.push(writeDomainName(q.domain)); buffers.push(new Uint16Array([ types[q.type], - q.cls === undefined ? classes.IN : q.cls + q.cls === undefined ? classes.IN : q.cls, ])); } @@ -221,7 +221,7 @@ function writeDNSPacket(parsed) { buffers.push(writeDomainName(rr.domain)); buffers.push(new Uint16Array([ types[rr.type], - rr.cls === undefined ? classes.IN : rr.cls + rr.cls === undefined ? classes.IN : rr.cls, ])); buffers.push(new Int32Array([rr.ttl])); @@ -266,7 +266,7 @@ function writeDNSPacket(parsed) { rdLengthBuf[0] = mname.length + rname.length + 20; buffers.push(mname, rname); buffers.push(new Uint32Array([ - rr.serial, rr.refresh, rr.retry, rr.expire, rr.minttl + rr.serial, rr.refresh, rr.retry, rr.expire, rr.minttl, ])); break; } @@ -308,5 +308,5 @@ module.exports = { parseDNSPacket, errorLookupMock, mockedErrorCode, - mockedSysCall + mockedSysCall, }; diff --git a/test/common/fixtures.js b/test/common/fixtures.js index b45e5bc8091865..bace6d4c1155fb 100644 --- a/test/common/fixtures.js +++ b/test/common/fixtures.js @@ -24,5 +24,5 @@ module.exports = { fixturesDir, path: fixturesPath, readSync: readFixtureSync, - readKey: readFixtureKey + readKey: readFixtureKey, }; diff --git a/test/common/http2.js b/test/common/http2.js index 0f3378e9b80f63..78f2d57a05d82c 100644 --- a/test/common/http2.js +++ b/test/common/http2.js @@ -135,5 +135,5 @@ module.exports = { PingFrame, kFakeRequestHeaders, kFakeResponseHeaders, - kClientMagic + kClientMagic, }; diff --git a/test/common/index.js b/test/common/index.js index ff1dc0ce261bd0..6da295e93e5dbd 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -42,7 +42,7 @@ Object.defineProperty(exports, 'PORT', { } return +process.env.NODE_COMMON_PORT || 12346; }, - enumerable: true + enumerable: true, }); @@ -147,7 +147,7 @@ Object.defineProperty(exports, 'inFreeBSDJail', { inFreeBSDJail = false; } return inFreeBSDJail; - } + }, }); Object.defineProperty(exports, 'localhostIPv4', { @@ -170,7 +170,7 @@ Object.defineProperty(exports, 'localhostIPv4', { if (localhostIPv4 === null) localhostIPv4 = '127.0.0.1'; return localhostIPv4; - } + }, }); // opensslCli defined lazily to reduce overhead of spawnSync @@ -198,13 +198,13 @@ Object.defineProperty(exports, 'opensslCli', { get: function() { Object.defineProperty(exports, 'hasCrypto', { get: function() { return Boolean(process.versions.openssl); - } + }, }); Object.defineProperty(exports, 'hasFipsCrypto', { get: function() { return exports.hasCrypto && require('crypto').fips; - } + }, }); { @@ -309,7 +309,7 @@ let knownGlobals = [ process, setImmediate, setInterval, - setTimeout + setTimeout, ]; if (global.gc) { @@ -454,7 +454,7 @@ function _mustCallInner(fn, criteria = 1, field) { [field]: criteria, actual: 0, stack: (new Error()).stack, - name: fn.name || '' + name: fn.name || '', }; // add the exit listener only once to avoid listener leak warnings @@ -655,13 +655,13 @@ exports.expectWarning = function(nameOrMap, expected) { Object.defineProperty(exports, 'hasIntl', { get: function() { return process.binding('config').hasIntl; - } + }, }); Object.defineProperty(exports, 'hasSmallICU', { get: function() { return process.binding('config').hasSmallICU; - } + }, }); // Useful for testing expected internal/error objects @@ -744,7 +744,7 @@ exports.getArrayBufferViews = function getArrayBufferViews(buf) { Uint32Array, Float32Array, Float64Array, - DataView + DataView, ]; for (const type of arrayBufferViews) { diff --git a/test/common/index.mjs b/test/common/index.mjs index 52cbd763637211..e5b927d13c64f4 100644 --- a/test/common/index.mjs +++ b/test/common/index.mjs @@ -14,7 +14,7 @@ let knownGlobals = [ process, setImmediate, setInterval, - setTimeout + setTimeout, ]; if (process.env.NODE_TEST_KNOWN_GLOBALS) { diff --git a/test/common/inspector-helper.js b/test/common/inspector-helper.js index 7590cfc104b70a..6b4effb6ce386e 100644 --- a/test/common/inspector-helper.js +++ b/test/common/inspector-helper.js @@ -399,8 +399,8 @@ class NodeInstance { 'Connection': 'Upgrade', 'Upgrade': 'websocket', 'Sec-WebSocket-Version': 13, - 'Sec-WebSocket-Key': 'key==' - } + 'Sec-WebSocket-Key': 'key==', + }, }); } @@ -489,10 +489,10 @@ function fires(promise, error, timeoutMs) { const timeout = timeoutPromise(error, timeoutMs); return Promise.race([ onResolvedOrRejected(promise, () => timeout.clear()), - timeout + timeout, ]); } module.exports = { - NodeInstance + NodeInstance, }; diff --git a/test/common/internet.js b/test/common/internet.js index 3880aa114e3743..f9a43fa901a9e3 100644 --- a/test/common/internet.js +++ b/test/common/internet.js @@ -39,7 +39,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)) { @@ -50,5 +50,5 @@ for (const key of Object.keys(addresses)) { } module.exports = { - addresses + addresses, }; diff --git a/test/common/wpt.js b/test/common/wpt.js index 7cd644dc88c097..1444e76ffccc25 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -26,5 +26,5 @@ module.exports = { assert_array_equals: assert.deepStrictEqual, assert_unreached(desc) { assert.fail(`Reached unreachable code: ${desc}`); - } + }, }; diff --git a/test/doctool/test-doctool-html.js b/test/doctool/test-doctool-html.js index bd1c5ddecac321..4e36fd903c60bd 100644 --- a/test/doctool/test-doctool-html.js +++ b/test/doctool/test-doctool-html.js @@ -24,7 +24,7 @@ const testData = [ { file: fixtures.path('sample_document.md'), html: '
  1. fish
  2. fish

  3. Redfish

  4. ' + - '
  5. Bluefish
' + '
  • Bluefish
  • ', }, { file: fixtures.path('order_of_end_tags_5873.md'), @@ -34,7 +34,7 @@ const testData = [ 'class="signature">' + '', }, { file: fixtures.path('doc_with_yaml.md'), @@ -70,7 +70,7 @@ const testData = [ 'id="foo_something"># ' + ' ' + '

    Describe Something in more detail here. ' + - '

    ' + '

    ', }, { file: fixtures.path('doc_with_includes.md'), @@ -81,13 +81,13 @@ const testData = [ '

    foobar#

    ' + '

    I exist and am being linked to.

    ' + - '' + '', }, { file: fixtures.path('sample_document.md'), html: '
    1. fish
    2. fish

    3. Redfish

    4. ' + '
    5. Bluefish
    ', - analyticsId: 'UA-67020396-1' + analyticsId: 'UA-67020396-1', }, ]; diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js index 1be086c3a6a7ea..c8d0b730506a74 100644 --- a/test/doctool/test-doctool-json.js +++ b/test/doctool/test-doctool-json.js @@ -31,12 +31,12 @@ const testData = [ desc: '
      \n
    1. fish
    2. \n
    3. fish

      \n
    4. \n
    5. ' + '

      Red fish

      \n
    6. \n
    7. Blue fish
    8. \n
    \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'), @@ -57,23 +57,23 @@ const testData = [ params: [{ textRaw: '`array` {Array} ', name: 'array', - type: 'Array' - }] + type: 'Array', + }], }, { params: [{ - name: 'array' - }] - } - ] + name: 'array', + }], + }, + ], }], type: 'module', - displayName: 'Subsection' + displayName: 'Subsection', }], type: 'module', - displayName: 'Title' - }] - } + displayName: 'Title', + }], + }, }, { file: fixtures.path('doc_with_yaml.md'), @@ -89,12 +89,12 @@ const testData = [ name: 'foobar', meta: { added: ['v1.0.0'], - changes: [] + changes: [], }, desc: '

    Describe Foobar in more detail ' + 'here.

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

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

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

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

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

    ' + 'Describe Something in more detail here.

    \n', type: 'module', - displayName: 'Something' - } + displayName: 'Something', + }, ], type: 'module', - displayName: 'Sample Markdown with YAML info' - } - ] - } - } + displayName: 'Sample Markdown with YAML info', + }, + ], + }, + }, ]; testData.forEach((item) => { diff --git a/test/es-module/test-esm-import-meta.mjs b/test/es-module/test-esm-import-meta.mjs index c17e0e20d49b4d..033c173b5db2a8 100644 --- a/test/es-module/test-esm-import-meta.mjs +++ b/test/es-module/test-esm-import-meta.mjs @@ -14,7 +14,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-modulemap.js b/test/es-module/test-esm-loader-modulemap.js index 1c1623b680e7bd..20cb2e463476da 100644 --- a/test/es-module/test-esm-loader-modulemap.js +++ b/test/es-module/test-esm-loader-modulemap.js @@ -24,7 +24,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "url" argument must be of type string' + message: 'The "url" argument must be of type string', } ); @@ -33,7 +33,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "url" argument must be of type string' + message: 'The "url" argument must be of type string', } ); @@ -42,7 +42,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "job" argument must be of type ModuleJob' + message: 'The "job" argument must be of type ModuleJob', } ); @@ -51,6 +51,6 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "url" argument must be of type string' + message: 'The "url" argument must be of type string', } ); diff --git a/test/es-module/test-esm-loader-search.js b/test/es-module/test-esm-loader-search.js index 4eb6b9fd4b3889..e5f34044e7b456 100644 --- a/test/es-module/test-esm-loader-search.js +++ b/test/es-module/test-esm-loader-search.js @@ -13,6 +13,6 @@ common.expectsError( { code: 'ERR_MISSING_MODULE', type: errors.Error, - message: 'Cannot find module target' + message: 'Cannot find module target', } ); diff --git a/test/gc/test-http-client-connaborted.js b/test/gc/test-http-client-connaborted.js index 008d75bca5d0b1..d1e6efac9ffe4d 100644 --- a/test/gc/test-http-client-connaborted.js +++ b/test/gc/test-http-client-connaborted.js @@ -32,7 +32,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/gc/test-http-client-onerror.js b/test/gc/test-http-client-onerror.js index 8b05e941749c63..37fa439ff43308 100644 --- a/test/gc/test-http-client-onerror.js +++ b/test/gc/test-http-client-onerror.js @@ -38,7 +38,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/gc/test-http-client-timeout.js b/test/gc/test-http-client-timeout.js index c396a89032bf0e..1be66124706ecf 100644 --- a/test/gc/test-http-client-timeout.js +++ b/test/gc/test-http-client-timeout.js @@ -37,7 +37,7 @@ function getall() { const req = http.get({ hostname: 'localhost', pathname: '/', - port: server.address().port + port: server.address().port, }, cb); req.on('error', cb); req.setTimeout(10, function() { diff --git a/test/gc/test-http-client.js b/test/gc/test-http-client.js index 8b50ad5ea4ffce..796e99d30043d4 100644 --- a/test/gc/test-http-client.js +++ b/test/gc/test-http-client.js @@ -36,7 +36,7 @@ function getall() { const req = http.get({ hostname: 'localhost', pathname: '/', - port: server.address().port + port: server.address().port, }, cb); count++; diff --git a/test/internet/test-dgram-broadcast-multi-process.js b/test/internet/test-dgram-broadcast-multi-process.js index 40868d219acc4e..0b930e05f84d91 100644 --- a/test/internet/test-dgram-broadcast-multi-process.js +++ b/test/internet/test-dgram-broadcast-multi-process.js @@ -35,7 +35,7 @@ const messages = [ Buffer.from('First message to send'), Buffer.from('Second message to send'), Buffer.from('Third message to send'), - Buffer.from('Fourth message to send') + Buffer.from('Fourth message to send'), ]; let bindAddress = null; @@ -164,7 +164,7 @@ if (process.argv[2] !== 'child') { const sendSocket = dgram.createSocket({ type: 'udp4', - reuseAddr: true + reuseAddr: true, }); // bind the address explicitly for sending @@ -215,7 +215,7 @@ if (process.argv[2] === 'child') { const receivedMessages = []; const listenSocket = dgram.createSocket({ type: 'udp4', - reuseAddr: true + reuseAddr: true, }); listenSocket.on('message', function(buf, rinfo) { diff --git a/test/internet/test-dgram-multicast-multi-process.js b/test/internet/test-dgram-multicast-multi-process.js index f8797bc8f3b032..bc17af79aa1cfe 100644 --- a/test/internet/test-dgram-multicast-multi-process.js +++ b/test/internet/test-dgram-multicast-multi-process.js @@ -35,7 +35,7 @@ const messages = [ Buffer.from('First message to send'), Buffer.from('Second message to send'), Buffer.from('Third message to send'), - Buffer.from('Fourth message to send') + Buffer.from('Fourth message to send'), ]; const workers = {}; const listeners = 3; @@ -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 c869b87d8a7507..e81d46949375e6 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: '::' }; @@ -70,7 +70,7 @@ const messages = [ { tail: 'Fourth message to send', mcast: MULTICASTS[FAM][2] }, { tail: 'Fifth message to send', mcast: MULTICASTS[FAM][1], rcv: true }, { tail: 'Sixth message to send', mcast: MULTICASTS[FAM][2], rcv: true, - newAddr: LOOPBACK[FAM] } + newAddr: LOOPBACK[FAM] }, ]; @@ -195,7 +195,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 @@ -255,7 +255,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', function(buf, rinfo) { diff --git a/test/internet/test-dns-any.js b/test/internet/test-dns-any.js index a83040801f38f4..d6a99f2a4b9ade 100644 --- a/test/internet/test-dns-any.js +++ b/test/internet/test-dns-any.js @@ -77,7 +77,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-cares-domains.js b/test/internet/test-dns-cares-domains.js index 6609758a7daf17..4a8e0eee71ba72 100644 --- a/test/internet/test-dns-cares-domains.js +++ b/test/internet/test-dns-cares-domains.js @@ -15,7 +15,7 @@ const methods = [ 'resolveSrv', 'resolvePtr', 'resolveNaptr', - 'resolveSoa' + 'resolveSoa', ]; methods.forEach(function(method) { diff --git a/test/internet/test-dns-ipv4.js b/test/internet/test-dns-ipv4.js index 4c6e0ae6865e3f..871ab2cc69cecc 100644 --- a/test/internet/test-dns-ipv4.js +++ b/test/internet/test-dns-ipv4.js @@ -105,7 +105,7 @@ TEST(function test_lookup_ipv4_implicit(done) { TEST(function test_lookup_ipv4_explicit_object(done) { const req = dns.lookup(addresses.INET4_HOST, { - family: 4 + family: 4, }, common.mustCall((err, ip, family) => { assert.ifError(err); assert.ok(net.isIPv4(ip)); @@ -119,7 +119,7 @@ TEST(function test_lookup_ipv4_explicit_object(done) { TEST(function test_lookup_ipv4_hint_addrconfig(done) { const req = dns.lookup(addresses.INET4_HOST, { - hints: dns.ADDRCONFIG + hints: dns.ADDRCONFIG, }, common.mustCall((err, ip, family) => { assert.ifError(err); assert.ok(net.isIPv4(ip)); diff --git a/test/internet/test-dns-ipv6.js b/test/internet/test-dns-ipv6.js index 8b1a8936802729..8b20ff570ea070 100644 --- a/test/internet/test-dns-ipv6.js +++ b/test/internet/test-dns-ipv6.js @@ -103,7 +103,7 @@ TEST(function test_lookup_ipv6_implicit(done) { TEST(function test_lookup_ipv6_explicit_object(done) { const req = dns.lookup(addresses.INET6_HOST, { - family: 6 + family: 6, }, common.mustCall((err, ip, family) => { assert.ifError(err); assert.ok(isIPv6(ip)); @@ -118,7 +118,7 @@ TEST(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 diff --git a/test/internet/test-dns.js b/test/internet/test-dns.js index f1b7b4ff056833..fb59b83f09d7f5 100644 --- a/test/internet/test-dns.js +++ b/test/internet/test-dns.js @@ -76,7 +76,7 @@ TEST(function test_reverse_bogus(done) { TEST(function test_resolve4_ttl(done) { const req = dns.resolve4(addresses.INET4_HOST, { - ttl: true + ttl: true, }, function(err, result) { assert.ifError(err); assert.ok(result.length > 0); @@ -99,7 +99,7 @@ TEST(function test_resolve4_ttl(done) { TEST(function test_resolve6_ttl(done) { const req = dns.resolve6(addresses.INET6_HOST, { - ttl: true + ttl: true, }, function(err, result) { assert.ifError(err); assert.ok(result.length > 0); @@ -467,7 +467,7 @@ TEST(function test_lookup_null_all(done) { TEST(function test_lookup_all_mixed(done) { const req = dns.lookup(addresses.INET_HOST, { - all: true + all: true, }, function(err, ips) { assert.ifError(err); assert.ok(Array.isArray(ips)); diff --git a/test/internet/test-http-dns-fail.js b/test/internet/test-http-dns-fail.js index 82a7030465dbc9..e473a844675556 100644 --- a/test/internet/test-http-dns-fail.js +++ b/test/internet/test-http-dns-fail.js @@ -36,7 +36,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/known_issues/test-http-path-contains-unicode.js b/test/known_issues/test-http-path-contains-unicode.js index 4d50c8865ba542..849a215af89fbd 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, function() { http.request({ port: this.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 12d3ba7470bf8f..64d689d721c504 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 cb8184babc8904..36e26c490d665d 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 f11c4999cd463b..354bd893eba39e 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/message/2100bytes.js b/test/message/2100bytes.js index ff1b51f4653394..abd8c4b55246ae 100644 --- a/test/message/2100bytes.js +++ b/test/message/2100bytes.js @@ -64,5 +64,5 @@ console.log([ '_____________________________________________1950', '_____________________________________________2000', '_____________________________________________2050', - '_____________________________________________2100' + '_____________________________________________2100', ].join('\n')); diff --git a/test/message/vm_dont_display_runtime_error.js b/test/message/vm_dont_display_runtime_error.js index e7c77081a597c6..64f688dfaad11a 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 (e) {} @@ -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 f3965b33430e78..be8397374dcf6b 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 (e) {} @@ -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/parallel/test-assert-checktag.js b/test/parallel/test-assert-checktag.js index 632bfa03c6d4bf..b7c15fa45d8d11 100644 --- a/test/parallel/test-assert-checktag.js +++ b/test/parallel/test-assert-checktag.js @@ -16,7 +16,7 @@ function re(literals, ...values) { } return common.expectsError({ code: 'ERR_ASSERTION', - message: new RegExp(`^${result}$`) + message: new RegExp(`^${result}$`), }); } diff --git a/test/parallel/test-assert-deep.js b/test/parallel/test-assert-deep.js index 129967ac952ee3..23f5d109259231 100644 --- a/test/parallel/test-assert-deep.js +++ b/test/parallel/test-assert-deep.js @@ -18,7 +18,7 @@ function re(literals, ...values) { } return common.expectsError({ code: 'ERR_ASSERTION', - message: new RegExp(`^${result}$`) + message: new RegExp(`^${result}$`), }); } @@ -126,7 +126,7 @@ common.expectsError(() => { assert.deepEqual(new Set([{ a: 0 }]), new Set([{ a: 1 }])); }, { code: 'ERR_ASSERTION', - message: /^Set { { a: 0 } } deepEqual Set { { a: 1 } }$/ + message: /^Set { { a: 0 } } deepEqual Set { { a: 1 } }$/, }); function assertDeepAndStrictEqual(a, b) { @@ -569,31 +569,31 @@ assert.throws(() => assert.deepEqual(/ab/, /a/), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '/ab/ deepEqual /a/' + message: '/ab/ deepEqual /a/', }); assert.throws(() => assert.deepEqual(/a/g, /a/), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '/a/g deepEqual /a/' + message: '/a/g deepEqual /a/', }); assert.throws(() => assert.deepEqual(/a/i, /a/), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '/a/i deepEqual /a/' + message: '/a/i deepEqual /a/', }); assert.throws(() => assert.deepEqual(/a/m, /a/), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '/a/m deepEqual /a/' + message: '/a/m deepEqual /a/', }); assert.throws(() => assert.deepEqual(/a/igm, /a/im), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '/a/gim deepEqual /a/im' + message: '/a/gim deepEqual /a/im', }); { @@ -628,7 +628,7 @@ assert.deepEqual(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) { @@ -698,35 +698,35 @@ assert.throws( { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '/ab/ deepStrictEqual /a/' + message: '/ab/ deepStrictEqual /a/', }); assert.throws( () => assert.deepStrictEqual(/a/g, /a/), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '/a/g deepStrictEqual /a/' + message: '/a/g deepStrictEqual /a/', }); assert.throws( () => assert.deepStrictEqual(/a/i, /a/), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '/a/i deepStrictEqual /a/' + message: '/a/i deepStrictEqual /a/', }); assert.throws( () => assert.deepStrictEqual(/a/m, /a/), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '/a/m deepStrictEqual /a/' + message: '/a/m deepStrictEqual /a/', }); assert.throws( () => assert.deepStrictEqual(/a/igm, /a/im), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '/a/gim deepStrictEqual /a/im' + message: '/a/gim deepStrictEqual /a/im', }); { @@ -754,19 +754,19 @@ assert.throws(() => assert.deepStrictEqual([4], ['4']), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: "[ 4 ] deepStrictEqual [ '4' ]" + message: "[ 4 ] deepStrictEqual [ '4' ]", }); assert.throws(() => assert.deepStrictEqual({ a: 4 }, { a: 4, b: true }), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: '{ a: 4 } deepStrictEqual { a: 4, b: true }' + message: '{ a: 4 } deepStrictEqual { a: 4, b: true }', }); assert.throws(() => assert.deepStrictEqual(['a'], { 0: 'a' }), { code: 'ERR_ASSERTION', name: 'AssertionError [ERR_ASSERTION]', - message: "[ 'a' ] deepStrictEqual { '0': 'a' }" + message: "[ 'a' ] deepStrictEqual { '0': 'a' }", }); /* eslint-enable */ diff --git a/test/parallel/test-assert-fail-deprecation.js b/test/parallel/test-assert-fail-deprecation.js index 9da26dab3fd17d..d7eae0eecc8e7b 100644 --- a/test/parallel/test-assert-fail-deprecation.js +++ b/test/parallel/test-assert-fail-deprecation.js @@ -18,7 +18,7 @@ assert.throws(() => { message: '\'first\' != \'second\'', operator: '!=', actual: 'first', - expected: 'second' + expected: 'second', }); // Three args @@ -30,7 +30,7 @@ assert.throws(() => { message: 'another custom message', operator: undefined, actual: 'ignored', - expected: 'ignored' + expected: 'ignored', }); // Three args with custom Error @@ -42,7 +42,7 @@ assert.throws(() => { operator: undefined, actual: undefined, expected: undefined, - code: undefined + code: undefined, }); // No third arg (but a fourth arg) @@ -54,7 +54,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 fc2b6cc03c1d99..c97ec2c3ca0423 100644 --- a/test/parallel/test-assert-fail.js +++ b/test/parallel/test-assert-fail.js @@ -12,7 +12,7 @@ assert.throws( message: 'Failed', operator: undefined, actual: undefined, - expected: undefined + expected: undefined, } ); @@ -25,7 +25,7 @@ assert.throws(() => { message: 'custom message', operator: undefined, actual: undefined, - expected: undefined + expected: undefined, }); // One arg = Error @@ -36,5 +36,5 @@ assert.throws(() => { message: 'custom message', operator: undefined, actual: undefined, - expected: undefined + expected: undefined, }); diff --git a/test/parallel/test-assert-if-error.js b/test/parallel/test-assert-if-error.js index cd6f99dfa43ea7..3b4a9f4a4e2d6f 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-typedarray-deepequal.js b/test/parallel/test-assert-typedarray-deepequal.js index b648f07d3297f6..bae0aac4124605 100644 --- a/test/parallel/test-assert-typedarray-deepequal.js +++ b/test/parallel/test-assert-typedarray-deepequal.js @@ -23,7 +23,7 @@ const equalArrayPairs = [ [new Float32Array([+0.0]), new Float32Array([+0.0])], [new Uint8Array([1, 2, 3, 4]).subarray(1), new Uint8Array([2, 3, 4])], [new Uint16Array([1, 2, 3, 4]).subarray(1), new Uint16Array([2, 3, 4])], - [new Uint32Array([1, 2, 3, 4]).subarray(1, 3), new Uint32Array([2, 3])] + [new Uint32Array([1, 2, 3, 4]).subarray(1, 3), new Uint32Array([2, 3])], ]; const looseEqualArrayPairs = [ @@ -31,7 +31,7 @@ const looseEqualArrayPairs = [ [new Int16Array(256), new Uint16Array(256)], [new Int16Array([256]), new Uint16Array([256])], [new Float32Array([+0.0]), new Float32Array([-0.0])], - [new Float64Array([+0.0]), new Float64Array([-0.0])] + [new Float64Array([+0.0]), new Float64Array([-0.0])], ]; const notEqualArrayPairs = [ @@ -44,7 +44,7 @@ const notEqualArrayPairs = [ [new Int16Array([-256]), new Uint16Array([0xff00])], // same bits [new Int32Array([-256]), new Uint32Array([0xffffff00])], // ditto [new Float32Array([0.1]), new Float32Array([0.0])], - [new Float64Array([0.1]), new Float64Array([0.0])] + [new Float64Array([0.1]), new Float64Array([0.0])], ]; equalArrayPairs.forEach((arrayPair) => { diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 2ea041e1e28dbd..042eefd58ba2f2 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -126,7 +126,7 @@ common.expectsError( type: a.AssertionError, code: 'ERR_ASSERTION', operator: 'doesNotThrow', - message: 'Got unwanted exception: user message\n[object Object]' + message: 'Got unwanted exception: user message\n[object Object]', } ); @@ -134,7 +134,7 @@ common.expectsError( () => a.doesNotThrow(() => thrower(Error), 'user message'), { code: 'ERR_ASSERTION', - message: /Got unwanted exception: user message\n\[object Object\]/ + message: /Got unwanted exception: user message\n\[object Object\]/, } ); @@ -142,7 +142,7 @@ common.expectsError( () => a.doesNotThrow(() => thrower(Error)), { code: 'ERR_ASSERTION', - message: /Got unwanted exception\.\n\[object Object\]/ + message: /Got unwanted exception\.\n\[object Object\]/, } ); @@ -198,28 +198,28 @@ a.throws(() => thrower(TypeError), (err) => { common.expectsError({ code: 'ERR_ASSERTION', message: /^Missing expected exception\.$/, - operator: 'throws' + operator: 'throws', })); assert.throws( () => { a.throws(noop, TypeError); }, common.expectsError({ code: 'ERR_ASSERTION', - message: /^Missing expected exception \(TypeError\)\.$/ + message: /^Missing expected exception \(TypeError\)\.$/, })); assert.throws( () => { a.throws(noop, 'fhqwhgads'); }, common.expectsError({ code: 'ERR_ASSERTION', - message: /^Missing expected exception: fhqwhgads$/ + message: /^Missing expected exception: fhqwhgads$/, })); assert.throws( () => { a.throws(noop, TypeError, 'fhqwhgads'); }, common.expectsError({ code: 'ERR_ASSERTION', - message: /^Missing expected exception \(TypeError\): fhqwhgads$/ + message: /^Missing expected exception \(TypeError\): fhqwhgads$/, })); } @@ -317,7 +317,7 @@ try { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "block" argument must be of type Function. Received ' + - `type ${typeName(block)}` + `type ${typeName(block)}`, } ); }; @@ -352,7 +352,7 @@ assert.throws(() => { assert.strictEqual('A'.repeat(1000), ''); }, common.expectsError({ code: 'ERR_ASSERTION', - message: /^'A{124}\.\.\. strictEqual ''$/ + message: /^'A{124}\.\.\. strictEqual ''$/, })); { @@ -365,7 +365,7 @@ assert.throws(() => { common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: re + message: re, })); }); } @@ -375,7 +375,7 @@ common.expectsError( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: /^'Error: foo' strictEqual 'Error: foobar'$/ + message: /^'Error: foo' strictEqual 'Error: foobar'$/, } ); @@ -399,14 +399,14 @@ common.expectsError( () => assert(...[]), { message: 'No value argument passed to `assert.ok()`', - name: 'AssertionError [ERR_ASSERTION]' + name: 'AssertionError [ERR_ASSERTION]', } ); assert.throws( () => a(), { message: 'No value argument passed to `assert.ok()`', - name: 'AssertionError [ERR_ASSERTION]' + name: 'AssertionError [ERR_ASSERTION]', } ); @@ -423,7 +423,7 @@ common.expectsError( code: 'ERR_ASSERTION', type: assert.AssertionError, message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert.ok(typeof 123 === 'string')${EOL}` + `assert.ok(typeof 123 === 'string')${EOL}`, } ); Error.stackTraceLimit = tmpLimit; @@ -466,7 +466,7 @@ common.expectsError( ' 1,', '...', ' 1', - ' ]' + ' ]', ].join('\n'); assert.throws( () => assert.deepEqual( @@ -486,7 +486,7 @@ common.expectsError( ' 1,', '...', ' 1', - ' ]' + ' ]', ].join('\n'); assert.throws( () => assert.deepEqual( @@ -507,7 +507,7 @@ common.expectsError( ' 0,', `${minus} 1,`, ' 1', - ' ]' + ' ]', ].join('\n'); assert.throws( () => assert.deepEqual( @@ -538,7 +538,7 @@ common.expectsError( `${minus} 1,`, ' 2,', ' 1', - ' ]' + ' ]', ].join('\n'); assert.throws( () => assert.deepEqual([1, 2, 1], [2, 1]), @@ -568,7 +568,7 @@ common.expectsError( `${plus} {\n` + `${plus} loop: 'forever',\n` + `${plus} [Symbol(util.inspect.custom)]: [Function]\n` + - `${plus} }` + `${plus} }`, }); // notDeepEqual tests @@ -593,7 +593,7 @@ common.expectsError( type: assert.AssertionError, generatedMessage: true, message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert.ok(null)${EOL}` + `assert.ok(null)${EOL}`, } ); common.expectsError( @@ -603,7 +603,7 @@ common.expectsError( type: assert.AssertionError, generatedMessage: true, message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert(typeof 123 === 'string')${EOL}` + `assert(typeof 123 === 'string')${EOL}`, } ); @@ -624,7 +624,7 @@ common.expectsError( code: 'ERR_ASSERTION', type: assert.AssertionError, message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert(Buffer.from('test') instanceof Error)${EOL}` + `assert(Buffer.from('test') instanceof Error)${EOL}`, } ); common.expectsError( @@ -633,7 +633,7 @@ common.expectsError( code: 'ERR_ASSERTION', type: assert.AssertionError, message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert(Buffer.from('test') instanceof Error)${EOL}` + `assert(Buffer.from('test') instanceof Error)${EOL}`, } ); fs.close = tmp; @@ -657,7 +657,7 @@ common.expectsError( ` // eslint-disable-next-line${EOL}` + ` ===${EOL}` + ` 123 instanceof${EOL}` + - ` Buffer)${EOL}` + ` Buffer)${EOL}`, } ); @@ -667,7 +667,7 @@ common.expectsError( code: 'ERR_ASSERTION', type: assert.AssertionError, message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert(null, undefined)${EOL}` + `assert(null, undefined)${EOL}`, } ); @@ -676,7 +676,7 @@ common.expectsError( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: '0 == true' + message: '0 == true', } ); @@ -686,7 +686,7 @@ common.expectsError( code: 'ERR_ASSERTION', type: assert.AssertionError, message: '0 == true', - generatedMessage: true + generatedMessage: true, } ); @@ -696,7 +696,7 @@ common.expectsError( code: 'ERR_ASSERTION', type: assert.AssertionError, message: 'test', - generatedMessage: false + generatedMessage: false, } ); @@ -721,7 +721,7 @@ common.expectsError( assert.throws( () => e.emit('hello', false), { - message: 'false == true' + message: 'false == true', } ); threw = true; @@ -739,7 +739,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "error" argument must be one of type Function or RegExp. ' + - 'Received type string' + 'Received type string', } ); @@ -751,7 +751,7 @@ common.expectsError( }; const errObj = { name: 'TypeError', - message: 'Wrong value' + message: 'Wrong value', }; assert.throws(errFn, errObj); @@ -764,7 +764,7 @@ common.expectsError( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: 'code: expected \'404\', not 404' + message: 'code: expected \'404\', not 404', } ); @@ -775,7 +775,7 @@ common.expectsError( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: 'foo: expected \'bar\', not undefined' + message: 'foo: expected \'bar\', not undefined', } ); @@ -784,7 +784,7 @@ common.expectsError( { type: assert.AssertionError, code: 'ERR_ASSERTION', - message: 'foobar' + message: 'foobar', } ); @@ -794,7 +794,7 @@ common.expectsError( type: TypeError, code: 'ERR_INVALID_ARG_TYPE', message: 'The "expected" argument must be one of type Function or ' + - 'RegExp. Received type object' + 'RegExp. Received type object', } ); @@ -804,7 +804,7 @@ common.expectsError( { type: assert.AssertionError, code: 'ERR_ASSERTION', - message: "name: expected 'Error', not 'TypeError'" + message: "name: expected 'Error', not 'TypeError'", } ); common.expectsError( @@ -812,7 +812,7 @@ common.expectsError( { type: assert.AssertionError, code: 'ERR_ASSERTION', - message: "message: expected '', not 'foo'" + message: "message: expected '', not 'foo'", } ); @@ -824,7 +824,7 @@ common.expectsError( { type: assert.AssertionError, code: 'ERR_ASSERTION', - message: 'Got unwanted exception.\nundefined' + message: 'Got unwanted exception.\nundefined', } ); } diff --git a/test/parallel/test-async-hooks-asyncresource-constructor.js b/test/parallel/test-async-hooks-asyncresource-constructor.js index ebd5a4cf646bfd..cc3d47bb9e8703 100644 --- a/test/parallel/test-async-hooks-asyncresource-constructor.js +++ b/test/parallel/test-async-hooks-asyncresource-constructor.js @@ -8,7 +8,7 @@ const { AsyncResource } = async_hooks; // Setup init hook such parameters are validated async_hooks.createHook({ - init() {} + init() {}, }).enable(); common.expectsError(() => { diff --git a/test/parallel/test-async-hooks-close-during-destroy.js b/test/parallel/test-async-hooks-close-during-destroy.js index abdeab2404251a..a8fd25aa7d41b1 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-constructor.js b/test/parallel/test-async-hooks-constructor.js index f2b4df6a9f9f99..2910ceaf3fa4d2 100644 --- a/test/parallel/test-async-hooks-constructor.js +++ b/test/parallel/test-async-hooks-constructor.js @@ -18,6 +18,6 @@ function typeErrorForFunction(functionName) { }, { code: 'ERR_ASYNC_CALLBACK', type: TypeError, - message: `hook.${functionName} must be a function` + message: `hook.${functionName} must be a function`, }); } 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 d6566661294734..1320de803d2d71 100644 --- a/test/parallel/test-async-hooks-disable-during-promise.js +++ b/test/parallel/test-async-hooks-disable-during-promise.js @@ -6,7 +6,7 @@ common.crashOnUnhandledRejection(); 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 a34739a9bb2b95..aafdeaf9487314 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.mustCall(1) // only 1 immediate is destroyed + destroy: common.mustCall(1), // only 1 immediate is destroyed }).enable(); new async_hooks.AsyncResource('foobar', { requireManualDestroy: true }); 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 17b3c884bb9284..bb26fa3a2546fe 100644 --- a/test/parallel/test-async-hooks-enable-during-promise.js +++ b/test/parallel/test-async-hooks-enable-during-promise.js @@ -8,7 +8,7 @@ Promise.resolve(1).then(common.mustCall(() => { async_hooks.createHook({ init: common.mustCall(), before: common.mustCall(), - after: common.mustCall(2) + after: common.mustCall(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 bcb0dcc0ce0a66..154dbd6cec1fc2 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((id, type) => { nestedHook.enable(); - }, 2) + }, 2), }).enable(); fs.access(__filename, common.mustCall(() => { 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-prevent-double-destroy.js b/test/parallel/test-async-hooks-prevent-double-destroy.js index 5cd9c5e9a017cb..299ad6466706ef 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.mustCall(2) // 1 immediate + manual destroy + destroy: common.mustCall(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 b7692c45cd9b2e..276ff4926db340 100644 --- a/test/parallel/test-async-hooks-promise-enable-disable.js +++ b/test/parallel/test-async-hooks-promise-enable-disable.js @@ -29,7 +29,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 7afd005855fb3e..e45d81aa169f70 100644 --- a/test/parallel/test-async-hooks-promise-triggerid.js +++ b/test/parallel/test-async-hooks-promise-triggerid.js @@ -22,7 +22,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 4b36f6026b36c6..74663f806a98d6 100644 --- a/test/parallel/test-async-hooks-promise.js +++ b/test/parallel/test-async-hooks-promise.js @@ -14,7 +14,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 e7a5d8f5606118..5c1e4fca2b0b36 100644 --- a/test/parallel/test-async-hooks-top-level-clearimmediate.js +++ b/test/parallel/test-async-hooks-top-level-clearimmediate.js @@ -19,7 +19,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-GH13045.js b/test/parallel/test-async-wrap-GH13045.js index bb4e1a0c411666..5a216cc743f8d8 100644 --- a/test/parallel/test-async-wrap-GH13045.js +++ b/test/parallel/test-async-wrap-GH13045.js @@ -13,7 +13,7 @@ const fixtures = require('../common/fixtures'); 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(serverOptions, common.mustCall((req, res) => { @@ -25,9 +25,9 @@ server.listen(0, common.mustCall(function() { const clientOptions = { agent: new https.Agent({ keepAlive: true, - rejectUnauthorized: false + rejectUnauthorized: false, }), - port: port + port: port, }; const req = https.get(clientOptions, common.mustCall((res) => { diff --git a/test/parallel/test-async-wrap-promise-after-enabled.js b/test/parallel/test-async-wrap-promise-after-enabled.js index 9535c080f246b7..9c9badef106acf 100644 --- a/test/parallel/test-async-wrap-promise-after-enabled.js +++ b/test/parallel/test-async-wrap-promise-after-enabled.js @@ -26,7 +26,7 @@ const hooks = async_hooks.createHook({ assert.ok(id > 1); seenEvents.push('after'); hooks.disable(); - }) + }), }); setImmediate(() => { diff --git a/test/parallel/test-benchmark-crypto.js b/test/parallel/test-benchmark-crypto.js index 2e78d78bc93985..0f5aa60b387e3b 100644 --- a/test/parallel/test-benchmark-crypto.js +++ b/test/parallel/test-benchmark-crypto.js @@ -20,6 +20,6 @@ runBenchmark('crypto', 'out=buffer', 'type=buf', 'v=crypto', - 'writes=1' + 'writes=1', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-benchmark-es.js b/test/parallel/test-benchmark-es.js index 8176ad0b07e9ac..19f9f37d086a85 100644 --- a/test/parallel/test-benchmark-es.js +++ b/test/parallel/test-benchmark-es.js @@ -14,6 +14,6 @@ runBenchmark('es', 'mode=', 'n=1', 'encoding=ascii', - 'size=1e1' + 'size=1e1', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-benchmark-fs.js b/test/parallel/test-benchmark-fs.js index ad01b4e5803ce5..ff12eee0721f90 100644 --- a/test/parallel/test-benchmark-fs.js +++ b/test/parallel/test-benchmark-fs.js @@ -16,5 +16,5 @@ runBenchmark('fs', [ 'statType=fstat', 'statSyncType=fstatSync', 'encodingType=buf', - 'filesize=1024' + 'filesize=1024', ], { NODE_TMPDIR: tmpdir.path, NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-benchmark-misc.js b/test/parallel/test-benchmark-misc.js index 52f568f97428fb..1f8610fbcdcd73 100644 --- a/test/parallel/test-benchmark-misc.js +++ b/test/parallel/test-benchmark-misc.js @@ -10,5 +10,5 @@ runBenchmark('misc', [ 'millions=.000001', 'n=1', 'type=extend', - 'val=magyarország.icom.museum' + 'val=magyarország.icom.museum', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-benchmark-module.js b/test/parallel/test-benchmark-module.js index f68fd314f20e1b..19e9dd7c107038 100644 --- a/test/parallel/test-benchmark-module.js +++ b/test/parallel/test-benchmark-module.js @@ -7,5 +7,5 @@ const runBenchmark = require('../common/benchmark'); runBenchmark('module', [ 'thousands=.001', 'useCache=true', - 'fullPath=true' + 'fullPath=true', ]); diff --git a/test/parallel/test-benchmark-path.js b/test/parallel/test-benchmark-path.js index 890fd7ae41f548..53181c00ed3256 100644 --- a/test/parallel/test-benchmark-path.js +++ b/test/parallel/test-benchmark-path.js @@ -10,5 +10,5 @@ runBenchmark('path', 'path=', 'pathext=', 'paths=', - 'props=' + 'props=', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-benchmark-process.js b/test/parallel/test-benchmark-process.js index c11d82b327f743..0deecc1aea7c82 100644 --- a/test/parallel/test-benchmark-process.js +++ b/test/parallel/test-benchmark-process.js @@ -8,5 +8,5 @@ runBenchmark('process', [ 'millions=0.000001', 'n=1', - 'type=raw' + 'type=raw', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-benchmark-querystring.js b/test/parallel/test-benchmark-querystring.js index 77d0ac99ff97d8..f5a6d3fa441ea3 100644 --- a/test/parallel/test-benchmark-querystring.js +++ b/test/parallel/test-benchmark-querystring.js @@ -7,6 +7,6 @@ const runBenchmark = require('../common/benchmark'); runBenchmark('querystring', [ 'n=1', 'input="there is nothing to unescape here"', - 'type=noencode' + 'type=noencode', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-benchmark-timers.js b/test/parallel/test-benchmark-timers.js index 4cbcb1f11b9327..817da38184e15a 100644 --- a/test/parallel/test-benchmark-timers.js +++ b/test/parallel/test-benchmark-timers.js @@ -9,6 +9,6 @@ runBenchmark('timers', 'type=depth', 'n=1', 'millions=0.000001', - 'thousands=0.001' + 'thousands=0.001', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-benchmark-zlib.js b/test/parallel/test-benchmark-zlib.js index 350d05552cda39..6e6af1000857aa 100644 --- a/test/parallel/test-benchmark-zlib.js +++ b/test/parallel/test-benchmark-zlib.js @@ -9,5 +9,5 @@ runBenchmark('zlib', 'method=deflate', 'n=1', 'options=true', - 'type=Deflate' + 'type=Deflate', ]); diff --git a/test/parallel/test-binding-constants.js b/test/parallel/test-binding-constants.js index aaf0ebde5230a8..247c8aba8380fc 100644 --- a/test/parallel/test-binding-constants.js +++ b/test/parallel/test-binding-constants.js @@ -27,5 +27,5 @@ function test(obj) { [ constants, constants.crypto, constants.fs, constants.os, constants.zlib, - constants.os.dlopen, constants.os.errno, constants.os.signals + constants.os.dlopen, constants.os.errno, constants.os.signals, ].forEach(test); diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index 30baa30319f116..b15b7881b0115d 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -895,7 +895,7 @@ common.expectsError( { code: 'ERR_UNKNOWN_ENCODING', type: TypeError, - message: 'Unknown encoding: buffer' + message: 'Unknown encoding: buffer', } ); @@ -972,7 +972,7 @@ assert.strictEqual(SlowBuffer.prototype.offset, undefined); const errMsg = common.expectsError({ code: 'ERR_BUFFER_OUT_OF_BOUNDS', type: 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); } @@ -1015,19 +1015,19 @@ common.expectsError(() => { Buffer.alloc(0x1000, 'This is not correctly encoded', 'hex'); }, { code: 'ERR_INVALID_ARG_VALUE', - type: TypeError + type: TypeError, }); common.expectsError(() => { Buffer.alloc(0x1000, 'c', 'hex'); }, { code: 'ERR_INVALID_ARG_VALUE', - type: TypeError + type: TypeError, }); common.expectsError(() => { Buffer.alloc(1, Buffer.alloc(0)); }, { code: 'ERR_INVALID_ARG_VALUE', - type: TypeError + type: TypeError, }); diff --git a/test/parallel/test-buffer-arraybuffer.js b/test/parallel/test-buffer-arraybuffer.js index b7f9359a00489c..90a1f22d9ffd68 100644 --- a/test/parallel/test-buffer-arraybuffer.js +++ b/test/parallel/test-buffer-arraybuffer.js @@ -61,12 +61,12 @@ assert.throws(function() { common.expectsError(() => Buffer.from(ab.buffer, 6), { code: 'ERR_BUFFER_OUT_OF_BOUNDS', type: RangeError, - message: '"offset" is outside of buffer bounds' + message: '"offset" is outside of buffer bounds', }); common.expectsError(() => Buffer.from(ab.buffer, 3, 6), { code: 'ERR_BUFFER_OUT_OF_BOUNDS', type: RangeError, - message: '"length" is outside of buffer bounds' + message: '"length" is outside of buffer bounds', }); } @@ -89,12 +89,12 @@ assert.throws(function() { common.expectsError(() => Buffer(ab.buffer, 6), { code: 'ERR_BUFFER_OUT_OF_BOUNDS', type: RangeError, - message: '"offset" is outside of buffer bounds' + message: '"offset" is outside of buffer bounds', }); common.expectsError(() => Buffer(ab.buffer, 3, 6), { code: 'ERR_BUFFER_OUT_OF_BOUNDS', type: RangeError, - message: '"length" is outside of buffer bounds' + message: '"length" is outside of buffer bounds', }); } @@ -116,7 +116,7 @@ assert.throws(function() { }, { code: 'ERR_BUFFER_OUT_OF_BOUNDS', type: RangeError, - message: '"offset" is outside of buffer bounds' + message: '"offset" is outside of buffer bounds', }); } @@ -138,7 +138,7 @@ assert.throws(function() { }, { code: 'ERR_BUFFER_OUT_OF_BOUNDS', type: RangeError, - message: '"length" is outside of buffer bounds' + message: '"length" is outside of buffer bounds', }); } diff --git a/test/parallel/test-buffer-bad-overload.js b/test/parallel/test-buffer-bad-overload.js index 63acb8ebfb6d49..cea3ce7028b85d 100644 --- a/test/parallel/test-buffer-bad-overload.js +++ b/test/parallel/test-buffer-bad-overload.js @@ -8,7 +8,7 @@ const err = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "value" argument must not be of type number. ' + - 'Received type number' + 'Received type number', }); assert.throws(function() { Buffer.from(10, 'hex'); diff --git a/test/parallel/test-buffer-bytelength.js b/test/parallel/test-buffer-bytelength.js index 45bd4cf3dfd393..ea5db11cb54e99 100644 --- a/test/parallel/test-buffer-bytelength.js +++ b/test/parallel/test-buffer-bytelength.js @@ -9,7 +9,7 @@ const vm = require('vm'); [32, 'latin1'], [NaN, 'utf8'], [{}, 'latin1'], - [] + [], ].forEach((args) => { common.expectsError( () => Buffer.byteLength(...args), @@ -17,7 +17,7 @@ const vm = require('vm'); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "string" argument must be one of type string, ' + - `Buffer, or ArrayBuffer. Received type ${typeof args[0]}` + `Buffer, or ArrayBuffer. Received type ${typeof args[0]}`, } ); }); diff --git a/test/parallel/test-buffer-compare-offset.js b/test/parallel/test-buffer-compare-offset.js index 7f3121bef17ab5..99c06c49df885e 100644 --- a/test/parallel/test-buffer-compare-offset.js +++ b/test/parallel/test-buffer-compare-offset.js @@ -70,5 +70,5 @@ common.expectsError(() => a.compare(), { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "target" argument must be one of ' + - 'type Buffer or Uint8Array. Received type undefined' + 'type Buffer or Uint8Array. Received type undefined', }); diff --git a/test/parallel/test-buffer-compare.js b/test/parallel/test-buffer-compare.js index 9ebd3a970b47d6..7732c035b271f3 100644 --- a/test/parallel/test-buffer-compare.js +++ b/test/parallel/test-buffer-compare.js @@ -32,7 +32,7 @@ const errMsg = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "buf1", "buf2" arguments must be one of ' + - 'type Buffer or Uint8Array' + 'type Buffer or Uint8Array', }, 2); assert.throws(() => Buffer.compare(Buffer.alloc(1), 'abc'), errMsg); @@ -42,5 +42,5 @@ common.expectsError(() => Buffer.alloc(1).compare('abc'), { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "target" argument must be one of ' + - 'type Buffer or Uint8Array. Received type string' + 'type Buffer or Uint8Array. Received type string', }); diff --git a/test/parallel/test-buffer-concat.js b/test/parallel/test-buffer-concat.js index 9d6c6c7d351e45..f4c0fa3a90735d 100644 --- a/test/parallel/test-buffer-concat.js +++ b/test/parallel/test-buffer-concat.js @@ -58,7 +58,7 @@ function assertWrongList(value) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "list" argument must be one of type ' + - 'Array, Buffer, or Uint8Array' + 'Array, Buffer, or Uint8Array', }); } diff --git a/test/parallel/test-buffer-equals.js b/test/parallel/test-buffer-equals.js index 91c79a5be8b169..df5d6e017c3008 100644 --- a/test/parallel/test-buffer-equals.js +++ b/test/parallel/test-buffer-equals.js @@ -20,6 +20,6 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "otherBuffer" argument must be one of type ' + - 'Buffer or Uint8Array. Received type string' + 'Buffer or Uint8Array. Received type string', } ); diff --git a/test/parallel/test-buffer-failed-alloc-typed-arrays.js b/test/parallel/test-buffer-failed-alloc-typed-arrays.js index fd9c2744e55f69..21b030344f4fdf 100644 --- a/test/parallel/test-buffer-failed-alloc-typed-arrays.js +++ b/test/parallel/test-buffer-failed-alloc-typed-arrays.js @@ -18,7 +18,7 @@ const allocators = [ SlowBuffer, Buffer.alloc, Buffer.allocUnsafe, - Buffer.allocUnsafeSlow + Buffer.allocUnsafeSlow, ]; for (const allocator of allocators) { for (const size of sizes) { diff --git a/test/parallel/test-buffer-fill.js b/test/parallel/test-buffer-fill.js index b2f14c3e428e55..c3c3e04f7f902b 100644 --- a/test/parallel/test-buffer-fill.js +++ b/test/parallel/test-buffer-fill.js @@ -117,7 +117,7 @@ common.expectsError(() => { buf.fill('yKJh', 'hex'); }, { code: 'ERR_INVALID_ARG_VALUE', - type: TypeError + type: TypeError, }); common.expectsError(() => { @@ -126,7 +126,7 @@ common.expectsError(() => { buf.fill('\u0222', 'hex'); }, { code: 'ERR_INVALID_ARG_VALUE', - type: TypeError + type: TypeError, }); // BASE64 @@ -182,20 +182,20 @@ common.expectsError( { code: 'ERR_UNKNOWN_ENCODING', type: TypeError, - message: 'Unknown encoding: node rocks!' + message: 'Unknown encoding: node rocks!', } ); [ ['a', 0, 0, NaN], - ['a', 0, 0, false] + ['a', 0, 0, false], ].forEach((args) => { common.expectsError( () => buf1.fill(...args), { code: 'ERR_INVALID_ARG_TYPE', message: 'The "encoding" argument must be of type ' + - `string. Received type ${args[3] === null ? 'null' : typeof args[3]}` + `string. Received type ${args[3] === null ? 'null' : typeof args[3]}`, } ); }); @@ -205,7 +205,7 @@ common.expectsError( { code: 'ERR_UNKNOWN_ENCODING', type: TypeError, - message: 'Unknown encoding: foo' + message: 'Unknown encoding: foo', } ); @@ -348,13 +348,13 @@ assert.strictEqual( elseWasLast = true; // Once buffer.js calls the C++ implementation of fill, return -1 return -1; - } + }, }; Buffer.alloc(1).fill(Buffer.alloc(1), 0, end); }, { code: 'ERR_INDEX_OUT_OF_RANGE', type: RangeError, - message: 'Index out of range' + message: 'Index out of range', }); // Make sure -1 is making it to Buffer::Fill(). assert.ok(elseWasLast, @@ -371,13 +371,13 @@ common.expectsError(() => { const buf = Buffer.from('w00t'); Object.defineProperty(buf, 'length', { value: 1337, - enumerable: true + enumerable: true, }); buf.fill(''); }, { code: 'ERR_INDEX_OUT_OF_RANGE', type: RangeError, - message: 'Index out of range' + message: 'Index out of range', }); assert.deepStrictEqual( @@ -421,5 +421,5 @@ common.expectsError(() => { buf.fill('This is not correctly encoded', 'hex'); }, { code: 'ERR_INVALID_ARG_VALUE', - type: TypeError + type: TypeError, }); diff --git a/test/parallel/test-buffer-from.js b/test/parallel/test-buffer-from.js index e8a9196b3d9d8c..ef376597438ed7 100644 --- a/test/parallel/test-buffer-from.js +++ b/test/parallel/test-buffer-from.js @@ -40,27 +40,27 @@ deepStrictEqual( [{ valueOf() { return null; } }, 'object'], [{ valueOf() { return undefined; } }, 'object'], [{ valueOf: null }, 'object'], - [Object.create(null), 'object'] + [Object.create(null), 'object'], ].forEach(([input, actualType]) => { const err = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The first argument must be one of type string, Buffer, ' + 'ArrayBuffer, Array, or Array-like Object. Received ' + - `type ${actualType}` + `type ${actualType}`, }); throws(() => Buffer.from(input), err); }); [ new Number(true), - new MyBadPrimitive() + new MyBadPrimitive(), ].forEach((input) => { const errMsg = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "value" argument must not be of type number. ' + - 'Received type number' + 'Received type number', }); throws(() => Buffer.from(input), errMsg); }); diff --git a/test/parallel/test-buffer-includes.js b/test/parallel/test-buffer-includes.js index 50f0d469b649eb..29c6562e175db7 100644 --- a/test/parallel/test-buffer-includes.js +++ b/test/parallel/test-buffer-includes.js @@ -274,7 +274,7 @@ for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) { [ () => { }, {}, - [] + [], ].forEach((val) => { common.expectsError( () => b.includes(val), @@ -282,7 +282,7 @@ for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "value" argument must be one of type string, ' + - `Buffer, or Uint8Array. Received type ${typeof val}` + `Buffer, or Uint8Array. Received type ${typeof val}`, } ); }); diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index 357558c74d2edc..c21fa2bebde82f 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -349,7 +349,7 @@ assert.strictEqual(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1); [ () => {}, {}, - [] + [], ].forEach((val) => { common.expectsError( () => b.indexOf(val), @@ -357,7 +357,7 @@ assert.strictEqual(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "value" argument must be one of type string, ' + - `Buffer, or Uint8Array. Received type ${typeof val}` + `Buffer, or Uint8Array. Received type ${typeof val}`, } ); }); diff --git a/test/parallel/test-buffer-isencoding.js b/test/parallel/test-buffer-isencoding.js index e67d1c078397a3..5742b1bfbe4f83 100644 --- a/test/parallel/test-buffer-isencoding.js +++ b/test/parallel/test-buffer-isencoding.js @@ -14,7 +14,7 @@ const assert = require('assert'); 'ucs2', 'ucs-2', 'utf16le', - 'utf-16le' + 'utf-16le', ].forEach((enc) => { assert.strictEqual(Buffer.isEncoding(enc), true); }); @@ -31,7 +31,7 @@ const assert = require('assert'); [], 1, 0, - -1 + -1, ].forEach((enc) => { assert.strictEqual(Buffer.isEncoding(enc), false); }); diff --git a/test/parallel/test-buffer-iterator.js b/test/parallel/test-buffer-iterator.js index 3120ff1d2ab457..2d9ab91e89703c 100644 --- a/test/parallel/test-buffer-iterator.js +++ b/test/parallel/test-buffer-iterator.js @@ -58,5 +58,5 @@ assert.deepStrictEqual(arr, [ [1, 2], [2, 3], [3, 4], - [4, 5] + [4, 5], ]); diff --git a/test/parallel/test-buffer-negative-length.js b/test/parallel/test-buffer-negative-length.js index bf903b933d2689..f87fe72e1995cf 100644 --- a/test/parallel/test-buffer-negative-length.js +++ b/test/parallel/test-buffer-negative-length.js @@ -7,7 +7,7 @@ const SlowBuffer = require('buffer').SlowBuffer; const bufferNegativeMsg = common.expectsError({ code: 'ERR_INVALID_OPT_VALUE', type: RangeError, - message: /^The value "[^"]*" is invalid for option "size"$/ + message: /^The value "[^"]*" is invalid for option "size"$/, }, 5); assert.throws(() => Buffer(-1).toString('utf8'), bufferNegativeMsg); assert.throws(() => SlowBuffer(-1).toString('utf8'), bufferNegativeMsg); diff --git a/test/parallel/test-buffer-new.js b/test/parallel/test-buffer-new.js index 31b29dee5b0815..55457304d3821c 100644 --- a/test/parallel/test-buffer-new.js +++ b/test/parallel/test-buffer-new.js @@ -5,5 +5,5 @@ const common = require('../common'); common.expectsError(() => new Buffer(42, 'utf8'), { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "string" argument must be of type string. Received type number' + message: 'The "string" argument must be of type string. Received type number', }); diff --git a/test/parallel/test-buffer-no-negative-allocation.js b/test/parallel/test-buffer-no-negative-allocation.js index b34477aa8c4b45..fbfd31aab13981 100644 --- a/test/parallel/test-buffer-no-negative-allocation.js +++ b/test/parallel/test-buffer-no-negative-allocation.js @@ -6,7 +6,7 @@ const assert = require('assert'); const msg = common.expectsError({ code: 'ERR_INVALID_OPT_VALUE', type: RangeError, - message: /^The value "[^"]*" is invalid for option "size"$/ + message: /^The value "[^"]*" is invalid for option "size"$/, }, 12); // 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 b1267b19ff439e..b75e001a89161f 100644 --- a/test/parallel/test-buffer-over-max-length.js +++ b/test/parallel/test-buffer-over-max-length.js @@ -9,7 +9,7 @@ const kMaxLength = buffer.kMaxLength; const bufferMaxSizeMsg = common.expectsError({ code: 'ERR_INVALID_OPT_VALUE', type: RangeError, - message: /^The value "[^"]*" is invalid for option "size"$/ + message: /^The value "[^"]*" is invalid for option "size"$/, }, 12); assert.throws(() => Buffer((-1 >>> 0) + 1), bufferMaxSizeMsg); diff --git a/test/parallel/test-buffer-readdouble.js b/test/parallel/test-buffer-readdouble.js index 2853142e3506ff..bf7eeb4902bb84 100644 --- a/test/parallel/test-buffer-readdouble.js +++ b/test/parallel/test-buffer-readdouble.js @@ -113,7 +113,7 @@ assert.strictEqual(buffer.readDoubleLE(0), -Infinity); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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}`, }); }); @@ -122,7 +122,7 @@ assert.strictEqual(buffer.readDoubleLE(0), -Infinity); { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError [ERR_BUFFER_OUT_OF_BOUNDS]', - message: 'Attempt to write outside buffer bounds' + message: 'Attempt to write outside buffer bounds', }); [NaN, 1.01].forEach((offset) => { @@ -132,7 +132,7 @@ assert.strictEqual(buffer.readDoubleLE(0), -Infinity); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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 8e1e0ba5bb34b2..1cf5489409f2a4 100644 --- a/test/parallel/test-buffer-readfloat.js +++ b/test/parallel/test-buffer-readfloat.js @@ -76,7 +76,7 @@ assert.strictEqual(buffer.readFloatLE(0), -Infinity); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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}`, }); }); @@ -85,7 +85,7 @@ assert.strictEqual(buffer.readFloatLE(0), -Infinity); { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError [ERR_BUFFER_OUT_OF_BOUNDS]', - message: 'Attempt to write outside buffer bounds' + message: 'Attempt to write outside buffer bounds', }); [NaN, 1.01].forEach((offset) => { @@ -95,7 +95,7 @@ assert.strictEqual(buffer.readFloatLE(0), -Infinity); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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 6cb11ee5a03cce..c7673ce87980c8 100644 --- a/test/parallel/test-buffer-readint.js +++ b/test/parallel/test-buffer-readint.js @@ -13,7 +13,7 @@ const assert = require('assert'); () => buffer[`read${fn}`](o), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError [ERR_INVALID_ARG_TYPE]' + name: 'TypeError [ERR_INVALID_ARG_TYPE]', }); }); @@ -22,7 +22,7 @@ const assert = require('assert'); () => buffer[`read${fn}`](offset), { code: 'ERR_OUT_OF_RANGE', - name: 'RangeError [ERR_OUT_OF_RANGE]' + name: 'RangeError [ERR_OUT_OF_RANGE]', }); }); @@ -33,7 +33,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', message: 'The value of "offset" is out of range. ' + - `It must be an integer. Received ${offset}` + `It must be an integer. Received ${offset}`, }); }); }); @@ -141,7 +141,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}`, }); }); @@ -152,7 +152,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', message: 'The value of "byteLength" is out of range. ' + - `It must be an integer. Received ${byteLength}` + `It must be an integer. Received ${byteLength}`, }); }); }); @@ -165,7 +165,7 @@ const assert = require('assert'); () => buffer[fn](o, i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError [ERR_INVALID_ARG_TYPE]' + name: 'TypeError [ERR_INVALID_ARG_TYPE]', }); }); @@ -176,7 +176,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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}`, }); }); @@ -187,7 +187,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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-regression-649.js b/test/parallel/test-buffer-regression-649.js index f02e769fa21847..e61014159abee3 100644 --- a/test/parallel/test-buffer-regression-649.js +++ b/test/parallel/test-buffer-regression-649.js @@ -9,7 +9,7 @@ const len = 1422561062959; const message = common.expectsError({ code: 'ERR_INVALID_OPT_VALUE', type: RangeError, - message: /^The value "[^"]*" is invalid for option "size"$/ + message: /^The value "[^"]*" is invalid for option "size"$/, }, 5); assert.throws(() => Buffer(len).toString('utf8'), message); assert.throws(() => SlowBuffer(len).toString('utf8'), message); diff --git a/test/parallel/test-buffer-slice.js b/test/parallel/test-buffer-slice.js index 6175370a9bccee..3a6fe3eb0be931 100644 --- a/test/parallel/test-buffer-slice.js +++ b/test/parallel/test-buffer-slice.js @@ -59,7 +59,7 @@ const expectedSameBufs = [ [buf.slice('-10', '-5'), Buffer.from('01234', 'utf8')], [buf.slice('-10', '-0'), Buffer.from('', 'utf8')], [buf.slice('111'), Buffer.from('', 'utf8')], - [buf.slice('0', '-111'), Buffer.from('', 'utf8')] + [buf.slice('0', '-111'), Buffer.from('', 'utf8')], ]; for (let i = 0, s = buf.toString(); i < buf.length; ++i) { @@ -114,13 +114,13 @@ assert.strictEqual(0, Buffer.from('hello', 'utf8').slice(0, 0).length); { const buf = Buffer.from([ 1, 29, 0, 0, 1, 143, 216, 162, 92, 254, 248, 63, 0, - 0, 0, 18, 184, 6, 0, 175, 29, 0, 8, 11, 1, 0, 0 + 0, 0, 18, 184, 6, 0, 175, 29, 0, 8, 11, 1, 0, 0, ]); const chunk1 = Buffer.from([ - 1, 29, 0, 0, 1, 143, 216, 162, 92, 254, 248, 63, 0 + 1, 29, 0, 0, 1, 143, 216, 162, 92, 254, 248, 63, 0, ]); const chunk2 = Buffer.from([ - 0, 0, 18, 184, 6, 0, 175, 29, 0, 8, 11, 1, 0, 0 + 0, 0, 18, 184, 6, 0, 175, 29, 0, 8, 11, 1, 0, 0, ]); const middle = buf.length / 2; diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js index e41dd1dd0fd3a0..506c983e91d12a 100644 --- a/test/parallel/test-buffer-slow.js +++ b/test/parallel/test-buffer-slow.js @@ -53,7 +53,7 @@ assert.strictEqual(SlowBuffer('string').length, 0); const bufferMaxSizeMsg = common.expectsError({ code: 'ERR_INVALID_OPT_VALUE', type: RangeError, - message: /^The value "[^"]*" is invalid for option "size"$/ + message: /^The value "[^"]*" is invalid for option "size"$/, }, 2); assert.throws(function() { SlowBuffer(Infinity); @@ -63,7 +63,7 @@ common.expectsError(function() { }, { code: 'ERR_INVALID_OPT_VALUE', type: RangeError, - message: 'The value "-1" is invalid for option "size"' + message: 'The value "-1" is invalid for option "size"', }); assert.throws(function() { diff --git a/test/parallel/test-buffer-tostring-range.js b/test/parallel/test-buffer-tostring-range.js index f6ee846dd8ef34..b52f9ac706ce5b 100644 --- a/test/parallel/test-buffer-tostring-range.js +++ b/test/parallel/test-buffer-tostring-range.js @@ -89,12 +89,12 @@ common.expectsError(() => { }, { code: 'ERR_UNKNOWN_ENCODING', type: TypeError, - message: 'Unknown encoding: 0' + message: 'Unknown encoding: 0', }); common.expectsError(() => { rangeBuffer.toString(null, 1, 2); }, { code: 'ERR_UNKNOWN_ENCODING', type: TypeError, - message: 'Unknown encoding: null' + message: 'Unknown encoding: null', }); diff --git a/test/parallel/test-buffer-tostring.js b/test/parallel/test-buffer-tostring.js index 7ea7ce8539f3a4..29cb8997e941bf 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', type: 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 06117f614e83dc..969ea3db43f02f 100644 --- a/test/parallel/test-buffer-write.js +++ b/test/parallel/test-buffer-write.js @@ -6,7 +6,7 @@ const assert = require('assert'); const outsideBounds = common.expectsError({ code: 'ERR_BUFFER_OUT_OF_BOUNDS', type: RangeError, - message: 'Attempt to write outside buffer bounds' + message: 'Attempt to write outside buffer bounds', }, 2); assert.throws(() => Buffer.alloc(9).write('foo', -1), outsideBounds); @@ -20,7 +20,7 @@ const resultMap = new Map([ ['binary', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])], ['utf16le', Buffer.from([102, 0, 111, 0, 111, 0, 0, 0, 0])], ['base64', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])], - ['hex', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])] + ['hex', Buffer.from([102, 111, 111, 0, 0, 0, 0, 0, 0])], ]); // utf8, ucs2, ascii, latin1, utf16le @@ -64,7 +64,7 @@ for (let i = 1; i < 10; i++) { const error = common.expectsError({ code: 'ERR_UNKNOWN_ENCODING', type: 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 8f56e93f734dea..4e55951cbd4edb 100644 --- a/test/parallel/test-buffer-writedouble.js +++ b/test/parallel/test-buffer-writedouble.js @@ -11,35 +11,35 @@ buffer.writeDoubleBE(2.225073858507201e-308, 0); buffer.writeDoubleLE(2.225073858507201e-308, 8); assert.ok(buffer.equals(new Uint8Array([ 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00 + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, ]))); buffer.writeDoubleBE(1.0000000000000004, 0); buffer.writeDoubleLE(1.0000000000000004, 8); assert.ok(buffer.equals(new Uint8Array([ 0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, ]))); buffer.writeDoubleBE(-2, 0); buffer.writeDoubleLE(-2, 8); assert.ok(buffer.equals(new Uint8Array([ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, ]))); buffer.writeDoubleBE(1.7976931348623157e+308, 0); buffer.writeDoubleLE(1.7976931348623157e+308, 8); assert.ok(buffer.equals(new Uint8Array([ 0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x7f + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x7f, ]))); buffer.writeDoubleBE(0 * -1, 0); buffer.writeDoubleLE(0 * -1, 8); assert.ok(buffer.equals(new Uint8Array([ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, ]))); buffer.writeDoubleBE(Infinity, 0); @@ -47,7 +47,7 @@ buffer.writeDoubleLE(Infinity, 8); assert.ok(buffer.equals(new Uint8Array([ 0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F, ]))); assert.strictEqual(buffer.readDoubleBE(0), Infinity); @@ -58,7 +58,7 @@ buffer.writeDoubleLE(-Infinity, 8); assert.ok(buffer.equals(new Uint8Array([ 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, ]))); assert.strictEqual(buffer.readDoubleBE(0), -Infinity); @@ -69,7 +69,7 @@ buffer.writeDoubleLE(NaN, 8); assert.ok(buffer.equals(new Uint8Array([ 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x7F + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x7F, ]))); assert.ok(Number.isNaN(buffer.readDoubleBE(0))); @@ -85,7 +85,7 @@ assert.ok(Number.isNaN(buffer.readDoubleLE(8))); { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError [ERR_BUFFER_OUT_OF_BOUNDS]', - message: 'Attempt to write outside buffer bounds' + message: 'Attempt to write outside buffer bounds', }); ['', '0', null, undefined, {}, [], () => {}, true, false].forEach((off) => { @@ -101,7 +101,7 @@ assert.ok(Number.isNaN(buffer.readDoubleLE(8))); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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}`, }); }); @@ -112,7 +112,7 @@ assert.ok(Number.isNaN(buffer.readDoubleLE(8))); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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 865b8838dae5dd..5a7067304c8e5e 100644 --- a/test/parallel/test-buffer-writefloat.js +++ b/test/parallel/test-buffer-writefloat.js @@ -66,7 +66,7 @@ assert.ok(Number.isNaN(buffer.readFloatLE(4))); { code: 'ERR_BUFFER_OUT_OF_BOUNDS', name: 'RangeError [ERR_BUFFER_OUT_OF_BOUNDS]', - message: 'Attempt to write outside buffer bounds' + message: 'Attempt to write outside buffer bounds', }); ['', '0', null, undefined, {}, [], () => {}, true, false].forEach((off) => { @@ -83,7 +83,7 @@ assert.ok(Number.isNaN(buffer.readFloatLE(4))); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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}`, } ); }); @@ -95,7 +95,7 @@ assert.ok(Number.isNaN(buffer.readFloatLE(4))); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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 adddb35afee75e..7864521cebea15 100644 --- a/test/parallel/test-buffer-writeint.js +++ b/test/parallel/test-buffer-writeint.js @@ -8,7 +8,7 @@ const errorOutOfBounds = common.expectsError({ code: 'ERR_OUT_OF_RANGE', type: 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 .+$'), }, 10); // Test 8 bit @@ -98,32 +98,32 @@ const errorOutOfBounds = common.expectsError({ buffer.writeInt32BE(0x23, 0); buffer.writeInt32LE(0x23, 4); assert.ok(buffer.equals(new Uint8Array([ - 0x00, 0x00, 0x00, 0x23, 0x23, 0x00, 0x00, 0x00 + 0x00, 0x00, 0x00, 0x23, 0x23, 0x00, 0x00, 0x00, ]))); buffer.writeInt32BE(-5, 0); buffer.writeInt32LE(-5, 4); assert.ok(buffer.equals(new Uint8Array([ - 0xff, 0xff, 0xff, 0xfb, 0xfb, 0xff, 0xff, 0xff + 0xff, 0xff, 0xff, 0xfb, 0xfb, 0xff, 0xff, 0xff, ]))); buffer.writeInt32BE(-805306713, 0); buffer.writeInt32LE(-805306713, 4); assert.ok(buffer.equals(new Uint8Array([ - 0xcf, 0xff, 0xfe, 0xa7, 0xa7, 0xfe, 0xff, 0xcf + 0xcf, 0xff, 0xfe, 0xa7, 0xa7, 0xfe, 0xff, 0xcf, ]))); /* Make sure we handle min/max correctly */ buffer.writeInt32BE(0x7fffffff, 0); buffer.writeInt32BE(-0x80000000, 4); assert.ok(buffer.equals(new Uint8Array([ - 0x7f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00 + 0x7f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, ]))); buffer.writeInt32LE(0x7fffffff, 0); buffer.writeInt32LE(-0x80000000, 4); assert.ok(buffer.equals(new Uint8Array([ - 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x80 + 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x80, ]))); ['writeInt32BE', 'writeInt32LE'].forEach((fn) => { @@ -166,7 +166,7 @@ const errorOutOfBounds = common.expectsError({ { code: 'ERR_OUT_OF_RANGE', message: 'The value of "byteLength" is out of range. ' + - `It must be >= 1 and <= 6. Received ${offset}` + `It must be >= 1 and <= 6. Received ${offset}`, } ); }); @@ -178,7 +178,7 @@ const errorOutOfBounds = common.expectsError({ code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', message: 'The value of "byteLength" is out of range. ' + - `It must be an integer. Received ${byteLength}` + `It must be an integer. Received ${byteLength}`, }); }); }); @@ -196,7 +196,7 @@ const errorOutOfBounds = common.expectsError({ code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', message: 'The value of "value" is out of range. ' + - `It must be >= ${min} and <= ${max}. Received ${val}` + `It must be >= ${min} and <= ${max}. Received ${val}`, }); }); @@ -205,7 +205,7 @@ const errorOutOfBounds = common.expectsError({ () => data[fn](min, o, i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError [ERR_INVALID_ARG_TYPE]' + name: 'TypeError [ERR_INVALID_ARG_TYPE]', }); }); @@ -216,7 +216,7 @@ const errorOutOfBounds = common.expectsError({ code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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}`, }); }); @@ -227,7 +227,7 @@ const errorOutOfBounds = common.expectsError({ code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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 3d6f81264195a6..16b33eaced30ec 100644 --- a/test/parallel/test-buffer-writeuint.js +++ b/test/parallel/test-buffer-writeuint.js @@ -124,7 +124,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 ${offset}` + `It must be >= 1 and <= 6. Received ${offset}`, } ); }); @@ -136,7 +136,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', message: 'The value of "byteLength" is out of range. ' + - `It must be an integer. Received ${byteLength}` + `It must be an integer. Received ${byteLength}`, }); }); }); @@ -150,7 +150,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', message: 'The value of "value" is out of range. ' + - `It must be >= 0 and <= ${val - 1}. Received ${val}` + `It must be >= 0 and <= ${val - 1}. Received ${val}`, }); ['', '0', null, undefined, {}, [], () => {}, true, false].forEach((o) => { @@ -158,7 +158,7 @@ const assert = require('assert'); () => data[fn](23, o, i), { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError [ERR_INVALID_ARG_TYPE]' + name: 'TypeError [ERR_INVALID_ARG_TYPE]', }); }); @@ -169,7 +169,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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}`, }); }); @@ -180,7 +180,7 @@ const assert = require('assert'); code: 'ERR_OUT_OF_RANGE', name: 'RangeError [ERR_OUT_OF_RANGE]', 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-zero-fill-cli.js b/test/parallel/test-buffer-zero-fill-cli.js index 91679498a1a560..33bdab7ee4eb58 100644 --- a/test/parallel/test-buffer-zero-fill-cli.js +++ b/test/parallel/test-buffer-zero-fill-cli.js @@ -24,7 +24,7 @@ for (let i = 0; i < 50; i++) { Buffer.allocUnsafe(20), SlowBuffer(20), Buffer(20), - new SlowBuffer(20) + new SlowBuffer(20), ]; for (const buf of bufs) { assert(isZeroFilled(buf)); diff --git a/test/parallel/test-c-ares.js b/test/parallel/test-c-ares.js index 8ba221ca99ee4b..02fa132bee7d15 100644 --- a/test/parallel/test-c-ares.js +++ b/test/parallel/test-c-ares.js @@ -50,14 +50,14 @@ dns.lookup('::1', common.mustCall((error, result, addressType) => { // Try calling resolve with an unsupported type. 'HI', // Try calling resolve with an unsupported type that's an object key - 'toString' + 'toString', ].forEach((val) => { common.expectsError( () => dns.resolve('www.google.com', val), { code: 'ERR_INVALID_OPT_VALUE', type: TypeError, - message: `The value "${val}" is invalid for option "rrtype"` + message: `The value "${val}" is invalid for option "rrtype"`, } ); }); diff --git a/test/parallel/test-child-process-can-write-to-stdout.js b/test/parallel/test-child-process-can-write-to-stdout.js index bb9ddb71c827bc..069e07fb160282 100644 --- a/test/parallel/test-child-process-can-write-to-stdout.js +++ b/test/parallel/test-child-process-can-write-to-stdout.js @@ -8,7 +8,7 @@ const assert = require('assert'); const spawn = require('child_process').spawn; const child = spawn(process.argv[0], [ - fixtures.path('GH-1899-output.js') + fixtures.path('GH-1899-output.js'), ]); let output = ''; diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index 33bcdcb66981fe..5ed7f2dd65aefa 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -20,7 +20,7 @@ function typeName(value) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options" argument must be of type Object. ' + - `Received type ${typeName(options)}` + `Received type ${typeName(options)}`, }); }); } @@ -36,7 +36,7 @@ function typeName(value) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.file" property must be of type string. ' + - `Received type ${typeName(file)}` + `Received type ${typeName(file)}`, }); }); } @@ -52,7 +52,7 @@ function typeName(value) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.envPairs" property must be of type Array. ' + - `Received type ${typeName(envPairs)}` + `Received type ${typeName(envPairs)}`, }); }); } @@ -68,7 +68,7 @@ function typeName(value) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.args" property must be of type Array. ' + - `Received type ${typeName(args)}` + `Received type ${typeName(args)}`, }); }); } @@ -79,7 +79,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-custom-fds.js b/test/parallel/test-child-process-custom-fds.js index 910babdd6fb823..935efebec5d023 100644 --- a/test/parallel/test-child-process-custom-fds.js +++ b/test/parallel/test-child-process-custom-fds.js @@ -17,7 +17,7 @@ const oldSpawnSync = internalCp.spawnSync; assert.deepStrictEqual(opts.options.stdio, [ { type: 'pipe', readable: true, writable: false }, { type: 'fd', fd: process.stdout.fd }, - { type: 'fd', fd: process.stderr.fd } + { type: 'fd', fd: process.stderr.fd }, ]); }); common.spawnSyncPwd({ customFds }); @@ -32,7 +32,7 @@ const oldSpawnSync = internalCp.spawnSync; assert.deepStrictEqual(opts.options.stdio, [ { type: 'pipe', readable: true, writable: false }, { type: 'pipe', readable: false, writable: true }, - { type: 'pipe', readable: false, writable: true } + { type: 'pipe', readable: false, writable: true }, ]); }); common.spawnSyncPwd({ customFds, stdio: 'pipe' }); diff --git a/test/parallel/test-child-process-env.js b/test/parallel/test-child-process-env.js index a819c5a64ee36c..6960ad3979a49f 100644 --- a/test/parallel/test-child-process-env.js +++ b/test/parallel/test-child-process-env.js @@ -30,10 +30,10 @@ const env = { 'HELLO': 'WORLD', 'UNDEFINED': undefined, 'NULL': null, - 'EMPTY': '' + 'EMPTY': '', }; Object.setPrototypeOf(env, { - 'FOO': 'BAR' + 'FOO': 'BAR', }); let child; diff --git a/test/parallel/test-child-process-exec-timeout.js b/test/parallel/test-child-process-exec-timeout.js index e08aff908522f2..e353e962d37562 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-fork-exec-path.js b/test/parallel/test-child-process-fork-exec-path.js index 8b94ef62a93bc8..b686f339ae7bfd 100644 --- a/test/parallel/test-child-process-fork-exec-path.js +++ b/test/parallel/test-child-process-fork-exec-path.js @@ -52,7 +52,7 @@ if (process.env.FORK) { envCopy.FORK = 'true'; const child = require('child_process').fork(__filename, { execPath: copyPath, - env: envCopy + env: envCopy, }); child.on('message', common.mustCall(function(recv) { assert.deepStrictEqual(msg, recv); diff --git a/test/parallel/test-child-process-fork-no-shell.js b/test/parallel/test-child-process-fork-no-shell.js index 168f115b0cbcbf..1c143a4d9a29d3 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: Object.assign({}, process.env, { foo: 'bar' }) + env: Object.assign({}, 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 d8e7abfe28944d..2e292627e0a7ee 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-recv-handle.js b/test/parallel/test-child-process-recv-handle.js index 24c6b07037f2d0..5f01f2bd3fbb29 100644 --- a/test/parallel/test-child-process-recv-handle.js +++ b/test/parallel/test-child-process-recv-handle.js @@ -37,7 +37,7 @@ function master() { // spawn() can only create one IPC channel so we use stdin/stdout as an // ad-hoc command channel. const proc = spawn(process.execPath, [__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 4e26d1261866a0..ae47b673de47cd 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({ type: 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-set-blocking.js b/test/parallel/test-child-process-set-blocking.js index bca886ed55cb16..f968ebb5bdb286 100644 --- a/test/parallel/test-child-process-set-blocking.js +++ b/test/parallel/test-child-process-set-blocking.js @@ -27,7 +27,7 @@ const ch = require('child_process'); const SIZE = 100000; 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 e9a753e91a4e48..ab10c1772d66f1 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: Object.assign({}, process.env, { BAZ: 'buzz' }), encoding: 'utf8', - shell: true + shell: true, }); let envOutput = ''; 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 3ea4eae2c449e3..704e5b34c5f68e 100644 --- a/test/parallel/test-child-process-spawnsync-input.js +++ b/test/parallel/test-child-process-spawnsync-input.js @@ -35,7 +35,7 @@ const msgErrBuf = Buffer.from(`${msgErr}\n`); const args = [ '-e', - `console.log("${msgOut}"); console.error("${msgErr}");` + `console.log("${msgOut}"); console.error("${msgErr}");`, ]; let ret; @@ -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, }; common.expectsError( @@ -81,7 +81,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: 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); @@ -101,7 +101,7 @@ assert.deepStrictEqual(ret.stdout, options.input); assert.deepStrictEqual(ret.stderr, Buffer.from('')); options = { - input: Uint8Array.from(Buffer.from('hello world')) + input: Uint8Array.from(Buffer.from('hello world')), }; ret = spawnSync('cat', [], options); diff --git a/test/parallel/test-child-process-spawnsync-maxbuf.js b/test/parallel/test-child-process-spawnsync-maxbuf.js index 022c090c338d13..21992c25eb21dd 100644 --- a/test/parallel/test-child-process-spawnsync-maxbuf.js +++ b/test/parallel/test-child-process-spawnsync-maxbuf.js @@ -11,7 +11,7 @@ const msgOutBuf = Buffer.from(`${msgOut}\n`); const args = [ '-e', - `console.log("${msgOut}");` + `console.log("${msgOut}");`, ]; // Verify that an error is returned if maxBuffer is surpassed. diff --git a/test/parallel/test-child-process-spawnsync-shell.js b/test/parallel/test-child-process-spawnsync-shell.js index 3eba0ba869f605..c122b0ae8df4b4 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: Object.assign({}, process.env, { BAZ: 'buzz' }), - shell: true + shell: true, }); assert.strictEqual(env.stdout.toString().trim(), 'buzz'); diff --git a/test/parallel/test-child-process-spawnsync.js b/test/parallel/test-child-process-spawnsync.js index 6ff7b41edaba71..c344ba7e710574 100644 --- a/test/parallel/test-child-process-spawnsync.js +++ b/test/parallel/test-child-process-spawnsync.js @@ -57,6 +57,6 @@ assert.deepStrictEqual(ret_err.spawnargs, ['bar']); assert.deepStrictEqual([ null, noEncoding.stdout.toString(), - noEncoding.stderr.toString() + noEncoding.stderr.toString(), ], utf8Encoding.output); } diff --git a/test/parallel/test-child-process-stdin-ipc.js b/test/parallel/test-child-process-stdin-ipc.js index b162ced916096d..584b678015ee10 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-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 4c4f137110b67e..da2ca7dabef0b1 100644 --- a/test/parallel/test-child-process-validate-stdio.js +++ b/test/parallel/test-child-process-validate-stdio.js @@ -37,9 +37,9 @@ common.expectsError(() => _validateStdio(stdio2, true), stdio: [ { type: 'fd', fd: 0 }, { type: 'fd', fd: 1 }, - { type: 'fd', fd: 2 } + { type: 'fd', fd: 2 }, ], ipc: undefined, - ipcFd: undefined + ipcFd: undefined, }); } diff --git a/test/parallel/test-cli-syntax.js b/test/parallel/test-cli-syntax.js index 0b1010c4dad2ec..05394646b95254 100644 --- a/test/parallel/test-cli-syntax.js +++ b/test/parallel/test-cli-syntax.js @@ -10,7 +10,7 @@ const node = process.execPath; // test both sets of arguments that check syntax const syntaxArgs = [ ['-c'], - ['--check'] + ['--check'], ]; // Match on the name of the `Error` but not the message as it is different @@ -24,7 +24,7 @@ const notFoundRE = /^Error: Cannot find module/m; 'syntax/good_syntax', 'syntax/good_syntax_shebang.js', 'syntax/good_syntax_shebang', - 'syntax/illegal_if_not_wrapped.js' + 'syntax/illegal_if_not_wrapped.js', ].forEach(function(file) { file = fixtures.path(file); @@ -46,7 +46,7 @@ const notFoundRE = /^Error: Cannot find module/m; 'syntax/bad_syntax.js', 'syntax/bad_syntax', 'syntax/bad_syntax_shebang.js', - 'syntax/bad_syntax_shebang' + 'syntax/bad_syntax_shebang', ].forEach(function(file) { file = fixtures.path(file); @@ -73,7 +73,7 @@ const notFoundRE = /^Error: Cannot find module/m; // test file not found [ 'syntax/file_not_found.js', - 'syntax/file_not_found' + 'syntax/file_not_found', ].forEach(function(file) { file = fixtures.path(file); diff --git a/test/parallel/test-cluster-basic.js b/test/parallel/test-cluster-basic.js index 8a0a41f90c59d9..a74052ff70d3e3 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-fork-env.js b/test/parallel/test-cluster-fork-env.js index 57e7881013d0fd..1fa726d09ad4e2 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 1d00e0768e5746..607cb7f41dd66b 100644 --- a/test/parallel/test-cluster-fork-stdio.js +++ b/test/parallel/test-cluster-fork-stdio.js @@ -8,7 +8,7 @@ if (cluster.isMaster) { const buf = Buffer.from('foobar'); cluster.setupMaster({ - 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 a7476983f9e39d..c76f6d73a00d3d 100644 --- a/test/parallel/test-cluster-fork-windowsHide.js +++ b/test/parallel/test-cluster-fork-windowsHide.js @@ -29,7 +29,7 @@ if (!process.argv[2]) { workerExit: common.mustCall((msg) => { assert.strictEqual(msg.code, 0); assert.strictEqual(msg.signal, null); - }) + }), }; master.on('message', (msg) => { @@ -46,7 +46,7 @@ if (!process.argv[2]) { } else if (cluster.isMaster) { cluster.setupMaster({ silient: 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 006c80a7aae8fc..6d79594278c191 100644 --- a/test/parallel/test-cluster-invalid-message.js +++ b/test/parallel/test-cluster-invalid-message.js @@ -14,7 +14,7 @@ if (cluster.isMaster) { worker.on('online', () => { worker.send({ cmd: 'NODE_CLUSTER', - ack: -1 + ack: -1, }, () => { worker.disconnect(); }); diff --git a/test/parallel/test-cluster-master-error.js b/test/parallel/test-cluster-master-error.js index 9abb42e4225567..2809eff7b79c2b 100644 --- a/test/parallel/test-cluster-master-error.js +++ b/test/parallel/test-cluster-master-error.js @@ -42,7 +42,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-master-kill.js b/test/parallel/test-cluster-master-kill.js index 4e21d8e906cfaf..47486dad30920a 100644 --- a/test/parallel/test-cluster-master-kill.js +++ b/test/parallel/test-cluster-master-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-message.js b/test/parallel/test-cluster-message.js index 5585a64d48149d..3265a3d21ea070 100644 --- a/test/parallel/test-cluster-message.js +++ b/test/parallel/test-cluster-message.js @@ -43,7 +43,7 @@ if (cluster.isWorker) { // Tell master 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, }, master: { 'receive': false, - 'correct': false + 'correct': false, }, worker: { 'receive': false, - 'correct': false - } + 'correct': false, + }, }; diff --git a/test/parallel/test-cluster-send-handle-twice.js b/test/parallel/test-cluster-send-handle-twice.js index fc0d4a03085aec..b0036fc3ddc159 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.isMaster) { @@ -48,7 +48,7 @@ if (cluster.isMaster) { 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(); })); setTimeout(function() { client.end(); }, 50); diff --git a/test/parallel/test-cluster-setup-master.js b/test/parallel/test-cluster-setup-master.js index 619a8439904d92..4f4eba9cddb902 100644 --- a/test/parallel/test-cluster-setup-master.js +++ b/test/parallel/test-cluster-setup-master.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 master cluster.setupMaster({ 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 71c151410cdb2c..9668c195d0ab15 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 ba9c4f8775760e..a8bf1f45da9e5b 100644 --- a/test/parallel/test-cluster-worker-exit.js +++ b/test/parallel/test-cluster-worker-exit.js @@ -53,17 +53,17 @@ if (cluster.isWorker) { worker_emitExit: [1, "the worker did not emit 'exit'"], worker_state: ['disconnected', 'the worker state is incorrect'], worker_exitedAfterDisconnect: [ - false, 'the .exitedAfterDisconnect flag is incorrect' + false, 'the .exitedAfterDisconnect flag is incorrect', ], 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 bb2d3495d95a4d..d2e248623fbce9 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-common-countdown.js b/test/parallel/test-common-countdown.js index 6a1a2f1bbce98a..d3c0daf599670c 100644 --- a/test/parallel/test-common-countdown.js +++ b/test/parallel/test-common-countdown.js @@ -19,7 +19,7 @@ const failFixtures = [ [ fixtures.path('failcounter.js'), 'Mismatched function calls. Expected exactly 1, actual 0.', - ] + ], ]; for (const p of failFixtures) { diff --git a/test/parallel/test-common.js b/test/parallel/test-common.js index 7a89b37660d5f6..b2f03d20c10ec6 100644 --- a/test/parallel/test-common.js +++ b/test/parallel/test-common.js @@ -49,7 +49,7 @@ common.expectsError( () => { assert.fail('fhqwhgads'); }, { code: 'ERR_ASSERTION', - message: /^fhqwhgads$/ + message: /^fhqwhgads$/, }); const fnOnce = common.mustCall(() => {}); @@ -73,11 +73,11 @@ fnAtLeast2Called3(); const failFixtures = [ [ fixtures.path('failmustcall1.js'), - 'Mismatched function calls. Expected exactly 2, actual 1.' + 'Mismatched function calls. Expected exactly 2, actual 1.', ], [ fixtures.path('failmustcall2.js'), - 'Mismatched function calls. Expected at least 2, actual 1.' - ] + 'Mismatched function calls. Expected at least 2, actual 1.', + ], ]; for (const p of failFixtures) { const [file, expected] = p; diff --git a/test/parallel/test-console-assign-undefined.js b/test/parallel/test-console-assign-undefined.js index 1c47b3bda784bb..d5f70053092167 100644 --- a/test/parallel/test-console-assign-undefined.js +++ b/test/parallel/test-console-assign-undefined.js @@ -17,7 +17,7 @@ assert.strictEqual(global.console, 42); common.expectsError( () => console.log('foo'), { - type: TypeError + type: TypeError, } ); 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-instance.js b/test/parallel/test-console-instance.js index 2fd07ac41219a9..efedf650547719 100644 --- a/test/parallel/test-console-instance.js +++ b/test/parallel/test-console-instance.js @@ -42,7 +42,7 @@ common.expectsError( { code: 'ERR_CONSOLE_WRITABLE_STREAM', type: TypeError, - message: /stdout/ + message: /stdout/, } ); @@ -56,7 +56,7 @@ common.expectsError( { code: 'ERR_CONSOLE_WRITABLE_STREAM', type: TypeError, - message: /stderr/ + message: /stderr/, } ); 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-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.js b/test/parallel/test-console.js index 4bde18d8883b06..354a77a89cb8b5 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -158,7 +158,7 @@ console.timeEnd('label3'); assert.strictEqual(console._times.size, timesMapSize); const expectedStrings = [ - 'foo', 'foo bar', 'foo bar hop', "{ slashes: '\\\\\\\\' }", 'inspect' + 'foo', 'foo bar', 'foo bar hop', "{ slashes: '\\\\\\\\' }", 'inspect', ]; for (const expected of expectedStrings) { diff --git a/test/parallel/test-crypto-authenticated.js b/test/parallel/test-crypto-authenticated.js index c016b3500dec81..5408998b287317 100644 --- a/test/parallel/test-crypto-authenticated.js +++ b/test/parallel/test-crypto-authenticated.js @@ -346,7 +346,7 @@ expectedDeprecationWarnings.push('crypto.DEFAULT_ENCODING is deprecated.'); common.expectWarning({ Warning: expectedWarnings, - DeprecationWarning: expectedDeprecationWarnings + DeprecationWarning: expectedDeprecationWarnings, }); for (const test of TEST_CASES) { diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index 6cdc894753c3ac..faf50bad77eb96 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -86,8 +86,8 @@ assert.throws(function() { sha512: '87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b305' + '45e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f170' + - '2e696c203a126854' - } + '2e696c203a126854', + }, }, { key: Buffer.from('4a656665', 'hex'), // 'Jefe' @@ -104,8 +104,8 @@ assert.throws(function() { sha512: '164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7' + 'ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b' + - '636e070a38bce737' - } + '636e070a38bce737', + }, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'), @@ -123,8 +123,8 @@ assert.throws(function() { sha512: 'fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33' + 'b2279d39bf3e848279a722c806b485a47e67c807b946a337bee89426' + - '74278859e13292fb' - } + '74278859e13292fb', + }, }, { key: Buffer.from('0102030405060708090a0b0c0d0e0f10111213141516171819', @@ -143,8 +143,8 @@ assert.throws(function() { sha512: 'b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050' + '361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2d' + - 'e2adebeb10a298dd' - } + 'e2adebeb10a298dd', + }, }, { key: Buffer.from('0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c', 'hex'), @@ -154,9 +154,9 @@ assert.throws(function() { sha224: '0e2aea68a90c8d37c988bcdb9fca6fa8', sha256: 'a3b6167473100ee06e0c796c2955552b', sha384: '3abf34c3503b2a23a46efc619baef897', - sha512: '415fad6271580a531d4179bc891d87a6' + sha512: '415fad6271580a531d4179bc891d87a6', }, - truncate: true + truncate: true, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -180,8 +180,8 @@ assert.throws(function() { sha512: '80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b0137' + '83f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec' + - '8b915a985d786598' - } + '8b915a985d786598', + }, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -211,9 +211,9 @@ assert.throws(function() { sha512: 'e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d' + '20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de04460' + - '65c97440fa8c6a58' - } - } + '65c97440fa8c6a58', + }, + }, ]; for (const testCase of rfc4231) { @@ -238,19 +238,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', @@ -259,12 +259,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' + @@ -273,7 +273,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' + @@ -284,19 +284,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'), @@ -304,7 +304,7 @@ assert.throws(function() { 'ddddddddddddddddddddddddddddddddddddddddddddd' + 'dddddddddd', 'hex'), - hmac: '125d7342b9ac11cd91a39af48aa17b4f63f175d3' + hmac: '125d7342b9ac11cd91a39af48aa17b4f63f175d3', }, { key: Buffer.from('0102030405060708090a0b0c0d0e0f10111213141516171819', @@ -313,12 +313,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' + @@ -327,7 +327,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' + @@ -338,8 +338,8 @@ assert.throws(function() { data: 'Test Using Larger Than Block-Size Key and Larger Than One ' + 'Block-Size Data', - hmac: 'e8e99d0f45237d786d6bbaa7965c7808bbff1a91' - } + hmac: 'e8e99d0f45237d786d6bbaa7965c7808bbff1a91', + }, ]; if (!common.hasFipsCrypto) { @@ -575,7 +575,7 @@ common.expectsError( () => crypto.createHash('sha1').update({ foo: 'bar' }), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); diff --git a/test/parallel/test-crypto-certificate.js b/test/parallel/test-crypto-certificate.js index 36742154efd64c..f9a6d51321cc57 100644 --- a/test/parallel/test-crypto-certificate.js +++ b/test/parallel/test-crypto-certificate.js @@ -88,7 +88,7 @@ assert(Certificate() instanceof Certificate); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "spkac" argument must be one of type Buffer, TypedArray, ' + - 'or DataView' + 'or DataView', } ); }); @@ -100,7 +100,7 @@ assert(Certificate() instanceof Certificate); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "spkac" argument must be one of type string, Buffer,' + - ' TypedArray, or DataView' + ' TypedArray, or DataView', } ); @@ -110,7 +110,7 @@ assert(Certificate() instanceof Certificate); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "spkac" argument must be one of type string, Buffer,' + - ' TypedArray, or DataView' + ' TypedArray, or DataView', } ); }); diff --git a/test/parallel/test-crypto-cipher-decipher.js b/test/parallel/test-crypto-cipher-decipher.js index b34f43377c5775..33736869407ddf 100644 --- a/test/parallel/test-crypto-cipher-decipher.js +++ b/test/parallel/test-crypto-cipher-decipher.js @@ -81,7 +81,7 @@ testCipher2(Buffer.from('0123456789abcdef')); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "cipher" argument must be of type string' + message: 'The "cipher" argument must be of type string', }); common.expectsError( @@ -90,7 +90,7 @@ testCipher2(Buffer.from('0123456789abcdef')); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "password" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', }); common.expectsError( @@ -99,7 +99,7 @@ testCipher2(Buffer.from('0123456789abcdef')); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "data" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', }); common.expectsError( @@ -108,7 +108,7 @@ testCipher2(Buffer.from('0123456789abcdef')); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "buffer" argument must be one of type Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', }); common.expectsError( @@ -117,7 +117,7 @@ testCipher2(Buffer.from('0123456789abcdef')); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "buffer" argument must be one of type Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', }); } @@ -132,7 +132,7 @@ testCipher2(Buffer.from('0123456789abcdef')); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "cipher" argument must be of type string' + message: 'The "cipher" argument must be of type string', }); common.expectsError( @@ -141,7 +141,7 @@ testCipher2(Buffer.from('0123456789abcdef')); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "password" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', }); } @@ -245,7 +245,7 @@ testCipher2(Buffer.from('0123456789abcdef')); { code: 'ERR_CRYPTO_INVALID_STATE', type: Error, - message: 'Invalid state for operation getAuthTag' + message: 'Invalid state for operation getAuthTag', } ); @@ -263,7 +263,7 @@ testCipher2(Buffer.from('0123456789abcdef')); { code: 'ERR_CRYPTO_INVALID_STATE', type: Error, - message: 'Invalid state for operation setAAD' + message: 'Invalid state for operation setAAD', }); common.expectsError( @@ -271,7 +271,7 @@ testCipher2(Buffer.from('0123456789abcdef')); { code: 'ERR_CRYPTO_INVALID_STATE', type: Error, - message: 'Invalid state for operation setAuthTag' + message: 'Invalid state for operation setAuthTag', }); common.expectsError( @@ -279,7 +279,7 @@ testCipher2(Buffer.from('0123456789abcdef')); { code: 'ERR_CRYPTO_INVALID_STATE', type: 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 dcdec728f1e3eb..f4ff2fe80fbda7 100644 --- a/test/parallel/test-crypto-cipheriv-decipheriv.js +++ b/test/parallel/test-crypto-cipheriv-decipheriv.js @@ -92,7 +92,7 @@ function testCipher3(key, iv) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "cipher" argument must be of type string' + message: 'The "cipher" argument must be of type string', }); common.expectsError( @@ -101,7 +101,7 @@ function testCipher3(key, iv) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "key" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', }); common.expectsError( @@ -110,7 +110,7 @@ function testCipher3(key, iv) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "iv" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', }); } @@ -128,7 +128,7 @@ function testCipher3(key, iv) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "cipher" argument must be of type string' + message: 'The "cipher" argument must be of type string', }); common.expectsError( @@ -137,7 +137,7 @@ function testCipher3(key, iv) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "key" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', }); common.expectsError( @@ -146,7 +146,7 @@ function testCipher3(key, iv) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "iv" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', }); } diff --git a/test/parallel/test-crypto-classes.js b/test/parallel/test-crypto-classes.js index 78d248c2b2850c..d89f1e43d5ff42 100644 --- a/test/parallel/test-crypto-classes.js +++ b/test/parallel/test-crypto-classes.js @@ -19,7 +19,7 @@ const TEST_CASES = { 'DiffieHellman': [1024], 'DiffieHellmanGroup': ['modp5'], 'ECDH': ['prime256v1'], - 'Credentials': [] + 'Credentials': [], }; if (!common.hasFipsCrypto) { diff --git a/test/parallel/test-crypto-deprecated.js b/test/parallel/test-crypto-deprecated.js index acdd71301fbed0..c38b43d8115184 100644 --- a/test/parallel/test-crypto-deprecated.js +++ b/test/parallel/test-crypto-deprecated.js @@ -9,7 +9,8 @@ const tls = require('tls'); common.expectWarning('DeprecationWarning', [ 'crypto.Credentials is deprecated. Use tls.SecureContext instead.', - 'crypto.createCredentials is deprecated. Use tls.createSecureContext instead.' + 'crypto.createCredentials is deprecated.' + + ' Use tls.createSecureContext instead.', ]); // Accessing the deprecated function is enough to trigger the warning event. diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js index 6b2b8faa36b89a..3a867803b15da6 100644 --- a/test/parallel/test-crypto-dh.js +++ b/test/parallel/test-crypto-dh.js @@ -48,7 +48,7 @@ assert.strictEqual(dh2.verifyError, 0); [0x1, 0x2], () => { }, /abc/, - {} + {}, ].forEach((i) => { common.expectsError( () => crypto.createDiffieHellman(i), @@ -56,7 +56,7 @@ assert.strictEqual(dh2.verifyError, 0); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "sizeOrKey" argument must be one of type number, string, ' + - 'Buffer, TypedArray, or DataView' + 'Buffer, TypedArray, or DataView', } ); }); @@ -141,7 +141,7 @@ const modp2buf = Buffer.from([ 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, 0xee, 0x38, 0x6b, 0xfb, 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, 0x7c, 0x4b, 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe6, 0x53, 0x81, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, ]); { @@ -237,7 +237,7 @@ if (availableCurves.has('prime256v1') && availableCurves.has('secp256k1')) { { code: 'ERR_CRYPTO_ECDH_INVALID_FORMAT', type: TypeError, - message: 'Invalid ECDH format: 10' + message: 'Invalid ECDH format: 10', }); // ECDH should check that point is on curve @@ -249,7 +249,7 @@ if (availableCurves.has('prime256v1') && availableCurves.has('secp256k1')) { { code: 'ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY', type: Error, - message: 'Public key is not valid for specified curve' + message: 'Public key is not valid for specified curve', }); // ECDH should allow .setPrivateKey()/.setPublicKey() @@ -362,7 +362,7 @@ if (availableCurves.has('prime256v1') && availableHashes.has('sha256')) { { code: 'ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY', type: 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 = @@ -380,5 +380,5 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "curve" argument must be of type string' + message: 'The "curve" argument must be of type string', }); diff --git a/test/parallel/test-crypto-engine.js b/test/parallel/test-crypto-engine.js index 43f8b8084c7fe9..90fa8248124717 100644 --- a/test/parallel/test-crypto-engine.js +++ b/test/parallel/test-crypto-engine.js @@ -12,7 +12,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "id" argument must be of type string' + message: 'The "id" argument must be of type string', }); common.expectsError( @@ -20,7 +20,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "flags" argument must be of type number' + message: 'The "flags" argument must be of type number', }); common.expectsError( @@ -28,7 +28,7 @@ common.expectsError( { code: 'ERR_CRYPTO_ENGINE_UNKNOWN', type: Error, - message: `Engine "${invalidEngineName}" was not found` + message: `Engine "${invalidEngineName}" was not found`, }); common.expectsError( @@ -36,5 +36,5 @@ common.expectsError( { code: 'ERR_CRYPTO_ENGINE_UNKNOWN', type: 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 7810d572ade56a..74d8b964ef2d19 100644 --- a/test/parallel/test-crypto-fips.js +++ b/test/parallel/test-crypto-fips.js @@ -35,7 +35,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-hash.js b/test/parallel/test-crypto-hash.js index bf080b1970369e..2e888864d739ee 100644 --- a/test/parallel/test-crypto-hash.js +++ b/test/parallel/test-crypto-hash.js @@ -129,21 +129,21 @@ common.expectsError( () => h3.digest(), { code: 'ERR_CRYPTO_HASH_FINALIZED', - type: Error + type: Error, }); common.expectsError( () => h3.update('foo'), { code: 'ERR_CRYPTO_HASH_FINALIZED', - type: Error + type: Error, }); common.expectsError( () => crypto.createHash('sha256').digest('ucs2'), { code: 'ERR_CRYPTO_HASH_DIGEST_NO_UTF16', - type: Error + type: Error, } ); @@ -152,7 +152,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "algorithm" argument must be of type string' + message: 'The "algorithm" argument must be of type string', } ); diff --git a/test/parallel/test-crypto-hmac.js b/test/parallel/test-crypto-hmac.js index 92fa16f98cda44..684c7645c470a6 100644 --- a/test/parallel/test-crypto-hmac.js +++ b/test/parallel/test-crypto-hmac.js @@ -18,7 +18,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "hmac" argument must be of type string' + message: 'The "hmac" argument must be of type string', }); common.expectsError( @@ -27,7 +27,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "key" argument must be one of type string, TypedArray, or ' + - 'DataView' + 'DataView', }); { @@ -51,8 +51,8 @@ const wikipedia = [ sha1: 'de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9', sha256: 'f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc' + - '2d1a3cd8' - } + '2d1a3cd8', + }, }, { key: 'key', data: '', @@ -61,8 +61,8 @@ const wikipedia = [ sha1: 'f42bb0eeb018ebbd4597ae7213711ec60760843f', sha256: '5d5d139563c95b5967b9bd9a8c9b233a9dedb45072794cd232dc1b74' + - '832607d0' - } + '832607d0', + }, }, { key: '', data: 'The quick brown fox jumps over the lazy dog', @@ -71,8 +71,8 @@ const wikipedia = [ sha1: '2ba7f707ad5f187c412de3106583c3111d668de8', sha256: 'fb011e6154a19b9a4c767373c305275a5a69e8b68b0b4c9200c383dc' + - 'ed19a416' - } + 'ed19a416', + }, }, { key: '', data: '', @@ -81,8 +81,8 @@ const wikipedia = [ sha1: 'fbdb1d1b18aa6c08324b7d64b71fb76370690e1d', sha256: 'b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c71214' + - '4292c5ad' - } + '4292c5ad', + }, }, ]; @@ -120,8 +120,8 @@ const rfc4231 = [ sha512: '87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b305' + '45e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f170' + - '2e696c203a126854' - } + '2e696c203a126854', + }, }, { key: Buffer.from('4a656665', 'hex'), // 'Jefe' @@ -138,8 +138,8 @@ const rfc4231 = [ sha512: '164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7' + 'ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b' + - '636e070a38bce737' - } + '636e070a38bce737', + }, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'hex'), @@ -157,8 +157,8 @@ const rfc4231 = [ sha512: 'fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33' + 'b2279d39bf3e848279a722c806b485a47e67c807b946a337bee89426' + - '74278859e13292fb' - } + '74278859e13292fb', + }, }, { key: Buffer.from('0102030405060708090a0b0c0d0e0f10111213141516171819', @@ -177,8 +177,8 @@ const rfc4231 = [ sha512: 'b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050' + '361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2d' + - 'e2adebeb10a298dd' - } + 'e2adebeb10a298dd', + }, }, { @@ -189,9 +189,9 @@ const rfc4231 = [ sha224: '0e2aea68a90c8d37c988bcdb9fca6fa8', sha256: 'a3b6167473100ee06e0c796c2955552b', sha384: '3abf34c3503b2a23a46efc619baef897', - sha512: '415fad6271580a531d4179bc891d87a6' + sha512: '415fad6271580a531d4179bc891d87a6', }, - truncate: true + truncate: true, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -215,8 +215,8 @@ const rfc4231 = [ sha512: '80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b0137' + '83f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec' + - '8b915a985d786598' - } + '8b915a985d786598', + }, }, { key: Buffer.from('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + @@ -246,9 +246,9 @@ const rfc4231 = [ sha512: 'e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d' + '20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de04460' + - '65c97440fa8c6a58' - } - } + '65c97440fa8c6a58', + }, + }, ]; for (let i = 0, l = rfc4231.length; i < l; i++) { @@ -278,19 +278,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', @@ -299,12 +299,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' + @@ -313,7 +313,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' + @@ -324,19 +324,19 @@ const rfc2202_md5 = [ 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'), @@ -344,7 +344,7 @@ const rfc2202_sha1 = [ 'ddddddddddddddddddddddddddddddddddddddddddddd' + 'dddddddddd', 'hex'), - hmac: '125d7342b9ac11cd91a39af48aa17b4f63f175d3' + hmac: '125d7342b9ac11cd91a39af48aa17b4f63f175d3', }, { key: Buffer.from('0102030405060708090a0b0c0d0e0f10111213141516171819', @@ -353,12 +353,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' + @@ -367,7 +367,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' + @@ -378,8 +378,8 @@ const rfc2202_sha1 = [ data: 'Test Using Larger Than Block-Size Key and Larger Than One ' + 'Block-Size Data', - hmac: 'e8e99d0f45237d786d6bbaa7965c7808bbff1a91' - } + hmac: 'e8e99d0f45237d786d6bbaa7965c7808bbff1a91', + }, ]; if (!common.hasFipsCrypto) { @@ -411,7 +411,7 @@ common.expectsError( () => crypto.createHmac('sha256', 'w00t').digest('ucs2'), { code: 'ERR_CRYPTO_HASH_DIGEST_NO_UTF16', - type: Error + type: Error, }); // Check initialized -> uninitialized state transition after calling digest(). diff --git a/test/parallel/test-crypto-pbkdf2.js b/test/parallel/test-crypto-pbkdf2.js index c72551016d2f42..6a4ad44fc94c95 100644 --- a/test/parallel/test-crypto-pbkdf2.js +++ b/test/parallel/test-crypto-pbkdf2.js @@ -61,7 +61,7 @@ common.expectsError( () => crypto.pbkdf2('password', 'salt', 1, 20, null), { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, } ); @@ -71,7 +71,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: RangeError, message: 'The value of "iterations" is out of range. ' + - 'It must be a non-negative number. Received -1' + 'It must be a non-negative number. Received -1', } ); @@ -82,7 +82,7 @@ common.expectsError( }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "keylen" argument must be of type number' + message: 'The "keylen" argument must be of type number', }); }); @@ -94,7 +94,7 @@ common.expectsError( }, { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "keylen" is out of range.' + message: 'The value of "keylen" is out of range.', }); }); @@ -107,7 +107,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "digest" argument must be one of type string or null' + message: 'The "digest" argument must be one of type string or null', }); common.expectsError( @@ -115,7 +115,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "digest" argument must be one of type string or null' + message: 'The "digest" argument must be one of type string or null', }); [1, {}, [], true, undefined, null].forEach((i) => { @@ -125,7 +125,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "password" argument must be one of type string, ' + - 'Buffer, or TypedArray' + 'Buffer, or TypedArray', } ); @@ -135,7 +135,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "salt" argument must be one of type string, ' + - 'Buffer, or TypedArray' + 'Buffer, or TypedArray', } ); @@ -145,7 +145,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "password" argument must be one of type string, ' + - 'Buffer, or TypedArray' + 'Buffer, or TypedArray', } ); @@ -155,7 +155,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "salt" argument must be one of type string, ' + - 'Buffer, or TypedArray' + 'Buffer, or TypedArray', } ); }); @@ -166,7 +166,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "iterations" argument must be of type number' + message: 'The "iterations" argument must be of type number', } ); @@ -175,7 +175,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "iterations" argument must be of type number' + message: 'The "iterations" argument must be of type number', } ); }); @@ -208,7 +208,7 @@ common.expectsError( { code: 'ERR_CRYPTO_INVALID_DIGEST', type: TypeError, - message: 'Invalid digest: md55' + message: 'Invalid digest: md55', } ); @@ -217,6 +217,6 @@ common.expectsError( { code: 'ERR_CRYPTO_INVALID_DIGEST', type: TypeError, - message: 'Invalid digest: md55' + message: 'Invalid digest: md55', } ); diff --git a/test/parallel/test-crypto-random.js b/test/parallel/test-crypto-random.js index 364d72448cb288..a257271638f51d 100644 --- a/test/parallel/test-crypto-random.js +++ b/test/parallel/test-crypto-random.js @@ -41,7 +41,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "size" argument must be of type (number|uint32)$/ + message: /^The "size" argument must be of type (number|uint32)$/, } ); @@ -50,7 +50,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "size" argument must be of type (number|uint32)$/ + message: /^The "size" argument must be of type (number|uint32)$/, } ); }); @@ -241,7 +241,7 @@ process.setMaxListeners(256); { const bufs = [ Buffer.alloc(10), - new Uint8Array(new Array(10).fill(0)) + new Uint8Array(new Array(10).fill(0)), ]; const max = require('buffer').kMaxLength + 1; @@ -255,7 +255,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "offset" argument must be of type number' + message: 'The "offset" argument must be of type number', } ); @@ -264,7 +264,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "offset" argument must be of type number' + message: 'The "offset" argument must be of type number', } ); @@ -273,7 +273,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "offset" argument must be of type number' + message: 'The "offset" argument must be of type number', } ); @@ -282,7 +282,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "offset" argument must be of type number' + message: 'The "offset" argument must be of type number', } ); @@ -291,7 +291,7 @@ process.setMaxListeners(256); { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "offset" is out of range.' + message: 'The value of "offset" is out of range.', } ); @@ -300,7 +300,7 @@ process.setMaxListeners(256); { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "offset" is out of range.' + message: 'The value of "offset" is out of range.', } ); @@ -309,7 +309,7 @@ process.setMaxListeners(256); { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "offset" is out of range.' + message: 'The value of "offset" is out of range.', } ); @@ -318,7 +318,7 @@ process.setMaxListeners(256); { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "offset" is out of range.' + message: 'The value of "offset" is out of range.', } ); @@ -327,7 +327,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "size" argument must be of type number' + message: 'The "size" argument must be of type number', } ); @@ -336,7 +336,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "size" argument must be of type number' + message: 'The "size" argument must be of type number', } ); @@ -345,7 +345,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "size" argument must be of type number' + message: 'The "size" argument must be of type number', } ); @@ -354,7 +354,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "size" argument must be of type number' + message: 'The "size" argument must be of type number', } ); @@ -366,7 +366,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "size" argument must be of type uint32' + message: 'The "size" argument must be of type uint32', } ); @@ -375,7 +375,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "size" argument must be of type uint32' + message: 'The "size" argument must be of type uint32', } ); @@ -384,7 +384,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "size" argument must be of type uint32' + message: 'The "size" argument must be of type uint32', } ); @@ -393,7 +393,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "size" argument must be of type uint32' + message: 'The "size" argument must be of type uint32', } ); } @@ -403,7 +403,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "offset" argument must be of type uint32' + message: 'The "offset" argument must be of type uint32', } ); @@ -412,7 +412,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "offset" argument must be of type uint32' + message: 'The "offset" argument must be of type uint32', } ); @@ -421,7 +421,7 @@ process.setMaxListeners(256); { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "size" is out of range.' + message: 'The value of "size" is out of range.', } ); @@ -430,7 +430,7 @@ process.setMaxListeners(256); { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "size" is out of range.' + message: 'The value of "size" is out of range.', } ); @@ -439,7 +439,7 @@ process.setMaxListeners(256); { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "size" is out of range.' + message: 'The value of "size" is out of range.', } ); @@ -448,7 +448,7 @@ process.setMaxListeners(256); { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "size" is out of range.' + message: 'The value of "size" is out of range.', } ); @@ -460,7 +460,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "offset" argument must be of type uint32' + message: 'The "offset" argument must be of type uint32', } ); @@ -469,7 +469,7 @@ process.setMaxListeners(256); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "offset" argument must be of type uint32' + message: 'The "offset" argument must be of type uint32', } ); } @@ -484,7 +484,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "size" argument must be of type uint32' + message: 'The "size" argument must be of type uint32', } ); @@ -494,14 +494,14 @@ common.expectsError( () => crypto.randomFillSync(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => crypto.randomFill(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index 744dc5657b089d..d72f4a57ebeca0 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -37,29 +37,29 @@ const decryptError = let 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: Buffer.from('password') + passphrase: Buffer.from('password'), }, bufferToEncrypt); decryptedBufferWithPassword = crypto.publicDecrypt({ key: rsaKeyPemEncrypted, - passphrase: Buffer.from('password') + passphrase: Buffer.from('password'), }, encryptedBuffer); assert.strictEqual(decryptedBufferWithPassword.toString(), input); @@ -81,26 +81,26 @@ const decryptError = 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: [].concat.apply([], Buffer.from('password')) + passphrase: [].concat.apply([], Buffer.from('password')), }, encryptedBuffer); }, decryptError); } @@ -116,12 +116,12 @@ function test_rsa(padding) { const encryptedBuffer = crypto.publicEncrypt({ key: rsaPubPem, - padding: padding + padding: padding, }, bufferToEncrypt); const decryptedBuffer = crypto.privateDecrypt({ key: rsaKeyPem, - padding: padding + padding: padding, }, encryptedBuffer); assert.deepStrictEqual(decryptedBuffer, input); } diff --git a/test/parallel/test-crypto-sign-verify.js b/test/parallel/test-crypto-sign-verify.js index 7619d91191617b..124b406aff5ed0 100644 --- a/test/parallel/test-crypto-sign-verify.js +++ b/test/parallel/test-crypto-sign-verify.js @@ -37,7 +37,7 @@ common.expectsError( { code: 'ERR_INVALID_OPT_VALUE', type: TypeError, - message: 'The value "undefined" is invalid for option "padding"' + message: 'The value "undefined" is invalid for option "padding"', }); common.expectsError( @@ -48,7 +48,7 @@ common.expectsError( { code: 'ERR_INVALID_OPT_VALUE', type: TypeError, - message: 'The value "undefined" is invalid for option "saltLength"' + message: 'The value "undefined" is invalid for option "saltLength"', }); // Test signing and verifying @@ -131,14 +131,14 @@ common.expectsError( getEffectiveSaltLength(crypto.constants.RSA_PSS_SALTLEN_DIGEST), crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN, getEffectiveSaltLength(crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN), - 0, 16, 32, 64, 128 + 0, 16, 32, 64, 128, ]; const verifySaltLengths = [ crypto.constants.RSA_PSS_SALTLEN_DIGEST, getEffectiveSaltLength(crypto.constants.RSA_PSS_SALTLEN_DIGEST), getEffectiveSaltLength(crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN), - 0, 16, 32, 64, 128 + 0, 16, 32, 64, 128, ]; const errMessage = /^Error:.*data too large for key size$/; @@ -151,7 +151,7 @@ common.expectsError( .sign({ key: keyPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: signSaltLength + saltLength: signSaltLength, }); }, errMessage); } else { @@ -161,7 +161,7 @@ common.expectsError( .sign({ key: keyPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: signSaltLength + saltLength: signSaltLength, }); let verified; @@ -173,7 +173,7 @@ common.expectsError( .verify({ key: certPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: verifySaltLength + saltLength: verifySaltLength, }, s4); const saltLengthCorrect = getEffectiveSaltLength(signSaltLength) === getEffectiveSaltLength(verifySaltLength); @@ -186,7 +186,7 @@ common.expectsError( .verify({ key: certPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO + saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO, }, s4); assert.strictEqual(verified, true, 'verify (PSS with SALTLEN_AUTO)'); @@ -196,7 +196,7 @@ common.expectsError( .verify({ key: certPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO + saltLength: crypto.constants.RSA_PSS_SALTLEN_AUTO, }, s4); assert.strictEqual(verified, false, 'verify (PSS, incorrect)'); } @@ -217,7 +217,7 @@ common.expectsError( .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, 'verify (PSS)'); } @@ -240,11 +240,11 @@ common.expectsError( .update('Test123') .sign({ key: keyPem, - padding: invalidValue + padding: invalidValue, }); }, { code: 'ERR_INVALID_OPT_VALUE', - type: TypeError + type: TypeError, }); common.expectsError(() => { @@ -253,11 +253,11 @@ common.expectsError( .sign({ key: keyPem, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, - saltLength: invalidValue + saltLength: invalidValue, }); }, { code: 'ERR_INVALID_OPT_VALUE', - type: TypeError + type: TypeError, }); }); @@ -266,7 +266,7 @@ common.expectsError( .update('Test123') .sign({ key: keyPem, - padding: crypto.constants.RSA_PKCS1_OAEP_PADDING + padding: crypto.constants.RSA_PKCS1_OAEP_PADDING, }); }, /^Error:.*illegal or unsupported padding mode$/); } @@ -277,7 +277,7 @@ common.expectsError( crypto.createSign('SHA1').update('Test123').sign(null, 'base64'); }, { code: 'ERR_CRYPTO_SIGN_KEY_REQUIRED', - type: Error + type: Error, }); } @@ -294,7 +294,7 @@ common.expectsError( .update(msg) .sign({ key: privkey, - padding: crypto.constants.RSA_PKCS1_PSS_PADDING + padding: crypto.constants.RSA_PKCS1_PSS_PADDING, }); const tmpdir = require('../common/tmpdir'); @@ -321,7 +321,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "algorithm" argument must be of type string' + message: 'The "algorithm" argument must be of type string', } ); common.expectsError( @@ -329,7 +329,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "algorithm" argument must be of type string' + message: 'The "algorithm" argument must be of type string', } ); }); @@ -345,7 +345,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "data" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', } ); common.expectsError( @@ -354,7 +354,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "data" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', } ); common.expectsError( @@ -363,7 +363,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "data" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', } ); common.expectsError( @@ -372,13 +372,13 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "data" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', } ); }); [ - Uint8Array, Uint16Array, Uint32Array, Float32Array, Float64Array + Uint8Array, Uint16Array, Uint32Array, Float32Array, Float64Array, ].forEach((i) => { // These should all just work sign.update(new i()); @@ -392,7 +392,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "key" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', } ); @@ -402,7 +402,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "key" argument must be one of type string, Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', } ); @@ -412,7 +412,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "signature" argument must be one of type string, ' + - 'Buffer, TypedArray, or DataView' + 'Buffer, TypedArray, or DataView', } ); }); diff --git a/test/parallel/test-crypto-verify-failure.js b/test/parallel/test-crypto-verify-failure.js index 72dfb926413d8b..997ff39db4101b 100644 --- a/test/parallel/test-crypto-verify-failure.js +++ b/test/parallel/test-crypto-verify-failure.js @@ -35,7 +35,7 @@ const certPem = fixtures.readSync('test_cert.pem', 'ascii'); 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) => { @@ -56,7 +56,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.js b/test/parallel/test-crypto.js index 1fc3db74828ca6..f85ccdf5021e84 100644 --- a/test/parallel/test-crypto.js +++ b/test/parallel/test-crypto.js @@ -97,7 +97,7 @@ common.expectsError( () => crypto.createHash('sha1').update({ foo: 'bar' }), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); @@ -207,7 +207,7 @@ assert.throws(function() { 'eKN7LggbF3Dk5wIQN6SL+fQ5H/+7NgARsVBp0QIRANxYRukavs4QvuyNhMx+vrkCEQCbf6j/', 'Ig6/HueCK/0Jkmp+', '-----END RSA PRIVATE KEY-----', - '' + '', ].join('\n'); crypto.createSign('SHA256').update('test').sign(priv); }, (err) => { @@ -290,9 +290,9 @@ testEncoding(undefined, assertionHashUtf8); testEncoding({}, assertionHashUtf8); testEncoding({ - defaultEncoding: 'utf8' + defaultEncoding: 'utf8', }, assertionHashUtf8); testEncoding({ - defaultEncoding: 'latin1' + defaultEncoding: 'latin1', }, assertionHashLatin1); diff --git a/test/parallel/test-debug-usage.js b/test/parallel/test-debug-usage.js index a264029f434a5a..b198dc90569121 100644 --- a/test/parallel/test-debug-usage.js +++ b/test/parallel/test-debug-usage.js @@ -12,7 +12,7 @@ child.stderr.setEncoding('utf8'); const expectedLines = [ /^\(node:\d+\) \[DEP0068\] DeprecationWarning:/, /^Usage: .*node.* debug script\.js$/, - /^ .*node.* debug :$/ + /^ .*node.* debug :$/, ]; let actualUsageMessage = ''; diff --git a/test/parallel/test-dgram-bind.js b/test/parallel/test-dgram-bind.js index 0b8447c3115da1..fba1f51eb65697 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', type: Error, - message: /^Socket is already bound$/ + message: /^Socket is already bound$/, }); socket.close(); diff --git a/test/parallel/test-dgram-create-socket-handle.js b/test/parallel/test-dgram-create-socket-handle.js index 57480f7d2cfaa6..567f0f4e141d53 100644 --- a/test/parallel/test-dgram-create-socket-handle.js +++ b/test/parallel/test-dgram-create-socket-handle.js @@ -10,7 +10,7 @@ common.expectsError(() => { _createSocketHandle(common.localhostIPv4, 0, 'udp4', 42); }, { code: 'ERR_ASSERTION', - message: /^false == true$/ + message: /^false == true$/, }); { diff --git a/test/parallel/test-dgram-createSocket-type.js b/test/parallel/test-dgram-createSocket-type.js index 9c5a20eaab3191..abdb4438b368c4 100644 --- a/test/parallel/test-dgram-createSocket-type.js +++ b/test/parallel/test-dgram-createSocket-type.js @@ -11,13 +11,13 @@ const invalidTypes = [ true, false, null, - undefined + undefined, ]; const validTypes = [ 'udp4', 'udp6', { type: 'udp4' }, - { type: 'udp6' } + { type: 'udp6' }, ]; const errMessage = /^Bad socket type specified\. Valid types are: udp4, udp6$/; @@ -28,7 +28,7 @@ invalidTypes.forEach((invalidType) => { }, { code: 'ERR_SOCKET_BAD_TYPE', type: 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 df715f81d63589..28f21ebba5373b 100644 --- a/test/parallel/test-dgram-custom-lookup.js +++ b/test/parallel/test-dgram-custom-lookup.js @@ -40,7 +40,7 @@ const dns = require('dns'); }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "lookup" argument must be of type Function' + message: 'The "lookup" argument must be of type Function', }); }); } diff --git a/test/parallel/test-dgram-membership.js b/test/parallel/test-dgram-membership.js index 47704e90b7ce13..7e41607decb1c6 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', type: 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', type: 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', type: 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', type: TypeError, - message: /^The "multicastAddress" argument must be specified$/ + message: /^The "multicastAddress" argument must be specified$/, }); socket.close(); } diff --git a/test/parallel/test-dgram-multicast-setTTL.js b/test/parallel/test-dgram-multicast-setTTL.js index 8cfa759ad9f382..899536150cc364 100644 --- a/test/parallel/test-dgram-multicast-setTTL.js +++ b/test/parallel/test-dgram-multicast-setTTL.js @@ -40,7 +40,7 @@ socket.on('listening', common.mustCall(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "ttl" argument must be of type number. Received type string' + message: 'The "ttl" argument must be of type number. Received type string', }); //close the socket diff --git a/test/parallel/test-dgram-send-address-types.js b/test/parallel/test-dgram-send-address-types.js index b3f4f3fcea290d..a5eef50b6dcb42 100644 --- a/test/parallel/test-dgram-send-address-types.js +++ b/test/parallel/test-dgram-send-address-types.js @@ -13,7 +13,7 @@ const onMessage = common.mustCall((err, bytes) => { const expectedError = { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - /^The "address" argument must be one of type string or falsy$/ + /^The "address" argument must be one of type string or falsy$/, }; const client = dgram.createSocket('udp4').bind(0, () => { diff --git a/test/parallel/test-dgram-sendto.js b/test/parallel/test-dgram-sendto.js index 782b2f692b290d..2b4e33e05d6f5d 100644 --- a/test/parallel/test-dgram-sendto.js +++ b/test/parallel/test-dgram-sendto.js @@ -11,7 +11,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: errorMessageOffset + message: errorMessageOffset, }); common.expectsError(() => { @@ -19,7 +19,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "length" argument must be of type number$/ + message: /^The "length" argument must be of type number$/, }); common.expectsError(() => { @@ -27,7 +27,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: errorMessageOffset + message: errorMessageOffset, }); common.expectsError(() => { @@ -35,7 +35,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "address" argument must be of type string$/ + message: /^The "address" argument must be of type string$/, }); common.expectsError(() => { @@ -43,5 +43,5 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "port" argument must be of type number$/ + message: /^The "port" argument must be of type number$/, }); diff --git a/test/parallel/test-dgram-setTTL.js b/test/parallel/test-dgram-setTTL.js index c6e8cb3c66923c..19dded85c6df10 100644 --- a/test/parallel/test-dgram-setTTL.js +++ b/test/parallel/test-dgram-setTTL.js @@ -14,7 +14,7 @@ socket.on('listening', common.mustCall(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "ttl" argument must be of type number. Received type string' + message: 'The "ttl" argument must be of type number. Received type string', }); // 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 1fe72690d23aa9..7114a849a75fd7 100644 --- a/test/parallel/test-dgram-socket-buffer-size.js +++ b/test/parallel/test-dgram-socket-buffer-size.js @@ -9,7 +9,7 @@ const dgram = require('dgram'); const errorObj = { code: 'ERR_SOCKET_BUFFER_SIZE', type: Error, - message: /^Could not get or set buffer size:.*$/ + message: /^Could not get or set buffer size:.*$/, }; const socket = dgram.createSocket('udp4'); @@ -36,7 +36,7 @@ const dgram = require('dgram'); const errorObj = { code: 'ERR_SOCKET_BAD_BUFFER_SIZE', type: TypeError, - message: /^Buffer size must be a positive integer$/ + message: /^Buffer size must be a positive integer$/, }; const badBufferSizes = [-1, Infinity, 'Doh!']; @@ -77,7 +77,7 @@ function checkBufferSizeError(type, size) { const errorObj = { code: 'ERR_SOCKET_BUFFER_SIZE', type: Error, - message: /^Could not get or set buffer size:.*$/ + message: /^Could not get or set buffer size:.*$/, }; const functionName = `set${type.charAt(0).toUpperCase()}${type.slice(1)}` + 'BufferSize'; diff --git a/test/parallel/test-dns-lookup.js b/test/parallel/test-dns-lookup.js index d006355742e55b..a2b5acc1d903d7 100644 --- a/test/parallel/test-dns-lookup.js +++ b/test/parallel/test-dns-lookup.js @@ -12,51 +12,51 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "hostname" argument must be one of type string or falsy/ + message: /^The "hostname" argument must be one of type string or falsy/, }); common.expectsError(() => { dns.lookup(false, 'cb'); }, { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }); common.expectsError(() => { dns.lookup(false, 'options', 'cb'); }, { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }); common.expectsError(() => { dns.lookup(false, { hints: 100, family: 0, - all: false + all: false, }, common.mustNotCall()); }, { code: 'ERR_INVALID_OPT_VALUE', type: TypeError, - message: 'The value "100" is invalid for option "hints"' + message: 'The value "100" is invalid for option "hints"', }); common.expectsError(() => { dns.lookup(false, { hints: 0, family: 20, - all: false + all: false, }, common.mustNotCall()); }, { code: 'ERR_INVALID_OPT_VALUE', type: TypeError, - message: 'The value "20" is invalid for option "family"' + message: 'The value "20" is invalid for option "family"', }); dns.lookup(false, { hints: 0, family: 0, - all: true + all: true, }, common.mustCall((error, result, addressType) => { assert.ifError(error); assert.deepStrictEqual(result, []); @@ -66,12 +66,12 @@ dns.lookup(false, { dns.lookup('127.0.0.1', { hints: 0, family: 4, - all: true + all: true, }, common.mustCall((error, result, addressType) => { assert.ifError(error); assert.deepStrictEqual(result, [{ address: '127.0.0.1', - family: 4 + family: 4, }]); assert.strictEqual(addressType, undefined); })); @@ -79,7 +79,7 @@ dns.lookup('127.0.0.1', { dns.lookup('127.0.0.1', { hints: 0, family: 4, - all: false + all: false, }, common.mustCall((error, result, addressType) => { assert.ifError(error); assert.deepStrictEqual(result, '127.0.0.1'); diff --git a/test/parallel/test-dns-multi-channel.js b/test/parallel/test-dns-multi-channel.js index bd88fe0b24fc75..69af8ba0095880 100644 --- a/test/parallel/test-dns-multi-channel.js +++ b/test/parallel/test-dns-multi-channel.js @@ -8,12 +8,12 @@ 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' }, + }, ]; let waiting = servers.length; @@ -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-regress-7070.js b/test/parallel/test-dns-regress-7070.js index ada5bf2d91c0d6..73b4465cb11dc5 100644 --- a/test/parallel/test-dns-regress-7070.js +++ b/test/parallel/test-dns-regress-7070.js @@ -29,10 +29,10 @@ common.expectsError(() => dns.resolveNs([]), // bad name { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "name" argument must be of type string/ + message: /^The "name" argument must be of type string/, }); common.expectsError(() => dns.resolveNs(''), // bad callback { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }); diff --git a/test/parallel/test-dns-resolveany.js b/test/parallel/test-dns-resolveany.js index 82f589147f58c9..ba69e14c621f4b 100644 --- a/test/parallel/test-dns-resolveany.js +++ b/test/parallel/test-dns-resolveany.js @@ -20,7 +20,7 @@ const answers = [ refresh: 900, retry: 900, expire: 1800, - minttl: 60 + minttl: 60, }, ]; diff --git a/test/parallel/test-dns-setserver-when-querying.js b/test/parallel/test-dns-setserver-when-querying.js index 205a5b6c8585d0..e918a120f67c51 100644 --- a/test/parallel/test-dns-setserver-when-querying.js +++ b/test/parallel/test-dns-setserver-when-querying.js @@ -18,7 +18,7 @@ const goog = [ common.expectsError(resolver.setServers.bind(resolver, goog), { 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.js b/test/parallel/test-dns.js index 839d434f9e1d65..49ae2dddc7e0cc 100644 --- a/test/parallel/test-dns.js +++ b/test/parallel/test-dns.js @@ -51,14 +51,14 @@ assert(existing.length > 0); get: () => { servers.length = 3; return '0.0.0.0'; - } + }, }); dns.setServers(servers); assert.deepStrictEqual(dns.getServers(), [ '127.0.0.1', '192.168.1.1', - '0.0.0.0' + '0.0.0.0', ]); } @@ -71,12 +71,12 @@ assert.deepStrictEqual(dns.getServers(), goog); common.expectsError(() => dns.setServers(['foobar']), { code: 'ERR_INVALID_IP_ADDRESS', type: Error, - message: 'Invalid IP address: foobar' + message: 'Invalid IP address: foobar', }); common.expectsError(() => dns.setServers(['127.0.0.1:va']), { code: 'ERR_INVALID_IP_ADDRESS', type: Error, - message: 'Invalid IP address: 127.0.0.1:va' + message: 'Invalid IP address: 127.0.0.1:va', }); assert.deepStrictEqual(dns.getServers(), goog); @@ -95,13 +95,13 @@ const ports = [ '4.4.4.4:53', '[2001:4860:4860::8888]:53', '103.238.225.181:666', - '[fe80::483a:5aff:fee6:1f04]:666' + '[fe80::483a:5aff:fee6:1f04]:666', ]; const portsExpected = [ '4.4.4.4', '2001:4860:4860::8888', '103.238.225.181:666', - '[fe80::483a:5aff:fee6:1f04]:666' + '[fe80::483a:5aff:fee6:1f04]:666', ]; dns.setServers(ports); assert.deepStrictEqual(dns.getServers(), portsExpected); @@ -115,7 +115,7 @@ common.expectsError(() => { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "rrtype" argument must be of type string. ' + - 'Received type object' + 'Received type object', }); // dns.lookup should accept only falsey and string values @@ -123,7 +123,7 @@ common.expectsError(() => { const errorReg = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "hostname" argument must be one of type string or falsy/ + message: /^The "hostname" argument must be one of type string or falsy/, }, 5); assert.throws(() => dns.lookup({}, common.mustNotCall()), errorReg); @@ -168,36 +168,36 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_OPT_VALUE', type: TypeError, - message: /The value "\d+" is invalid for option "hints"/ + message: /The value "\d+" is invalid for option "hints"/, }); common.expectsError(() => dns.lookup('nodejs.org'), { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }); common.expectsError(() => dns.lookup('nodejs.org', 4), { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: 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()); common.expectsError(() => dns.lookupService('0.0.0.0'), { code: 'ERR_MISSING_ARGS', type: TypeError, - message: 'The "host", "port", and "callback" arguments must be specified' + message: 'The "host", "port", and "callback" arguments must be specified', }); const invalidHost = 'fasdfdsaf'; @@ -206,7 +206,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_OPT_VALUE', type: TypeError, - message: `The value "${invalidHost}" is invalid for option "host"` + message: `The value "${invalidHost}" is invalid for option "host"`, }); const portErr = (port) => { @@ -218,7 +218,7 @@ const portErr = (port) => { code: 'ERR_SOCKET_BAD_PORT', message: `Port should be > 0 and < 65536. Received ${port}.`, - type: RangeError + type: RangeError, } ); }; @@ -231,5 +231,5 @@ common.expectsError(() => { dns.lookupService('0.0.0.0', 80, null); }, { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }); diff --git a/test/parallel/test-domain-abort-on-uncaught.js b/test/parallel/test-domain-abort-on-uncaught.js index e74fb436bf18e0..08551721c1d39b 100644 --- a/test/parallel/test-domain-abort-on-uncaught.js +++ b/test/parallel/test-domain-abort-on-uncaught.js @@ -191,7 +191,7 @@ const tests = [ }); }); }); - } + }, ]; if (process.argv[2] === 'child') { diff --git a/test/parallel/test-domain-error-types.js b/test/parallel/test-domain-error-types.js index 6569c6de4bf1e1..656c6b063d1a44 100644 --- a/test/parallel/test-domain-error-types.js +++ b/test/parallel/test-domain-error-types.js @@ -8,7 +8,7 @@ const domain = require('domain'); // for each errors. for (const something of [ - 42, null, undefined, false, () => {}, 'string', Symbol('foo') + 42, null, undefined, false, () => {}, 'string', Symbol('foo'), ]) { const d = new domain.Domain(); d.run(common.mustCall(() => { 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 697d4d30806ee7..b300b05a8c887e 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 @@ -8,7 +8,7 @@ common.expectsError( { code: 'ERR_DOMAIN_CALLBACK_NOT_AVAILABLE', type: 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-multiple-errors.js b/test/parallel/test-domain-multiple-errors.js index 5b031eb1b44bc4..fc4ccc47d32708 100644 --- a/test/parallel/test-domain-multiple-errors.js +++ b/test/parallel/test-domain-multiple-errors.js @@ -10,7 +10,7 @@ const domain = require('domain'); const d = new domain.Domain(); const values = [ - 42, null, undefined, false, () => {}, 'string', Symbol('foo') + 42, null, undefined, false, () => {}, 'string', Symbol('foo'), ]; d.on('error', common.mustCall((err) => { 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 e7cbffd00758e2..d5abc257038c0a 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', type: 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 0d6465fbf3f42f..137ffe8bbdd403 100644 --- a/test/parallel/test-domain-uncaught-exception.js +++ b/test/parallel/test-domain-uncaught-exception.js @@ -31,7 +31,7 @@ function test1() { tests.push({ fn: test1, - expectedMessages: ['uncaughtException'] + expectedMessages: ['uncaughtException'], }); function test2() { @@ -47,7 +47,7 @@ function test2() { tests.push({ fn: test2, - expectedMessages: ['uncaughtException'] + expectedMessages: ['uncaughtException'], }); function test3() { @@ -72,7 +72,7 @@ function test3() { tests.push({ fn: test3, - expectedMessages: ['errorHandledByDomain'] + expectedMessages: ['errorHandledByDomain'], }); function test4() { @@ -103,7 +103,7 @@ function test4() { tests.push({ fn: test4, - expectedMessages: ['uncaughtException'] + expectedMessages: ['uncaughtException'], }); function test5() { @@ -127,7 +127,7 @@ function test5() { } tests.push({ fn: test5, - expectedMessages: ['errorHandledByDomain'] + expectedMessages: ['errorHandledByDomain'], }); function test6() { @@ -154,7 +154,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 03ab39dbfc05d2..9f9df1f53f2d3a 100644 --- a/test/parallel/test-domain-with-abort-on-uncaught-exception.js +++ b/test/parallel/test-domain-with-abort-on-uncaught-exception.js @@ -135,35 +135,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-errors-systemerror.js b/test/parallel/test-errors-systemerror.js index 45ac7341752512..d0c43215e6c0d9 100644 --- a/test/parallel/test-errors-systemerror.js +++ b/test/parallel/test-errors-systemerror.js @@ -10,7 +10,7 @@ common.expectsError( { code: 'ERR_SYSTEM_ERROR', type: errors.SystemError, - message: 'A system error occurred' + message: 'A system error occurred', } ); @@ -19,7 +19,7 @@ common.expectsError( { code: 'ERR_SYSTEM_ERROR', type: errors.SystemError, - message: 'A system error occurred' + message: 'A system error occurred', } ); @@ -28,7 +28,7 @@ common.expectsError( { code: 'ERR_SYSTEM_ERROR', type: errors.SystemError, - message: 'A system error occurred' + message: 'A system error occurred', } ); @@ -37,21 +37,21 @@ common.expectsError( { code: 'ERR_SYSTEM_ERROR', type: errors.SystemError, - message: 'A system error occurred: ERR' + message: 'A system error occurred: ERR', } ); { const ctx = { code: 'ERR', - syscall: 'foo' + syscall: 'foo', }; common.expectsError( () => { throw new errors.SystemError(ctx); }, { code: 'ERR_SYSTEM_ERROR', type: errors.SystemError, - message: 'A system error occurred: ERR [foo]' + message: 'A system error occurred: ERR [foo]', } ); } @@ -60,14 +60,14 @@ common.expectsError( const ctx = { code: 'ERR', syscall: 'foo', - path: Buffer.from('a') + path: Buffer.from('a'), }; common.expectsError( () => { throw new errors.SystemError(ctx); }, { code: 'ERR_SYSTEM_ERROR', type: errors.SystemError, - message: 'A system error occurred: ERR [foo]: a' + message: 'A system error occurred: ERR [foo]: a', } ); } @@ -77,14 +77,14 @@ common.expectsError( code: 'ERR', syscall: 'foo', path: Buffer.from('a'), - dest: Buffer.from('b') + dest: Buffer.from('b'), }; common.expectsError( () => { throw new errors.SystemError(ctx); }, { code: 'ERR_SYSTEM_ERROR', type: errors.SystemError, - message: 'A system error occurred: ERR [foo]: a => b' + message: 'A system error occurred: ERR [foo]: a => b', } ); } @@ -93,14 +93,14 @@ common.expectsError( const ctx = { syscall: 'foo', path: Buffer.from('a'), - dest: Buffer.from('b') + dest: Buffer.from('b'), }; common.expectsError( () => { throw new errors.SystemError(ctx); }, { code: 'ERR_SYSTEM_ERROR', type: errors.SystemError, - message: 'A system error occurred: [foo]: a => b' + message: 'A system error occurred: [foo]: a => b', } ); } @@ -108,14 +108,14 @@ common.expectsError( { const ctx = { path: Buffer.from('a'), - dest: Buffer.from('b') + dest: Buffer.from('b'), }; common.expectsError( () => { throw new errors.SystemError(ctx); }, { code: 'ERR_SYSTEM_ERROR', type: errors.SystemError, - message: 'A system error occurred: a => b' + message: 'A system error occurred: a => b', } ); } @@ -126,27 +126,27 @@ common.expectsError( message: 'something happened', syscall: 'foo', path: Buffer.from('a'), - dest: Buffer.from('b') + dest: Buffer.from('b'), }; common.expectsError( () => { throw new errors.SystemError(ctx); }, { code: 'ERR_SYSTEM_ERROR', type: errors.SystemError, - message: 'something happened: ERR [foo]: a => b' + message: 'something happened: ERR [foo]: a => b', } ); } { const ctx = { - code: 'ERR_ASSERTION' + code: 'ERR_ASSERTION', }; common.expectsError( () => { throw new errors.SystemError(ctx); }, { code: 'ERR_ASSERTION', - type: errors.SystemError + type: errors.SystemError, } ); } @@ -158,7 +158,7 @@ common.expectsError( message: 'something happened', syscall: 'foo', path: Buffer.from('a'), - dest: Buffer.from('b') + dest: Buffer.from('b'), }; const err = new errors.SystemError(ctx); assert.strictEqual(err.info, ctx); diff --git a/test/parallel/test-eslint-alphabetize-errors.js b/test/parallel/test-eslint-alphabetize-errors.js index 220f09d54eb69e..c10352cf4a190a 100644 --- a/test/parallel/test-eslint-alphabetize-errors.js +++ b/test/parallel/test-eslint-alphabetize-errors.js @@ -11,7 +11,7 @@ new RuleTester().run('alphabetize-errors', rule, { E('AAA', 'foo'); E('BBB', 'bar'); E('CCC', 'baz'); - ` + `, ], invalid: [ { @@ -20,7 +20,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-buffer-constructor.js b/test/parallel/test-eslint-buffer-constructor.js index 6b9254f9379b06..8726da0e07c8c9 100644 --- a/test/parallel/test-eslint-buffer-constructor.js +++ b/test/parallel/test-eslint-buffer-constructor.js @@ -11,16 +11,16 @@ const message = 'Use of the Buffer() constructor has been deprecated. ' + new RuleTester().run('buffer-constructor', rule, { valid: [ - 'Buffer.from(foo)' + 'Buffer.from(foo)', ], invalid: [ { code: 'Buffer(foo)', - errors: [{ message }] + errors: [{ message }], }, { code: 'new Buffer(foo)', - errors: [{ message }] - } - ] + errors: [{ message }], + }, + ], }); diff --git a/test/parallel/test-eslint-crypto-check.js b/test/parallel/test-eslint-crypto-check.js index 86c28d21218154..cd342330e02b81 100644 --- a/test/parallel/test-eslint-crypto-check.js +++ b/test/parallel/test-eslint-crypto-check.js @@ -19,7 +19,7 @@ new RuleTester().run('crypto-check', rule, { common.skip("missing crypto"); } require("crypto"); - ` + `, ], invalid: [ { @@ -30,7 +30,7 @@ new RuleTester().run('crypto-check', rule, { 'if (!common.hasCrypto) {' + ' common.skip("missing crypto");' + '}\n' + - 'require("crypto")' + 'require("crypto")', }, { code: 'require("common")\n' + @@ -42,7 +42,7 @@ new RuleTester().run('crypto-check', rule, { ' common.skip("missing crypto");' + '}\n' + 'if (common.foo) {}\n' + - 'require("crypto")' - } - ] + 'require("crypto")', + }, + ], }); diff --git a/test/parallel/test-eslint-documented-errors.js b/test/parallel/test-eslint-documented-errors.js index 50c92acd151215..06ab324637f954 100644 --- a/test/parallel/test-eslint-documented-errors.js +++ b/test/parallel/test-eslint-documented-errors.js @@ -11,7 +11,7 @@ new RuleTester().run('documented-errors', rule, { valid: [ ` E('ERR_ASSERTION', 'foo'); - ` + `, ], invalid: [ { @@ -21,14 +21,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-inspector-check.js b/test/parallel/test-eslint-inspector-check.js index bdec596f8d128e..15158cde560b5c 100644 --- a/test/parallel/test-eslint-inspector-check.js +++ b/test/parallel/test-eslint-inspector-check.js @@ -14,7 +14,7 @@ new RuleTester().run('inspector-check', rule, { 'foo;', 'require("common")\n' + 'common.skipIfInspectorDisabled();\n' + - 'require("inspector")' + 'require("inspector")', ], invalid: [ { @@ -23,7 +23,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 929ff03c656cd6..461860472c631b 100644 --- a/test/parallel/test-eslint-lowercase-name-for-primitive.js +++ b/test/parallel/test-eslint-lowercase-name-for-primitive.js @@ -12,7 +12,7 @@ const valid = [ 'number', 'boolean', 'null', - 'undefined' + 'undefined', ]; new RuleTester().run('lowercase-name-for-primitive', rule, { @@ -20,7 +20,7 @@ new RuleTester().run('lowercase-name-for-primitive', rule, { 'new errors.TypeError("ERR_INVALID_ARG_TYPE", "a", ["string", "number"])', ...valid.map((name) => `new errors.TypeError("ERR_INVALID_ARG_TYPE", "name", "${name}")` - ) + ), ], invalid: [ { @@ -28,24 +28,24 @@ new RuleTester().run('lowercase-name-for-primitive', rule, { '\'Number\')', errors: [{ message: 'primitive should use lowercase: Number' }], output: 'new errors.TypeError(\'ERR_INVALID_ARG_TYPE\', \'a\', ' + - '\'number\')' + '\'number\')', }, { code: 'new errors.TypeError(\'ERR_INVALID_ARG_TYPE\', \'a\', ' + '\'STRING\')', errors: [{ message: 'primitive should use lowercase: STRING' }], output: 'new errors.TypeError(\'ERR_INVALID_ARG_TYPE\', \'a\', ' + - '\'string\')' + '\'string\')', }, { code: 'new errors.TypeError(\'ERR_INVALID_ARG_TYPE\', \'a\', ' + '[\'String\', \'Number\']) ', errors: [ { message: 'primitive should use lowercase: String' }, - { message: 'primitive should use lowercase: Number' } + { message: 'primitive should use lowercase: Number' }, ], output: 'new errors.TypeError(\'ERR_INVALID_ARG_TYPE\', \'a\', ' + - '[\'string\', \'number\']) ' - } - ] + '[\'string\', \'number\']) ', + }, + ], }); diff --git a/test/parallel/test-eslint-no-let-in-for-declaration.js b/test/parallel/test-eslint-no-let-in-for-declaration.js index ed8f306eea8ad5..a34a7e84a3053c 100644 --- a/test/parallel/test-eslint-no-let-in-for-declaration.js +++ b/test/parallel/test-eslint-no-let-in-for-declaration.js @@ -21,23 +21,23 @@ ruleTester.run('no-let-in-for-declaration', rule, { 'for (const foo of bar);', 'for (var foo of bar);', 'for (const foo in bar);', - 'for (var foo in bar);' + 'for (var foo in bar);', ], invalid: [ { code: 'for (let foo = 1;;);', output: 'for (var foo = 1;;);', - errors: [{ message }] + errors: [{ message }], }, { code: 'for (let foo in bar);', output: 'for (var foo in bar);', - errors: [{ message }] + errors: [{ message }], }, { code: 'for (let foo of bar);', output: 'for (var foo of bar);', - errors: [{ message }] - } - ] + errors: [{ message }], + }, + ], }); diff --git a/test/parallel/test-eslint-no-unescaped-regexp-dot.js b/test/parallel/test-eslint-no-unescaped-regexp-dot.js index e6f09291b0838d..24f7c708c1c3e9 100644 --- a/test/parallel/test-eslint-no-unescaped-regexp-dot.js +++ b/test/parallel/test-eslint-no-unescaped-regexp-dot.js @@ -15,16 +15,16 @@ new RuleTester().run('no-unescaped-regexp-dot', rule, { '/.*/', '/.?/', '/.{5}/', - String.raw`/\\\./` + String.raw`/\\\./`, ], 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-number-isnan.js b/test/parallel/test-eslint-number-isnan.js index b290a48a8957e7..b7a718c9518b6b 100644 --- a/test/parallel/test-eslint-number-isnan.js +++ b/test/parallel/test-eslint-number-isnan.js @@ -11,12 +11,12 @@ const message = 'Please use Number.isNaN instead of the global isNaN function'; new RuleTester().run('number-isnan', rule, { valid: [ - 'Number.isNaN()' + 'Number.isNaN()', ], invalid: [ { code: 'isNaN()', - errors: [{ message }] - } - ] + errors: [{ message }], + }, + ], }); diff --git a/test/parallel/test-eslint-prefer-assert-iferror.js b/test/parallel/test-eslint-prefer-assert-iferror.js index 7dc3bbe7bcda4d..83463cc06fa01f 100644 --- a/test/parallel/test-eslint-prefer-assert-iferror.js +++ b/test/parallel/test-eslint-prefer-assert-iferror.js @@ -12,7 +12,7 @@ new RuleTester().run('prefer-assert-iferror', rule, { 'assert.ifError(err);', 'if (err) throw somethingElse;', 'throw err;', - 'if (err) { throw somethingElse; }' + 'if (err) { throw somethingElse; }', ], invalid: [ { @@ -20,14 +20,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 3ad1cd5c376e9b..5da56a855326df 100644 --- a/test/parallel/test-eslint-prefer-assert-methods.js +++ b/test/parallel/test-eslint-prefer-assert-methods.js @@ -19,36 +19,36 @@ new RuleTester().run('prefer-assert-methods', rule, { 'assert(foo != bar && baz);', 'assert.ok(foo);', 'assert.ok(foo != bar);', - 'assert.ok(foo === bar && baz);' + 'assert.ok(foo === bar && baz);', ], invalid: [ { 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-expectserror.js b/test/parallel/test-eslint-prefer-common-expectserror.js index e0d208b68bb743..3fbe13d063b8e1 100644 --- a/test/parallel/test-eslint-prefer-common-expectserror.js +++ b/test/parallel/test-eslint-prefer-common-expectserror.js @@ -14,16 +14,16 @@ new RuleTester().run('prefer-common-expectserror', rule, { valid: [ 'assert.throws(fn, /[a-z]/)', 'assert.throws(function () {}, function() {})', - 'common.expectsError(function() {}, err)' + 'common.expectsError(function() {}, err)', ], invalid: [ { code: 'assert.throws(function() {}, common.expectsError(err))', - errors: [{ message }] + errors: [{ message }], }, { code: 'assert.throws(fn, common.expectsError(err))', - errors: [{ message }] - } - ] + errors: [{ message }], + }, + ], }); diff --git a/test/parallel/test-eslint-prefer-common-mustnotcall.js b/test/parallel/test-eslint-prefer-common-mustnotcall.js index e6e9d1d2f88332..728b3c13720450 100644 --- a/test/parallel/test-eslint-prefer-common-mustnotcall.js +++ b/test/parallel/test-eslint-prefer-common-mustnotcall.js @@ -14,16 +14,16 @@ new RuleTester().run('prefer-common-mustnotcall', rule, { valid: [ 'common.mustNotCall(fn)', 'common.mustCall(fn)', - 'common.mustCall(fn, 1)' + 'common.mustCall(fn, 1)', ], 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-util-format-errors.js b/test/parallel/test-eslint-prefer-util-format-errors.js index 560222438b9aee..76352705271227 100644 --- a/test/parallel/test-eslint-prefer-util-format-errors.js +++ b/test/parallel/test-eslint-prefer-util-format-errors.js @@ -15,15 +15,15 @@ new RuleTester({ parserOptions: { ecmaVersion: 6 } }) 'E(\'ABC\', \'abc\');', 'E(\'ABC\', (arg1, arg2) => `${arg2}${arg1}`);', 'E(\'ABC\', (arg1, arg2) => `${arg1}{arg2.something}`);', - 'E(\'ABC\', (arg1, arg2) => fn(arg1, arg2));' + 'E(\'ABC\', (arg1, arg2) => fn(arg1, arg2));', ], invalid: [ { 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-buffer.js b/test/parallel/test-eslint-require-buffer.js index bdc794dd594240..de3ceb7a0e68aa 100644 --- a/test/parallel/test-eslint-require-buffer.js +++ b/test/parallel/test-eslint-require-buffer.js @@ -8,7 +8,7 @@ const RuleTester = require('../../tools/node_modules/eslint').RuleTester; const rule = require('../../tools/eslint-rules/require-buffer'); const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 6 }, - env: { node: true } + env: { node: true }, }); const message = "Use const Buffer = require('buffer').Buffer; " + @@ -45,5 +45,5 @@ ruleTester.run('require-buffer', rule, { errors: [{ message }], output: mockComment + useStrict + bufferModule + useBuffer, }, - ] + ], }); diff --git a/test/parallel/test-eslint-required-modules.js b/test/parallel/test-eslint-required-modules.js index dbdc135ccf633f..7b8b864006a02b 100644 --- a/test/parallel/test-eslint-required-modules.js +++ b/test/parallel/test-eslint-required-modules.js @@ -11,23 +11,23 @@ new RuleTester().run('required-modules', rule, { valid: [ { code: 'require("common")', - options: ['common'] + options: ['common'], }, { code: 'foo', - options: [] + options: [], }, ], invalid: [ { code: 'foo', options: ['common'], - errors: [{ message: 'Mandatory module "common" must be loaded.' }] + errors: [{ message: 'Mandatory module "common" must be loaded.' }], }, { code: 'require("somethingElse")', options: ['common'], - errors: [{ message: 'Mandatory module "common" must be loaded.' }] - } - ] + errors: [{ message: 'Mandatory module "common" must be loaded.' }], + }, + ], }); diff --git a/test/parallel/test-eval-require.js b/test/parallel/test-eval-require.js index d6f371a99a6e22..9b4e2e9a555a41 100644 --- a/test/parallel/test-eval-require.js +++ b/test/parallel/test-eval-require.js @@ -26,7 +26,7 @@ const assert = require('assert'); const spawn = require('child_process').spawn; const options = { - cwd: fixturesDir + cwd: fixturesDir, }; const child = spawn(process.execPath, ['-e', 'require("foo")'], options); child.on('exit', common.mustCall((code) => { diff --git a/test/parallel/test-event-emitter-add-listeners.js b/test/parallel/test-event-emitter-add-listeners.js index 448db80516fc2b..9e1f85b46f56ee 100644 --- a/test/parallel/test-event-emitter-add-listeners.js +++ b/test/parallel/test-event-emitter-add-listeners.js @@ -92,5 +92,5 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "listener" argument must be of type Function' + message: 'The "listener" argument must be of type Function', }); diff --git a/test/parallel/test-event-emitter-errors.js b/test/parallel/test-event-emitter-errors.js index ef2bbee93f8bfd..076d7a9c69ccec 100644 --- a/test/parallel/test-event-emitter-errors.js +++ b/test/parallel/test-event-emitter-errors.js @@ -9,7 +9,7 @@ common.expectsError( { code: 'ERR_UNHANDLED_ERROR', type: Error, - message: 'Unhandled error. (Accepts a string)' + message: 'Unhandled error. (Accepts a string)', } ); @@ -18,6 +18,6 @@ common.expectsError( { code: 'ERR_UNHANDLED_ERROR', type: Error, - message: 'Unhandled error. ([object Object])' + message: 'Unhandled error. ([object Object])', } ); diff --git a/test/parallel/test-event-emitter-max-listeners.js b/test/parallel/test-event-emitter-max-listeners.js index a906000477f7da..a1b6f235ffbe59 100644 --- a/test/parallel/test-event-emitter-max-listeners.js +++ b/test/parallel/test-event-emitter-max-listeners.js @@ -38,7 +38,7 @@ for (const obj of throwsObjs) { code: 'ERR_OUT_OF_RANGE', type: RangeError, message: 'The value of "n" is out of range. ' + - `It must be a non-negative number. Received ${obj}` + `It must be a non-negative number. Received ${obj}`, } ); @@ -48,7 +48,7 @@ for (const obj of throwsObjs) { code: 'ERR_OUT_OF_RANGE', type: RangeError, message: 'The value of "defaultMaxListeners" is out of range. ' + - `It must be a non-negative number. Received ${obj}` + `It must be a non-negative number. Received ${obj}`, } ); } diff --git a/test/parallel/test-event-emitter-once.js b/test/parallel/test-event-emitter-once.js index fa99a1362a8b9a..18b26c66a2debb 100644 --- a/test/parallel/test-event-emitter-once.js +++ b/test/parallel/test-event-emitter-once.js @@ -57,7 +57,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "listener" argument must be of type Function' + message: 'The "listener" argument must be of type Function', }); { diff --git a/test/parallel/test-event-emitter-prepend.js b/test/parallel/test-event-emitter-prepend.js index dd9a9bdfc5bc9d..cfb3828964d5ee 100644 --- a/test/parallel/test-event-emitter-prepend.js +++ b/test/parallel/test-event-emitter-prepend.js @@ -26,7 +26,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "listener" argument must be of type Function' + message: 'The "listener" argument must be of type Function', }); // Test fallback if prependListener is undefined. diff --git a/test/parallel/test-event-emitter-remove-listeners.js b/test/parallel/test-event-emitter-remove-listeners.js index 75a4c876506eb0..2ddb2fd39187bd 100644 --- a/test/parallel/test-event-emitter-remove-listeners.js +++ b/test/parallel/test-event-emitter-remove-listeners.js @@ -151,7 +151,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "listener" argument must be of type Function' + message: 'The "listener" argument must be of type Function', }); { diff --git a/test/parallel/test-event-emitter-special-event-names.js b/test/parallel/test-event-emitter-special-event-names.js index 7ff781f0f90c5a..f34faba9468cc2 100644 --- a/test/parallel/test-event-emitter-special-event-names.js +++ b/test/parallel/test-event-emitter-special-event-names.js @@ -19,7 +19,7 @@ ee.on('toString', handler); assert.deepStrictEqual(ee.eventNames(), [ '__proto__', '__defineGetter__', - 'toString' + 'toString', ]); assert.deepStrictEqual(ee.listeners('__proto__'), [handler]); diff --git a/test/parallel/test-file-write-stream.js b/test/parallel/test-file-write-stream.js index 4860417dd29bc5..818ae3475b45b6 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 @@ -73,7 +73,7 @@ file { code: 'ERR_STREAM_WRITE_AFTER_END', type: Error, - message: 'write after end' + message: 'write after end', } ); diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js index 2db06640e18dba..4b7b152c2ad717 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 6bb64e6092bfc6..796b066e997c41 100644 --- a/test/parallel/test-file-write-stream3.js +++ b/test/parallel/test-file-write-stream3.js @@ -185,7 +185,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. Received {start: -5}', - type: RangeError + type: RangeError, }; common.expectsError(block, err); }); diff --git a/test/parallel/test-fs-access.js b/test/parallel/test-fs-access.js index 81070286eba6bc..969af8a0b0a207 100644 --- a/test/parallel/test-fs-access.js +++ b/test/parallel/test-fs-access.js @@ -97,7 +97,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "path" argument must be one of type string, Buffer, or URL' + message: 'The "path" argument must be one of type string, Buffer, or URL', } ); @@ -107,7 +107,7 @@ common.expectsError( }, { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }); common.expectsError( @@ -116,7 +116,7 @@ common.expectsError( }, { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }); // Regular access should not throw. diff --git a/test/parallel/test-fs-buffer.js b/test/parallel/test-fs-buffer.js index c4ab80a42905ad..a72a37a01ce6bc 100644 --- a/test/parallel/test-fs-buffer.js +++ b/test/parallel/test-fs-buffer.js @@ -25,7 +25,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "path" argument must be one of type string, Buffer, or URL' + message: 'The "path" argument must be one of type string, Buffer, or URL', } ); diff --git a/test/parallel/test-fs-chmod.js b/test/parallel/test-fs-chmod.js index 7c1b14ff24c91e..84c76e3ad0cefb 100644 --- a/test/parallel/test-fs-chmod.js +++ b/test/parallel/test-fs-chmod.js @@ -114,7 +114,7 @@ fs.open(file2, 'w', common.mustCall((err, fd) => { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "mode" argument must be of type integer' + message: 'The "mode" argument must be of type integer', } ); @@ -152,7 +152,7 @@ if (fs.lchmod) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); common.expectsError( @@ -160,7 +160,7 @@ if (fs.lchmod) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); }); @@ -170,14 +170,14 @@ if (fs.lchmod) { () => fs.chmod(i, 1, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.chmodSync(i, 1), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-chown-type-check.js b/test/parallel/test-fs-chown-type-check.js index 897c3e1de2d7e2..1905263da1e57a 100644 --- a/test/parallel/test-fs-chown-type-check.js +++ b/test/parallel/test-fs-chown-type-check.js @@ -8,14 +8,14 @@ const fs = require('fs'); () => fs.chown(i, 1, 1, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.chownSync(i, 1, 1), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); @@ -25,28 +25,28 @@ const fs = require('fs'); () => fs.chown('not_a_file_that_exists', i, 1, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.chown('not_a_file_that_exists', 1, i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.chownSync('not_a_file_that_exists', i, 1), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.chownSync('not_a_file_that_exists', 1, i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-close-errors.js b/test/parallel/test-fs-close-errors.js index f81d96c0569990..5e45436346a56a 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', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); common.expectsError( @@ -20,7 +20,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); }); diff --git a/test/parallel/test-fs-copyfile.js b/test/parallel/test-fs-copyfile.js index 21e0838148b5ef..fbc4e232decc48 100644 --- a/test/parallel/test-fs-copyfile.js +++ b/test/parallel/test-fs-copyfile.js @@ -70,7 +70,7 @@ common.expectsError(() => { fs.copyFile(src, dest, 0, 0); }, { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }); // Throws if the source path is not a string. @@ -79,28 +79,28 @@ common.expectsError(() => { () => fs.copyFile(i, dest, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.copyFile(src, i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.copyFileSync(i, dest), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.copyFileSync(src, i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-fchmod.js b/test/parallel/test-fs-fchmod.js index 22e6a490c9ca5d..905b3cc63e3492 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', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); common.expectsError( @@ -20,7 +20,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); @@ -29,7 +29,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "mode" argument must be of type integer' + message: 'The "mode" argument must be of type integer', } ); common.expectsError( @@ -37,7 +37,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "mode" argument must be of type integer' + message: 'The "mode" argument must be of type integer', } ); }); @@ -54,7 +54,7 @@ common.expectsError( { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "mode" is out of range.' + message: 'The value of "mode" is out of range.', } ); common.expectsError( @@ -62,6 +62,6 @@ common.expectsError( { code: 'ERR_OUT_OF_RANGE', type: RangeError, - message: 'The value of "mode" is out of range.' + message: 'The value of "mode" is out of range.', } ); diff --git a/test/parallel/test-fs-fchown.js b/test/parallel/test-fs-fchown.js index a7e6bf6cbca571..613f3ecf09b623 100644 --- a/test/parallel/test-fs-fchown.js +++ b/test/parallel/test-fs-fchown.js @@ -9,7 +9,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); common.expectsError( @@ -17,7 +17,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); @@ -26,7 +26,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "uid" argument must be of type integer' + message: 'The "uid" argument must be of type integer', } ); common.expectsError( @@ -34,7 +34,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "uid" argument must be of type integer' + message: 'The "uid" argument must be of type integer', } ); @@ -43,7 +43,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "gid" argument must be of type integer' + message: 'The "gid" argument must be of type integer', } ); common.expectsError( @@ -51,7 +51,7 @@ const fs = require('fs'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "gid" argument must be of type integer' + message: 'The "gid" argument must be of type integer', } ); }); diff --git a/test/parallel/test-fs-fsync.js b/test/parallel/test-fs-fsync.js index 1f575881e3743d..4beb04b717d9a7 100644 --- a/test/parallel/test-fs-fsync.js +++ b/test/parallel/test-fs-fsync.js @@ -56,7 +56,7 @@ fs.open(fileTemp, 'a', 0o777, common.mustCall(function(err, fd) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); common.expectsError( @@ -64,7 +64,7 @@ fs.open(fileTemp, 'a', 0o777, common.mustCall(function(err, fd) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); common.expectsError( @@ -72,7 +72,7 @@ fs.open(fileTemp, 'a', 0o777, common.mustCall(function(err, fd) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); common.expectsError( @@ -80,7 +80,7 @@ fs.open(fileTemp, 'a', 0o777, common.mustCall(function(err, fd) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); }); diff --git a/test/parallel/test-fs-link.js b/test/parallel/test-fs-link.js index d007f4e985b2d5..d8282516903a78 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', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.link('', i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.linkSync(i, ''), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.linkSync('', i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-long-path.js b/test/parallel/test-fs-long-path.js index 74f63868b81054..46655c48992f99 100644 --- a/test/parallel/test-fs-long-path.js +++ b/test/parallel/test-fs-long-path.js @@ -39,7 +39,7 @@ tmpdir.refresh(); console.log({ filenameLength: fileName.length, - fullPathLength: fullPath.length + fullPathLength: fullPath.length, }); fs.writeFile(fullPath, 'ok', common.mustCall(function(err) { diff --git a/test/parallel/test-fs-make-callback.js b/test/parallel/test-fs-make-callback.js index d3ff165513156c..47a02046894361 100644 --- a/test/parallel/test-fs-make-callback.js +++ b/test/parallel/test-fs-make-callback.js @@ -19,7 +19,7 @@ function invalidCallbackThrowsTests() { callbackThrowValues.forEach((value) => { common.expectsError(testMakeCallback(value), { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }); }); } diff --git a/test/parallel/test-fs-makeStatsCallback.js b/test/parallel/test-fs-makeStatsCallback.js index c8de29e407fec2..a2bde03abf718b 100644 --- a/test/parallel/test-fs-makeStatsCallback.js +++ b/test/parallel/test-fs-makeStatsCallback.js @@ -17,7 +17,7 @@ function invalidCallbackThrowsTests() { callbackThrowValues.forEach((value) => { common.expectsError(testMakeStatsCallback(value), { code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }); }); } diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index 937c73aca4a4c2..785ea7b3372ebd 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -59,14 +59,14 @@ tmpdir.refresh(); () => fs.mkdir(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.mkdirSync(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-mkdtemp-prefix-check.js b/test/parallel/test-fs-mkdtemp-prefix-check.js index 4573dbbaae8435..172304c19ff77c 100644 --- a/test/parallel/test-fs-mkdtemp-prefix-check.js +++ b/test/parallel/test-fs-mkdtemp-prefix-check.js @@ -11,7 +11,7 @@ function fail(value) { }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); } @@ -22,7 +22,7 @@ function failAsync(value) { }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); } diff --git a/test/parallel/test-fs-non-number-arguments-throw.js b/test/parallel/test-fs-non-number-arguments-throw.js index 61ed3f6c285dd0..1bac15c3579f23 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 @@ common.expectsError( }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); common.expectsError( @@ -29,7 +29,7 @@ common.expectsError( }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); common.expectsError( @@ -38,7 +38,7 @@ common.expectsError( }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: 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 6ffaef571ac8d6..79f34427a59053 100644 --- a/test/parallel/test-fs-null-bytes.js +++ b/test/parallel/test-fs-null-bytes.js @@ -47,7 +47,7 @@ function check(async, sync) { }, { code: 'ERR_INVALID_ARG_VALUE', - type: Error + type: Error, }); } } diff --git a/test/parallel/test-fs-open.js b/test/parallel/test-fs-open.js index e988a7e197bfb4..b59b48dee2ed4c 100644 --- a/test/parallel/test-fs-open.js +++ b/test/parallel/test-fs-open.js @@ -49,14 +49,14 @@ fs.open(__filename, 'rs', common.mustCall((err) => { () => fs.open(i, 'r', common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.openSync(i, 'r', common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js index ba3a91d5b39f8a..c737835fc80cba 100644 --- a/test/parallel/test-fs-promises.js +++ b/test/parallel/test-fs-promises.js @@ -31,7 +31,7 @@ const { symlink, write, unlink, - utimes + utimes, } = fsPromises; const tmpDir = tmpdir.path; @@ -49,7 +49,7 @@ common.crashOnUnhandledRejection(); code: 'ENOENT', type: Error, message: - /^ENOENT: no such file or directory, access/ + /^ENOENT: no such file or directory, access/, })); } @@ -105,7 +105,7 @@ function verifyStatObject(stat) { // expect it to be ENOSYS common.expectsError({ code: 'ENOSYS', - type: Error + type: Error, })(err); } 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 a9b4838cf1834f..f17110223aac61 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-inherit.js b/test/parallel/test-fs-read-stream-inherit.js index f43f81ddee395d..9620bc11f99e0b 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, - type: RangeError + type: RangeError, }); } 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 c2b0d5452c55e3..65484184710408 100644 --- a/test/parallel/test-fs-read-stream-throw-type-error.js +++ b/test/parallel/test-fs-read-stream-throw-type-error.js @@ -17,7 +17,7 @@ const createReadStreamErr = (path, opt) => { }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); }; diff --git a/test/parallel/test-fs-read-stream.js b/test/parallel/test-fs-read-stream.js index 7fc7a0d56bce37..7d33908d748563 100644 --- a/test/parallel/test-fs-read-stream.js +++ b/test/parallel/test-fs-read-stream.js @@ -148,7 +148,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', message: 'The value of "start" is out of range. It must be <= "end". ' + 'Received {start: 10, end: 2}', - type: RangeError + type: RangeError, }); { diff --git a/test/parallel/test-fs-read-type.js b/test/parallel/test-fs-read-type.js index 3338410bec5282..6dab9212e36185 100644 --- a/test/parallel/test-fs-read-type.js +++ b/test/parallel/test-fs-read-type.js @@ -14,7 +14,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "buffer" argument must be one of type Buffer or Uint8Array' + message: 'The "buffer" argument must be one of type Buffer or Uint8Array', } ); @@ -56,7 +56,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "buffer" argument must be one of type Buffer or Uint8Array' + message: 'The "buffer" argument must be one of type Buffer or Uint8Array', } ); diff --git a/test/parallel/test-fs-readdir-stack-overflow.js b/test/parallel/test-fs-readdir-stack-overflow.js index b7dea52cc37ec5..81f53162da8410 100644 --- a/test/parallel/test-fs-readdir-stack-overflow.js +++ b/test/parallel/test-fs-readdir-stack-overflow.js @@ -13,6 +13,6 @@ common.expectsError( () => recurse(), { type: RangeError, - message: 'Maximum call stack size exceeded' + message: 'Maximum call stack size exceeded', } ); diff --git a/test/parallel/test-fs-readdir.js b/test/parallel/test-fs-readdir.js index a24def6f12db9e..906c1aa86291d0 100644 --- a/test/parallel/test-fs-readdir.js +++ b/test/parallel/test-fs-readdir.js @@ -41,14 +41,14 @@ fs.readdir(__filename, common.mustCall(function(e) { () => fs.readdir(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.readdirSync(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-readfile-error.js b/test/parallel/test-fs-readfile-error.js index 97633c9a887acc..7a378911bad962 100644 --- a/test/parallel/test-fs-readfile-error.js +++ b/test/parallel/test-fs-readfile-error.js @@ -61,6 +61,6 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', message: 'The "path" argument must be one of type string, Buffer, or URL', - type: TypeError + type: TypeError, } ); diff --git a/test/parallel/test-fs-readlink-type-check.js b/test/parallel/test-fs-readlink-type-check.js index 914c1e55af5b2e..3b27882c7ff113 100644 --- a/test/parallel/test-fs-readlink-type-check.js +++ b/test/parallel/test-fs-readlink-type-check.js @@ -8,14 +8,14 @@ const fs = require('fs'); () => fs.readlink(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.readlinkSync(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-realpath-pipe.js b/test/parallel/test-fs-realpath-pipe.js index 55010cf78b4a5a..d4a9f2cf1c0d54 100644 --- a/test/parallel/test-fs-realpath-pipe.js +++ b/test/parallel/test-fs-realpath-pipe.js @@ -24,9 +24,9 @@ for (const code of [ } } catch (e) { process.exit(1); - }` + }`, ]) { assert.strictEqual(spawnSync(process.execPath, ['-e', code], { - stdio: 'pipe' + stdio: 'pipe', }).status, 2); } diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js index 6cfd79cecfb694..339c4de553ef13 100644 --- a/test/parallel/test-fs-realpath.js +++ b/test/parallel/test-fs-realpath.js @@ -112,7 +112,7 @@ function test_simple_relative_symlink(realpath, realpathSync, callback) { const entry = `${tmpDir}/symlink`; const expected = `${tmpDir}/cycles/root.js`; [ - [entry, `../${path.basename(tmpDir)}/cycles/root.js`] + [entry, `../${path.basename(tmpDir)}/cycles/root.js`], ].forEach(function(t) { try { fs.unlinkSync(t[0]); } catch (e) {} console.log('fs.symlinkSync(%j, %j, %j)', t[1], t[0], 'file'); @@ -138,7 +138,7 @@ function test_simple_absolute_symlink(realpath, realpathSync, callback) { const entry = `${tmpAbsDir}/symlink`; const expected = fixtures.path('nested-index', 'one'); [ - [entry, expected] + [entry, expected], ].forEach(function(t) { try { fs.unlinkSync(t[0]); } catch (e) {} console.error('fs.symlinkSync(%j, %j, %j)', t[1], t[0], type); @@ -220,7 +220,7 @@ function test_cyclic_link_protection(realpath, realpathSync, callback) { [ [entry, '../cycles/realpath-3b'], [path.join(tmpDir, '/cycles/realpath-3b'), '../cycles/realpath-3c'], - [path.join(tmpDir, '/cycles/realpath-3c'), '../cycles/realpath-3a'] + [path.join(tmpDir, '/cycles/realpath-3c'), '../cycles/realpath-3a'], ].forEach(function(t) { try { fs.unlinkSync(t[0]); } catch (e) {} fs.symlinkSync(t[1], t[0], 'dir'); @@ -273,7 +273,7 @@ function test_relative_input_cwd(realpath, realpathSync, callback) { [ [entry, '../cycles/realpath-3b'], [`${tmpDir}/cycles/realpath-3b`, '../cycles/realpath-3c'], - [`${tmpDir}/cycles/realpath-3c`, 'root.js'] + [`${tmpDir}/cycles/realpath-3c`, 'root.js'], ].forEach(function(t) { const fn = t[0]; console.error('fn=%j', fn); @@ -330,7 +330,7 @@ function test_deep_symlink_mix(realpath, realpathSync, callback) { [`${targetsAbsDir}/nested-index/one/realpath-c`, `${targetsAbsDir}/nested-index/two/realpath-c`], [`${targetsAbsDir}/nested-index/two/realpath-c`, - `${tmpDir}/cycles/root.js`] + `${tmpDir}/cycles/root.js`], ].forEach(function(t) { try { fs.unlinkSync(t[0]); } catch (e) {} fs.symlinkSync(t[1], t[0]); @@ -441,14 +441,14 @@ function test_abs_with_kids(realpath, realpathSync, cb) { const root = `${tmpAbsDir}/node-test-realpath-abs-kids`; function cleanup() { ['/a/b/c/x.txt', - '/a/link' + '/a/link', ].forEach(function(file) { try { fs.unlinkSync(root + file); } catch (ex) {} }); ['/a/b/c', '/a/b', '/a', - '' + '', ].forEach(function(folder) { try { fs.rmdirSync(root + folder); } catch (ex) {} }); @@ -458,7 +458,7 @@ function test_abs_with_kids(realpath, realpathSync, cb) { ['', '/a', '/a/b', - '/a/b/c' + '/a/b/c', ].forEach(function(folder) { console.log(`mkdir ${root}${folder}`); fs.mkdirSync(root + folder, 0o700); diff --git a/test/parallel/test-fs-rename-type-check.js b/test/parallel/test-fs-rename-type-check.js index 68126e9f7e66e8..24eaf52266532a 100644 --- a/test/parallel/test-fs-rename-type-check.js +++ b/test/parallel/test-fs-rename-type-check.js @@ -10,7 +10,7 @@ const fs = require('fs'); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "oldPath" argument must be one of type string, Buffer, or URL' + 'The "oldPath" argument must be one of type string, Buffer, or URL', } ); common.expectsError( @@ -19,7 +19,7 @@ const fs = require('fs'); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "newPath" argument must be one of type string, Buffer, or URL' + 'The "newPath" argument must be one of type string, Buffer, or URL', } ); common.expectsError( @@ -28,7 +28,7 @@ const fs = require('fs'); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "oldPath" argument must be one of type string, Buffer, or URL' + 'The "oldPath" argument must be one of type string, Buffer, or URL', } ); common.expectsError( @@ -37,7 +37,7 @@ const fs = require('fs'); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "newPath" argument must be one of type string, Buffer, or URL' + 'The "newPath" argument must be one of type string, Buffer, or URL', } ); }); diff --git a/test/parallel/test-fs-rmdir-type-check.js b/test/parallel/test-fs-rmdir-type-check.js index fc2106b8cabee7..e3dd76176cf2d3 100644 --- a/test/parallel/test-fs-rmdir-type-check.js +++ b/test/parallel/test-fs-rmdir-type-check.js @@ -8,14 +8,14 @@ const fs = require('fs'); () => fs.rmdir(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.rmdirSync(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-stat.js b/test/parallel/test-fs-stat.js index 7f0f535d0c590c..23efb0f7a43df9 100644 --- a/test/parallel/test-fs-stat.js +++ b/test/parallel/test-fs-stat.js @@ -96,14 +96,14 @@ fs.stat(__filename, common.mustCall(function(err, s) { 'dev', 'mode', 'nlink', 'uid', 'gid', 'rdev', 'ino', 'size', 'atime', 'mtime', 'ctime', 'birthtime', - 'atimeMs', 'mtimeMs', 'ctimeMs', 'birthtimeMs' + 'atimeMs', 'mtimeMs', 'ctimeMs', 'birthtimeMs', ]; if (!common.isWindows) { keys.push('blocks', 'blksize'); } const numberFields = [ 'dev', 'mode', 'nlink', 'uid', 'gid', 'rdev', 'ino', 'size', - 'atimeMs', 'mtimeMs', 'ctimeMs', 'birthtimeMs' + 'atimeMs', 'mtimeMs', 'ctimeMs', 'birthtimeMs', ]; const dateFields = ['atime', 'mtime', 'ctime', 'birthtime']; keys.forEach(function(k) { @@ -137,7 +137,7 @@ fs.stat(__filename, common.mustCall(function(err, s) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); common.expectsError( @@ -145,7 +145,7 @@ fs.stat(__filename, common.mustCall(function(err, s) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); }); @@ -155,28 +155,28 @@ fs.stat(__filename, common.mustCall(function(err, s) { () => fs.lstat(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.lstatSync(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.stat(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.statSync(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-symlink.js b/test/parallel/test-fs-symlink.js index 19903fff58c761..36d2086b8bcd5a 100644 --- a/test/parallel/test-fs-symlink.js +++ b/test/parallel/test-fs-symlink.js @@ -65,7 +65,7 @@ fs.symlink(linkData, linkPath, common.mustCall(function(err) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "target" argument must be one of type string, Buffer, or URL' + 'The "target" argument must be one of type string, Buffer, or URL', } ); common.expectsError( @@ -74,7 +74,7 @@ fs.symlink(linkData, linkPath, common.mustCall(function(err) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "path" argument must be one of type string, Buffer, or URL' + 'The "path" argument must be one of type string, Buffer, or URL', } ); common.expectsError( @@ -83,7 +83,7 @@ fs.symlink(linkData, linkPath, common.mustCall(function(err) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "target" argument must be one of type string, Buffer, or URL' + 'The "target" argument must be one of type string, Buffer, or URL', } ); common.expectsError( @@ -92,7 +92,7 @@ fs.symlink(linkData, linkPath, common.mustCall(function(err) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "path" argument must be one of type string, Buffer, or URL' + 'The "path" argument must be one of type string, Buffer, or URL', } ); }); @@ -103,7 +103,7 @@ common.expectsError( code: 'ERR_FS_INVALID_SYMLINK_TYPE', type: Error, message: - 'Symlink type must be one of "dir", "file", or "junction". Received "🍏"' + 'Symlink type must be one of "dir", "file", or "junction". Received "🍏"', } ); common.expectsError( @@ -112,7 +112,7 @@ common.expectsError( code: 'ERR_FS_INVALID_SYMLINK_TYPE', type: Error, message: - 'Symlink type must be one of "dir", "file", or "junction". Received "🍏"' + 'Symlink type must be one of "dir", "file", or "junction". Received "🍏"', } ); diff --git a/test/parallel/test-fs-syncwritestream.js b/test/parallel/test-fs-syncwritestream.js index a014277a6ba259..27166125a6288e 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(() => { @@ -36,6 +36,6 @@ proc.on('close', common.mustCall(() => { assert.deepStrictEqual(JSON.parse(fs.readFileSync(filename, 'utf8')), [ { instance: true, readable: false, writable: true }, - { instance: true, readable: false, writable: true } + { instance: true, readable: false, writable: true }, ]); })); diff --git a/test/parallel/test-fs-timestamp-parsing-error.js b/test/parallel/test-fs-timestamp-parsing-error.js index 4456a86830f43f..c9b30ccd035269 100644 --- a/test/parallel/test-fs-timestamp-parsing-error.js +++ b/test/parallel/test-fs-timestamp-parsing-error.js @@ -9,7 +9,7 @@ const fs = require('fs'); }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); }); @@ -19,7 +19,7 @@ common.expectsError( }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: 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 28a9852d82a9c5..9d5128d1a5ff6a 100644 --- a/test/parallel/test-fs-truncate.js +++ b/test/parallel/test-fs-truncate.js @@ -188,7 +188,7 @@ function testFtruncate(cb) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "len" argument must be of type integer' + message: 'The "len" argument must be of type integer', } ); }); @@ -216,7 +216,7 @@ function testFtruncate(cb) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); common.expectsError( @@ -224,7 +224,7 @@ function testFtruncate(cb) { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fd" argument must be of type integer' + message: 'The "fd" argument must be of type integer', } ); }); diff --git a/test/parallel/test-fs-unlink-type-check.js b/test/parallel/test-fs-unlink-type-check.js index 7fe3ce946c89d5..2e89b17cface58 100644 --- a/test/parallel/test-fs-unlink-type-check.js +++ b/test/parallel/test-fs-unlink-type-check.js @@ -8,14 +8,14 @@ const fs = require('fs'); () => fs.unlink(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.unlinkSync(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index 5b57287a6428b5..1843a9936a6e32 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -102,7 +102,7 @@ function testIt(atime, mtime, callback) { () => fs.futimesSync(-1, atime, mtime), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); tests_run++; @@ -211,14 +211,14 @@ if (common.isWindows) { () => fs.utimes(i, new Date(), new Date(), common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.utimesSync(i, new Date(), new Date()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-fs-watch.js b/test/parallel/test-fs-watch.js index 7affe370c7ed03..cc6f8331ab807e 100644 --- a/test/parallel/test-fs-watch.js +++ b/test/parallel/test-fs-watch.js @@ -32,7 +32,7 @@ const cases = [ 'watch2', 'bar', 'dirPath' - ) + ), ]; const tmpdir = require('../common/tmpdir'); diff --git a/test/parallel/test-fs-watchfile.js b/test/parallel/test-fs-watchfile.js index 3c24ae84ac036b..ef8d75e12a92e8 100644 --- a/test/parallel/test-fs-watchfile.js +++ b/test/parallel/test-fs-watchfile.js @@ -14,7 +14,7 @@ common.expectsError( }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); common.expectsError( @@ -23,7 +23,7 @@ common.expectsError( }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); common.expectsError(function() { diff --git a/test/parallel/test-fs-whatwg-url.js b/test/parallel/test-fs-whatwg-url.js index cfdfbe0dde01b8..cc4d782edd6d4a 100644 --- a/test/parallel/test-fs-whatwg-url.js +++ b/test/parallel/test-fs-whatwg-url.js @@ -37,7 +37,7 @@ common.expectsError( { code: 'ERR_INVALID_URL_SCHEME', type: 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 @@ -51,7 +51,7 @@ if (common.isWindows) { { code: 'ERR_INVALID_FILE_URL_PATH', type: TypeError, - message: 'File URL path must not include encoded \\ or / characters' + message: 'File URL path must not include encoded \\ or / characters', } ); }); @@ -63,7 +63,7 @@ if (common.isWindows) { code: 'ERR_INVALID_ARG_VALUE', type: Error, message: 'The argument \'path\' must be a string or Uint8Array without ' + - 'null bytes. Received \'c:/tmp/\\u0000test\'' + 'null bytes. Received \'c:/tmp/\\u0000test\'', } ); } else { @@ -76,7 +76,7 @@ if (common.isWindows) { { code: 'ERR_INVALID_FILE_URL_PATH', type: TypeError, - message: 'File URL path must not include encoded / characters' + message: 'File URL path must not include encoded / characters', }); }); common.expectsError( @@ -86,7 +86,7 @@ if (common.isWindows) { { code: 'ERR_INVALID_FILE_URL_HOST', type: 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()}`, } ); common.expectsError( @@ -97,7 +97,7 @@ if (common.isWindows) { code: 'ERR_INVALID_ARG_VALUE', type: Error, message: 'The argument \'path\' must be a string or Uint8Array without ' + - 'null bytes. Received \'/tmp/\\u0000test\'' + 'null bytes. Received \'/tmp/\\u0000test\'', } ); } 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-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 36bf9dbcfb068e..c534f662dfe36d 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-throw-type-error.js b/test/parallel/test-fs-write-stream-throw-type-error.js index c80f647b3d622e..ed2d8dbbcd90b9 100644 --- a/test/parallel/test-fs-write-stream-throw-type-error.js +++ b/test/parallel/test-fs-write-stream-throw-type-error.js @@ -21,7 +21,7 @@ const createWriteStreamErr = (path, opt) => { }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); }; diff --git a/test/parallel/test-fs-write-stream.js b/test/parallel/test-fs-write-stream.js index e93f65e604c20b..44e00e4091f6de 100644 --- a/test/parallel/test-fs-write-stream.js +++ b/test/parallel/test-fs-write-stream.js @@ -60,7 +60,7 @@ tmpdir.refresh(); }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "data" argument must be of type Buffer. Received type number' + message: 'The "data" argument must be of type Buffer. Received type number', }); stream.destroy(); } diff --git a/test/parallel/test-fs-write.js b/test/parallel/test-fs-write.js index a3c8814bc392ce..fc57c436fbb505 100644 --- a/test/parallel/test-fs-write.js +++ b/test/parallel/test-fs-write.js @@ -139,14 +139,14 @@ fs.open(fn3, 'w', 0o644, common.mustCall(function(err, fd) { () => fs.write(i, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); common.expectsError( () => fs.writeSync(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); 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 eda08ced97c55c..1369778dd7f650 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((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(); diff --git a/test/parallel/test-http-abort-queued.js b/test/parallel/test-http-abort-queued.js index 224d0b606ea744..915e4232110176 100644 --- a/test/parallel/test-http-abort-queued.js +++ b/test/parallel/test-http-abort-queued.js @@ -49,7 +49,7 @@ server.listen(0, () => { port: server.address().port, method: 'GET', path: '/', - agent: agent + agent: agent, }; const req1 = http.request(options); @@ -62,7 +62,7 @@ server.listen(0, () => { 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-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-destroyed-socket.js b/test/parallel/test-http-agent-destroyed-socket.js index 39f4ebef5374c1..69f206602919ec 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-error-on-idle.js b/test/parallel/test-http-agent-error-on-idle.js index fce5e8f0324f5c..95b37e1113d1af 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 4d92d5e01e03e2..66bc509c945401 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 31dc255ba558db..390ba9b9ae88fa 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 8ac8d79df192b0..fcddb6e7e71a6c 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); } diff --git a/test/parallel/test-http-agent-maxsockets-regress-4050.js b/test/parallel/test-http-agent-maxsockets-regress-4050.js index eb1c95d5200694..3c9363ddef85c9 100644 --- a/test/parallel/test-http-agent-maxsockets-regress-4050.js +++ b/test/parallel/test-http-agent-maxsockets-regress-4050.js @@ -10,7 +10,7 @@ const agent = new http.Agent({ keepAlive: true, keepAliveMsecs: 1000, maxSockets: MAX_SOCKETS, - maxFreeSockets: 2 + maxFreeSockets: 2, }); const server = http.createServer(common.mustCall((req, res) => { @@ -24,7 +24,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-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-allow-req-after-204-res.js b/test/parallel/test-http-allow-req-after-204-res.js index 8de53a9e539a66..41cbf4cc65eb4d 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 40377fb6684db4..503422df2d0514 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({ host: 'example.org:443', origin: 'http://example.org', - cookie: '' + cookie: '', }, req.headers); })); diff --git a/test/parallel/test-http-buffer-sanity.js b/test/parallel/test-http-buffer-sanity.js index 8dfccf7d5c688d..bd91eff1f979d5 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 f999f055fc0a91..9be140f27f59ed 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 9ae2932a5c4149..5c0fdd06a47545 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-queued-tcp-socket.js b/test/parallel/test-http-client-abort-keep-alive-queued-tcp-socket.js index 6282aa3da7caf2..84b6d63bd9a309 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 @@ -19,7 +19,7 @@ server.listen(0, common.mustCall(() => { 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-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 1e7feb7d5860f6..2fcb3acac79df2 100644 --- a/test/parallel/test-http-client-aborted-event.js +++ b/test/parallel/test-http-client-aborted-event.js @@ -11,7 +11,7 @@ const server = http.Server(function(req, res) { 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.js b/test/parallel/test-http-client-agent.js index 3ae906f09c92ae..d72934a2c37325 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 828d7fa79a503c..1ba228f27822a2 100644 --- a/test/parallel/test-http-client-check-http-token.js +++ b/test/parallel/test-http-client-check-http-token.js @@ -23,7 +23,7 @@ server.listen(0, common.mustCall(() => { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "method" argument must be of type string. ' + - `Received type ${typeof method}` + `Received type ${typeof method}`, }); }); diff --git a/test/parallel/test-http-client-default-headers-exist.js b/test/parallel/test-http-client-default-headers-exist.js index e0cf82e46220c4..fddd84389bd0ba 100644 --- a/test/parallel/test-http-client-default-headers-exist.js +++ b/test/parallel/test-http-client-default-headers-exist.js @@ -31,7 +31,7 @@ const expectedHeaders = { 'HEAD': ['host', 'connection'], 'OPTIONS': ['host', 'connection'], 'POST': ['host', 'connection', 'content-length'], - 'PUT': ['host', 'connection', 'content-length'] + 'PUT': ['host', 'connection', 'content-length'], }; const expectedMethods = Object.keys(expectedHeaders); @@ -68,7 +68,7 @@ server.listen(0, common.mustCall(() => { expectedMethods.forEach((method) => { http.request({ method: method, - port: server.address().port + port: server.address().port, }).end(); }); })); 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-headers-array.js b/test/parallel/test-http-client-headers-array.js index dffe04bb108401..bb036e6ec4f010 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(); @@ -44,11 +44,11 @@ execute({ headers: { 'x-foo': 'boom', 'cookie': 'a=1; b=2; c=3' } }); execute({ headers: { 'x-foo': 'boom', 'cookie': [ 'a=1', 'b=2', 'c=3' ] } }); execute({ headers: [[ 'x-foo', 'boom' ], [ 'cookie', 'a=1; b=2; c=3' ]] }); execute({ headers: [ - [ 'x-foo', 'boom' ], [ 'cookie', [ 'a=1', 'b=2', 'c=3' ]] + [ 'x-foo', 'boom' ], [ 'cookie', [ 'a=1', 'b=2', 'c=3' ]], ] }); execute({ headers: [ [ 'x-foo', 'boom' ], [ 'cookie', 'a=1' ], - [ 'cookie', 'b=2' ], [ 'cookie', 'c=3'] + [ 'cookie', 'b=2' ], [ 'cookie', 'c=3'], ] }); // Authorization and Host header both missing from the second @@ -56,5 +56,5 @@ execute({ auth: 'foo:bar', headers: { 'x-foo': 'boom', 'cookie': 'a=1; b=2; c=3' } }); execute({ auth: 'foo:bar', headers: [ [ 'x-foo', 'boom' ], [ 'cookie', 'a=1' ], - [ 'cookie', 'b=2' ], [ 'cookie', 'c=3'] + [ 'cookie', 'b=2' ], [ 'cookie', 'c=3'], ] }); diff --git a/test/parallel/test-http-client-immediate-error.js b/test/parallel/test-http-client-immediate-error.js index 1c65d07ca50bfe..f960bc1d389aa0 100644 --- a/test/parallel/test-http-client-immediate-error.js +++ b/test/parallel/test-http-client-immediate-error.js @@ -11,7 +11,7 @@ const http = require('http'); const uv = process.binding('uv'); const { newAsyncId, - symbols: { async_id_symbol } + symbols: { async_id_symbol }, } = require('internal/async_hooks'); const agent = new http.Agent(); @@ -24,7 +24,7 @@ agent.createConnection = common.mustCall((cfg) => { return uv.UV_ENETUNREACH; }), readStart() {}, - close() {} + close() {}, }; // Simulate just enough socket handle initialization @@ -37,7 +37,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-invalid-path.js b/test/parallel/test-http-client-invalid-path.js index c042d61eda0999..03cc1813836cc1 100644 --- a/test/parallel/test-http-client-invalid-path.js +++ b/test/parallel/test-http-client-invalid-path.js @@ -4,9 +4,9 @@ const http = require('http'); common.expectsError(() => { http.request({ - path: '/thisisinvalid\uffe2' + path: '/thisisinvalid\uffe2', }).end(); }, { code: 'ERR_UNESCAPED_CHARACTERS', - type: TypeError + type: 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 0efedc91e2613d..c316f3bb9f3372 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-parse-error.js b/test/parallel/test-http-client-parse-error.js index cb4e3ff08434dd..23cf35d95b0942 100644 --- a/test/parallel/test-http-client-parse-error.js +++ b/test/parallel/test-http-client-parse-error.js @@ -29,7 +29,7 @@ const countdown = new Countdown(2, () => server.close()); const payloads = [ 'HTTP/1.1 302 Object Moved\r\nContent-Length: 0\r\n\r\nhi world', - 'bad http = should trigger parse error' + 'bad http = should trigger parse error', ]; // Create a TCP server @@ -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' + message: 'Parse Error', })(e); countdown.dec(); })); diff --git a/test/parallel/test-http-client-pipe-end.js b/test/parallel/test-http-client-pipe-end.js index 9dcdbe4a49d83a..48ba7280f562cd 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 73b86b0d7edd62..de016714d9c446 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'); }); 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 50e5d2b57a7b96..161a866c39c551 100644 --- a/test/parallel/test-http-client-reject-unexpected-agent.js +++ b/test/parallel/test-http-client-reject-unexpected-agent.js @@ -53,7 +53,7 @@ server.listen(0, baseOptions.host, common.mustCall(function() { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "Agent option" argument must be one of type ' + - 'Agent-like Object, undefined, or false' + 'Agent-like Object, undefined, or false', } ); }); 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 d2c526eab69c6c..31506c72b71046 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 @@ -14,7 +14,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-response-domain.js b/test/parallel/test-http-client-response-domain.js index 0a32e929141e45..b12bd007afc11a 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-spurious-aborted.js b/test/parallel/test-http-client-spurious-aborted.js index 58a2f92de94054..3c8f7355f05a46 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; diff --git a/test/parallel/test-http-client-timeout-event.js b/test/parallel/test-http-client-timeout-event.js index c76d56ef256407..2417603d716729 100644 --- a/test/parallel/test-http-client-timeout-event.js +++ b/test/parallel/test-http-client-timeout-event.js @@ -27,7 +27,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 727b5fddf09624..032e58b610ffb0 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.js b/test/parallel/test-http-client-timeout-option.js index 6741fbe0bd1e35..a354473bc1ef1e 100644 --- a/test/parallel/test-http-client-timeout-option.js +++ b/test/parallel/test-http-client-timeout-option.js @@ -8,7 +8,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 bc5670b6939e39..03e592aada1241 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 bf0a3fbe54f8ce..92f47aa4922032 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 6d5a945dd5f893..7087afa7d206fa 100644 --- a/test/parallel/test-http-client-unescaped-path.js +++ b/test/parallel/test-http-client-unescaped-path.js @@ -30,7 +30,7 @@ for (let i = 0; i <= 32; i += 1) { { code: 'ERR_UNESCAPED_CHARACTERS', type: 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 b778d07a826b1d..e1eba7f9311afc 100644 --- a/test/parallel/test-http-client-upload-buf.js +++ b/test/parallel/test-http-client-upload-buf.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-client-upload.js b/test/parallel/test-http-client-upload.js index 000bf1d58424a3..f4bd8ebb9eb8dc 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 ffb3aa07551bfd..3624699e94003d 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, }; // start a tcp server that closes incoming connections immediately diff --git a/test/parallel/test-http-connect-req-res.js b/test/parallel/test-http-connect-req-res.js index 5db19aedde91d8..c4eee42c60c546 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()); req.on('close', common.mustCall()); diff --git a/test/parallel/test-http-connect.js b/test/parallel/test-http-connect.js index f90d235521a649..9a164d6a6bdcb9 100644 --- a/test/parallel/test-http-connect.js +++ b/test/parallel/test-http-connect.js @@ -53,7 +53,7 @@ server.listen(0, common.mustCall(() => { const req = http.request({ port: server.address().port, method: 'CONNECT', - path: 'google.com:443' + path: 'google.com:443', }, 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-date-header.js b/test/parallel/test-http-date-header.js index b389e33664738c..0c6b59e1f0529b 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 36d3f0a65244fe..0d054d245de0a2 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 a5af439a8ec6c3..3ad7f4f46d21a7 100644 --- a/test/parallel/test-http-default-port.js +++ b/test/parallel/test-http-default-port.js @@ -32,12 +32,12 @@ 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 [ { mod: http, createServer: http.createServer }, - { mod: https, createServer: https.createServer.bind(null, options) } + { mod: https, createServer: https.createServer.bind(null, options) }, ]) { const server = createServer(common.mustCall((req, res) => { assert.strictEqual(req.headers.host, hostExpect); @@ -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 99a0c4663a8ba3..6b7643ff88cd80 100644 --- a/test/parallel/test-http-destroyed-socket-write2.js +++ b/test/parallel/test-http-destroyed-socket-write2.js @@ -37,7 +37,7 @@ server.listen(0, function() { const req = http.request({ port: this.address().port, path: '/', - method: 'POST' + method: 'POST', }); function write() { diff --git a/test/parallel/test-http-dns-error.js b/test/parallel/test-http-dns-error.js index 06a15c89fb46b3..7dc3edaa3ec33b 100644 --- a/test/parallel/test-http-dns-error.js +++ b/test/parallel/test-http-dns-error.js @@ -54,7 +54,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 e87dfee96f433f..4e9c30e367be72 100644 --- a/test/parallel/test-http-dump-req-when-res-ends.js +++ b/test/parallel/test-http-dump-req-when-res-ends.js @@ -32,7 +32,7 @@ const server = http.createServer(function(req, res) { server.listen(0, 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 7f97ce35927e99..907b4a6f61d5d4 100644 --- a/test/parallel/test-http-expect-continue.js +++ b/test/parallel/test-http-expect-continue.js @@ -36,7 +36,7 @@ function handler(req, res) { console.error('Server sending full response...'); res.writeHead(200, { 'Content-Type': 'text/plain', - 'ABCD': '1' + 'ABCD': '1', }); res.end(test_res_body); } @@ -58,7 +58,7 @@ server.on('listening', function() { port: this.address().port, method: 'POST', path: '/world', - headers: { 'Expect': '100-continue' } + headers: { 'Expect': '100-continue' }, }); console.error('Client sending request...'); outstanding_reqs++; diff --git a/test/parallel/test-http-expect-handling.js b/test/parallel/test-http-expect-handling.js index fd1f244979459f..fbf680dd7d3bdb 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 2f6fc8fc2a176c..73f32d42138d5c 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 bc28d1fcd4632b..ced98defc9ba0d 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) => { @@ -42,7 +42,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) => { 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-host-header-ipv6-fail.js b/test/parallel/test-http-host-header-ipv6-fail.js index 0c56afad7f28e5..05c5a7ca15ba2a 100644 --- a/test/parallel/test-http-host-header-ipv6-fail.js +++ b/test/parallel/test-http-host-header-ipv6-fail.js @@ -16,7 +16,7 @@ const net = require('net'); const requests = [ { host: 'foo:1234', headers: { expectedhost: 'foo:1234:80' } }, - { host: '::1', headers: { expectedhost: '[::1]:80' } } + { host: '::1', headers: { expectedhost: '[::1]:80' } }, ]; function createLocalConnection(options) { 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 72440391fa2938..bc5fe7bc66361f 100644 --- a/test/parallel/test-http-hostname-typechecking.js +++ b/test/parallel/test-http-hostname-typechecking.js @@ -15,7 +15,7 @@ vals.forEach((v) => { type: TypeError, message: 'The "options.hostname" property must be one of ' + 'type string, undefined, or null. ' + - `Received type ${typeof v}` + `Received type ${typeof v}`, } ); @@ -26,7 +26,7 @@ vals.forEach((v) => { type: TypeError, message: 'The "options.host" property must be one of ' + 'type string, undefined, or null. ' + - `Received type ${typeof v}` + `Received type ${typeof v}`, } ); }); diff --git a/test/parallel/test-http-information-processing.js b/test/parallel/test-http-information-processing.js index af589477f05dd1..68b8031dd783e6 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) => { console.error('Server sending full response...'); res.writeHead(200, { 'Content-Type': 'text/plain', - 'ABCD': '1' + 'ABCD': '1', }); res.end(test_res_body); }); @@ -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(); console.error('Client sending request...'); diff --git a/test/parallel/test-http-invalid-path-chars.js b/test/parallel/test-http-invalid-path-chars.js index c1d0baa62c3e9b..f20b2d23f7b321 100644 --- a/test/parallel/test-http-invalid-path-chars.js +++ b/test/parallel/test-http-invalid-path-chars.js @@ -7,7 +7,7 @@ const http = require('http'); const expectedError = common.expectsError({ code: 'ERR_UNESCAPED_CHARACTERS', type: TypeError, - message: 'Request path contains unescaped characters' + message: 'Request path contains unescaped characters', }, 1320); const theExperimentallyDeterminedNumber = 39; 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-invalidheaderfield2.js b/test/parallel/test-http-invalidheaderfield2.js index 40415d9c368891..1b4e9e6edb01f3 100644 --- a/test/parallel/test-http-invalidheaderfield2.js +++ b/test/parallel/test-http-invalidheaderfield2.js @@ -25,7 +25,7 @@ const { _checkIsHttpToken, _checkInvalidHeaderChar } = require('_http_common'); 'It\'s_fun', '2*3', '4+2', - '3.14159265359' + '3.14159265359', ].forEach(function(str) { assert.strictEqual( _checkIsHttpToken(str), true, @@ -51,7 +51,7 @@ const { _checkIsHttpToken, _checkInvalidHeaderChar } = require('_http_common'); 'End)', 'End]', '"Quote"', - 'This,That' + 'This,That', ].forEach(function(str) { assert.strictEqual( _checkIsHttpToken(str), false, @@ -64,7 +64,7 @@ const { _checkIsHttpToken, _checkInvalidHeaderChar } = require('_http_common'); 'foo bar', 'foo\tbar', '0123456789ABCdef', - '!@#$%^&*()-_=+\\;\':"[]{}<>,./?|~`' + '!@#$%^&*()-_=+\\;\':"[]{}<>,./?|~`', ].forEach(function(str) { assert.strictEqual( _checkInvalidHeaderChar(str), false, @@ -80,7 +80,7 @@ const { _checkIsHttpToken, _checkInvalidHeaderChar } = require('_http_common'); '\x7FMe!', 'Testing 123\x00', 'foo\vbar', - 'Ding!\x07' + 'Ding!\x07', ].forEach(function(str) { assert.strictEqual( _checkInvalidHeaderChar(str), true, 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 f5fb9466db1fa7..8309bc08228773 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(1, agent.sockets[name].length); 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(1, agent.sockets[name].length); 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(1, agent.sockets[name].length); diff --git a/test/parallel/test-http-keep-alive.js b/test/parallel/test-http-keep-alive.js index 42d534e8e6b459..91f16dec8d326e 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-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-headers-count.js b/test/parallel/test-http-max-headers-count.js index 05f4f774c2c929..625491c24fe920 100644 --- a/test/parallel/test-http-max-headers-count.js +++ b/test/parallel/test-http-max-headers-count.js @@ -36,7 +36,7 @@ for (let i = 0; i < N; ++i) { const maxAndExpected = [ // for server [50, 50], [1500, 1500], - [0, N + 2] // Host and Connection + [0, N + 2], // Host and Connection ]; let max = maxAndExpected[requests][0]; let expected = maxAndExpected[requests][1]; @@ -57,7 +57,7 @@ server.listen(0, function() { const maxAndExpected = [ // for client [20, 20], [1200, 1200], - [0, N + 3] // Connection, Date and Transfer-Encoding + [0, N + 3], // Connection, Date and Transfer-Encoding ]; doRequest(); @@ -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-methods.js b/test/parallel/test-http-methods.js index f56d1a5fb3e3ce..158c405d74e47d 100644 --- a/test/parallel/test-http-methods.js +++ b/test/parallel/test-http-methods.js @@ -60,7 +60,7 @@ const methods = [ 'PURGE', 'MKCALENDAR', 'LINK', - 'UNLINK' + 'UNLINK', ]; assert.deepStrictEqual(http.METHODS, methods.sort()); 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 2473a08eb1978e..978440deeafb60 100644 --- a/test/parallel/test-http-mutable-headers.js +++ b/test/parallel/test-http-mutable-headers.js @@ -36,7 +36,7 @@ let test = 'headers'; const content = 'hello world\n'; const cookies = [ 'session_token=; path=/; expires=Sun, 15-Sep-2030 13:48:52 GMT', - 'prefers_open_id=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT' + 'prefers_open_id=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT', ]; const s = http.createServer(common.mustCall((req, res) => { @@ -55,7 +55,7 @@ const s = http.createServer(common.mustCall((req, res) => { { code: 'ERR_INVALID_HTTP_TOKEN', type: TypeError, - message: 'Header name must be a valid HTTP token ["undefined"]' + message: 'Header name must be a valid HTTP token ["undefined"]', } ); common.expectsError( @@ -63,7 +63,7 @@ const s = http.createServer(common.mustCall((req, res) => { { code: 'ERR_HTTP_INVALID_HEADER_VALUE', type: TypeError, - message: 'Invalid value "undefined" for header "someHeader"' + message: 'Invalid value "undefined" for header "someHeader"', } ); common.expectsError( @@ -71,7 +71,7 @@ const s = http.createServer(common.mustCall((req, res) => { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "name" argument must be of type string' + message: 'The "name" argument must be of type string', } ); common.expectsError( @@ -79,7 +79,7 @@ const s = http.createServer(common.mustCall((req, res) => { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "name" argument must be of type string' + message: 'The "name" argument must be of type string', } ); @@ -97,7 +97,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); @@ -115,14 +115,14 @@ const s = http.createServer(common.mustCall((req, res) => { true, {}, { toString: () => 'X-TEST-HEADER2' }, - () => { } + () => { }, ].forEach((val) => { common.expectsError( () => res.hasHeader(val), { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "name" argument must be of type string' + message: 'The "name" argument must be of type string', } ); }); diff --git a/test/parallel/test-http-no-read-no-dump.js b/test/parallel/test-http-no-read-no-dump.js index 17d36c56b2eeba..06b4c1eb775c16 100644 --- a/test/parallel/test-http-no-read-no-dump.js +++ b/test/parallel/test-http-no-read-no-dump.js @@ -18,7 +18,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-finish-writable.js b/test/parallel/test-http-outgoing-finish-writable.js index 033e9b6bc1a7db..5da920d324e078 100644 --- a/test/parallel/test-http-outgoing-finish-writable.js +++ b/test/parallel/test-http-outgoing-finish-writable.js @@ -25,7 +25,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 c805a89cc165f2..c9b149541cc072 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-internal-headers.js b/test/parallel/test-http-outgoing-internal-headers.js index e36917a970d987..168b2e3a5cac23 100644 --- a/test/parallel/test-http-outgoing-internal-headers.js +++ b/test/parallel/test-http-outgoing-internal-headers.js @@ -18,11 +18,11 @@ const { OutgoingMessage } = require('http'); const outgoingMessage = new OutgoingMessage(); outgoingMessage._headers = { host: 'risingstack.com', - Origin: 'localhost' + Origin: 'localhost', }; assert.deepStrictEqual(outgoingMessage[outHeadersKey], { host: ['host', 'risingstack.com'], - origin: ['Origin', 'localhost'] + origin: ['Origin', 'localhost'], }); } diff --git a/test/parallel/test-http-outgoing-message-inheritance.js b/test/parallel/test-http-outgoing-message-inheritance.js index 05a241dc8bda00..79add09ee44c6b 100644 --- a/test/parallel/test-http-outgoing-message-inheritance.js +++ b/test/parallel/test-http-outgoing-message-inheritance.js @@ -22,7 +22,7 @@ const ws = new Writable({ write: common.mustCall((chunk, encoding, callback) => { assert(chunk.toString().match(/hello world/)); setImmediate(callback); - }) + }), }); res.socket = ws; diff --git a/test/parallel/test-http-outgoing-proto.js b/test/parallel/test-http-outgoing-proto.js index 6b7987db10d726..5c127ca769a51a 100644 --- a/test/parallel/test-http-outgoing-proto.js +++ b/test/parallel/test-http-outgoing-proto.js @@ -12,7 +12,7 @@ common.expectsError( { code: 'ERR_METHOD_NOT_IMPLEMENTED', type: Error, - message: 'The _implicitHeader() method is not implemented' + message: 'The _implicitHeader() method is not implemented', } ); assert.strictEqual( @@ -27,7 +27,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_HTTP_TOKEN', type: TypeError, - message: 'Header name must be a valid HTTP token ["undefined"]' + message: 'Header name must be a valid HTTP token ["undefined"]', }); common.expectsError(() => { @@ -36,7 +36,7 @@ common.expectsError(() => { }, { code: 'ERR_HTTP_INVALID_HEADER_VALUE', type: TypeError, - message: 'Invalid value "undefined" for header "test"' + message: 'Invalid value "undefined" for header "test"', }); common.expectsError(() => { @@ -45,7 +45,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_HTTP_TOKEN', type: TypeError, - message: 'Header name must be a valid HTTP token ["404"]' + message: 'Header name must be a valid HTTP token ["404"]', }); common.expectsError(() => { @@ -54,7 +54,7 @@ common.expectsError(() => { }, { code: 'ERR_HTTP_HEADERS_SENT', type: Error, - message: 'Cannot set headers after they are sent to the client' + message: 'Cannot set headers after they are sent to the client', }); common.expectsError(() => { @@ -63,7 +63,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_CHAR', type: TypeError, - message: 'Invalid character in header content ["200"]' + message: 'Invalid character in header content ["200"]', }); // write @@ -73,7 +73,7 @@ common.expectsError(() => { }, { code: 'ERR_METHOD_NOT_IMPLEMENTED', type: Error, - message: 'The _implicitHeader() method is not implemented' + message: 'The _implicitHeader() method is not implemented', }); assert(OutgoingMessage.prototype.write.call({ _header: 'test' })); @@ -84,7 +84,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The first argument must be one of type string or Buffer' + message: 'The first argument must be one of type string or Buffer', }); common.expectsError(() => { @@ -93,7 +93,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The first argument must be one of type string or Buffer' + message: 'The first argument must be one of type string or Buffer', }); // addTrailers() @@ -111,7 +111,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_HTTP_TOKEN', type: TypeError, - message: 'Trailer name must be a valid HTTP token ["あ"]' + message: 'Trailer name must be a valid HTTP token ["あ"]', }); common.expectsError(() => { @@ -120,5 +120,5 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_CHAR', type: 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 138ab967539edb..6a456148aae3bd 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', type: 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[outHeadersKey] = { 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-parser-freed-before-upgrade.js b/test/parallel/test-http-parser-freed-before-upgrade.js index 4ba1de9501681c..21c52b568590d2 100644 --- a/test/parallel/test-http-parser-freed-before-upgrade.js +++ b/test/parallel/test-http-parser-freed-before-upgrade.js @@ -12,7 +12,7 @@ server.on('upgrade', common.mustCall((request, socket) => { 'HTTP/1.1 101 Switching Protocols', 'Connection: Upgrade', 'Upgrade: WebSocket', - '\r\n' + '\r\n', ].join('\r\n')); })); @@ -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-pause-resume-one-end.js b/test/parallel/test-http-pause-resume-one-end.js index 4886a7d490e413..c87377538ed94c 100644 --- a/test/parallel/test-http-pause-resume-one-end.js +++ b/test/parallel/test-http-pause-resume-one-end.js @@ -32,7 +32,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 e2f462582ffa0a..fdd585ef2708f8 100644 --- a/test/parallel/test-http-pause.js +++ b/test/parallel/test-http-pause.js @@ -51,7 +51,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-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 8781679c0a45b8..01c7411380b601 100644 --- a/test/parallel/test-http-proxy.js +++ b/test/parallel/test-http-proxy.js @@ -27,7 +27,7 @@ const url = require('url'); const cookies = [ 'session_token=; path=/; expires=Sun, 15-Sep-2030 13:48:52 GMT', - 'prefers_open_id=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT' + 'prefers_open_id=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT', ]; const headers = { 'content-type': 'text/plain', @@ -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(200, res.statusCode); diff --git a/test/parallel/test-http-raw-headers.js b/test/parallel/test-http-raw-headers.js index eb3f7280f89100..6bfad4f8a6bd6e 100644 --- a/test/parallel/test-http-raw-headers.js +++ b/test/parallel/test-http-raw-headers.js @@ -34,13 +34,13 @@ http.createServer(function(req, res) { 'x-BaR', 'yoyoyo', 'Connection', - 'close' + 'close', ]; const expectHeaders = { host: `localhost:${this.address().port}`, 'transfer-encoding': 'CHUNKED', 'x-bar': 'yoyoyo', - connection: 'close' + connection: 'close', }; const expectRawTrailers = [ 'x-bAr', @@ -50,7 +50,7 @@ http.createServer(function(req, res) { 'X-bAr', 'yOyOyOy', 'X-baR', - 'OyOyOyO' + 'OyOyOyO', ]; const expectTrailers = { 'x-bar': 'yOyOyOy, OyOyOyO, yOyOyOy, OyOyOyO' }; @@ -70,7 +70,7 @@ http.createServer(function(req, res) { ['x-fOo', 'xOxOxOx'], ['x-foO', 'OxOxOxO'], ['X-fOo', 'xOxOxOx'], - ['X-foO', 'OxOxOxO'] + ['X-foO', 'OxOxOxO'], ]); res.end('x f o o'); }).listen(0, function() { @@ -79,7 +79,7 @@ http.createServer(function(req, res) { ['x-bAr', 'yOyOyOy'], ['x-baR', 'OyOyOyO'], ['X-bAr', 'yOyOyOy'], - ['X-baR', 'OyOyOyO'] + ['X-baR', 'OyOyOyO'], ]); req.setHeader('transfer-ENCODING', 'CHUNKED'); req.setHeader('x-BaR', 'yoyoyo'); @@ -93,13 +93,13 @@ http.createServer(function(req, res) { 'Connection', 'close', 'Transfer-Encoding', - 'chunked' + 'chunked', ]; const expectHeaders = { trailer: 'x-foo', date: null, connection: 'close', - 'transfer-encoding': 'chunked' + 'transfer-encoding': 'chunked', }; res.rawHeaders[3] = null; res.headers.date = null; @@ -114,7 +114,7 @@ http.createServer(function(req, res) { 'X-fOo', 'xOxOxOx', 'X-foO', - 'OxOxOxO' + 'OxOxOxO', ]; const expectTrailers = { 'x-foo': 'xOxOxOx, OxOxOxO, xOxOxOx, OxOxOxO' }; diff --git a/test/parallel/test-http-regr-gh-2821.js b/test/parallel/test-http-regr-gh-2821.js index 9f1df0a0f56807..6976155fa5ed1f 100644 --- a/test/parallel/test-http-regr-gh-2821.js +++ b/test/parallel/test-http-regr-gh-2821.js @@ -13,7 +13,7 @@ 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-request-dont-override-options.js b/test/parallel/test-http-request-dont-override-options.js index ff534436cb8f93..a933c562664f5e 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 a0cdcf27dd03a9..f1edebc3668271 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 ae11985e12ff87..64af1265f95302 100644 --- a/test/parallel/test-http-request-invalid-method-error.js +++ b/test/parallel/test-http-request-invalid-method-error.js @@ -7,6 +7,6 @@ common.expectsError( { code: 'ERR_INVALID_HTTP_TOKEN', type: 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-res-write-after-end.js b/test/parallel/test-http-res-write-after-end.js index 1d34cf6dcb4841..8b6254bb316094 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', - type: Error + type: 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 a4d3f629e24b3d..769f0ac0b7e452 100644 --- a/test/parallel/test-http-response-add-header-after-sent.js +++ b/test/parallel/test-http-response-add-header-after-sent.js @@ -10,7 +10,7 @@ const server = http.createServer((req, res) => { { code: 'ERR_HTTP_HEADERS_SENT', type: 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-close.js b/test/parallel/test-http-response-close.js index c58a5884d59d1a..509ac053bb91b5 100644 --- a/test/parallel/test-http-response-close.js +++ b/test/parallel/test-http-response-close.js @@ -39,7 +39,7 @@ server.listen(0); server.on('listening', function() { console.error('make req'); http.get({ - port: this.address().port + port: this.address().port, }, function(res) { console.error('got res'); res.on('data', function(data) { diff --git a/test/parallel/test-http-response-multiheaders.js b/test/parallel/test-http-response-multiheaders.js index f9429cff934276..033a47600459ba 100644 --- a/test/parallel/test-http-response-multiheaders.js +++ b/test/parallel/test-http-response-multiheaders.js @@ -26,7 +26,7 @@ const norepeat = [ 'last-modified', 'server', 'age', - 'expires' + 'expires', ]; const runCount = 2; diff --git a/test/parallel/test-http-response-no-headers.js b/test/parallel/test-http-response-no-headers.js index 87b0f8e67faf7c..63893e4129b96f 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 52acd3d1059ef3..1519f76e2edc6b 100644 --- a/test/parallel/test-http-response-remove-header-after-sent.js +++ b/test/parallel/test-http-response-remove-header-after-sent.js @@ -10,7 +10,7 @@ const server = http.createServer((req, res) => { { code: 'ERR_HTTP_HEADERS_SENT', type: 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 2c75940b7a3656..30d51bfa2637e7 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', type: 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 0f9bce8fa87d67..aca8ce501f80b7 100644 --- a/test/parallel/test-http-response-status-message.js +++ b/test/parallel/test-http-response-status-message.js @@ -36,7 +36,7 @@ const testCases = [ { path: '/missing', statusMessage: '', response: 'HTTP/1.1 200 \r\n\r\n' }, { path: '/missing-no-space', statusMessage: '', - response: 'HTTP/1.1 200\r\n\r\n' } + response: 'HTTP/1.1 200\r\n\r\n' }, ]; testCases.findByPath = function(path) { const matching = this.filter(function(testCase) { @@ -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 7e93ad10a9f9c8..8025472bfa3c1e 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', type: 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', type: 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-server-de-chunked-trailer.js b/test/parallel/test-http-server-de-chunked-trailer.js index dad744209ee419..a6355f5ec11718 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', - type: Error + type: Error, }; common.expectsError(() => res.writeHead(200, { 'Content-Length': '2' }), trailerInvalidErr); diff --git a/test/parallel/test-http-server-keep-alive-timeout.js b/test/parallel/test-http-server-keep-alive-timeout.js index 767963fbdc2f38..34f356cf2a359d 100644 --- a/test/parallel/test-http-server-keep-alive-timeout.js +++ b/test/parallel/test-http-server-keep-alive-timeout.js @@ -32,7 +32,7 @@ test(function serverEndKeepAliveTimeoutWithPipeline(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'); @@ -54,7 +54,7 @@ test(function serverNoEndKeepAliveTimeoutWithPipeline(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 bf918ad24cc168..6fcef04676e9e1 100644 --- a/test/parallel/test-http-server-multiheaders.js +++ b/test/parallel/test-http-server-multiheaders.js @@ -75,6 +75,6 @@ srv.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 a4bfa1b7646fc6..61c97702c92860 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.Server({ - 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 7025c734b3103d..09a551fee55b64 100644 --- a/test/parallel/test-http-server-response-standalone.js +++ b/test/parallel/test-http-server-response-standalone.js @@ -12,14 +12,14 @@ const assert = require('assert'); const res = new ServerResponse({ method: 'GET', httpVersionMajor: 1, - httpVersionMinor: 1 + httpVersionMinor: 1, }); const ws = new Writable({ write: common.mustCall((chunk, encoding, callback) => { assert(chunk.toString().match(/hello world/)); setImmediate(callback); - }) + }), }); res.assignSocket(ws); diff --git a/test/parallel/test-http-server-stale-close.js b/test/parallel/test-http-server-stale-close.js index b72c2b55a02f25..246b68e02a44e6 100644 --- a/test/parallel/test-http-server-stale-close.js +++ b/test/parallel/test-http-server-stale-close.js @@ -45,8 +45,8 @@ if (process.env.NODE_TEST_FORK_PORT) { server.listen(0, function() { fork(__filename, { env: Object.assign({}, process.env, { - NODE_TEST_FORK_PORT: this.address().port - }) + 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 a405844cfc9659..7ab7b89ed36815 100644 --- a/test/parallel/test-http-server-write-after-end.js +++ b/test/parallel/test-http-server-write-after-end.js @@ -11,7 +11,7 @@ function handle(req, res) { res.on('error', common.mustCall((err) => { common.expectsError({ code: 'ERR_STREAM_WRITE_AFTER_END', - type: Error + type: Error, })(err); server.close(); })); diff --git a/test/parallel/test-http-set-timeout-server.js b/test/parallel/test-http-set-timeout-server.js index 7984fdfc0ffbf0..2898cfb223642f 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-set-trailers.js b/test/parallel/test-http-set-trailers.js index 204207dfa8dcb6..63ee83eb1b0fdc 100644 --- a/test/parallel/test-http-set-trailers.js +++ b/test/parallel/test-http-set-trailers.js @@ -100,7 +100,7 @@ server.on('listening', function() { http.get({ port: this.address().port, path: '/hello', - headers: {} + headers: {}, }, function(res) { res.on('end', function() { //console.log(res.trailers); diff --git a/test/parallel/test-http-should-keep-alive.js b/test/parallel/test-http-should-keep-alive.js index 038af47ee4db97..dfc99cf4f3b3a1 100644 --- a/test/parallel/test-http-should-keep-alive.js +++ b/test/parallel/test-http-should-keep-alive.js @@ -32,7 +32,7 @@ const SERVER_RESPONSES = [ 'HTTP/1.0 200 ok\r\nContent-Length: 0\r\nConnection: close\r\n\r\n', 'HTTP/1.1 200 ok\r\nContent-Length: 0\r\n\r\n', 'HTTP/1.1 200 ok\r\nContent-Length: 0\r\nConnection: keep-alive\r\n\r\n', - 'HTTP/1.1 200 ok\r\nContent-Length: 0\r\nConnection: close\r\n\r\n' + 'HTTP/1.1 200 ok\r\nContent-Length: 0\r\nConnection: close\r\n\r\n', ]; const SHOULD_KEEP_ALIVE = [ false, // HTTP/1.0, default @@ -40,7 +40,7 @@ const SHOULD_KEEP_ALIVE = [ false, // HTTP/1.0, Connection: close true, // HTTP/1.1, default true, // HTTP/1.1, Connection: keep-alive - false // HTTP/1.1, Connection: close + false, // HTTP/1.1, Connection: close ]; http.globalAgent.maxSockets = 5; 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-unix-socket-keep-alive.js b/test/parallel/test-http-unix-socket-keep-alive.js index 11b3d9b39264a4..6b0486af621005 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 cfed45a43c2e83..0a72ce66e5803f 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.', - type: Error + type: Error, })); })); })); diff --git a/test/parallel/test-http-upgrade-advertise.js b/test/parallel/test-http-upgrade-advertise.js index 99a3e8fd353015..638daf834881b8 100644 --- a/test/parallel/test-http-upgrade-advertise.js +++ b/test/parallel/test-http-upgrade-advertise.js @@ -8,7 +8,7 @@ const tests = [ { headers: {}, expected: 'regular' }, { headers: { upgrade: 'h2c' }, expected: 'regular' }, { headers: { connection: 'upgrade' }, expected: 'regular' }, - { headers: { connection: 'upgrade', upgrade: 'h2c' }, expected: 'upgrade' } + { headers: { connection: 'upgrade', upgrade: 'h2c' }, expected: 'upgrade' }, ]; function fire() { @@ -26,7 +26,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'); @@ -43,7 +43,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 5c840eeb532814..84a2b4b5eec928 100644 --- a/test/parallel/test-http-upgrade-agent.js +++ b/test/parallel/test-http-upgrade-agent.js @@ -53,8 +53,8 @@ srv.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 c637324a53d801..ab10bd05c83de6 100644 --- a/test/parallel/test-http-upgrade-client.js +++ b/test/parallel/test-http-upgrade-client.js @@ -52,21 +52,21 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { const headers = [ { connection: 'upgrade', - upgrade: 'websocket' + upgrade: 'websocket', }, [ ['Host', 'echo.websocket.org'], ['Connection', 'Upgrade'], ['Upgrade', 'websocket'], - ['Origin', 'http://www.websocket.org'] - ] + ['Origin', 'http://www.websocket.org'], + ], ]; const countdown = new Countdown(headers.length, () => srv.close()); 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) { @@ -84,7 +84,7 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { const expectedHeaders = { hello: 'world', connection: 'upgrade', - upgrade: 'websocket' + upgrade: 'websocket', }; assert.deepStrictEqual(expectedHeaders, res.headers); 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 c10f5ed7b0d31b..30a467e87ddc2a 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 f58be0257c1fc5..de0d2961b4dfc3 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 986f75d3076434..06d0316f82f227 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 @@ -30,7 +30,7 @@ const invalidUrls = [ 'ftp://www.example.com', 'javascript:alert(\'hello\');', 'xmpp:foo@bar.com', - 'f://some.host/path' + 'f://some.host/path', ]; invalidUrls.forEach((invalid) => { @@ -38,7 +38,7 @@ invalidUrls.forEach((invalid) => { () => { http.request(url.parse(invalid)); }, { code: 'ERR_INVALID_PROTOCOL', - type: Error + type: Error, } ); }); diff --git a/test/parallel/test-http-write-callbacks.js b/test/parallel/test-http-write-callbacks.js index 440807a2df7ca0..75bede8acaac35 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', function() { // ok, good to go. diff --git a/test/parallel/test-http-write-head.js b/test/parallel/test-http-write-head.js index f2ac7cb7b39dd4..35f6673d3b49a3 100644 --- a/test/parallel/test-http-write-head.js +++ b/test/parallel/test-http-write-head.js @@ -46,7 +46,7 @@ const s = http.createServer(common.mustCall((req, res) => { { code: 'ERR_HTTP_INVALID_HEADER_VALUE', type: TypeError, - message: 'Invalid value "undefined" for header "foo"' + message: 'Invalid value "undefined" for header "foo"', } ); @@ -57,7 +57,7 @@ const s = http.createServer(common.mustCall((req, res) => { }, { code: 'ERR_HTTP_HEADERS_SENT', type: 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 e9a48c0fba3826..83027d6cc81549 100644 --- a/test/parallel/test-http.js +++ b/test/parallel/test-http.js @@ -69,9 +69,9 @@ server.on('listening', function() { 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', function() { 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', function() { 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 9fd9a9fc278552..b9665164fbc05c 100644 --- a/test/parallel/test-http2-altsvc.js +++ b/test/parallel/test-http2-altsvc.js @@ -33,7 +33,7 @@ server.on('session', common.mustCall((session) => { () => session.altsvc('h2=":8000"', i), { code: 'ERR_OUT_OF_RANGE', - type: RangeError + type: RangeError, } ); }); @@ -44,7 +44,7 @@ server.on('session', common.mustCall((session) => { () => session.altsvc(i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); @@ -54,7 +54,7 @@ server.on('session', common.mustCall((session) => { () => session.altsvc(i), { code: 'ERR_INVALID_CHAR', - type: TypeError + type: TypeError, } ); }); @@ -64,7 +64,7 @@ server.on('session', common.mustCall((session) => { () => session.altsvc('clear', i), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); @@ -73,13 +73,13 @@ server.on('session', common.mustCall((session) => { 'abc:', new URL('abc:'), { origin: 'null' }, - { origin: '' } + { origin: '' }, ].forEach((i) => { common.expectsError( () => session.altsvc('h2=":8000', i), { code: 'ERR_HTTP2_ALTSVC_INVALID_ORIGIN', - type: TypeError + type: TypeError, } ); }); @@ -92,7 +92,7 @@ server.on('session', common.mustCall((session) => { }, { code: 'ERR_HTTP2_ALTSVC_LENGTH', - type: TypeError + type: TypeError, } ); })); diff --git a/test/parallel/test-http2-backpressure.js b/test/parallel/test-http2-backpressure.js index 9b69dddbfd2e26..73f155c57dc24f 100644 --- a/test/parallel/test-http2-backpressure.js +++ b/test/parallel/test-http2-backpressure.js @@ -17,7 +17,7 @@ common.crashOnUnhandledRejection(); server.on('stream', common.mustCallAsync(async (stream, headers) => { stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); req._readableState.highWaterMark = 20; stream._writableState.highWaterMark = 20; @@ -34,7 +34,7 @@ common.crashOnUnhandledRejection(); 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 f267e2e6c1481e..0dc24fc6f9921a 100644 --- a/test/parallel/test-http2-binding.js +++ b/test/parallel/test-http2-binding.js @@ -88,7 +88,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 = { @@ -166,7 +166,7 @@ const expectedHeaderNames = { HTTP2_HEADER_CONTENT_MD5: 'content-md5', HTTP2_HEADER_TE: 'te', HTTP2_HEADER_UPGRADE: 'upgrade', - HTTP2_HEADER_HTTP2_SETTINGS: 'http2-settings' + HTTP2_HEADER_HTTP2_SETTINGS: 'http2-settings', }; const expectedNGConstants = { @@ -217,14 +217,14 @@ const expectedNGConstants = { NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: 3, NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: 4, NGHTTP2_SETTINGS_MAX_FRAME_SIZE: 5, - NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6 + NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: 6, }; const defaultSettings = { DEFAULT_SETTINGS_HEADER_TABLE_SIZE: 4096, DEFAULT_SETTINGS_ENABLE_PUSH: 1, DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: 65535, - DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384 + DEFAULT_SETTINGS_MAX_FRAME_SIZE: 16384, }; for (const name of Object.keys(constants)) { diff --git a/test/parallel/test-http2-client-destroy.js b/test/parallel/test-http2-client-destroy.js index eab413e2327d8f..ddcadd9d53a014 100644 --- a/test/parallel/test-http2-client-destroy.js +++ b/test/parallel/test-http2-client-destroy.js @@ -15,7 +15,7 @@ const Countdown = require('../common/countdown'); server.listen(0, common.mustCall(() => { const destroyCallbacks = [ (client) => client.destroy(), - (client) => client[kSocket].destroy() + (client) => client[kSocket].destroy(), ]; const countdown = new Countdown(destroyCallbacks.length, () => { @@ -63,7 +63,7 @@ const Countdown = require('../common/countdown'); req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_CANCEL', type: Error, - message: 'The pending stream has been canceled' + message: 'The pending stream has been canceled', })); client.destroy(); @@ -73,7 +73,7 @@ const Countdown = require('../common/countdown'); const sessionError = { type: Error, code: 'ERR_HTTP2_INVALID_SESSION', - message: 'The session has been destroyed' + message: 'The session has been destroyed', }; common.expectsError(() => client.setNextStreamID(), sessionError); diff --git a/test/parallel/test-http2-client-http1-server.js b/test/parallel/test-http2-client-http1-server.js index c7535adcef2381..8ea7bdc4f5281e 100644 --- a/test/parallel/test-http2-client-http1-server.js +++ b/test/parallel/test-http2-client-http1-server.js @@ -21,14 +21,14 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_ERROR', type: NghttpError, - message: 'Protocol error' + message: 'Protocol error', })); client.on('error', common.expectsError({ code: 'ERR_HTTP2_ERROR', type: NghttpError, name: 'Error [ERR_HTTP2_ERROR]', - message: 'Protocol error' + message: 'Protocol error', })); client.on('close', common.mustCall(() => server.close())); diff --git a/test/parallel/test-http2-client-onconnect-errors.js b/test/parallel/test-http2-client-onconnect-errors.js index a75dc590c669a1..dbb3816f51a265 100644 --- a/test/parallel/test-http2-client-onconnect-errors.js +++ b/test/parallel/test-http2-client-onconnect-errors.js @@ -8,7 +8,7 @@ if (!common.hasCrypto) const { constants, Http2Session, - nghttp2ErrorString + nghttp2ErrorString, } = process.binding('http2'); const http2 = require('http2'); const { NghttpError } = require('internal/http2/util'); @@ -20,7 +20,7 @@ const { NghttpError } = require('internal/http2/util'); const specificTestKeys = [ 'NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE', - 'NGHTTP2_ERR_INVALID_ARGUMENT' + 'NGHTTP2_ERR_INVALID_ARGUMENT', ]; const specificTests = [ @@ -30,18 +30,18 @@ const specificTests = [ code: 'ERR_HTTP2_OUT_OF_STREAMS', type: 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', type: Error, - message: 'A stream cannot depend on itself' + message: 'A stream cannot depend on itself', }, - type: 'stream' + type: 'stream', }, ]; @@ -55,9 +55,9 @@ const genericTests = Object.getOwnPropertyNames(constants) code: 'ERR_HTTP2_ERROR', type: NghttpError, name: 'Error [ERR_HTTP2_ERROR]', - message: nghttp2ErrorString(constants[key]) + message: nghttp2ErrorString(constants[key]), }, - type: 'session' + type: 'session', })); const tests = specificTests.concat(genericTests); @@ -93,10 +93,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 3ad808cb1fbe23..7fcbe339a4c102 100644 --- a/test/parallel/test-http2-client-request-options-errors.js +++ b/test/parallel/test-http2-client-request-options-errors.js @@ -14,7 +14,7 @@ const optionsToTest = { weight: 'number', parent: 'number', exclusive: 'boolean', - silent: 'boolean' + silent: 'boolean', }; const types = { @@ -24,7 +24,7 @@ const types = { object: {}, array: [], null: null, - symbol: Symbol('test') + symbol: Symbol('test'), }; const server = http2.createServer(common.mustNotCall()); @@ -42,14 +42,14 @@ server.listen(0, common.mustCall(() => { common.expectsError( () => client.request({ ':method': 'CONNECT', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }, { - [option]: types[type] + [option]: types[type], }), { type: TypeError, code: 'ERR_INVALID_OPT_VALUE', message: `The value "${String(types[type])}" is invalid ` + - `for option "${option}"` + `for option "${option}"`, }); }); }); diff --git a/test/parallel/test-http2-client-rststream-before-connect.js b/test/parallel/test-http2-client-rststream-before-connect.js index 547ad2fa43b10b..54b89dfba444f9 100644 --- a/test/parallel/test-http2-client-rststream-before-connect.js +++ b/test/parallel/test-http2-client-rststream-before-connect.js @@ -23,7 +23,7 @@ server.listen(0, common.mustCall(() => { { type: RangeError, code: 'ERR_OUT_OF_RANGE', - message: 'The value of "code" is out of range.' + message: 'The value of "code" is out of range.', } ); assert.strictEqual(req.closed, false); @@ -34,7 +34,7 @@ server.listen(0, common.mustCall(() => { { type: TypeError, code: 'ERR_INVALID_CALLBACK', - message: 'Callback must be a function' + message: 'Callback must be a function', } ); assert.strictEqual(req.closed, false); @@ -59,7 +59,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: Error, - message: 'Stream closed with error code NGHTTP2_PROTOCOL_ERROR' + message: 'Stream closed with error code NGHTTP2_PROTOCOL_ERROR', })); req.on('response', common.mustCall()); diff --git a/test/parallel/test-http2-client-setNextStreamID-errors.js b/test/parallel/test-http2-client-setNextStreamID-errors.js index 0c982061b857e1..9226f973855e51 100644 --- a/test/parallel/test-http2-client-setNextStreamID-errors.js +++ b/test/parallel/test-http2-client-setNextStreamID-errors.js @@ -19,7 +19,7 @@ const types = { object: {}, array: [], null: null, - symbol: Symbol('test') + symbol: Symbol('test'), }; server.listen(0, common.mustCall(() => { @@ -33,7 +33,7 @@ server.listen(0, common.mustCall(() => { type: RangeError, code: 'ERR_OUT_OF_RANGE', message: 'The value of "id" is out of range.' + - ' It must be > 0 and <= 2147483647. Received ' + outOfRangeNum + ' It must be > 0 and <= 2147483647. Received ' + outOfRangeNum, } ); @@ -48,7 +48,7 @@ server.listen(0, common.mustCall(() => { { type: TypeError, code: 'ERR_INVALID_ARG_TYPE', - message: 'The "id" argument must be of type number' + message: 'The "id" argument must be of type number', } ); }); diff --git a/test/parallel/test-http2-client-settings-before-connect.js b/test/parallel/test-http2-client-settings-before-connect.js index ceea1bc39ad7d3..c694304ee03f76 100644 --- a/test/parallel/test-http2-client-settings-before-connect.js +++ b/test/parallel/test-http2-client-settings-before-connect.js @@ -34,13 +34,13 @@ server.listen(0, common.mustCall(() => { ['enablePush', 1, TypeError], ['enablePush', 0, TypeError], ['enablePush', null, TypeError], - ['enablePush', {}, TypeError] + ['enablePush', {}, TypeError], ].forEach(([name, value, errorType]) => common.expectsError( () => client.settings({ [name]: value }), { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', - type: errorType + type: errorType, } ) ); @@ -51,7 +51,7 @@ server.listen(0, common.mustCall(() => { { type: TypeError, code: 'ERR_INVALID_CALLBACK', - message: 'Callback must be a function' + message: 'Callback must be a function', } ) ); 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 884a38fac6f71d..fad6c3326edca0 100644 --- a/test/parallel/test-http2-client-stream-destroy-before-connect.js +++ b/test/parallel/test-http2-client-stream-destroy-before-connect.js @@ -33,7 +33,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ type: Error, - message: 'test' + message: 'test', })); req.on('close', common.mustCall((code) => { diff --git a/test/parallel/test-http2-client-unescaped-path.js b/test/parallel/test-http2-client-unescaped-path.js index ff122a02ca1a68..34495390965951 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', type: 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 c10698d417038d..0892de855cf8d7 100644 --- a/test/parallel/test-http2-client-write-empty-string.js +++ b/test/parallel/test-http2-client-write-empty-string.js @@ -9,7 +9,7 @@ if (!common.hasCrypto) for (const chunkSequence of [ [ '' ], - [ '', '' ] + [ '', '' ], ]) { const server = http2.createServer(); server.on('stream', common.mustCall((stream, headers, flags) => { @@ -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-compat-expect-continue-check.js b/test/parallel/test-http2-compat-expect-continue-check.js index 6aded8b52935c1..028e207a37e51e 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 42fa80ae4e8620..af929cb1890f06 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 e987118476337d..8c568734c5877c 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 5843104c019189..97d0a8453eb3c5 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_TYPE', type: TypeError, - message: 'The "method" argument must be of type string' + message: 'The "method" argument must be of type string', } ); common.expectsError( @@ -58,7 +58,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "method" argument must be of type string' + message: 'The "method" argument must be of type string', } ); @@ -75,7 +75,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-pause.js b/test/parallel/test-http2-compat-serverrequest-pause.js index 9c81e8ff6140c7..1fff4fbc085f46 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 81184d70752563..dfac1a387ec6c2 100644 --- a/test/parallel/test-http2-compat-serverrequest-settimeout.js +++ b/test/parallel/test-http2-compat-serverrequest-settimeout.js @@ -28,7 +28,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 285178cab66816..bb7d618a9fad57 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(); @@ -35,7 +35,7 @@ server.listen(0, common.mustCall(function() { 'x-foo', 'OxOxOxO', 'x-foo-test', - 'test, test' + 'test, test', ], request.rawTrailers); assert.strictEqual(data, 'test\ntest'); response.end(); @@ -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, { getTrailers(trailers) { @@ -57,7 +57,7 @@ server.listen(0, common.mustCall(function() { trailers['X-fOo'] = 'xOxOxOx'; trailers['X-foO'] = 'OxOxOxO'; trailers['x-foo-test'] = 'test, test'; - } + }, }); request.resume(); request.on('end', common.mustCall(function() { 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 e0ce51bfc7ac50..eea00ebd4185e7 100644 --- a/test/parallel/test-http2-compat-serverresponse-createpushresponse.js +++ b/test/parallel/test-http2-compat-serverresponse-createpushresponse.js @@ -19,18 +19,18 @@ const server = h2.createServer((request, response) => { common.expectsError( () => response.createPushResponse({ ':path': '/pushed', - ':method': 'GET' + ':method': 'GET', }, undefined), { code: 'ERR_INVALID_CALLBACK', type: TypeError, - message: 'Callback must be a function' + message: 'Callback must be a function', } ); response.createPushResponse({ ':path': '/pushed', - ':method': 'GET' + ':method': 'GET', }, common.mustCall((error, push) => { assert.ifError(error); assert.strictEqual(push.stream.id % 2, 0); @@ -41,7 +41,7 @@ const server = h2.createServer((request, response) => { setImmediate(function() { response.createPushResponse({ ':path': '/pushed', - ':method': 'GET' + ':method': 'GET', }, common.mustCall((error) => { assert.strictEqual(error.code, 'ERR_HTTP2_INVALID_STREAM'); })); diff --git a/test/parallel/test-http2-compat-serverresponse-destroy.js b/test/parallel/test-http2-compat-serverresponse-destroy.js index 8ee52a74ab4e81..535e13f734a3be 100644 --- a/test/parallel/test-http2-compat-serverresponse-destroy.js +++ b/test/parallel/test-http2-compat-serverresponse-destroy.js @@ -12,7 +12,7 @@ const Countdown = require('../common/countdown'); const errors = [ 'test-error', - Error('test') + Error('test'), ]; let nextError; @@ -58,7 +58,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: 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())); @@ -73,7 +73,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: 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.js b/test/parallel/test-http2-compat-serverresponse-end.js index 0e846a5948e3cc..a244190853ab08 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'); @@ -76,7 +76,7 @@ const { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.setEncoding('utf8'); @@ -106,7 +106,7 @@ const { ':path': '/', ':method': 'GET', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('data', mustNotCall()); @@ -133,7 +133,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', mustCall((headers, flags) => { @@ -167,7 +167,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('data', mustNotCall()); @@ -198,7 +198,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', mustCall((headers, flags) => { @@ -233,7 +233,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', mustCall((headers, flags) => { @@ -273,7 +273,7 @@ const { ':path': '/', ':method': 'HEAD', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const request = client.request(headers); request.on('response', mustCall((headers, flags) => { @@ -306,7 +306,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 ceaa6eb5c3cf2c..4f51f0ae07df18 100644 --- a/test/parallel/test-http2-compat-serverresponse-finished.js +++ b/test/parallel/test-http2-compat-serverresponse-finished.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-flushheaders.js b/test/parallel/test-http2-compat-serverresponse-flushheaders.js index d155b07863d26c..23fdd49460d5fd 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() { common.expectsError(() => { 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 206bd1c9d43e06..900f8a31fc0ef5 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 7b5313b8e7b037..cee3cd9211bc2c 100644 --- a/test/parallel/test-http2-compat-serverresponse-headers.js +++ b/test/parallel/test-http2-compat-serverresponse-headers.js @@ -46,7 +46,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "name" argument must be of type string' + message: 'The "name" argument must be of type string', } ); common.expectsError( @@ -54,7 +54,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "name" argument must be of type string' + message: 'The "name" argument must be of type string', } ); common.expectsError( @@ -62,7 +62,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "name" argument must be of type string' + message: 'The "name" argument must be of type string', } ); @@ -71,13 +71,13 @@ server.listen(0, common.mustCall(function() { ':method', ':path', ':authority', - ':scheme' + ':scheme', ].forEach((header) => common.expectsError( () => response.setHeader(header, 'foobar'), { code: 'ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED', type: Error, - message: 'Cannot set HTTP/2 pseudo-headers' + message: 'Cannot set HTTP/2 pseudo-headers', }) ); common.expectsError(function() { @@ -85,21 +85,21 @@ server.listen(0, common.mustCall(function() { }, { code: 'ERR_HTTP2_INVALID_HEADER_VALUE', type: TypeError, - message: 'Invalid value "null" for header "foo-bar"' + message: 'Invalid value "null" for header "foo-bar"', }); common.expectsError(function() { response.setHeader(real, undefined); }, { code: 'ERR_HTTP2_INVALID_HEADER_VALUE', type: TypeError, - message: 'Invalid value "undefined" for header "foo-bar"' + message: 'Invalid value "undefined" for header "foo-bar"', }); common.expectsError( () => response.setHeader(), // header name undefined { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "name" argument must be of type string' + message: 'The "name" argument must be of type string', } ); common.expectsError( @@ -107,7 +107,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_INVALID_HTTP_TOKEN', type: TypeError, - message: 'Header name must be a valid HTTP token [""]' + message: 'Header name must be a valid HTTP token [""]', } ); @@ -132,7 +132,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_HTTP2_HEADERS_SENT', type: Error, - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); common.expectsError( @@ -140,7 +140,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_HTTP2_HEADERS_SENT', type: Error, - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); @@ -150,7 +150,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_HTTP2_HEADERS_SENT', type: Error, - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); common.expectsError( @@ -158,7 +158,7 @@ server.listen(0, common.mustCall(function() { { code: 'ERR_HTTP2_HEADERS_SENT', type: Error, - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); @@ -175,7 +175,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 220a84a754d651..1ad7b78ca5616c 100644 --- a/test/parallel/test-http2-compat-serverresponse-settimeout.js +++ b/test/parallel/test-http2-compat-serverresponse-settimeout.js @@ -28,7 +28,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 dd92db8d96597a..bdb1a2a3c0fd3e 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', - type: RangeError + type: RangeError, }); common.expectsError(function() { response.statusCode = fakeStatusCodes.tooLow; }, { code: 'ERR_HTTP2_STATUS_INVALID', - type: RangeError + type: RangeError, }); common.expectsError(function() { response.statusCode = fakeStatusCodes.tooHigh; }, { code: 'ERR_HTTP2_STATUS_INVALID', - type: RangeError + type: 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 66ad8843fa33b9..4ceecdfcb15bef 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', type: TypeError, - message: 'Header name must be a valid HTTP token [""]' + message: 'Header name must be a valid HTTP token [""]', } ); common.expectsError( @@ -28,7 +28,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_HTTP2_INVALID_HEADER_VALUE', type: TypeError, - message: 'Invalid value "undefined" for header "test"' + message: 'Invalid value "undefined" for header "test"', } ); common.expectsError( @@ -36,7 +36,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_HTTP2_INVALID_HEADER_VALUE', type: TypeError, - message: 'Invalid value "null" for header "test"' + message: 'Invalid value "null" for header "test"', } ); common.expectsError( @@ -44,7 +44,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "name" argument must be of type string' + message: 'The "name" argument must be of type string', } ); common.expectsError( @@ -52,7 +52,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_INVALID_HTTP_TOKEN', type: 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 af3029835eaecb..8625462dc45187 100644 --- a/test/parallel/test-http2-compat-serverresponse-write.js +++ b/test/parallel/test-http2-compat-serverresponse-write.js @@ -5,7 +5,7 @@ const { mustNotCall, expectsError, hasCrypto, - skip + skip, } = require('../common'); if (!hasCrypto) skip('missing crypto'); @@ -38,7 +38,7 @@ server.listen(0, mustCall(() => { { type: 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-compat-serverresponse-writehead.js b/test/parallel/test-http2-compat-serverresponse-writehead.js index 5fd787e100350c..2d44d134ca44da 100644 --- a/test/parallel/test-http2-compat-serverresponse-writehead.js +++ b/test/parallel/test-http2-compat-serverresponse-writehead.js @@ -16,14 +16,14 @@ server.listen(0, common.mustCall(function() { response.writeHead(418, { 'foo-bar': 'abc123' }); // Override common.expectsError(() => { response.writeHead(300); }, { - code: 'ERR_HTTP2_HEADERS_SENT' + code: 'ERR_HTTP2_HEADERS_SENT', }); response.on('finish', common.mustCall(function() { server.close(); process.nextTick(common.mustCall(() => { common.expectsError(() => { response.writeHead(300); }, { - code: 'ERR_HTTP2_INVALID_STREAM' + code: 'ERR_HTTP2_INVALID_STREAM', }); })); })); @@ -36,7 +36,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-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-set.js b/test/parallel/test-http2-compat-socket-set.js index 05beb09d548e91..57051b2dea887f 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', type: 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 498677af6ee796..1f79cf53bec0eb 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', type: 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.js b/test/parallel/test-http2-connect-method.js index 0ddbc60433cf85..fdcc02cc18594a 100644 --- a/test/parallel/test-http2-connect-method.js +++ b/test/parallel/test-http2-connect-method.js @@ -14,7 +14,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) => { @@ -58,33 +58,33 @@ server.listen(0, common.mustCall(() => { // confirm that :authority is required and :scheme & :path are forbidden common.expectsError( () => 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', } ); common.expectsError( () => 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', } ); common.expectsError( () => 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.js b/test/parallel/test-http2-connect.js index 9b628db5aeebaa..0cdc70a91a8b8f 100644 --- a/test/parallel/test-http2-connect.js +++ b/test/parallel/test-http2-connect.js @@ -45,6 +45,6 @@ const { createServer, connect } = require('http2'); connect(authority); }, { code: 'ERR_HTTP2_UNSUPPORTED_PROTOCOL', - type: Error + type: Error, }); } diff --git a/test/parallel/test-http2-cookies.js b/test/parallel/test-http2-cookies.js index cf763915389287..70b8f9391bfaf8 100644 --- a/test/parallel/test-http2-cookies.js +++ b/test/parallel/test-http2-cookies.js @@ -11,7 +11,7 @@ const server = h2.createServer(); const setCookie = [ 'a=b', 'c=d; Wed, 21 Oct 2015 07:28:00 GMT; Secure; HttpOnly', - 'e=f' + 'e=f', ]; // we use the lower-level API here @@ -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 02c6c70642acb0..3b044dc537659c 100644 --- a/test/parallel/test-http2-create-client-connect.js +++ b/test/parallel/test-http2-create-client-connect.js @@ -23,7 +23,7 @@ const URL = url.URL; [new URL(`http://localhost:${port}`)], [url.parse(`http://localhost:${port}`)], [{ port }, { protocol: 'http:' }], - [{ port, hostname: '127.0.0.1' }, { protocol: 'http:' }] + [{ port, hostname: '127.0.0.1' }, { protocol: 'http:' }], ]; const serverClose = new Countdown(items.length + 1, @@ -51,7 +51,7 @@ const URL = url.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); @@ -65,7 +65,7 @@ const URL = url.URL; [new URL(`https://localhost:${port}`), opts], [url.parse(`https://localhost:${port}`), opts], [{ port: port, protocol: 'https:' }, opts], - [{ port: port, hostname: '127.0.0.1', protocol: 'https:' }, opts] + [{ port: port, hostname: '127.0.0.1', protocol: 'https:' }, opts], ]; const serverClose = new Countdown(items.length, diff --git a/test/parallel/test-http2-create-client-secure-session.js b/test/parallel/test-http2-create-client-secure-session.js index 1f20ec8e42a871..34bc3f5ac06df4 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 34e4e975d92d81..07d9c9eebfafc3 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-nooptions.js b/test/parallel/test-http2-createsecureserver-nooptions.js index 71764f5783e404..6efa4187da29f0 100644 --- a/test/parallel/test-http2-createsecureserver-nooptions.js +++ b/test/parallel/test-http2-createsecureserver-nooptions.js @@ -10,7 +10,7 @@ const invalidOptions = [() => {}, 1, 'test', null]; const invalidArgTypeError = { type: TypeError, code: 'ERR_INVALID_ARG_TYPE', - message: 'The "options" argument must be of type Object' + message: 'The "options" argument must be of type Object', }; // Error if options are not passed to createSecureServer diff --git a/test/parallel/test-http2-createwritereq.js b/test/parallel/test-http2-createwritereq.js index 1575424d1609b4..7fa780de986ea1 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-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 56b96321139630..27a6d4ca32d131 100644 --- a/test/parallel/test-http2-getpackedsettings.js +++ b/test/parallel/test-http2-getpackedsettings.js @@ -24,7 +24,7 @@ assert.deepStrictEqual(val, check); ['maxConcurrentStreams', 0], ['maxConcurrentStreams', 2 ** 31 - 1], ['maxHeaderListSize', 0], - ['maxHeaderListSize', 2 ** 32 - 1] + ['maxHeaderListSize', 2 ** 32 - 1], ].forEach((i) => { // Valid options should not throw. http2.getPackedSettings({ [i[0]]: i[1] }); @@ -43,26 +43,26 @@ http2.getPackedSettings({ enablePush: false }); ['maxConcurrentStreams', -1], ['maxConcurrentStreams', 2 ** 31], ['maxHeaderListSize', -1], - ['maxHeaderListSize', 2 ** 32] + ['maxHeaderListSize', 2 ** 32], ].forEach((i) => { common.expectsError(() => { http2.getPackedSettings({ [i[0]]: i[1] }); }, { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', type: RangeError, - message: `Invalid value for setting "${i[0]}": ${i[1]}` + message: `Invalid value for setting "${i[0]}": ${i[1]}`, }); }); [ - 1, null, '', Infinity, new Date(), {}, NaN, [false] + 1, null, '', Infinity, new Date(), {}, NaN, [false], ].forEach((i) => { common.expectsError(() => { http2.getPackedSettings({ enablePush: i }); }, { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', type: TypeError, - message: `Invalid value for setting "enablePush": ${i}` + message: `Invalid value for setting "enablePush": ${i}`, }); }); @@ -80,7 +80,7 @@ http2.getPackedSettings({ enablePush: false }); maxConcurrentStreams: 200, maxHeaderListSize: 100, enablePush: true, - foo: 'ignored' + foo: 'ignored', }); assert.strictEqual(packed.length, 36); assert.deepStrictEqual(packed, check); @@ -106,7 +106,8 @@ http2.getPackedSettings({ enablePush: false }); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "buf" argument must be one of type Buffer, TypedArray, or DataView' + 'The "buf" argument must be one of type ' + + 'Buffer, TypedArray, or DataView', }); }); @@ -115,7 +116,7 @@ http2.getPackedSettings({ enablePush: false }); }, { code: 'ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH', type: 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); @@ -164,7 +165,7 @@ http2.getPackedSettings({ enablePush: false }); }, { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', type: RangeError, - message: 'Invalid value for setting "maxFrameSize": 16777216' + message: 'Invalid value for setting "maxFrameSize": 16777216', }); } @@ -177,6 +178,6 @@ http2.getPackedSettings({ enablePush: false }); }, { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', type: RangeError, - message: 'Invalid value for setting "maxConcurrentStreams": 4294967295' + message: 'Invalid value for setting "maxConcurrentStreams": 4294967295', }); } diff --git a/test/parallel/test-http2-head-request.js b/test/parallel/test-http2-head-request.js index a56abf3c9006f3..ab81769dadd933 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({ type: Error, code: 'ERR_STREAM_WRITE_AFTER_END', - message: 'write after end' + message: 'write after end', }, 2); const { @@ -38,7 +38,7 @@ server.listen(0, () => { const req = client.request({ [HTTP2_HEADER_METHOD]: HTTP2_METHOD_HEAD, - [HTTP2_HEADER_PATH]: '/' + [HTTP2_HEADER_PATH]: '/', }); // Because it is a HEAD request, the payload is meaningless. The 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 20e2b122a24e8c..5392a678662aae 100644 --- a/test/parallel/test-http2-https-fallback-http-server-options.js +++ b/test/parallel/test-http2-https-fallback-http-server-options.js @@ -25,7 +25,7 @@ function onRequest(request, response) { response.end(JSON.stringify({ alpnProtocol, httpVersion: request.httpVersion, - userAgent: request.getUserAgent() + userAgent: request.getUserAgent(), })); } @@ -48,7 +48,7 @@ class MyServerResponse extends http.ServerResponse { cert, key, allowHTTP1: true, Http1IncomingMessage: MyIncomingMessage, - Http1ServerResponse: MyServerResponse + Http1ServerResponse: MyServerResponse, }, common.mustCall(onRequest, 1) ); @@ -63,7 +63,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 437add098b8a9f..595d222a7e5d0b 100644 --- a/test/parallel/test-http2-info-headers-errors.js +++ b/test/parallel/test-http2-info-headers-errors.js @@ -8,7 +8,7 @@ const http2 = require('http2'); const { constants, Http2Stream, - nghttp2ErrorString + nghttp2ErrorString, } = process.binding('http2'); const { NghttpError } = require('internal/http2/util'); @@ -28,9 +28,9 @@ const genericTests = Object.getOwnPropertyNames(constants) code: 'ERR_HTTP2_ERROR', type: NghttpError, name: 'Error [ERR_HTTP2_ERROR]', - message: nghttp2ErrorString(constants[key]) + message: nghttp2ErrorString(constants[key]), }, - type: 'stream' + type: 'stream', })); @@ -72,7 +72,7 @@ function runTest(test) { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: 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 2313040de12a97..cc07475e9a47a7 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', type: RangeError, - message: /^Invalid informational status code: 201$/ + message: /^Invalid informational status code: 201$/, }); common.expectsError(() => stream.additionalHeaders({ ':status': 101 }), { code: 'ERR_HTTP2_STATUS_101', type: Error, - message: status101regex + message: status101regex, }); common.expectsError( @@ -37,7 +37,7 @@ function onStream(stream, headers, flags) { { code: 'ERR_HTTP2_INVALID_PSEUDOHEADER', type: Error, - 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, }); common.expectsError(() => stream.additionalHeaders({ abc: 123 }), { code: 'ERR_HTTP2_HEADERS_AFTER_RESPOND', type: 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 ff189a2977559f..3e34e323446e35 100644 --- a/test/parallel/test-http2-invalidargtypes-errors.js +++ b/test/parallel/test-http2-invalidargtypes-errors.js @@ -13,7 +13,7 @@ server.on('stream', common.mustCall((stream) => { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "code" argument must be of type number' + message: 'The "code" argument must be of type number', } ); stream.respond(); diff --git a/test/parallel/test-http2-max-concurrent-streams.js b/test/parallel/test-http2-max-concurrent-streams.js index b270d6cc6aff31..14885186fd23e2 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', type: 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-methods.js b/test/parallel/test-http2-methods.js index a291bdf00800d5..327647ef4d4433 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 60a2cdabf847d9..83aeaa5dbc015c 100644 --- a/test/parallel/test-http2-misbehaving-flow-control-paused.js +++ b/test/parallel/test-http2-misbehaving-flow-control-paused.js @@ -25,13 +25,13 @@ const preamble = Buffer.from([ 0xa0, 0xe4, 0x1d, 0x13, 0x9d, 0x09, 0xb8, 0xf0, 0x1e, 0x07, 0x53, 0x03, 0x2a, 0x2f, 0x2a, 0x90, 0x7a, 0x8a, 0xaa, 0x69, 0xd2, 0x9a, 0xc4, 0xc0, 0x57, 0x0b, 0xcb, 0x87, 0x0f, 0x0d, 0x83, 0x08, 0x00, - 0x0f + 0x0f, ]); const data = Buffer.from([ 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a, 0x68, 0x65, 0x6c, - 0x6c, 0x6f, 0x0a, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a + 0x6c, 0x6f, 0x0a, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a, ]); // This is testing the case of a misbehaving client that is not paying @@ -63,7 +63,7 @@ server.on('stream', (stream) => { stream.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: 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 f2da0ba56c8e67..3296f7d5ab5ff6 100644 --- a/test/parallel/test-http2-misbehaving-flow-control.js +++ b/test/parallel/test-http2-misbehaving-flow-control.js @@ -25,7 +25,7 @@ const preamble = Buffer.from([ 0xa0, 0xe4, 0x1d, 0x13, 0x9d, 0x09, 0xb8, 0xf0, 0x1e, 0x07, 0x53, 0x03, 0x2a, 0x2f, 0x2a, 0x90, 0x7a, 0x8a, 0xaa, 0x69, 0xd2, 0x9a, 0xc4, 0xc0, 0x57, 0x0b, 0xcb, 0x87, 0x0f, 0x0d, 0x83, 0x08, 0x00, - 0x0f + 0x0f, ]); const data = Buffer.from([ @@ -46,7 +46,7 @@ const data = Buffer.from([ 0x6c, 0x6f, 0x0a, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a, 0x68, 0x65, 0x6c, - 0x6c, 0x6f, 0x0a, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a + 0x6c, 0x6f, 0x0a, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x0a, ]); // This is testing the case of a misbehaving client that is not paying @@ -69,7 +69,7 @@ server.on('stream', (stream) => { stream.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: 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 aba1721a562a3b..f3173c3310f86f 100644 --- a/test/parallel/test-http2-misbehaving-multiplex.js +++ b/test/parallel/test-http2-misbehaving-multiplex.js @@ -21,7 +21,7 @@ server.on('session', common.mustCall((session) => { session.on('error', common.expectsError({ code: 'ERR_HTTP2_ERROR', type: 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 993424f77130ea..11410116467ced 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 @@ common.expectsError( { code: 'ERR_HTTP2_INVALID_SETTING_VALUE', type: RangeError, - message: 'Invalid value for setting "test": -1' + message: 'Invalid value for setting "test": -1', }); assertWithinRange('test', 1); @@ -35,7 +35,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "test" argument must be of type Object' + message: 'The "test" argument must be of type Object', }); common.expectsError( @@ -43,7 +43,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "test" argument must be of type Date' + message: 'The "test" argument must be of type Date', }); assertIsObject({}, 'test'); diff --git a/test/parallel/test-http2-misused-pseudoheaders.js b/test/parallel/test-http2-misused-pseudoheaders.js index e9253baa74ad1d..98bbbc532034e1 100644 --- a/test/parallel/test-http2-misused-pseudoheaders.js +++ b/test/parallel/test-http2-misused-pseudoheaders.js @@ -12,22 +12,22 @@ server.on('stream', common.mustCall((stream) => { ':path', ':authority', ':method', - ':scheme' + ':scheme', ].forEach((i) => { common.expectsError(() => stream.respond({ [i]: '/' }), { - code: 'ERR_HTTP2_INVALID_PSEUDOHEADER' + code: 'ERR_HTTP2_INVALID_PSEUDOHEADER', }); }); stream.respond({}, { getTrailers: common.mustCall((trailers) => { trailers[':status'] = 'bar'; - }) + }), }); stream.on('error', common.expectsError({ - code: 'ERR_HTTP2_INVALID_PSEUDOHEADER' + code: 'ERR_HTTP2_INVALID_PSEUDOHEADER', })); stream.end('hello world'); @@ -41,7 +41,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: Error, - message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR' + message: 'Stream closed with error code NGHTTP2_INTERNAL_ERROR', })); req.on('response', common.mustCall()); diff --git a/test/parallel/test-http2-multi-content-length.js b/test/parallel/test-http2-multi-content-length.js index c64b803a0ecca3..81b0e2b86b118a 100644 --- a/test/parallel/test-http2-multi-content-length.js +++ b/test/parallel/test-http2-multi-content-length.js @@ -27,12 +27,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', type: Error, - message: 'Header field "content-length" must have only a single value' + message: 'Header field "content-length" must have only a single value', } ); @@ -40,7 +40,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()); @@ -58,7 +58,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: 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-multiheaders-raw.js b/test/parallel/test-http2-multiheaders-raw.js index da9aa3a68eaa51..56b418b2a2a6be 100644 --- a/test/parallel/test-http2-multiheaders-raw.js +++ b/test/parallel/test-http2-multiheaders-raw.js @@ -31,7 +31,7 @@ server.on('stream', common.mustCall((stream, headers, flags, rawHeaders) => { 'www-authenticate', 'baz', 'test', - 'foo, bar, baz' + 'foo, bar, baz', ]; assert.deepStrictEqual(expected, rawHeaders); diff --git a/test/parallel/test-http2-no-more-streams.js b/test/parallel/test-http2-no-more-streams.js index ff0c8baa14ccdb..4f443e0d3a55dc 100644 --- a/test/parallel/test-http2-no-more-streams.js +++ b/test/parallel/test-http2-no-more-streams.js @@ -45,7 +45,8 @@ server.listen(0, common.mustCall(() => { code: 'ERR_HTTP2_OUT_OF_STREAMS', type: Error, message: - 'No stream ID is available because maximum stream ID has been reached' + 'No stream ID is available because' + + ' maximum stream ID has been reached', })); req.on('error', () => countdown.dec()); } 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 0706e6a83e6d48..d56ddd257ae530 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', type: 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-padding-aligned.js b/test/parallel/test-http2-padding-aligned.js index 183eaef7389360..3ccec5ec9aff18 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-padding-callback.js b/test/parallel/test-http2-padding-callback.js index 6d6a6b27221b07..4c5e3029d09048 100644 --- a/test/parallel/test-http2-padding-callback.js +++ b/test/parallel/test-http2-padding-callback.js @@ -20,7 +20,7 @@ function selectPadding(frameLen, max) { // 3. For the server response data frame const options = { paddingStrategy: PADDING_STRATEGY_CALLBACK, - selectPadding: common.mustCall(selectPadding, 3) + selectPadding: common.mustCall(selectPadding, 3), }; const server = h2.createServer(options); @@ -29,7 +29,7 @@ server.on('stream', common.mustCall(onStream)); 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-perf_hooks.js b/test/parallel/test-http2-perf_hooks.js index e30d0ac83e0d1f..972b532a4b9e26 100644 --- a/test/parallel/test-http2-perf_hooks.js +++ b/test/parallel/test-http2-perf_hooks.js @@ -65,7 +65,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-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 0280f656d065db..9e5c3006f51751 100644 --- a/test/parallel/test-http2-ping.js +++ b/test/parallel/test-http2-ping.js @@ -32,7 +32,7 @@ const hook = async_hooks.createHook({ if (pings.has(id)) { events[3]++; } - } + }, }); hook.enable(); @@ -76,7 +76,7 @@ server.listen(0, common.mustCall(() => { assert(!client.ping(common.expectsError({ code: 'ERR_HTTP2_PING_CANCEL', type: Error, - message: 'HTTP2 ping cancelled' + message: 'HTTP2 ping cancelled', }))); // should throw if payload is not of type ArrayBufferView @@ -88,7 +88,7 @@ server.listen(0, common.mustCall(() => { type: TypeError, code: 'ERR_INVALID_ARG_TYPE', message: 'The "payload" argument must be one of type' + - ' Buffer, TypedArray, or DataView' + ' Buffer, TypedArray, or DataView', } ) ); @@ -104,7 +104,7 @@ server.listen(0, common.mustCall(() => { { type: RangeError, code: 'ERR_HTTP2_PING_LENGTH', - message: 'HTTP2 ping payload must be 8 bytes' + message: 'HTTP2 ping payload must be 8 bytes', } ) ); @@ -119,7 +119,7 @@ server.listen(0, common.mustCall(() => { { type: TypeError, code: 'ERR_INVALID_CALLBACK', - message: 'Callback must be a function' + message: 'Callback must be a function', } ) ); diff --git a/test/parallel/test-http2-priority-event.js b/test/parallel/test-http2-priority-event.js index fe04ffb342d70d..66cd67a431e0ee 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-respond-errors.js b/test/parallel/test-http2-respond-errors.js index 656a27df26edb5..caf76b8b67626d 100644 --- a/test/parallel/test-http2-respond-errors.js +++ b/test/parallel/test-http2-respond-errors.js @@ -14,7 +14,7 @@ const types = { object: {}, array: [], null: null, - symbol: Symbol('test') + symbol: Symbol('test'), }; const server = http2.createServer(); @@ -30,24 +30,24 @@ server.on('stream', common.mustCall((stream) => { common.expectsError( () => stream.respond({ - 'content-type': 'text/plain' + 'content-type': 'text/plain', }, { - ['getTrailers']: value + ['getTrailers']: value, }), { type: TypeError, code: 'ERR_INVALID_OPT_VALUE', message: `The value "${String(value)}" is invalid ` + - 'for option "getTrailers"' + 'for option "getTrailers"', } ); }); // Send headers stream.respond({ - 'content-type': 'text/plain' + 'content-type': 'text/plain', }, { - ['getTrailers']: () => common.mustCall() + ['getTrailers']: () => common.mustCall(), }); // Should throw if headers already sent @@ -56,7 +56,7 @@ server.on('stream', common.mustCall((stream) => { { type: Error, code: 'ERR_HTTP2_HEADERS_SENT', - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); @@ -67,7 +67,7 @@ server.on('stream', common.mustCall((stream) => { { type: 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 b0ba634e67df69..fad297d8c4e713 100644 --- a/test/parallel/test-http2-respond-file-204.js +++ b/test/parallel/test-http2-respond-file-204.js @@ -8,7 +8,7 @@ const http2 = require('http2'); const { HTTP2_HEADER_CONTENT_TYPE, - HTTP2_HEADER_STATUS + HTTP2_HEADER_STATUS, } = http2.constants; const fname = fixtures.path('elipses.txt'); @@ -18,12 +18,12 @@ server.on('stream', (stream) => { common.expectsError(() => { stream.respondWithFile(fname, { [HTTP2_HEADER_STATUS]: 204, - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' + [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain', }); }, { code: 'ERR_HTTP2_PAYLOAD_FORBIDDEN', type: 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 536c48c624e73c..5ae0fb7f923032 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 60bc21f185dd5c..6dd9ec804a5a56 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', type: 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 6818616227df89..3ce0ca70a788db 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', type: Error, - message: 'Only regular files can be sent' + message: 'Only regular files can 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-errors.js b/test/parallel/test-http2-respond-file-errors.js index 83d3900bc5c288..71578167087ff9 100644 --- a/test/parallel/test-http2-respond-file-errors.js +++ b/test/parallel/test-http2-respond-file-errors.js @@ -10,7 +10,7 @@ const optionsWithTypeError = { offset: 'number', length: 'number', statCheck: 'function', - getTrailers: 'function' + getTrailers: 'function', }; const types = { @@ -20,7 +20,7 @@ const types = { object: {}, array: [], null: null, - symbol: Symbol('test') + symbol: Symbol('test'), }; const fname = fixtures.path('elipses.txt'); @@ -38,15 +38,15 @@ server.on('stream', common.mustCall((stream) => { common.expectsError( () => stream.respondWithFile(fname, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }, { - [option]: types[type] + [option]: types[type], }), { type: TypeError, code: 'ERR_INVALID_OPT_VALUE', message: `The value "${String(types[type])}" is invalid ` + - `for option "${option}"` + `for option "${option}"`, } ); }); @@ -60,7 +60,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`, } )); @@ -68,11 +68,11 @@ server.on('stream', common.mustCall((stream) => { stream.respond({ ':status': 200 }); common.expectsError( () => 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.', } ); @@ -80,11 +80,11 @@ server.on('stream', common.mustCall((stream) => { stream.destroy(); common.expectsError( () => 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 44876b60e1c4cb..d0ec7893dacb4e 100644 --- a/test/parallel/test-http2-respond-file-fd-errors.js +++ b/test/parallel/test-http2-respond-file-fd-errors.js @@ -11,7 +11,7 @@ const optionsWithTypeError = { offset: 'number', length: 'number', statCheck: 'function', - getTrailers: 'function' + getTrailers: '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'); @@ -38,12 +38,12 @@ server.on('stream', common.mustCall((stream) => { common.expectsError( () => stream.respondWithFD(types[type], { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }), { type: TypeError, code: 'ERR_INVALID_ARG_TYPE', - message: 'The "fd" argument must be of type number' + message: 'The "fd" argument must be of type number', } ); }); @@ -57,15 +57,15 @@ server.on('stream', common.mustCall((stream) => { common.expectsError( () => stream.respondWithFD(fd, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }, { - [option]: types[type] + [option]: types[type], }), { type: TypeError, code: 'ERR_INVALID_OPT_VALUE', message: `The value "${String(types[type])}" is invalid ` + - `for option "${option}"` + `for option "${option}"`, } ); }); @@ -80,7 +80,7 @@ server.on('stream', common.mustCall((stream) => { { code: 'ERR_HTTP2_PAYLOAD_FORBIDDEN', type: Error, - message: `Responses with ${status} status must not have a payload` + message: `Responses with ${status} status must not have a payload`, } )); @@ -88,12 +88,12 @@ server.on('stream', common.mustCall((stream) => { stream.respond(); common.expectsError( () => stream.respondWithFD(fd, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }), { code: 'ERR_HTTP2_HEADERS_SENT', type: Error, - message: 'Response has already been initiated.' + message: 'Response has already been initiated.', } ); @@ -101,12 +101,12 @@ server.on('stream', common.mustCall((stream) => { stream.destroy(); common.expectsError( () => stream.respondWithFD(fd, { - 'content-type': 'text/plain' + 'content-type': 'text/plain', }), { code: 'ERR_HTTP2_INVALID_STREAM', type: 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 21fcf790b449eb..bc9371879a40ee 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', type: 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-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.js b/test/parallel/test-http2-respond-file.js index 9ad8e7a69648dc..b5e4d16616f911 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', (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; - } + }, }); }); server.listen(0, () => { diff --git a/test/parallel/test-http2-respond-nghttperrors.js b/test/parallel/test-http2-respond-nghttperrors.js index ad9eee0d59fecc..47cf01315a94f8 100644 --- a/test/parallel/test-http2-respond-nghttperrors.js +++ b/test/parallel/test-http2-respond-nghttperrors.js @@ -8,7 +8,7 @@ const http2 = require('http2'); const { constants, Http2Stream, - nghttp2ErrorString + nghttp2ErrorString, } = process.binding('http2'); const { NghttpError } = require('internal/http2/util'); @@ -29,9 +29,9 @@ const genericTests = Object.getOwnPropertyNames(constants) code: 'ERR_HTTP2_ERROR', type: NghttpError, name: 'Error [ERR_HTTP2_ERROR]', - message: nghttp2ErrorString(constants[key]) + message: nghttp2ErrorString(constants[key]), }, - type: 'stream' + type: 'stream', })); @@ -72,7 +72,7 @@ function runTest(test) { ':path': '/', ':method': 'POST', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const client = http2.connect(url); @@ -80,7 +80,7 @@ function runTest(test) { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: 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 0eccd231c63a2e..da5cc3a1dd1efc 100644 --- a/test/parallel/test-http2-respond-with-fd-errors.js +++ b/test/parallel/test-http2-respond-with-fd-errors.js @@ -13,7 +13,7 @@ const http2 = require('http2'); const { constants, Http2Stream, - nghttp2ErrorString + nghttp2ErrorString, } = process.binding('http2'); const { NghttpError } = require('internal/http2/util'); @@ -36,9 +36,9 @@ const genericTests = Object.getOwnPropertyNames(constants) code: 'ERR_HTTP2_ERROR', type: NghttpError, name: 'Error [ERR_HTTP2_ERROR]', - message: nghttp2ErrorString(constants[key]) + message: nghttp2ErrorString(constants[key]), }, - type: 'stream' + type: 'stream', })); @@ -79,7 +79,7 @@ function runTest(test) { ':path': '/', ':method': 'POST', ':scheme': 'http', - ':authority': `localhost:${port}` + ':authority': `localhost:${port}`, }; const client = http2.connect(url); @@ -88,7 +88,7 @@ function runTest(test) { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: 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-sent-headers.js b/test/parallel/test-http2-sent-headers.js index bffa4d71c6d5f3..2f229a3ed504a5 100644 --- a/test/parallel/test-http2-sent-headers.js +++ b/test/parallel/test-http2-sent-headers.js @@ -15,7 +15,7 @@ server.on('stream', common.mustCall((stream) => { stream.respond({ abc: 'xyz' }, { getTrailers(headers) { headers.xyz = 'abc'; - } + }, }); assert.strictEqual(stream.sentHeaders.abc, 'xyz'); assert.strictEqual(stream.sentHeaders[':status'], 200); 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 394993d4d72088..8cb0a0474f8a0f 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', type: 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 78b3e26ad4968b..0f3d8e8dd245ee 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', - type: Error + type: 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 f752f44310c0df..598608b34fa6cb 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' + message: 'Callback must be a function', } ); @@ -31,7 +31,7 @@ server.on('stream', common.mustCall((stream, headers) => { () => stream.pushStream({ 'connection': 'test' }, {}, () => {}), { code: 'ERR_HTTP2_INVALID_CONNECTION_HEADERS', - 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 a6d2fe127827a8..2b148f30e59a37 100644 --- a/test/parallel/test-http2-server-push-stream-errors.js +++ b/test/parallel/test-http2-server-push-stream-errors.js @@ -8,7 +8,7 @@ const http2 = require('http2'); const { constants, Http2Stream, - nghttp2ErrorString + nghttp2ErrorString, } = process.binding('http2'); const { NghttpError } = require('internal/http2/util'); @@ -19,7 +19,7 @@ const { NghttpError } = require('internal/http2/util'); const specificTestKeys = [ 'NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE', - 'NGHTTP2_ERR_STREAM_CLOSED' + 'NGHTTP2_ERR_STREAM_CLOSED', ]; const specificTests = [ @@ -29,17 +29,17 @@ const specificTests = [ code: 'ERR_HTTP2_OUT_OF_STREAMS', type: 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', - type: Error + type: Error, }, - type: 'stream' + type: 'stream', }, ]; @@ -53,9 +53,9 @@ const genericTests = Object.getOwnPropertyNames(constants) code: 'ERR_HTTP2_ERROR', type: NghttpError, name: 'Error [ERR_HTTP2_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 cd2276746f4bdd..137085c0bf128e 100644 --- a/test/parallel/test-http2-server-push-stream-head.js +++ b/test/parallel/test-http2-server-push-stream-head.js @@ -27,7 +27,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 6ac10cae77f951..6d4ac2ec72cd2b 100644 --- a/test/parallel/test-http2-server-push-stream.js +++ b/test/parallel/test-http2-server-push-stream.js @@ -27,7 +27,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 74181f4ffa0bbe..6b6ee83b4879d5 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) { common.expectsError(() => { 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 4a58091aa61d7f..536ebd5bafa4d7 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 = [ @@ -21,7 +21,7 @@ const tests = [ [NGHTTP2_PROTOCOL_ERROR, true], [NGHTTP2_CANCEL, false], [NGHTTP2_REFUSED_STREAM, true], - [NGHTTP2_INTERNAL_ERROR, true] + [NGHTTP2_INTERNAL_ERROR, true], ]; const server = http2.createServer(); @@ -40,7 +40,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((code) => { assert.strictEqual(code, test[0]); diff --git a/test/parallel/test-http2-server-sessionerror.js b/test/parallel/test-http2-server-sessionerror.js index 525eb2e6efd11a..891265232da791 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({ type: 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 a43fbb212958c8..b3432bb1619d12 100644 --- a/test/parallel/test-http2-server-settimeout-no-callback.js +++ b/test/parallel/test-http2-server-settimeout-no-callback.js @@ -14,7 +14,7 @@ const verifyCallbacks = (server) => { const invalidCallBackError = { type: TypeError, code: 'ERR_INVALID_CALLBACK', - message: 'Callback must be a function' + message: 'Callback must be a function', }; notFunctions.forEach((notFunction) => diff --git a/test/parallel/test-http2-server-shutdown-before-respond.js b/test/parallel/test-http2-server-shutdown-before-respond.js index 33f224fc69a9d5..69726903b302af 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 6cee8f25729535..5c09f90e3e2541 100644 --- a/test/parallel/test-http2-server-shutdown-options-errors.js +++ b/test/parallel/test-http2-server-shutdown-options-errors.js @@ -12,7 +12,7 @@ const types = [ {}, [], null, - new Date() + new Date(), ]; server.on('stream', common.mustCall((stream) => { @@ -24,7 +24,7 @@ server.on('stream', common.mustCall((stream) => { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "code" argument must be of type number' + message: 'The "code" argument must be of type number', } ); common.expectsError( @@ -32,7 +32,7 @@ server.on('stream', common.mustCall((stream) => { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "lastStreamID" argument must be of type number' + message: 'The "lastStreamID" argument must be of type number', } ); common.expectsError( @@ -41,7 +41,7 @@ server.on('stream', common.mustCall((stream) => { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "opaqueData" argument must be one of type Buffer, ' + - 'TypedArray, or DataView' + 'TypedArray, or DataView', } ); }); diff --git a/test/parallel/test-http2-server-shutdown-redundant.js b/test/parallel/test-http2-server-shutdown-redundant.js index f47a0d2c951c86..c8c1c959bcec65 100644 --- a/test/parallel/test-http2-server-shutdown-redundant.js +++ b/test/parallel/test-http2-server-shutdown-redundant.js @@ -16,7 +16,7 @@ server.on('stream', common.mustCall((stream) => { () => session.goaway(3), { code: 'ERR_HTTP2_INVALID_SESSION', - type: Error + type: Error, } ); })); @@ -25,12 +25,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 4ebcc21c27aa8e..8193549077ee68 100644 --- a/test/parallel/test-http2-server-startup.js +++ b/test/parallel/test-http2-server-startup.js @@ -16,7 +16,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. @@ -63,7 +63,7 @@ server.on('error', common.mustNotCall()); client = tls.connect({ port: port, rejectUnauthorized: false, - ALPNProtocols: ['h2'] + ALPNProtocols: ['h2'], }, common.mustCall()); })); } diff --git a/test/parallel/test-http2-server-stream-session-destroy.js b/test/parallel/test-http2-server-stream-session-destroy.js index 5eb04a8d376635..ce7415ba6fa2f4 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 = { type: Error, code: 'ERR_HTTP2_INVALID_STREAM', - message: 'The stream has been destroyed' + message: 'The stream has been destroyed', }; common.expectsError(() => stream.additionalHeaders(), invalidStreamError); common.expectsError(() => stream.priority(), invalidStreamError); @@ -31,7 +31,7 @@ server.on('stream', common.mustCall((stream) => { () => stream.pushStream({}, common.mustNotCall()), { code: 'ERR_HTTP2_PUSH_DISABLED', - type: Error + type: Error, } ); assert.strictEqual(stream.write('data'), false); 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 bb23760cebf967..754ccfee91a612 100644 --- a/test/parallel/test-http2-session-gc-while-write-scheduled.js +++ b/test/parallel/test-http2-session-gc-while-write-scheduled.js @@ -13,7 +13,7 @@ const makeDuplexPair = require('../common/duplexpair'); { // 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 6061808082519d..e0917e54a349fe 100644 --- a/test/parallel/test-http2-session-settings.js +++ b/test/parallel/test-http2-session-settings.js @@ -32,7 +32,7 @@ server.on( stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }); stream.end('hello world'); }) @@ -44,8 +44,8 @@ server.listen( const client = h2.connect(`http://localhost:${server.address().port}`, { settings: { enablePush: false, - initialWindowSize: 123456 - } + initialWindowSize: 123456, + }, }); client.on( @@ -87,7 +87,7 @@ server.listen( ['maxFrameSize', 16383], ['maxFrameSize', 2 ** 24], ['maxHeaderListSize', -1], - ['maxHeaderListSize', 2 ** 32] + ['maxHeaderListSize', 2 ** 32], ].forEach((i) => { const settings = {}; settings[i[0]] = i[1]; @@ -96,7 +96,7 @@ server.listen( { type: 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]}`, } ); }); @@ -108,7 +108,7 @@ server.listen( { type: 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 e63cd0d208e32b..1c4e9a161476f8 100644 --- a/test/parallel/test-http2-session-unref.js +++ b/test/parallel/test-http2-session-unref.js @@ -41,7 +41,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.destroy(); client.unref(); 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 c545b065015050..b8bcd2f3271e14 100644 --- a/test/parallel/test-http2-single-headers.js +++ b/test/parallel/test-http2-single-headers.js @@ -18,7 +18,7 @@ const singles = [ 'if-unmodified-since', 'from', 'location', - 'max-forwards' + 'max-forwards', ]; server.on('stream', common.mustNotCall()); @@ -32,7 +32,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_HTTP2_HEADER_SINGLE_VALUE', type: Error, - message: `Header field "${i}" must have only a single value` + message: `Header field "${i}" must have only a single value`, } ); @@ -41,7 +41,7 @@ server.listen(0, common.mustCall(() => { { code: 'ERR_HTTP2_HEADER_SINGLE_VALUE', type: Error, - message: `Header field "${i}" must have only a single value` + message: `Header field "${i}" must have only a single value`, } ); }); diff --git a/test/parallel/test-http2-socket-proxy.js b/test/parallel/test-http2-socket-proxy.js index 71429b3db2f196..72e680c01ef105 100644 --- a/test/parallel/test-http2-socket-proxy.js +++ b/test/parallel/test-http2-socket-proxy.js @@ -17,7 +17,7 @@ const errMsg = { code: 'ERR_HTTP2_NO_SOCKET_MANIPULATION', type: 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 3337aad32d7f70..343fe1d548a996 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', type: 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 db5822776aea5e..e0c5c173b2df62 100644 --- a/test/parallel/test-http2-timeouts.js +++ b/test/parallel/test-http2-timeouts.js @@ -21,7 +21,7 @@ server.on('stream', common.mustCall((stream) => { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "msecs" argument must be of type number. Received type string' + 'The "msecs" argument must be of type number. Received type string', } ); common.expectsError( @@ -29,7 +29,7 @@ server.on('stream', common.mustCall((stream) => { { code: 'ERR_INVALID_CALLBACK', type: TypeError, - message: 'Callback must be a function' + message: 'Callback must be a function', } ); common.expectsError( @@ -37,7 +37,7 @@ server.on('stream', common.mustCall((stream) => { { code: 'ERR_INVALID_CALLBACK', type: TypeError, - message: 'Callback must be a function' + message: 'Callback must be a function', } ); })); diff --git a/test/parallel/test-http2-too-large-headers.js b/test/parallel/test-http2-too-large-headers.js index ad7a24f39b2fa2..2a790cc36fc614 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; const server = http2.createServer({ settings: { maxHeaderListSize: 100 } }); @@ -20,7 +20,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: 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((code) => { assert.strictEqual(code, 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 9b57060be695bb..218c3023941c23 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', type: 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((code) => { assert.strictEqual(code, 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 0302fe623da07c..9b3dcfd990add1 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', - type: Error + type: 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 1ca5bdf70d05b0..6af72c30b40e5b 100644 --- a/test/parallel/test-http2-trailers.js +++ b/test/parallel/test-http2-trailers.js @@ -21,11 +21,11 @@ function onStream(stream, headers, flags) { })); stream.respond({ 'content-type': 'text/html', - ':status': 200 + ':status': 200, }, { getTrailers: common.mustCall((trailers) => { trailers[trailerKey] = trailerValue; - }) + }), }); stream.end(body); } @@ -37,7 +37,7 @@ server.on('listening', common.mustCall(function() { const req = client.request({ ':path': '/', ':method': 'POST' }, { getTrailers: common.mustCall((trailers) => { trailers[trailerKey] = trailerValue; - }) + }), }); req.on('data', common.mustCall()); req.on('trailers', common.mustCall((headers) => { diff --git a/test/parallel/test-http2-util-assert-valid-pseudoheader.js b/test/parallel/test-http2-util-assert-valid-pseudoheader.js index 27050fedd6c579..628867d63d14d6 100644 --- a/test/parallel/test-http2-util-assert-valid-pseudoheader.js +++ b/test/parallel/test-http2-util-assert-valid-pseudoheader.js @@ -18,7 +18,7 @@ function isError(val) { common.expectsError({ code: 'ERR_HTTP2_INVALID_PSEUDOHEADER', type: Error, - message: '":foo" is an invalid pseudoheader or is used incorrectly' + message: '":foo" is an invalid pseudoheader or is used incorrectly', })(val); } diff --git a/test/parallel/test-http2-util-asserts.js b/test/parallel/test-http2-util-asserts.js index bfed09de4f72b8..2dd91859afcee9 100644 --- a/test/parallel/test-http2-util-asserts.js +++ b/test/parallel/test-http2-util-asserts.js @@ -12,7 +12,7 @@ const { {}, Object.create(null), new Date(), - new (class Foo {})() + new (class Foo {})(), ].forEach((i) => { assertIsObject(i, 'foo', 'Object'); }); @@ -24,12 +24,12 @@ const { NaN, Infinity, [], - [{}] + [{}], ].forEach((i) => { common.expectsError(() => assertIsObject(i, 'foo', 'Object'), { code: 'ERR_INVALID_ARG_TYPE', - message: /^The "foo" argument must be of type Object$/ + message: /^The "foo" argument must be of type Object$/, }); }); @@ -38,5 +38,5 @@ assertWithinRange('foo', 1, 0, 2); common.expectsError(() => 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 0ff6b558d9a51b..0b623c4c033b83 100644 --- a/test/parallel/test-http2-util-headers-list.js +++ b/test/parallel/test-http2-util-headers-list.js @@ -87,7 +87,7 @@ const { HTTP2_HEADER_TRANSFER_ENCODING, HTTP2_HEADER_HOST, HTTP2_HEADER_KEEP_ALIVE, - HTTP2_HEADER_PROXY_CONNECTION + HTTP2_HEADER_PROXY_CONNECTION, } = process.binding('http2').constants; { @@ -97,7 +97,7 @@ const { ':path': 'abc', 'xyz': [1, '2', { toString() { return '3'; } }, 4], 'foo': [], - 'BAR': [1] + 'BAR': [1], }; assert.deepStrictEqual( @@ -113,7 +113,7 @@ const { ':path': 'abc', ':status': [200], ':authority': [], - 'xyz': [1, 2, 3, 4] + 'xyz': [1, 2, 3, 4], }; assert.deepStrictEqual( @@ -130,7 +130,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( @@ -160,7 +160,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), @@ -178,7 +178,7 @@ const { common.expectsError({ code: 'ERR_HTTP2_HEADER_SINGLE_VALUE', type: Error, - message: 'Header field ":status" must have only a single value' + message: 'Header field ":status" must have only a single value', })(mapToHeaders(headers)); } @@ -221,12 +221,12 @@ const { HTTP2_HEADER_TK, HTTP2_HEADER_UPGRADE_INSECURE_REQUESTS, HTTP2_HEADER_USER_AGENT, - HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS + HTTP2_HEADER_X_CONTENT_TYPE_OPTIONS, ].forEach((name) => { const msg = `Header field "${name}" must have only a single value`; common.expectsError({ code: 'ERR_HTTP2_HEADER_SINGLE_VALUE', - message: msg + message: msg, })(mapToHeaders({ [name]: [1, 2, 3] })); }); @@ -259,7 +259,7 @@ const { HTTP2_HEADER_VIA, HTTP2_HEADER_WARNING, HTTP2_HEADER_WWW_AUTHENTICATE, - HTTP2_HEADER_X_FRAME_OPTIONS + HTTP2_HEADER_X_FRAME_OPTIONS, ].forEach((name) => { assert(!(mapToHeaders({ [name]: [1, 2, 3] }) instanceof Error), name); }); @@ -279,25 +279,25 @@ const { 'TE', 'Transfer-Encoding', 'Proxy-Connection', - 'Keep-Alive' + 'Keep-Alive', ].forEach((name) => { common.expectsError({ code: 'ERR_HTTP2_INVALID_CONNECTION_HEADERS', message: 'HTTP/1 Connection specific headers are forbidden: ' + - `"${name.toLowerCase()}"` + `"${name.toLowerCase()}"`, })(mapToHeaders({ [name]: 'abc' })); }); common.expectsError({ code: 'ERR_HTTP2_INVALID_CONNECTION_HEADERS', message: 'HTTP/1 Connection specific headers are forbidden: ' + - `"${HTTP2_HEADER_TE}"` + `"${HTTP2_HEADER_TE}"`, })(mapToHeaders({ [HTTP2_HEADER_TE]: ['abc'] })); common.expectsError({ code: 'ERR_HTTP2_INVALID_CONNECTION_HEADERS', message: 'HTTP/1 Connection specific headers are forbidden: ' + - `"${HTTP2_HEADER_TE}"` + `"${HTTP2_HEADER_TE}"`, })(mapToHeaders({ [HTTP2_HEADER_TE]: ['abc', 'trailers'] })); assert(!(mapToHeaders({ te: 'trailers' }) instanceof Error)); diff --git a/test/parallel/test-http2-util-nghttp2error.js b/test/parallel/test-http2-util-nghttp2error.js index 7a9009515b3234..67b8fe82237bd9 100644 --- a/test/parallel/test-http2-util-nghttp2error.js +++ b/test/parallel/test-http2-util-nghttp2error.js @@ -12,5 +12,5 @@ common.expectsError(() => { }, { code: 'ERR_HTTP2_ERROR', type: NghttpError, - message: 'Invalid argument' + message: 'Invalid argument', }); diff --git a/test/parallel/test-http2-util-update-options-buffer.js b/test/parallel/test-http2-util-update-options-buffer.js index 6ab8bcff02866e..78673a24c409d6 100644 --- a/test/parallel/test-http2-util-update-options-buffer.js +++ b/test/parallel/test-http2-util-update-options-buffer.js @@ -33,7 +33,7 @@ const IDX_OPTIONS_FLAGS = 9; maxHeaderListPairs: 6, maxOutstandingPings: 7, maxOutstandingSettings: 8, - maxSessionMemory: 9 + maxSessionMemory: 9, }); strictEqual(optionsBuffer[IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE], 1); @@ -67,7 +67,7 @@ const IDX_OPTIONS_FLAGS = 9; 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 3d1c14de847e48..02edaf84b8e565 100644 --- a/test/parallel/test-http2-window-size.js +++ b/test/parallel/test-http2-window-size.js @@ -49,15 +49,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) => { @@ -90,7 +90,7 @@ const initialWindowSizeList = [ (1 << 8) - 1, 1 << 8, 1 << 17, - undefined // use default window size which is (1 << 16) - 1 + undefined, // use default window size which is (1 << 16) - 1 ]; // Call `run` on each element in the cartesian product of buffersList and 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-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-agent-additional-options.js b/test/parallel/test-https-agent-additional-options.js index 8d10524d902ca7..4851acdd71f3f4 100644 --- a/test/parallel/test-https-agent-additional-options.js +++ b/test/parallel/test-https-agent-additional-options.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, function(req, res) { diff --git a/test/parallel/test-https-agent-create-connection.js b/test/parallel/test-https-agent-create-connection.js index 5dcf73cc76d6aa..737cbeea872c4f 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); 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-getname.js b/test/parallel/test-https-agent-getname.js index c29e09731df0b2..f7ebeb7d404b84 100644 --- a/test/parallel/test-https-agent-getname.js +++ b/test/parallel/test-https-agent-getname.js @@ -33,7 +33,7 @@ const options = { secureOptions: 0, secureProtocol: 'secureProtocol', servername: 'localhost', - sessionIdContext: 'sessionIdContext' + sessionIdContext: 'sessionIdContext', }; assert.strictEqual( diff --git a/test/parallel/test-https-agent-servername.js b/test/parallel/test-https-agent-servername.js index df14d113994f89..6cf41fd7e1ee8e 100644 --- a/test/parallel/test-https-agent-servername.js +++ b/test/parallel/test-https-agent-servername.js @@ -10,7 +10,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'), }; @@ -26,7 +26,7 @@ server.listen(0, function() { port: this.address().port, rejectUnauthorized: true, servername: 'agent1', - ca: options.ca + ca: options.ca, }, function(res) { res.resume(); console.log(res.statusCode); diff --git a/test/parallel/test-https-agent-session-eviction.js b/test/parallel/test-https-agent-session-eviction.js index cf6a1341c1e03f..d03e6e808c1aa0 100644 --- a/test/parallel/test-https-agent-session-eviction.js +++ b/test/parallel/test-https-agent-session-eviction.js @@ -14,7 +14,7 @@ const { OPENSSL_VERSION_NUMBER, SSL_OP_NO_TICKET } = const options = { key: readKey('agent1-key.pem'), cert: readKey('agent1-cert.pem'), - secureOptions: SSL_OP_NO_TICKET + secureOptions: SSL_OP_NO_TICKET, }; // 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(); }); @@ -85,7 +85,7 @@ function second(server, session) { function third(server) { const req = https.request({ port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function(res) { res.resume(); assert(!req.socket.isSessionReused()); diff --git a/test/parallel/test-https-agent-session-reuse.js b/test/parallel/test-https-agent-session-reuse.js index 0717a3f8165d67..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,8 +89,8 @@ const server = https.createServer(options, function(req, res) { path: '/', servername: 'agent1', ca: ca, - port: this.address().port - } + port: this.address().port, + }, ]; function request() { diff --git a/test/parallel/test-https-agent-sni.js b/test/parallel/test-https-agent-sni.js index 80278ed2d8fe96..8cd6459565f344 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; @@ -19,7 +19,7 @@ const server = https.Server(options, function(req, res) { if (--waiting === 0) server.close(); res.writeHead(200, { - 'x-sni': req.socket.servername + 'x-sni': req.socket.servername, }); res.end('hello world'); }); @@ -33,7 +33,7 @@ server.listen(0, function() { } const agent = new https.Agent({ - maxSockets: 1 + maxSockets: 1, }); for (let j = 0; j < TOTAL; j++) { https.get({ @@ -43,7 +43,7 @@ server.listen(0, function() { port: this.address().port, host: '127.0.0.1', servername: `sni.${j}`, - rejectUnauthorized: false + rejectUnauthorized: false, }, expectResponse(j)); } }); 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 835b85e004080f..a96b3d305127d0 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, function() { 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 56a6fe6d18641a..2b7d81267c6be2 100644 --- a/test/parallel/test-https-client-get-url.js +++ b/test/parallel/test-https-client-get-url.js @@ -36,7 +36,7 @@ const URL = url.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-reject.js b/test/parallel/test-https-client-reject.js index 729256df54ff8c..d9aca2cfa2dc54 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.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + cert: fixtures.readSync('test_cert.pem'), }; 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.readSync('test_cert.pem')] + ca: [fixtures.readSync('test_cert.pem')], }; 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 149f0ccf01ae5f..338b9671910b12 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 @@ -48,7 +48,7 @@ server.listen(0, function() { let session1 = null; const client1 = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { console.log('connect1'); assert.ok(!client1.isSessionReused(), 'Session *should not* be reused.'); @@ -64,7 +64,7 @@ server.listen(0, function() { const opts = { port: server.address().port, rejectUnauthorized: false, - session: session1 + session: session1, }; const client2 = tls.connect(opts, function() { diff --git a/test/parallel/test-https-close.js b/test/parallel/test-https-close.js index f33754fb818940..77f54f61deddeb 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, function() { port: this.address().port, path: '/', method: 'GET', - rejectUnauthorized: false + rejectUnauthorized: false, }; const req = https.request(requestOptions, function(res) { diff --git a/test/parallel/test-https-connect-address-family.js b/test/parallel/test-https-connect-address-family.js index 8b3584b3396551..0ec844cbd41dfe 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 98e43b27d4cebd..bc62a0022c0c08 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.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + cert: fixtures.readSync('test_cert.pem'), }; 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 2e42680c7d6d5f..8f85fcf9ace4a2 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 2a22bda60e74cf..ffec423ad5e502 100644 --- a/test/parallel/test-https-foafssl.js +++ b/test/parallel/test-https-foafssl.js @@ -36,7 +36,7 @@ const options = { key: fixtures.readSync('agent.key'), cert: fixtures.readSync('agent.crt'), requestCert: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; const modulus = 'A6F44A9C25791431214F5C87AF9E040177A8BB89AC803F7E09BBC3A5519F' + diff --git a/test/parallel/test-https-host-headers.js b/test/parallel/test-https-host-headers.js index eb0e8b896a85ca..da8c94a98250e7 100644 --- a/test/parallel/test-https-host-headers.js +++ b/test/parallel/test-https-host-headers.js @@ -10,7 +10,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 httpsServer = https.createServer(options, reqHandler); @@ -57,7 +57,7 @@ function testHttps() { host: 'localhost', //agent: false, port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', thrower); https.request({ @@ -66,7 +66,7 @@ function testHttps() { host: 'localhost', //agent: false, port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', thrower).end(); https.request({ @@ -75,7 +75,7 @@ function testHttps() { host: 'localhost', //agent: false, port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', thrower).end(); https.request({ @@ -84,7 +84,7 @@ function testHttps() { host: 'localhost', //agent: false, port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', thrower).end(); https.request({ @@ -93,7 +93,7 @@ function testHttps() { host: 'localhost', //agent: false, port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', thrower).end(); https.get({ @@ -102,7 +102,7 @@ function testHttps() { host: 'localhost', setHost: false, port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, cb).on('error', thrower).end(); }); } 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 bfa24457dac64e..d38d2849d1b7ec 100644 --- a/test/parallel/test-https-localaddress.js +++ b/test/parallel/test-https-localaddress.js @@ -33,7 +33,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) { @@ -54,7 +54,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-options-boolean-check.js b/test/parallel/test-https-options-boolean-check.js index fa223aa8872bd6..981e634bec53b3 100644 --- a/test/parallel/test-https-options-boolean-check.js +++ b/test/parallel/test-https-options-boolean-check.js @@ -62,11 +62,11 @@ const invalidCertRE = /^The "cert" argument must be one of type string, Buffer, [[keyStr, keyStr2], false], [false, [certStr, certStr2]], [[{ pem: keyBuff }], false], - [[{ pem: keyBuff }, { pem: keyBuff }], false] + [[{ pem: keyBuff }, { pem: keyBuff }], false], ].forEach((params) => { https.createServer({ key: params[0], - cert: params[1] + cert: params[1], }); }); @@ -96,17 +96,17 @@ const invalidCertRE = /^The "cert" argument must be one of type string, Buffer, [[true, false], [certBuff, certBuff2], invalidKeyRE], [[keyStr, keyStr2], [true, false], invalidCertRE], [[keyStr, keyStr2], true, invalidCertRE], - [true, [certBuff, certBuff2], invalidKeyRE] + [true, [certBuff, certBuff2], invalidKeyRE], ].forEach((params) => { common.expectsError(() => { https.createServer({ key: params[0], - cert: params[1] + cert: params[1], }); }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: params[2] + message: params[2], }); }); @@ -124,7 +124,7 @@ const invalidCertRE = /^The "cert" argument must be one of type string, Buffer, https.createServer({ key: params[0], cert: params[1], - ca: params[2] + ca: params[2], }); }); @@ -135,17 +135,17 @@ const invalidCertRE = /^The "cert" argument must be one of type string, Buffer, [keyBuff, certBuff, {}], [keyBuff, certBuff, 1], [keyBuff, certBuff, true], - [keyBuff, certBuff, [caCert, true]] + [keyBuff, certBuff, [caCert, true]], ].forEach((params) => { common.expectsError(() => { https.createServer({ key: params[0], cert: params[1], - ca: params[2] + ca: params[2], }); }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "ca" argument must be one of type string, Buffer, TypedArray, or DataView$/ + message: /^The "ca" argument must be one of type string, Buffer, TypedArray, or DataView$/, }); }); diff --git a/test/parallel/test-https-pfx.js b/test/parallel/test-https-pfx.js index 7cf23a7dfa17f4..b20c6a4f47081a 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-req-split.js b/test/parallel/test-https-req-split.js index 05fc85fc07b781..3c5c8cf5110a54 100644 --- a/test/parallel/test-https-req-split.js +++ b/test/parallel/test-https-req-split.js @@ -34,7 +34,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'), }; // Force splitting incoming data @@ -55,8 +55,8 @@ server.listen(0, function() { agent: false, headers: { Connection: 'Upgrade', - Upgrade: 'Websocket' - } + Upgrade: 'Websocket', + }, }, function() { req.socket.destroy(); server.close(); diff --git a/test/parallel/test-https-resume-after-renew.js b/test/parallel/test-https-resume-after-renew.js index 5a621e8f561829..14e278a6264b7a 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) { @@ -42,7 +42,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-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-set-timeout-server.js b/test/parallel/test-https-set-timeout-server.js index e353f0afde5a92..3f25b5be82b1aa 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 b6a7c692ebb5ae..3392858ee57059 100644 --- a/test/parallel/test-https-simple.js +++ b/test/parallel/test-https-simple.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'), }; const tests = 2; @@ -62,7 +62,7 @@ server.listen(0, common.mustCall(() => { port: port, path: '/', method: 'GET', - rejectUnauthorized: false + rejectUnauthorized: false, }; noCertCheckOptions.Agent = new https.Agent(noCertCheckOptions); @@ -89,7 +89,7 @@ server.listen(0, common.mustCall(() => { hostname: '127.0.0.1', port: port, path: '/', - method: 'GET' + method: 'GET', }; const checkCertReq = https.request(checkCertOptions, function(res) { 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 f575f524061580..93b20f4d1991c0 100644 --- a/test/parallel/test-https-strict.js +++ b/test/parallel/test-https-strict.js @@ -59,17 +59,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 e034adc39d2899..af4685f91b1211 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(); diff --git a/test/parallel/test-https-unix-socket-self-signed.js b/test/parallel/test-https-unix-socket-self-signed.js index 48207a7a22f52a..dc0624a759adf7 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.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + key: fixtures.readSync('test_key.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-transcode.js b/test/parallel/test-icu-transcode.js index 4f51e7230452ce..8568b4d9c4c2dd 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, 0xe9, 0x00, 0x73, 0x00, 0x74, 0x00, 0x20, 0x00, - 0xac, 0x20] + 0xac, 0x20], }; for (const test in tests) { @@ -47,7 +47,7 @@ common.expectsError( type: TypeError, code: 'ERR_INVALID_ARG_TYPE', message: 'The "source" argument must be one of type Buffer ' + - 'or Uint8Array. Received type null' + 'or Uint8Array. Received type null', } ); diff --git a/test/parallel/test-inspect-async-hook-setup-at-inspect.js b/test/parallel/test-inspect-async-hook-setup-at-inspect.js index 6b1c875138ba01..d50b083756bcd8 100644 --- a/test/parallel/test-inspect-async-hook-setup-at-inspect.js +++ b/test/parallel/test-inspect-async-hook-setup-at-inspect.js @@ -32,7 +32,7 @@ async function setupTimeoutForStackTrace(session) { await session.send([ { 'method': 'Runtime.evaluate', 'params': { expression: 'setupTimeoutWithBreak()' } }, - { 'method': 'Debugger.resume' } + { 'method': 'Debugger.resume' }, ]); } @@ -56,7 +56,7 @@ async function runTests() { 'params': { 'maxDepth': 10 } }, { 'method': 'Debugger.setBlackboxPatterns', 'params': { 'patterns': [] } }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]); await waitForInitialSetup(session); diff --git a/test/parallel/test-inspector-esm.js b/test/parallel/test-inspector-esm.js index 3171da58cf7a4c..a371f80086716f 100644 --- a/test/parallel/test-inspector-esm.js +++ b/test/parallel/test-inspector-esm.js @@ -40,7 +40,7 @@ async function testBreakpointOnStart(session) { 'params': { 'interval': 100 } }, { 'method': 'Debugger.setBlackboxPatterns', 'params': { 'patterns': [] } }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]; await session.send(commands); @@ -55,8 +55,8 @@ async function testBreakpoint(session) { 'params': { 'lineNumber': 7, 'url': session.scriptURL(), 'columnNumber': 0, - 'condition': '' - } + 'condition': '', + }, }, { 'method': 'Debugger.resume' }, ]; @@ -78,8 +78,8 @@ async function testBreakpoint(session) { 'objectId': scopeId, 'ownProperties': false, 'accessorPropertiesOnly': false, - 'generatePreview': true - } + 'generatePreview': true, + }, }); assertScopeValues(response, { t: 1001, k: 1, message: 'A message' }); @@ -91,16 +91,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-internal-errors.js b/test/parallel/test-internal-errors.js index 9bce8a59eafa5b..7a271a43102991 100644 --- a/test/parallel/test-internal-errors.js +++ b/test/parallel/test-internal-errors.js @@ -56,86 +56,86 @@ common.expectsError( () => new errors.Error('TEST_FOO_KEY'), { code: 'ERR_ASSERTION', - message: invalidKey('TEST_FOO_KEY') + message: invalidKey('TEST_FOO_KEY'), }); // Calling it twice yields same result (using the key does not create it) common.expectsError( () => new errors.Error('TEST_FOO_KEY'), { code: 'ERR_ASSERTION', - message: invalidKey('TEST_FOO_KEY') + message: invalidKey('TEST_FOO_KEY'), }); common.expectsError( () => new errors.Error(1), { code: 'ERR_ASSERTION', - message: invalidKey(1) + message: invalidKey(1), }); common.expectsError( () => new errors.Error({}), { code: 'ERR_ASSERTION', - message: invalidKey('\\[object Object\\]') + message: invalidKey('\\[object Object\\]'), }); common.expectsError( () => new errors.Error([]), { code: 'ERR_ASSERTION', - message: invalidKey('') + message: invalidKey(''), }); common.expectsError( () => new errors.Error(true), { code: 'ERR_ASSERTION', - message: invalidKey('true') + message: invalidKey('true'), }); common.expectsError( () => new errors.TypeError(1), { code: 'ERR_ASSERTION', - message: invalidKey(1) + message: invalidKey(1), }); common.expectsError( () => new errors.TypeError({}), { code: 'ERR_ASSERTION', - message: invalidKey('\\[object Object\\]') + message: invalidKey('\\[object Object\\]'), }); common.expectsError( () => new errors.TypeError([]), { code: 'ERR_ASSERTION', - message: invalidKey('') + message: invalidKey(''), }); common.expectsError( () => new errors.TypeError(true), { code: 'ERR_ASSERTION', - message: invalidKey('true') + message: invalidKey('true'), }); common.expectsError( () => new errors.RangeError(1), { code: 'ERR_ASSERTION', - message: invalidKey(1) + message: invalidKey(1), }); common.expectsError( () => new errors.RangeError({}), { code: 'ERR_ASSERTION', - message: invalidKey('\\[object Object\\]') + message: invalidKey('\\[object Object\\]'), }); common.expectsError( () => new errors.RangeError([]), { code: 'ERR_ASSERTION', - message: invalidKey('') + message: invalidKey(''), }); common.expectsError( () => new errors.RangeError(true), { code: 'ERR_ASSERTION', - message: invalidKey('true') + message: invalidKey('true'), }); // Tests for common.expectsError @@ -155,7 +155,7 @@ common.expectsError(() => { }, { code: 'TEST_ERROR_1', type: TypeError, - message: 'Error for testing purposes: a' + message: 'Error for testing purposes: a', }); common.expectsError(() => { @@ -164,7 +164,7 @@ common.expectsError(() => { }, { code: 'TEST_ERROR_1', type: RangeError }); }, { code: 'ERR_ASSERTION', - message: /^.+ is not instance of \S/ + message: /^.+ is not instance of \S/, }); common.expectsError(() => { @@ -176,7 +176,7 @@ common.expectsError(() => { }, { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: /.+ does not match \S/ + message: /.+ does not match \S/, }); // // Test ERR_INVALID_ARG_TYPE @@ -227,7 +227,7 @@ common.expectsError( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: /^At least one expected value needs to be specified$/ + message: /^At least one expected value needs to be specified$/, }); // Test ERR_MISSING_ARGS @@ -242,7 +242,7 @@ common.expectsError( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: /^At least one arg needs to be specified$/ + message: /^At least one arg needs to be specified$/, }); // Test ERR_SOCKET_BAD_PORT diff --git a/test/parallel/test-internal-module-map-asserts.js b/test/parallel/test-internal-module-map-asserts.js index 1160c910421b80..79854d9e54e443 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/loader/ModuleMap'); const errorReg = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "url" argument must be of type string/ + message: /^The "url" argument must be of type string/, }, 15); const moduleMap = new ModuleMap(); @@ -33,7 +33,7 @@ const ModuleMap = require('internal/loader/ModuleMap'); const errorReg = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "job" argument must be of type ModuleJob/ + message: /^The "job" argument must be of type ModuleJob/, }, 5); const moduleMap = new ModuleMap(); diff --git a/test/parallel/test-internal-os.js b/test/parallel/test-internal-os.js index c4014abc5b1c0f..3c05f6cf2d2950 100644 --- a/test/parallel/test-internal-os.js +++ b/test/parallel/test-internal-os.js @@ -19,7 +19,7 @@ const specs = [ ['255.255.9.0', 'ipv4', null], ['255.255.1.0', 'ipv4', null], ['ffff:ffff:43::', 'ipv6', null], - ['ffff:ffff:ffff:1::', 'ipv6', null] + ['ffff:ffff:ffff:1::', 'ipv6', null], ]; specs.forEach(([mask, protocol, expectedSuffix]) => { diff --git a/test/parallel/test-internal-socket-list-receive.js b/test/parallel/test-internal-socket-list-receive.js index c0eb223719ae6f..b793331b8d4f7a 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 797baf43f4dd76..51bcc826b4c44b 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', type: 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', type: 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', type: 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 035519c9c9ef7a..60634b98e34ef9 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', - type: Error + type: Error, }); assert.throws(() => util.assertCrypto(), expectedError); } else { diff --git a/test/parallel/test-internal-util-decorate-error-stack.js b/test/parallel/test-internal-util-decorate-error-stack.js index 5694d746c667f4..797c155666c0f3 100644 --- a/test/parallel/test-internal-util-decorate-error-stack.js +++ b/test/parallel/test-internal-util-decorate-error-stack.js @@ -55,7 +55,7 @@ checkStack(err.stack); // Verify that the stack is only decorated once for uncaught exceptions. const args = [ '-e', - `require('${badSyntaxPath}')` + `require('${badSyntaxPath}')`, ]; const result = spawnSync(process.argv[0], args, { encoding: 'utf8' }); checkStack(result.stderr); diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index a1aea88aaddd92..135b51452f890c 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -68,7 +68,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 da8abd868300e3..d1639572d7fd5f 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 master = spawn(process.execPath, [__filename, 'master'], { stdio: [ 0, 'pipe', 2, server._handle, 'ipc' ], - detached: true + detached: true, }); // Now close the parent, so that the master is the only thing @@ -117,7 +117,7 @@ function test(cb) { function master() { console.error('in master, spawning worker'); cluster.setupMaster({ - 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 aad8d663c915c8..a40c63b62d69b1 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 b2b9c74a9a2da1..e7a70a9e62e03b 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 b21b5ee55d2e31..8898beaf6697a3 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-microtask-queue-integration-domain.js b/test/parallel/test-microtask-queue-integration-domain.js index 8a4a06f9ffbe5e..c6278f02c8c59f 100644 --- a/test/parallel/test-microtask-queue-integration-domain.js +++ b/test/parallel/test-microtask-queue-integration-domain.js @@ -35,7 +35,7 @@ common.crashOnUnhandledRejection(); const implementations = [ function(fn) { Promise.resolve().then(fn); - } + }, ]; let expected = 0; diff --git a/test/parallel/test-microtask-queue-integration.js b/test/parallel/test-microtask-queue-integration.js index a7241d99ee9395..88fcfe49887f75 100644 --- a/test/parallel/test-microtask-queue-integration.js +++ b/test/parallel/test-microtask-queue-integration.js @@ -28,7 +28,7 @@ common.crashOnUnhandledRejection(); const implementations = [ function(fn) { Promise.resolve().then(fn); - } + }, ]; let expected = 0; diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js index 811d7d5ded8576..2d46c4866cbdde 100644 --- a/test/parallel/test-module-loading-error.js +++ b/test/parallel/test-module-loading-error.js @@ -30,7 +30,7 @@ const errorMessagesByPlatform = { sunos: ['unknown file type', 'not an ELF file'], darwin: ['file too short'], aix: ['Cannot load module', - 'Cannot run a file that does not have a valid format.'] + 'Cannot run a file that does not have a valid format.'], }; // If we don't know a priori what the error would be, we accept anything. const errorMessages = errorMessagesByPlatform[process.platform] || ['']; @@ -66,7 +66,7 @@ const re = /^The "id" argument must be of type string\. Received type \w+$/; { type: TypeError, code: 'ERR_INVALID_ARG_TYPE', - message: re + message: re, }); }); @@ -76,12 +76,12 @@ common.expectsError( { type: Error, 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 \'\'', }); common.expectsError( () => { 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 c79d2e6e72c64c..8d87b4a1ee0a17 100644 --- a/test/parallel/test-module-nodemodulepaths.js +++ b/test/parallel/test-module-nodemodulepaths.js @@ -39,8 +39,8 @@ const cases = { 'C:\\Users\\hefangshi\\AppData\\node_modules', 'C:\\Users\\hefangshi\\node_modules', 'C:\\Users\\node_modules', - 'C:\\node_modules' - ] + 'C:\\node_modules', + ], }, { file: 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo', expect: [ @@ -48,8 +48,8 @@ const cases = { 'C:\\Users\\Rocko Artischocko\\node_stuff\\node_modules', 'C:\\Users\\Rocko Artischocko\\node_modules', 'C:\\Users\\node_modules', - 'C:\\node_modules' - ] + 'C:\\node_modules', + ], }, { file: 'C:\\Users\\Rocko Artischocko\\node_stuff\\foo_node_modules', expect: [ @@ -58,18 +58,18 @@ Artischocko\\node_stuff\\foo_node_modules\\node_modules', 'C:\\Users\\Rocko Artischocko\\node_stuff\\node_modules', 'C:\\Users\\Rocko Artischocko\\node_modules', 'C:\\Users\\node_modules', - 'C:\\node_modules' - ] + 'C:\\node_modules', + ], }, { file: 'C:\\node_modules', expect: [ - 'C:\\node_modules' - ] + 'C:\\node_modules', + ], }, { file: 'C:\\', expect: [ - 'C:\\node_modules' - ] + 'C:\\node_modules', + ], }], 'POSIX': [{ file: '/usr/lib/node_modules/npm/node_modules/\ @@ -83,8 +83,8 @@ node-gyp/node_modules/glob/node_modules', '/usr/lib/node_modules/npm/node_modules', '/usr/lib/node_modules', '/usr/node_modules', - '/node_modules' - ] + '/node_modules', + ], }, { file: '/usr/test/lib/node_modules/npm/foo', expect: [ @@ -93,8 +93,8 @@ node-gyp/node_modules/glob/node_modules', '/usr/test/lib/node_modules', '/usr/test/node_modules', '/usr/node_modules', - '/node_modules' - ] + '/node_modules', + ], }, { file: '/usr/test/lib/node_modules/npm/foo_node_modules', expect: [ @@ -103,19 +103,19 @@ node-gyp/node_modules/glob/node_modules', '/usr/test/lib/node_modules', '/usr/test/node_modules', '/usr/node_modules', - '/node_modules' - ] + '/node_modules', + ], }, { file: '/node_modules', expect: [ - '/node_modules' - ] + '/node_modules', + ], }, { file: '/', expect: [ - '/node_modules' - ] - }] + '/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 0d16894ff83f6c..87039b60955046 100644 --- a/test/parallel/test-net-better-error-messages-path.js +++ b/test/parallel/test-net-better-error-messages-path.js @@ -9,7 +9,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 1a8aa770b44a22..9648dadd202c5b 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 assert = require('assert'); 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()); diff --git a/test/parallel/test-net-binary.js b/test/parallel/test-net-binary.js index b8dbc0e8d70e8f..1e8f0992b9aa67 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-buffer.js b/test/parallel/test-net-connect-buffer.js index 028ea22183634a..94c88f8ac7ba22 100644 --- a/test/parallel/test-net-connect-buffer.js +++ b/test/parallel/test-net-connect-buffer.js @@ -54,7 +54,7 @@ tcp.listen(0, common.mustCall(function() { { code: 'ERR_STREAM_NULL_VALUES', type: TypeError, - message: 'May not write null values to stream' + message: 'May not write null values to stream', }); [ true, @@ -66,12 +66,12 @@ tcp.listen(0, common.mustCall(function() { +Infinity, -Infinity, [], - {} + {}, ].forEach((v) => { common.expectsError(() => socket.write(v), { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "chunk" argument must be one of type string or Buffer' + message: 'The "chunk" argument must be one of type string or Buffer', }); }); diff --git a/test/parallel/test-net-connect-immediate-finish.js b/test/parallel/test-net-connect-immediate-finish.js index 27d988ab5af45f..0a78de84c5c3d5 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((err) => { diff --git a/test/parallel/test-net-connect-options-fd.js b/test/parallel/test-net-connect-options-fd.js index 76a5e30755b15c..c609368a0f7470 100644 --- a/test/parallel/test-net-connect-options-fd.js +++ b/test/parallel/test-net-connect-options-fd.js @@ -23,7 +23,7 @@ function testClients(getSocketOpt, getConnectOpt, getConnectCb) { .on('connect', getConnectCb(3)), new net.Socket(getSocketOpt(4)).connect(getConnectOpt(4), getConnectCb(4)), new net.Socket(getSocketOpt(5)).connect(getConnectOpt(5)) - .on('connect', getConnectCb(5)) + .on('connect', getConnectCb(5)), ]; } @@ -81,7 +81,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 ea3fadf7211af6..f6f3378f1193b7 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 = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }, 96); syncFailToConnect(true, portTypeError); @@ -43,7 +43,7 @@ const net = require('net'); { const portRangeError = common.expectsError({ code: 'ERR_SOCKET_BAD_PORT', - type: RangeError + type: RangeError, }, 168); syncFailToConnect('', portRangeError); @@ -66,7 +66,7 @@ const net = require('net'); common.expectsError(block, { code: 'ERR_INVALID_OPT_VALUE', type: TypeError, - message: /The value "\d+" is invalid for option "hints"/ + message: /The value "\d+" is invalid for option "hints"/, }); } } @@ -123,7 +123,7 @@ function doConnect(args, getCb) { const socket = new net.Socket(); return socket.connect.apply(socket, args) .on('connect', getCb()); - } + }, ]; } diff --git a/test/parallel/test-net-dns-custom-lookup.js b/test/parallel/test-net-dns-custom-lookup.js index c7a01f5fa6faec..adb51c53799ab5 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); diff --git a/test/parallel/test-net-end-close.js b/test/parallel/test-net-end-close.js index 31c150e09c09af..a1c460f44421af 100644 --- a/test/parallel/test-net-end-close.js +++ b/test/parallel/test-net-end-close.js @@ -10,9 +10,9 @@ const s = new net.Socket({ readStart: function() { setImmediate(() => this.onread(uv.UV_EOF, null)); }, - close: (cb) => setImmediate(cb) + close: (cb) => setImmediate(cb), }, - writable: false + writable: false, }); assert.strictEqual(s, s.resume()); diff --git a/test/parallel/test-net-isip.js b/test/parallel/test-net-isip.js index e9a8749aaee412..61d7a3c0777167 100644 --- a/test/parallel/test-net-isip.js +++ b/test/parallel/test-net-isip.js @@ -72,7 +72,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); @@ -87,7 +87,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 00d5e73cb17675..ae097f997389cc 100644 --- a/test/parallel/test-net-listen-exclusive-random-ports.js +++ b/test/parallel/test-net-listen-exclusive-random-ports.js @@ -28,7 +28,7 @@ if (cluster.isMaster) { server.listen({ port: 0, - exclusive: true + exclusive: true, }, function() { process.send(server.address().port); }); diff --git a/test/parallel/test-net-options-lookup.js b/test/parallel/test-net-options-lookup.js index 0b4e18f12f04f0..e2385aeb6935e0 100644 --- a/test/parallel/test-net-options-lookup.js +++ b/test/parallel/test-net-options-lookup.js @@ -9,14 +9,14 @@ function connectThrows(input) { const opts = { host: 'localhost', port: 0, - lookup: input + lookup: input, }; common.expectsError(() => { net.connect(opts); }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); } @@ -26,7 +26,7 @@ function connectDoesNotThrow(input) { const opts = { host: 'localhost', port: 0, - lookup: input + lookup: input, }; net.connect(opts); 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 4b1a8d07334ac2..c0ebcf87c7907b 100644 --- a/test/parallel/test-net-server-call-listen-multiple-times.js +++ b/test/parallel/test-net-server-call-listen-multiple-times.js @@ -30,7 +30,7 @@ const net = require('net'); common.expectsError(() => server.listen(), { code: 'ERR_SERVER_ALREADY_LISTEN', - type: Error + type: Error, }); } diff --git a/test/parallel/test-net-server-listen-options.js b/test/parallel/test-net-server-listen-options.js index 83984844388a82..b02c028eda7af1 100644 --- a/test/parallel/test-net-server-listen-options.js +++ b/test/parallel/test-net-server-listen-options.js @@ -20,14 +20,14 @@ function close() { this.close(); } // Test listen(port, cb) and listen({ port }, cb) combinations const listenOnPort = [ (port, cb) => net.createServer().listen({ port }, cb), - (port, cb) => net.createServer().listen(port, cb) + (port, cb) => net.createServer().listen(port, cb), ]; { const assertPort = () => { return common.expectsError({ code: 'ERR_SOCKET_BAD_PORT', - type: RangeError + type: RangeError, }); }; @@ -61,7 +61,7 @@ const listenOnPort = [ { code: 'ERR_INVALID_OPT_VALUE', type: Error, - message: /^The value "{.*}" is invalid for option "options"$/ + message: /^The value "{.*}" is invalid for option "options"$/, }); } diff --git a/test/parallel/test-net-server-options.js b/test/parallel/test-net-server-options.js index 2275d9f859b409..e4b4c3ff8f838d 100644 --- a/test/parallel/test-net-server-options.js +++ b/test/parallel/test-net-server-options.js @@ -5,11 +5,11 @@ const net = require('net'); common.expectsError(function() { net.createServer('path'); }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); common.expectsError(function() { net.createServer(0); }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); diff --git a/test/parallel/test-net-socket-destroy-send.js b/test/parallel/test-net-socket-destroy-send.js index a602b89253887d..51b4addc82da2d 100644 --- a/test/parallel/test-net-socket-destroy-send.js +++ b/test/parallel/test-net-socket-destroy-send.js @@ -15,13 +15,13 @@ server.listen(0, common.mustCall(function() { conn.on('error', common.expectsError({ code: 'ERR_SOCKET_CLOSED', message: 'Socket is closed', - type: Error + type: Error, })); conn.write(Buffer.from('kaboom'), common.expectsError({ code: 'ERR_SOCKET_CLOSED', message: 'Socket is closed', - type: Error + type: Error, })); server.close(); })); diff --git a/test/parallel/test-net-socket-timeout.js b/test/parallel/test-net-socket-timeout.js index 2826b1dd76f146..20e2b4140308ab 100644 --- a/test/parallel/test-net-socket-timeout.js +++ b/test/parallel/test-net-socket-timeout.js @@ -27,7 +27,7 @@ const assert = require('assert'); // Verify that invalid delays throw const s = new net.Socket(); const nonNumericDelays = [ - '100', true, false, undefined, null, '', {}, () => {}, [] + '100', true, false, undefined, null, '', {}, () => {}, [], ]; const badRangeDelays = [-0.001, -1, -Infinity, Infinity, NaN]; const validDelays = [0, 0.001, 1, 1e6]; diff --git a/test/parallel/test-net-socket-write-after-close.js b/test/parallel/test-net-socket-write-after-close.js index e3593a3a09a146..a9796b1658469a 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', - type: Error + type: Error, })); server.close(); diff --git a/test/parallel/test-net-socket-write-error.js b/test/parallel/test-net-socket-write-error.js index 800d6020da4cbe..b1adf8687d2e56 100644 --- a/test/parallel/test-net-socket-write-error.js +++ b/test/parallel/test-net-socket-write-error.js @@ -10,7 +10,7 @@ function connectToServer() { common.expectsError(() => client.write(1337), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); client.end(); diff --git a/test/parallel/test-next-tick-errors.js b/test/parallel/test-next-tick-errors.js index acb7c497278429..7764dc9176397a 100644 --- a/test/parallel/test-next-tick-errors.js +++ b/test/parallel/test-next-tick-errors.js @@ -49,7 +49,7 @@ function testNextTickWith(val) { { code: 'ERR_INVALID_CALLBACK', name: 'TypeError [ERR_INVALID_CALLBACK]', - type: TypeError + type: TypeError, } ); } diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js index dc9f60b799e0f6..fa432ef534f9e3 100644 --- a/test/parallel/test-npm-install.js +++ b/test/parallel/test-npm-install.js @@ -28,8 +28,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'); @@ -45,7 +45,7 @@ const env = Object.assign({}, 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-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.js b/test/parallel/test-os.js index 47d4209c36a20b..df333055d8a0d2 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) => @@ -133,7 +133,7 @@ switch (platform) { mac: '00:00:00:00:00:00', family: 'IPv4', internal: true, - cidr: '127.0.0.1/8' + cidr: '127.0.0.1/8', }]; assert.deepStrictEqual(actual, expected); break; @@ -149,7 +149,7 @@ switch (platform) { mac: '00:00:00:00:00:00', family: 'IPv4', internal: true, - cidr: '127.0.0.1/8' + cidr: '127.0.0.1/8', }]; assert.deepStrictEqual(actual, expected); break; @@ -159,7 +159,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 7cfe3687ecc8a7..b46d7dea356bc6 100644 --- a/test/parallel/test-outgoing-message-pipe.js +++ b/test/parallel/test-outgoing-message-pipe.js @@ -9,6 +9,6 @@ common.expectsError( () => { outgoingMessage.pipe(outgoingMessage); }, { code: 'ERR_STREAM_CANNOT_PIPE', - type: Error + type: Error, } ); diff --git a/test/parallel/test-path-join.js b/test/parallel/test-path-join.js index 691ba98f9bc095..54b61cc424438d 100644 --- a/test/parallel/test-path-join.js +++ b/test/parallel/test-path-join.js @@ -55,9 +55,9 @@ const joinTests = [ [['/', '//foo'], '/foo'], [['/', '', '/foo'], '/foo'], [['', '/', 'foo'], '/foo'], - [['', '/', '/foo'], '/foo'] - ] - ] + [['', '/', '/foo'], '/foo'], + ], + ], ]; // Windows-specific join tests @@ -109,9 +109,9 @@ joinTests.push([ [['c:.', '/'], 'c:.\\'], [['c:.', 'file'], 'c:file'], [['c:', '/'], 'c:\\'], - [['c:', 'file'], 'c:\\file'] + [['c:', 'file'], 'c:\\file'], ] - ) + ), ]); joinTests.forEach((test) => { if (!Array.isArray(test[0])) diff --git a/test/parallel/test-path-parse-format.js b/test/parallel/test-path-parse-format.js index 3586ebece1af16..20a3e4b4d52392 100644 --- a/test/parallel/test-path-parse-format.js +++ b/test/parallel/test-path-parse-format.js @@ -47,7 +47,7 @@ const winPaths = [ ['\\\\server two\\shared folder\\file path.zip', '\\\\server two\\shared folder\\'], ['\\\\teela\\admin$\\system32', '\\\\teela\\admin$\\'], - ['\\\\?\\UNC\\server\\share', '\\\\?\\UNC\\'] + ['\\\\?\\UNC\\server\\share', '\\\\?\\UNC\\'], ]; const winSpecialCaseParseTests = [ @@ -61,7 +61,7 @@ const winSpecialCaseFormatTests = [ [{ name: 'index', ext: '.html' }, 'index.html'], [{ dir: 'some\\dir', name: 'index', ext: '.html' }, 'some\\dir\\index.html'], [{ root: 'C:\\', name: 'index', ext: '.html' }, 'C:\\index.html'], - [{}, ''] + [{}, ''], ]; const unixPaths = [ @@ -85,7 +85,7 @@ const unixPaths = [ ['/.', '/'], ['/.foo', '/'], ['/.foo.bar', '/'], - ['/foo/bar.baz', '/'] + ['/foo/bar.baz', '/'], ]; const unixSpecialCaseFormatTests = [ @@ -95,12 +95,12 @@ const unixSpecialCaseFormatTests = [ [{ name: 'index', ext: '.html' }, 'index.html'], [{ dir: 'some/dir', name: 'index', ext: '.html' }, 'some/dir/index.html'], [{ root: '/', name: 'index', ext: '.html' }, '/index.html'], - [{}, ''] + [{}, ''], ]; const expectedMessage = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }, 18); const errors = [ @@ -136,10 +136,10 @@ const trailingTests = [ dir: 'D:\\foo\\\\', base: 'bar.baz', ext: '.baz', - name: 'bar' - } - ] - ] + name: 'bar', + }, + ], + ], ], [ path.posix.parse, [['./', { root: '', dir: '', base: '.', ext: '', name: '.' }], @@ -147,10 +147,10 @@ const trailingTests = [ ['///', { root: '/', dir: '/', base: '', ext: '', name: '' }], ['/foo///', { root: '/', dir: '/', base: 'foo', ext: '', name: 'foo' }], ['/foo///bar.baz', - { root: '/', dir: '/foo//', base: 'bar.baz', ext: '.baz', name: 'bar' } - ] - ] - ] + { root: '/', dir: '/foo//', base: 'bar.baz', ext: '.baz', name: 'bar' }, + ], + ], + ], ]; const failures = []; trailingTests.forEach(function(test) { @@ -231,7 +231,7 @@ function checkFormat(path, testCases) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "pathObject" argument must be of type Object. ' + - `Received type ${typeName(pathObject)}` + `Received type ${typeName(pathObject)}`, }); }); } diff --git a/test/parallel/test-path-relative.js b/test/parallel/test-path-relative.js index bd2c3f75a52dd2..e96b74b61b3b43 100644 --- a/test/parallel/test-path-relative.js +++ b/test/parallel/test-path-relative.js @@ -31,8 +31,8 @@ const relativeTests = [ ['\\\\foo\\baz-quux', '\\\\foo\\baz', '..\\baz'], ['\\\\foo\\baz', '\\\\foo\\baz-quux', '..\\baz-quux'], ['C:\\baz', '\\\\foo\\bar\\baz', '\\\\foo\\bar\\baz'], - ['\\\\foo\\bar\\baz', 'C:\\baz', 'C:\\baz'] - ] + ['\\\\foo\\bar\\baz', 'C:\\baz', 'C:\\baz'], + ], ], [ path.posix.relative, // arguments result @@ -47,9 +47,9 @@ const relativeTests = [ ['/foo/bar/baz-quux', '/foo/bar/baz', '../baz'], ['/foo/bar/baz', '/foo/bar/baz-quux', '../baz-quux'], ['/baz-quux', '/baz', '../baz'], - ['/baz', '/baz-quux', '../baz-quux'] - ] - ] + ['/baz', '/baz-quux', '../baz-quux'], + ], + ], ]; relativeTests.forEach((test) => { const relative = test[0]; diff --git a/test/parallel/test-path-resolve.js b/test/parallel/test-path-resolve.js index abbbf4dd5f47b4..d07d65d47c8a55 100644 --- a/test/parallel/test-path-resolve.js +++ b/test/parallel/test-path-resolve.js @@ -24,8 +24,8 @@ const resolveTests = [ [['c:/', '//server//share'], '\\\\server\\share\\'], [['c:/', '///some//dir'], 'c:\\some\\dir'], [['C:\\foo\\tmp.3\\', '..\\tmp.3\\cycles\\root.js'], - 'C:\\foo\\tmp.3\\cycles\\root.js'] - ] + 'C:\\foo\\tmp.3\\cycles\\root.js'], + ], ], [ path.posix.resolve, // arguments result @@ -34,9 +34,9 @@ const resolveTests = [ [['a/b/c/', '../../..'], process.cwd()], [['.'], process.cwd()], [['/some/dir', '.', '/absolute/'], '/absolute'], - [['/foo/tmp.3/', '../tmp.3/cycles/root.js'], '/foo/tmp.3/cycles/root.js'] - ] - ] + [['/foo/tmp.3/', '../tmp.3/cycles/root.js'], '/foo/tmp.3/cycles/root.js'], + ], + ], ]; resolveTests.forEach((test) => { const resolve = test[0]; diff --git a/test/parallel/test-pending-deprecation.js b/test/parallel/test-pending-deprecation.js index f8b4ec8e5b7b94..54da1a2cee9b25 100644 --- a/test/parallel/test-pending-deprecation.js +++ b/test/parallel/test-pending-deprecation.js @@ -31,7 +31,7 @@ switch (process.argv[2]) { // Test the --pending-deprecation command line switch. fork(__filename, ['switch'], { execArgv: ['--pending-deprecation'], - silent: true + silent: true, }).on('exit', common.mustCall((code) => { assert.strictEqual(code, 0, message('--pending-deprecation')); })); @@ -39,7 +39,7 @@ switch (process.argv[2]) { // Test the NODE_PENDING_DEPRECATION environment var. fork(__filename, ['env'], { env: Object.assign({}, process.env, { NODE_PENDING_DEPRECATION: 1 }), - silent: true + silent: true, }).on('exit', common.mustCall((code) => { assert.strictEqual(code, 0, message('NODE_PENDING_DEPRECATION')); })); diff --git a/test/parallel/test-performance-function.js b/test/parallel/test-performance-function.js index 0deaa0e057c302..82f65ad23870e3 100644 --- a/test/parallel/test-performance-function.js +++ b/test/parallel/test-performance-function.js @@ -5,7 +5,7 @@ const assert = require('assert'); const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); { @@ -75,7 +75,7 @@ const { { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fn" argument must be of type Function' + message: 'The "fn" argument must be of type Function', }); }); } diff --git a/test/parallel/test-performance-gc.js b/test/parallel/test-performance-gc.js index ec0714ea50034d..d2e3f9eadfe016 100644 --- a/test/parallel/test-performance-gc.js +++ b/test/parallel/test-performance-gc.js @@ -5,21 +5,21 @@ const common = require('../common'); const assert = require('assert'); const { performance, - PerformanceObserver + PerformanceObserver, } = require('perf_hooks'); const { NODE_PERFORMANCE_GC_MAJOR, NODE_PERFORMANCE_GC_MINOR, NODE_PERFORMANCE_GC_INCREMENTAL, - NODE_PERFORMANCE_GC_WEAKCB + NODE_PERFORMANCE_GC_WEAKCB, } = process.binding('performance').constants; const kinds = [ NODE_PERFORMANCE_GC_MAJOR, NODE_PERFORMANCE_GC_MINOR, NODE_PERFORMANCE_GC_INCREMENTAL, - NODE_PERFORMANCE_GC_WEAKCB + NODE_PERFORMANCE_GC_WEAKCB, ]; // No observers for GC events, no entries should appear diff --git a/test/parallel/test-performance-warning.js b/test/parallel/test-performance-warning.js index f3104677a7c649..3ace9f44dd2257 100644 --- a/test/parallel/test-performance-warning.js +++ b/test/parallel/test-performance-warning.js @@ -15,7 +15,7 @@ performance.maxEntries = 1; () => performance.maxEntries = i, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-performance.js b/test/parallel/test-performance.js index a8ea38997fa457..fcffaa0fd7264d 100644 --- a/test/parallel/test-performance.js +++ b/test/parallel/test-performance.js @@ -73,7 +73,7 @@ assert.strictEqual(typeof performance.timeOrigin, 'number'); { code: 'ERR_INVALID_PERFORMANCE_MARK', type: Error, - message: `The "${i}" performance mark has not been set` + message: `The "${i}" performance mark has not been set`, }); }); @@ -120,7 +120,7 @@ assert.strictEqual(performance.nodeTiming.entryType, 'node'); 'moduleLoadStart', 'moduleLoadEnd', 'preloadModuleLoadStart', - 'preloadModuleLoadEnd' + 'preloadModuleLoadEnd', ].forEach((i) => { assert.strictEqual(typeof performance.nodeTiming[i], 'number'); }); diff --git a/test/parallel/test-performanceobserver.js b/test/parallel/test-performanceobserver.js index 2a6299952271e1..ffebf18e562699 100644 --- a/test/parallel/test-performanceobserver.js +++ b/test/parallel/test-performanceobserver.js @@ -4,12 +4,12 @@ const common = require('../common'); const Countdown = require('../common/countdown'); const assert = require('assert'); const { - observerCounts: counts + observerCounts: counts, } = process.binding('performance'); const { performance, PerformanceObserver, - constants + constants, } = require('perf_hooks'); const { @@ -32,7 +32,7 @@ assert.strictEqual(counts[NODE_PERFORMANCE_ENTRY_TYPE_FUNCTION], 0); { code: 'ERR_INVALID_CALLBACK', type: TypeError, - message: 'Callback must be a function' + message: 'Callback must be a function', }); }); const observer = new PerformanceObserver(common.mustNotCall()); @@ -44,7 +44,7 @@ assert.strictEqual(counts[NODE_PERFORMANCE_ENTRY_TYPE_FUNCTION], 0); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options" argument must be of type Object' + message: 'The "options" argument must be of type Object', }); }); @@ -54,7 +54,7 @@ assert.strictEqual(counts[NODE_PERFORMANCE_ENTRY_TYPE_FUNCTION], 0); code: 'ERR_INVALID_OPT_VALUE', type: TypeError, message: 'The value "[object Object]" is invalid ' + - 'for option "entryTypes"' + 'for option "entryTypes"', }); }); } diff --git a/test/parallel/test-pipe-file-to-http.js b/test/parallel/test-pipe-file-to-http.js index cfe289c30caa9d..4375f95756ac2f 100644 --- a/test/parallel/test-pipe-file-to-http.js +++ b/test/parallel/test-pipe-file-to-http.js @@ -69,7 +69,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 c6191a906b32d6..fc47430ca71f1e 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', - type: Error + type: 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-postmortem-metadata.js b/test/parallel/test-postmortem-metadata.js index 0438f7fccb71c1..0de8aa4660cc87 100644 --- a/test/parallel/test-postmortem-metadata.js +++ b/test/parallel/test-postmortem-metadata.js @@ -12,7 +12,7 @@ const { getSharedLibPath } = require('../common/shared-lib-util.js'); // For shared lib case, check shared lib instead const args = [ process.config.variables.node_shared ? - getSharedLibPath() : process.execPath + getSharedLibPath() : process.execPath, ]; if (common.isAIX) diff --git a/test/parallel/test-preload.js b/test/parallel/test-preload.js index 60d52dbcf1c0cb..fd07e41e1a8b58 100644 --- a/test/parallel/test-preload.js +++ b/test/parallel/test-preload.js @@ -93,7 +93,7 @@ replProc.on('close', function(code) { assert.strictEqual(code, 0); const output = [ 'A', - '> ' + '> ', ].join('\n'); assert.strictEqual(replStdout, output); }); 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 74792eebb7bd2f..0c5343402cfa99 100644 --- a/test/parallel/test-process-assert.js +++ b/test/parallel/test-process-assert.js @@ -14,12 +14,12 @@ common.expectsError(() => { }, { code: 'ERR_ASSERTION', type: Error, - message: 'errorMessage' + message: 'errorMessage', }); common.expectsError(() => { process.assert(false); }, { code: 'ERR_ASSERTION', type: Error, - message: 'assertion error' + message: 'assertion error', }); diff --git a/test/parallel/test-process-cpuUsage.js b/test/parallel/test-process-cpuUsage.js index 92c7b74c591f74..ba5e8755f1f8ae 100644 --- a/test/parallel/test-process-cpuUsage.js +++ b/test/parallel/test-process-cpuUsage.js @@ -34,13 +34,13 @@ for (let i = 0; i < 10; i++) { const invalidUserArgument = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "preValue.user" property must be of type number' + message: 'The "preValue.user" property must be of type number', }, 8); const invalidSystemArgument = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "preValue.system" property must be of type number' + message: 'The "preValue.system" property must be of type number', }, 2); @@ -80,14 +80,14 @@ assert.throws(() => { assert.throws(() => { process.cpuUsage({ user: Number.POSITIVE_INFINITY, - system: 4 + system: 4, }); }, invalidUserArgument); assert.throws(() => { process.cpuUsage({ user: 5, - system: Number.NEGATIVE_INFINITY + system: Number.NEGATIVE_INFINITY, }); }, invalidSystemArgument); diff --git a/test/parallel/test-process-emit-warning-from-native.js b/test/parallel/test-process-emit-warning-from-native.js index d50ea3962bdedc..cae517ed531e6c 100644 --- a/test/parallel/test-process-emit-warning-from-native.js +++ b/test/parallel/test-process-emit-warning-from-native.js @@ -31,7 +31,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); @@ -42,5 +42,5 @@ const realEmitWarning = process.emitWarning; Object.defineProperty(process, 'emitWarning', { value: realEmitWarning, configurable: true, - writable: true + writable: true, }); diff --git a/test/parallel/test-process-emitwarning.js b/test/parallel/test-process-emitwarning.js index e07fcd253c4128..1d6746f05b3131 100644 --- a/test/parallel/test-process-emitwarning.js +++ b/test/parallel/test-process-emitwarning.js @@ -42,7 +42,7 @@ class CustomWarning extends Error { [testMsg, { type: testType, code: testCode, detail: true }], [testMsg, { type: testType, code: testCode, detail: [] }], [testMsg, { type: testType, code: testCode, detail: null }], - [testMsg, { type: testType, code: testCode, detail: 1 }] + [testMsg, { type: testType, code: testCode, detail: 1 }], ].forEach((i) => { process.emitWarning.apply(null, i); }); diff --git a/test/parallel/test-process-exception-capture-errors.js b/test/parallel/test-process-exception-capture-errors.js index 7053497adaf873..5cec8c13762405 100644 --- a/test/parallel/test-process-exception-capture-errors.js +++ b/test/parallel/test-process-exception-capture-errors.js @@ -6,7 +6,7 @@ common.expectsError( { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "fn" argument must be one of type Function or null' + message: 'The "fn" argument must be one of type Function or null', } ); @@ -17,6 +17,6 @@ common.expectsError( { code: 'ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET', type: Error, - message: /setupUncaughtExceptionCapture.*called while a capture callback/ + message: /setupUncaughtExceptionCapture.*called while a capture callback/, } ); diff --git a/test/parallel/test-process-external-stdio-close-spawn.js b/test/parallel/test-process-external-stdio-close-spawn.js index 93d7f795bd74ce..b53e0c0cf05f23 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-fatal-exception-tick.js b/test/parallel/test-process-fatal-exception-tick.js index 605f961f639228..d69ce158a6eabb 100644 --- a/test/parallel/test-process-fatal-exception-tick.js +++ b/test/parallel/test-process-fatal-exception-tick.js @@ -11,7 +11,7 @@ let stage = 0; process.once('uncaughtException', common.expectsError({ type: Error, - message: 'caughtException' + message: 'caughtException', })); setImmediate(() => { diff --git a/test/parallel/test-process-hrtime.js b/test/parallel/test-process-hrtime.js index 1d2d2ecde9da2b..a5a02abadb92d9 100644 --- a/test/parallel/test-process-hrtime.js +++ b/test/parallel/test-process-hrtime.js @@ -38,28 +38,28 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "time" argument must be of type Array. Received type number' + message: 'The "time" argument must be of type Array. Received type number', }); common.expectsError(() => { process.hrtime([]); }, { code: 'ERR_INVALID_ARRAY_LENGTH', type: TypeError, - message: 'The array "time" (length 0) must be of length 2.' + message: 'The array "time" (length 0) must be of length 2.', }); common.expectsError(() => { process.hrtime([1]); }, { code: 'ERR_INVALID_ARRAY_LENGTH', type: TypeError, - message: 'The array "time" (length 1) must be of length 2.' + message: 'The array "time" (length 1) must be of length 2.', }); common.expectsError(() => { process.hrtime([1, 2, 3]); }, { code: 'ERR_INVALID_ARRAY_LENGTH', type: TypeError, - message: 'The array "time" (length 3) must be of length 2.' + message: 'The array "time" (length 3) must be of length 2.', }); function validateTuple(tuple) { diff --git a/test/parallel/test-process-kill-pid.js b/test/parallel/test-process-kill-pid.js index 594a2a6a0bd8e6..d5106f47624a0b 100644 --- a/test/parallel/test-process-kill-pid.js +++ b/test/parallel/test-process-kill-pid.js @@ -41,7 +41,7 @@ const assert = require('assert'); const invalidPidArgument = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "pid" argument must be of type number' + message: 'The "pid" argument must be of type number', }, 6); assert.throws(function() { process.kill('SIGTERM'); }, @@ -61,14 +61,14 @@ assert.throws(function() { process.kill(-1 / 0); }, common.expectsError(() => process.kill(0, 'test'), { code: 'ERR_UNKNOWN_SIGNAL', type: TypeError, - message: 'Unknown signal: test' + message: 'Unknown signal: test', }); // Test that kill throws an error for invalid signal numbers common.expectsError(() => process.kill(0, 987), { code: 'EINVAL', type: 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 59de0da42d3962..65c992672901db 100644 --- a/test/parallel/test-process-next-tick.js +++ b/test/parallel/test-process-next-tick.js @@ -42,6 +42,6 @@ process.on('exit', function() { { code: 'ERR_INVALID_CALLBACK', type: TypeError, - message: 'Callback must be a function' + message: 'Callback must be a function', }); }); diff --git a/test/parallel/test-process-wrap.js b/test/parallel/test-process-wrap.js index b3cca47c463c19..e55007768e4fce 100644 --- a/test/parallel/test-process-wrap.js +++ b/test/parallel/test-process-wrap.js @@ -59,8 +59,8 @@ p.spawn({ stdio: [ { type: 'ignore' }, { type: 'pipe', handle: pipe }, - { type: 'ignore' } - ] + { type: 'ignore' }, + ], }); // 'this' safety @@ -73,8 +73,8 @@ assert.throws(function() { stdio: [ { type: 'ignore' }, { type: 'pipe', handle: pipe }, - { type: 'ignore' } - ] + { type: 'ignore' }, + ], }); }, TypeError); diff --git a/test/parallel/test-promise-internal-creation.js b/test/parallel/test-promise-internal-creation.js index 7142c872d9452e..ecaab2465d5518 100644 --- a/test/parallel/test-promise-internal-creation.js +++ b/test/parallel/test-promise-internal-creation.js @@ -2,7 +2,7 @@ const common = require('../common'); const assert = require('assert'); const { - createPromise, promiseResolve, promiseReject + createPromise, promiseResolve, promiseReject, } = process.binding('util'); const { inspect } = require('util'); diff --git a/test/parallel/test-promises-unhandled-proxy-rejections.js b/test/parallel/test-promises-unhandled-proxy-rejections.js index f632857d6373ba..76bfd852863847 100644 --- a/test/parallel/test-promises-unhandled-proxy-rejections.js +++ b/test/parallel/test-promises-unhandled-proxy-rejections.js @@ -29,7 +29,7 @@ const thorny = new Proxy({}, { deleteProperty: throwErr, ownKeys: throwErr, apply: throwErr, - construct: throwErr + construct: throwErr, }); common.expectWarning({ diff --git a/test/parallel/test-promises-unhandled-rejections.js b/test/parallel/test-promises-unhandled-rejections.js index 1ade061994c3bb..a12c29ac36e641 100644 --- a/test/parallel/test-promises-unhandled-rejections.js +++ b/test/parallel/test-promises-unhandled-rejections.js @@ -46,7 +46,7 @@ const asyncTest = (function() { asyncTestQueue.push({ action: fn, stack: stack, - description: description + description: description, }); if (!asyncTestsEnabled) { asyncTestsEnabled = true; diff --git a/test/parallel/test-promises-unhandled-symbol-rejections.js b/test/parallel/test-promises-unhandled-symbol-rejections.js index 3e687d4e49bf08..d8d53680cf44a0 100644 --- a/test/parallel/test-promises-unhandled-symbol-rejections.js +++ b/test/parallel/test-promises-unhandled-symbol-rejections.js @@ -17,7 +17,7 @@ common.expectWarning({ DeprecationWarning: expectedDeprecationWarning, UnhandledPromiseRejectionWarning: [ expectedPromiseWarning, - expectedValueWarning + expectedValueWarning, ], }); diff --git a/test/parallel/test-punycode.js b/test/parallel/test-punycode.js index 9f7f772e17b0fe..233bbbc4781ba6 100644 --- a/test/parallel/test-punycode.js +++ b/test/parallel/test-punycode.js @@ -63,33 +63,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) @@ -97,14 +99,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) @@ -113,7 +115,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) @@ -121,7 +123,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 @@ -130,7 +132,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 @@ -139,13 +141,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 @@ -153,7 +155,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- @@ -161,40 +163,40 @@ 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', + }, ]; let errors = 0; @@ -230,7 +232,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 25a800a09a684c..934dae8296cb3a 100644 --- a/test/parallel/test-querystring-escape.js +++ b/test/parallel/test-querystring-escape.js @@ -18,7 +18,7 @@ common.expectsError( { code: 'ERR_INVALID_URI', type: 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 2db3acff0fc41f..99176ae09d6caa 100644 --- a/test/parallel/test-querystring-maxKeys-non-finite.js +++ b/test/parallel/test-querystring-maxKeys-non-finite.js @@ -40,16 +40,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 f4046c33a11d62..a04af68251d131 100644 --- a/test/parallel/test-querystring.js +++ b/test/parallel/test-querystring.js @@ -107,7 +107,7 @@ const qsTestCases = [ ['%20+&', '%20%20=', { ' ': '' }], ['=%20+&', '=%20%20', { '': ' ' }], [null, '', {}], - [undefined, '', {}] + [undefined, '', {}], ]; // [ wonkyQS, canonicalQS, obj ] @@ -118,7 +118,7 @@ const qsColonTestCases = [ 'foo:1%26bar%3A2;baz:quux', { 'foo': '1&bar:2', 'baz': 'quux' }], ['foo%3Abaz:bar', 'foo%3Abaz:bar', { 'foo:baz': 'bar' }], - ['foo:baz:bar', 'foo:baz%3Abar', { 'foo': 'baz:bar' }] + ['foo:baz:bar', 'foo:baz%3Abar', { 'foo': 'baz:bar' }], ]; // [wonkyObj, qs, canonicalObj] @@ -138,13 +138,13 @@ const qsWeirdObjects = [ [ { f: new Boolean(false), t: new Boolean(true) }, 'f=&t=', - { 'f': '', 't': '' } + { 'f': '', 't': '' }, ], [{ f: false, t: true }, 'f=false&t=true', { 'f': 'false', 't': 'true' }], [{ n: null }, 'n=', { 'n': '' }], [{ nan: NaN }, 'nan=', { 'nan': '' }], [{ inf: Infinity }, 'inf=', { 'inf': '' }], - [{ a: [], b: [] }, '', {}] + [{ a: [], b: [] }, '', {}], ]; // }}} @@ -163,7 +163,7 @@ const qsNoMungeTestCases = [ ['gragh=1&gragh=3&goo=2', { 'gragh': ['1', '3'], 'goo': '2' }], ['frappucino=muffin&goat%5B%5D=scone&pond=moose', { 'frappucino': 'muffin', 'goat[]': 'scone', 'pond': 'moose' }], - ['trololol=yes&lololo=no', { 'trololol': 'yes', 'lololo': 'no' }] + ['trololol=yes&lololo=no', { 'trololol': 'yes', 'lololo': 'no' }], ]; const qsUnescapeTestCases = [ @@ -174,7 +174,7 @@ const qsUnescapeTestCases = [ ['there%2Qare%0-fake%escaped values in%%%%this%9Hstring', 'there%2Qare%0-fake%escaped values in%%%%this%9Hstring'], ['%20%21%22%23%24%25%26%27%28%29%2A%2B%2C%2D%2E%2F%30%31%32%33%34%35%36%37', - ' !"#$%&\'()*+,-./01234567'] + ' !"#$%&\'()*+,-./01234567'], ]; assert.strictEqual('918854443121279438895193', @@ -229,13 +229,13 @@ qsNoMungeTestCases.forEach((testCase) => { const f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); check(f, createWithNoPrototype([ { key: 'a', value: 'b' }, - { key: 'q', value: 'x=y&y=z' } + { key: 'q', value: 'x=y&y=z' }, ])); f.q = qs.parse(f.q); const expectedInternal = createWithNoPrototype([ { key: 'x', value: 'y' }, - { key: 'y', value: 'z' } + { key: 'y', value: 'z' }, ]); check(f.q, expectedInternal); } @@ -245,12 +245,12 @@ qsNoMungeTestCases.forEach((testCase) => { const f = qs.parse('a:b;q:x%3Ay%3By%3Az', ';', ':'); check(f, createWithNoPrototype([ { key: 'a', value: 'b' }, - { key: 'q', value: 'x:y;y:z' } + { key: 'q', value: 'x:y;y:z' }, ])); f.q = qs.parse(f.q, ';', ':'); const expectedInternal = createWithNoPrototype([ { key: 'x', value: 'y' }, - { key: 'y', value: 'z' } + { key: 'y', value: 'z' }, ]); check(f.q, expectedInternal); } @@ -276,7 +276,7 @@ common.expectsError( { code: 'ERR_INVALID_URI', type: URIError, - message: 'URI malformed' + message: 'URI malformed', } ); @@ -294,8 +294,8 @@ assert.strictEqual('foo=', qs.stringify({ foo: Infinity })); a: 'b', q: qs.stringify({ x: 'y', - y: 'z' - }) + y: 'z', + }), }); assert.strictEqual(f, 'a=b&q=x%3Dy%26y%3Dz'); } @@ -308,8 +308,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-readline-csi.js b/test/parallel/test-readline-csi.js index f5c2d3044c5cdf..f92cdf3c676938 100644 --- a/test/parallel/test-readline-csi.js +++ b/test/parallel/test-readline-csi.js @@ -79,7 +79,7 @@ common.expectsError( { type: Error, 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-emit-keypress-events.js b/test/parallel/test-readline-emit-keypress-events.js index ddadf6d223feaf..2ab3cd8aa38467 100644 --- a/test/parallel/test-readline-emit-keypress-events.js +++ b/test/parallel/test-readline-emit-keypress-events.js @@ -25,6 +25,6 @@ process.on('exit', () => { assert.deepStrictEqual(keys, [ { sequence: 'f', name: 'f', ctrl: false, meta: false, shift: false }, { sequence: 'o', name: 'o', ctrl: false, meta: false, shift: false }, - { sequence: 'o', name: 'o', ctrl: false, meta: false, shift: false } + { sequence: 'o', name: 'o', ctrl: false, meta: false, shift: false }, ]); }); diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index 30afba843a2d98..7298a5940bd5e3 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -66,7 +66,7 @@ function isWarned(emitter) { const rli = new readline.Interface({ input: fi, output: fi, - crlfDelay: 100.5 + crlfDelay: 100.5, }); assert.strictEqual(rli.crlfDelay, 100.5); rli.close(); @@ -78,7 +78,7 @@ function isWarned(emitter) { const rli = new readline.Interface({ input: fi, output: fi, - crlfDelay: 5000 + crlfDelay: 5000, }); assert.strictEqual(rli.crlfDelay, 5000); rli.close(); @@ -274,7 +274,7 @@ function isWarned(emitter) { input: fi, output: fi, terminal: terminal, - crlfDelay: delay + crlfDelay: delay, }); let callCount = 0; rli.on('line', function(line) { @@ -297,7 +297,7 @@ function isWarned(emitter) { input: fi, output: fi, terminal: terminal, - crlfDelay + crlfDelay, }); let callCount = 0; rli.on('line', function(line) { @@ -338,7 +338,7 @@ function isWarned(emitter) { input: fi, output: fi, terminal: true, - completer: completer + completer: completer, }); let called = false; rli.on('line', function(line) { @@ -360,11 +360,11 @@ function isWarned(emitter) { common.expectsError(function() { readline.createInterface({ input: fi, - completer: 'string is not valid' + completer: 'string is not valid', }); }, { type: TypeError, - code: 'ERR_INVALID_OPT_VALUE' + code: 'ERR_INVALID_OPT_VALUE', }); } @@ -373,29 +373,29 @@ function isWarned(emitter) { const fi = new FakeInput(); common.expectsError(function() { readline.createInterface({ - input: fi, historySize: 'not a number' + input: fi, historySize: 'not a number', }); }, { type: RangeError, - code: 'ERR_INVALID_OPT_VALUE' + code: 'ERR_INVALID_OPT_VALUE', }); common.expectsError(function() { readline.createInterface({ - input: fi, historySize: -1 + input: fi, historySize: -1, }); }, { type: RangeError, - code: 'ERR_INVALID_OPT_VALUE' + code: 'ERR_INVALID_OPT_VALUE', }); common.expectsError(function() { readline.createInterface({ - input: fi, historySize: NaN + input: fi, historySize: NaN, }); }, { type: RangeError, - code: 'ERR_INVALID_OPT_VALUE' + code: 'ERR_INVALID_OPT_VALUE', }); } @@ -407,7 +407,7 @@ function isWarned(emitter) { input: fi, output: fi, terminal: true, - removeHistoryDuplicates: true + removeHistoryDuplicates: true, }); const expectedLines = ['foo', 'bar', 'baz', 'bar', 'bat', 'bat']; let callCount = 0; @@ -447,7 +447,7 @@ function isWarned(emitter) { input: fi, output: fi, terminal: true, - removeHistoryDuplicates: false + removeHistoryDuplicates: false, }); const expectedLines = ['foo', 'bar', 'baz', 'bar', 'bat', 'bat']; let callCount = 0; @@ -599,7 +599,7 @@ function isWarned(emitter) { input: fi, output: fi, prompt: '', - terminal: terminal + terminal: terminal, }); fi.emit('data', 'the quick brown fox'); fi.emit('keypress', '.', { ctrl: true, name: 'a' }); @@ -620,7 +620,7 @@ function isWarned(emitter) { input: fi, output: fi, prompt: '', - terminal: terminal + terminal: terminal, }); fi.emit('data', 'the quick brown fox'); fi.emit('keypress', '.', { ctrl: true, name: 'left' }); @@ -647,7 +647,7 @@ function isWarned(emitter) { [ { ctrl: true, name: 'w' }, { ctrl: true, name: 'backspace' }, - { meta: true, name: 'backspace' } + { meta: true, name: 'backspace' }, ] .forEach((deleteWordLeftKey) => { let fi = new FakeInput(); @@ -655,7 +655,7 @@ function isWarned(emitter) { input: fi, output: fi, prompt: '', - terminal: terminal + terminal: terminal, }); fi.emit('data', 'the quick brown fox'); fi.emit('keypress', '.', { ctrl: true, name: 'left' }); @@ -672,7 +672,7 @@ function isWarned(emitter) { input: fi, output: fi, prompt: '', - terminal: terminal + terminal: terminal, }); fi.emit('data', 'the quick brown fox'); fi.emit('keypress', '.', { ctrl: true, name: 'a' }); @@ -690,7 +690,7 @@ function isWarned(emitter) { [ { ctrl: true, name: 'delete' }, { meta: true, name: 'delete' }, - { meta: true, name: 'd' } + { meta: true, name: 'd' }, ] .forEach((deleteWordRightKey) => { let fi = new FakeInput(); @@ -698,7 +698,7 @@ function isWarned(emitter) { input: fi, output: fi, prompt: '', - terminal: terminal + terminal: terminal, }); fi.emit('data', 'the quick brown fox'); fi.emit('keypress', '.', { ctrl: true, name: 'left' }); @@ -716,7 +716,7 @@ function isWarned(emitter) { input: fi, output: fi, prompt: '', - terminal: terminal + terminal: terminal, }); fi.emit('data', 'the quick brown fox'); rli.on('line', common.mustCall((line) => { @@ -735,7 +735,7 @@ function isWarned(emitter) { input: fi, output: fi, prompt: '', - terminal: terminal + terminal: terminal, }); fi.columns = 10; fi.emit('data', 'multi-line text'); @@ -801,7 +801,7 @@ function isWarned(emitter) { 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); @@ -843,14 +843,14 @@ function isWarned(emitter) { assert.strictEqual(chunk.toString(), expected[counter++]); cb(); rl.close(); - }, expected.length) + }, expected.length), }); const rl = readline.createInterface({ input: new Readable({ read: common.mustCall() }), output: output, prompt: '$ ', - terminal: terminal + terminal: terminal, }); rl.prompt(); @@ -877,7 +877,7 @@ const crlfDelay = Infinity; input: fi, output: fi, terminal: terminal, - crlfDelay + crlfDelay, } ); const expectedLines = ['foo', 'bar', 'baz', 'bat']; @@ -898,7 +898,7 @@ const crlfDelay = Infinity; input: fi, output: fi, terminal: terminal, - crlfDelay + crlfDelay, }); const expectedLines = ['foo', 'bar', 'baz', 'bat']; let callCount = 0; @@ -923,7 +923,7 @@ const crlfDelay = Infinity; input: fi, output: fi, terminal: terminal, - crlfDelay + crlfDelay, }); let callCount = 0; rli.on('line', () => callCount++); diff --git a/test/parallel/test-readline-keys.js b/test/parallel/test-readline-keys.js index 62d5ab24b85cef..ae3e557ea1df68 100644 --- a/test/parallel/test-readline-keys.js +++ b/test/parallel/test-readline-keys.js @@ -284,15 +284,15 @@ addTest('\x1b[31ma\x1b[39ma', [ const runKeyIntervalTests = [ // escape character addKeyIntervalTest('\x1b', [ - { name: 'escape', sequence: '\x1b', meta: true } + { name: 'escape', sequence: '\x1b', meta: true }, ]), // chain of escape characters addKeyIntervalTest('\x1b\x1b\x1b\x1b'.split(''), [ { name: 'escape', sequence: '\x1b', meta: true }, { name: 'escape', sequence: '\x1b', meta: true }, { name: 'escape', sequence: '\x1b', meta: true }, - { name: 'escape', sequence: '\x1b', meta: true } - ]) + { name: 'escape', sequence: '\x1b', meta: true }, + ]), ].reverse().reduce((acc, fn) => fn(acc), () => {}); // run key interval tests one after another diff --git a/test/parallel/test-readline-position.js b/test/parallel/test-readline-position.js index 4e1114418eb380..ddcee46e3a53f6 100644 --- a/test/parallel/test-readline-position.js +++ b/test/parallel/test-readline-position.js @@ -11,13 +11,13 @@ const ctrlU = { ctrl: true, name: 'u' }; const rl = readline.createInterface({ terminal: true, input: input, - prompt: '' + prompt: '', }); const tests = [ [1, 'a'], [2, 'ab'], - [2, '丁'] + [2, '丁'], ]; // The non-ICU JS implementation of character width calculation is only aware diff --git a/test/parallel/test-readline-reopen.js b/test/parallel/test-readline-reopen.js index dead22d81ac961..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)); @@ -23,7 +23,7 @@ rl1.on('line', common.mustCall(rl1OnLine)); // that it doesn’t get lost when closing the readline instance. input.write(Buffer.concat([ Buffer.from('foo\n'), - Buffer.from([ 0xe2 ]) // Exactly one third of a ☃ snowman. + Buffer.from([ 0xe2 ]), // Exactly one third of a ☃ snowman. ])); function rl1OnLine(line) { @@ -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 db42a5a9495a9e..44cc1abe9e8ce9 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 40fe2c16d609e9..65377d5069cc8b 100644 --- a/test/parallel/test-readline-undefined-columns.js +++ b/test/parallel/test-readline-undefined-columns.js @@ -17,7 +17,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 82bf74549b2343..a183d48b61675b 100644 --- a/test/parallel/test-readline.js +++ b/test/parallel/test-readline.js @@ -8,7 +8,7 @@ const assert = require('assert'); const input = new PassThrough(); const rl = readline.createInterface({ terminal: true, - input: input + input: input, }); rl.on('line', common.mustCall((data) => { @@ -22,7 +22,7 @@ const assert = require('assert'); 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')); @@ -34,7 +34,7 @@ const assert = require('assert'); const input = new PassThrough(); const rl = readline.createInterface({ terminal: true, - input: input + input: input, }); rl.on('line', common.mustCall((data) => { @@ -48,7 +48,7 @@ const assert = require('assert'); const input = new PassThrough(); const rl = readline.createInterface({ terminal: true, - input: input + input: input, }); rl.write('foo'); @@ -61,16 +61,16 @@ const assert = require('assert'); }, 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) { @@ -86,7 +86,7 @@ const assert = require('assert'); const input = new PassThrough(); const rl = readline.createInterface({ terminal: true, - input: input + input: input, }); const key = { @@ -94,7 +94,7 @@ const assert = require('assert'); 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'); @@ -122,14 +122,14 @@ const assert = require('assert'); 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'); @@ -140,7 +140,7 @@ const assert = require('assert'); 'hop/zoo', '/zoo', 'zoo', - '' + '', ].forEach(function(expectedLine) { rl.write.apply(rl, key.xterm.metad); assert.strictEqual(0, rl.cursor); diff --git a/test/parallel/test-regress-GH-1531.js b/test/parallel/test-regress-GH-1531.js index a61cc64ab626af..c6d1bf032613fc 100644 --- a/test/parallel/test-regress-GH-1531.js +++ b/test/parallel/test-regress-GH-1531.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-regress-GH-2245.js b/test/parallel/test-regress-GH-2245.js index 37260b59e34721..3a7307f911046a 100644 --- a/test/parallel/test-regress-GH-2245.js +++ b/test/parallel/test-regress-GH-2245.js @@ -16,7 +16,7 @@ function test() { 'function bar() {', '\'use strict\';', 'return foo; // foo isn\'t captured in 0.10', - '};' + '};', ].join('\n'); eval(code); diff --git a/test/parallel/test-regress-GH-5051.js b/test/parallel/test-regress-GH-5051.js index 0fef879c6f15d5..54e40781e230e0 100644 --- a/test/parallel/test-regress-GH-5051.js +++ b/test/parallel/test-regress-GH-5051.js @@ -5,7 +5,7 @@ const agent = require('http').globalAgent; // small stub just so we can call addRequest directly const req = { - getHeader: () => {} + getHeader: () => {}, }; agent.maxSockets = 0; @@ -25,7 +25,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-regress-GH-5727.js b/test/parallel/test-regress-GH-5727.js index fab139ca7c305c..19a9bdf0555941 100644 --- a/test/parallel/test-regress-GH-5727.js +++ b/test/parallel/test-regress-GH-5727.js @@ -18,7 +18,7 @@ common.expectsError(() => { net.Server().listen({ port: invalidPort }, common.mustNotCall()); }, { code: 'ERR_SOCKET_BAD_PORT', - type: RangeError + type: RangeError, }); // The first argument is the port, no IP given. @@ -26,7 +26,7 @@ common.expectsError(() => { net.Server().listen(invalidPort, common.mustNotCall()); }, { code: 'ERR_SOCKET_BAD_PORT', - type: RangeError + type: RangeError, }); // The first argument is the port, the second an IP. @@ -34,5 +34,5 @@ common.expectsError(() => { net.Server().listen(invalidPort, '0.0.0.0', common.mustNotCall()); }, { code: 'ERR_SOCKET_BAD_PORT', - type: RangeError + type: RangeError, }); diff --git a/test/parallel/test-regress-GH-9819.js b/test/parallel/test-regress-GH-9819.js index 7eed1c512f7942..413bd480f9b5ac 100644 --- a/test/parallel/test-regress-GH-9819.js +++ b/test/parallel/test-regress-GH-9819.js @@ -10,7 +10,7 @@ const setup = 'const enc = { toString: () => { throw new Error("xyz"); } };'; const scripts = [ 'crypto.createHash("sha256").digest(enc)', - 'crypto.createHmac("sha256", "msg").digest(enc)' + 'crypto.createHmac("sha256", "msg").digest(enc)', ]; scripts.forEach((script) => { diff --git a/test/parallel/test-regress-GH-node-9326.js b/test/parallel/test-regress-GH-node-9326.js index 78565e3f596594..fc10c570082f26 100644 --- a/test/parallel/test-regress-GH-node-9326.js +++ b/test/parallel/test-regress-GH-node-9326.js @@ -6,7 +6,7 @@ const child_process = require('child_process'); // NOTE: Was crashing on FreeBSD const cp = child_process.spawn(process.execPath, [ '-e', - 'process.kill(process.pid, "SIGINT")' + 'process.kill(process.pid, "SIGINT")', ]); cp.on('exit', function(code) { diff --git a/test/parallel/test-repl-console.js b/test/parallel/test-repl-console.js index 94547e4768bb76..c7bce400854b6d 100644 --- a/test/parallel/test-repl-console.js +++ b/test/parallel/test-repl-console.js @@ -30,7 +30,7 @@ const stream = new common.ArrayStream(); const r = repl.start({ input: stream, output: stream, - useGlobal: false + useGlobal: false, }); diff --git a/test/parallel/test-repl-context.js b/test/parallel/test-repl-context.js index 9d18067bc2aca4..54ff03cbe03ad7 100644 --- a/test/parallel/test-repl-context.js +++ b/test/parallel/test-repl-context.js @@ -11,7 +11,7 @@ const stream = new common.ArrayStream(); testContext(repl.start({ input: stream, output: stream, - useGlobal: false + useGlobal: false, })); function testContext(repl) { 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-domain.js b/test/parallel/test-repl-domain.js index ff36eeaf3a4af4..f3f6f1542a23af 100644 --- a/test/parallel/test-repl-domain.js +++ b/test/parallel/test-repl-domain.js @@ -40,5 +40,5 @@ putIn.write = function(data) { putIn.run([ 'require("domain").create().on("error", function() { console.log("OK") })' + - '.run(function() { throw new Error("threw") })' + '.run(function() { throw new Error("threw") })', ]); diff --git a/test/parallel/test-repl-editor.js b/test/parallel/test-repl-editor.js index 091eaec1ab41be..da8d7d4e099de4 100644 --- a/test/parallel/test-repl-editor.js +++ b/test/parallel/test-repl-editor.js @@ -25,7 +25,7 @@ function run({ input, output, event, checkTerminalCodes = true }) { terminal: true, input: stream, output: stream, - useColors: false + useColors: false, }); stream.emit('data', '.editor\n'); @@ -45,29 +45,29 @@ const tests = [ { input: '', output: '\n(To exit, press ^C again or type .exit)', - event: { ctrl: true, name: 'c' } + event: { ctrl: true, name: 'c' }, }, { input: 'var i = 1;', output: '', - event: { ctrl: true, name: 'c' } + event: { ctrl: true, name: 'c' }, }, { input: 'var i = 1;\ni + 3', output: '\n4', - event: { ctrl: true, name: 'd' } + event: { ctrl: true, name: 'd' }, }, { input: ' var i = 1;\ni + 3', output: '\n4', - event: { ctrl: true, name: 'd' } + event: { ctrl: true, name: 'd' }, }, { input: '', output: '', checkTerminalCodes: false, event: null, - } + }, ]; tests.forEach(run); @@ -84,7 +84,7 @@ function testCodeAligment({ input, cursor = 0, line = '' }) { terminal: true, input: stream, output: outputStream, - useColors: false + useColors: false, }); stream.emit('data', '.editor\n'); @@ -101,23 +101,23 @@ function testCodeAligment({ input, cursor = 0, line = '' }) { const codeAlignmentTests = [ { - input: 'var i = 1;\n' + input: 'var i = 1;\n', }, { input: ' var i = 1;\n', cursor: 2, - line: ' ' + line: ' ', }, { input: ' var i = 1;\n', cursor: 5, - line: ' ' + line: ' ', }, { input: ' var i = 1;\n var j = 2\n', cursor: 2, - line: ' ' - } + line: ' ', + }, ]; codeAlignmentTests.forEach(testCodeAligment); 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 67f667eeb3d8db..c8902d5436741f 100644 --- a/test/parallel/test-repl-end-emits-exit.js +++ b/test/parallel/test-repl-end-emits-exit.js @@ -33,7 +33,7 @@ function testTerminalMode() { const r1 = repl.start({ input: stream, output: stream, - terminal: true + terminal: true, }); process.nextTick(function() { @@ -52,7 +52,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 d29e7b3574c1f2..ee800bc20376fa 100644 --- a/test/parallel/test-repl-envvars.js +++ b/test/parallel/test-repl-envvars.js @@ -11,28 +11,28 @@ const inspect = require('util').inspect; 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 }, + }, ]; function run(test) { @@ -41,7 +41,7 @@ function run(test) { const opts = { terminal: true, input: new stream.Readable({ read() {} }), - output: new stream.Writable({ write() {} }) + output: new stream.Writable({ write() {} }), }; REPL.createInternalRepl(env, opts, function(err, repl) { diff --git a/test/parallel/test-repl-eval-scope.js b/test/parallel/test-repl-eval-scope.js index 00b577cba73f76..b89fcfda30a745 100644 --- a/test/parallel/test-repl-eval-scope.js +++ b/test/parallel/test-repl-eval-scope.js @@ -12,7 +12,7 @@ const repl = require('repl'); }), input: stream, output: stream, - terminal: true + terminal: true, }; const r = repl.start(options); 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 1e3063e3db53ff..091e423ae731b7 100644 --- a/test/parallel/test-repl-function-definition-edge-case.js +++ b/test/parallel/test-repl-function-definition-edge-case.js @@ -33,6 +33,6 @@ function initRepl() { output, useColors: false, terminal: false, - prompt: '' + prompt: '', }); } diff --git a/test/parallel/test-repl-history-perm.js b/test/parallel/test-repl-history-perm.js index b125fa551dc858..623c63f6aac78b 100644 --- a/test/parallel/test-repl-history-perm.js +++ b/test/parallel/test-repl-history-perm.js @@ -54,7 +54,7 @@ repl.createInternalRepl( { terminal: true, input: stream, - output: stream + output: stream, }, checkResults ); diff --git a/test/parallel/test-repl-inspector.js b/test/parallel/test-repl-inspector.js index b02f6139e72d60..e809cc02bcc38d 100644 --- a/test/parallel/test-repl-inspector.js +++ b/test/parallel/test-repl-inspector.js @@ -27,7 +27,7 @@ putIn.run([ 'const session = new inspector.Session()', 'session.connect()', 'session.post("Runtime.evaluate", { expression: "1 + 1" }, console.log)', - 'session.disconnect()' + 'session.disconnect()', ]); assert(output.includes( diff --git a/test/parallel/test-repl-load-multiline.js b/test/parallel/test-repl-load-multiline.js index 8ab878ae768ddd..361385d53fa1b2 100644 --- a/test/parallel/test-repl-load-multiline.js +++ b/test/parallel/test-repl-load-multiline.js @@ -32,7 +32,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 60b430d8c7ee31..13aedeacb8b4cd 100644 --- a/test/parallel/test-repl-mode.js +++ b/test/parallel/test-repl-mode.js @@ -9,7 +9,7 @@ common.globalCheck = false; const tests = [ testSloppyMode, testStrictMode, - testAutoMode + testAutoMode, ]; tests.forEach(function(test) { @@ -67,6 +67,6 @@ function initRepl(mode) { output: output, useColors: false, terminal: false, - replMode: mode + replMode: mode, }); } diff --git a/test/parallel/test-repl-multiline.js b/test/parallel/test-repl-multiline.js index 54048bf31f2f6f..65367923c459e8 100644 --- a/test/parallel/test-repl-multiline.js +++ b/test/parallel/test-repl-multiline.js @@ -14,7 +14,7 @@ const r = repl.start({ input: inputStream, output: outputStream, terminal: true, - useColors: false + useColors: false, }); r.on('exit', common.mustCall(() => { diff --git a/test/parallel/test-repl-null-thrown.js b/test/parallel/test-repl-null-thrown.js index 1fe5d30396d534..c3a1a47e5404bc 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 9dc1b37fa2a250..df388c4d3be370 100644 --- a/test/parallel/test-repl-options.js +++ b/test/parallel/test-repl-options.js @@ -33,7 +33,7 @@ const stream = new common.ArrayStream(); const r1 = repl.start({ input: stream, output: stream, - terminal: true + terminal: true, }); assert.strictEqual(r1.input, stream); @@ -67,7 +67,7 @@ const r2 = repl.start({ ignoreUndefined: true, eval: evaler, writer: writer, - replMode: repl.REPL_MODE_STRICT + replMode: repl.REPL_MODE_STRICT, }); assert.strictEqual(r2.input, stream); assert.strictEqual(r2.output, stream); @@ -93,7 +93,7 @@ const r3 = repl.start({ output: stream, writer: writer, replMode: repl.REPL_MODE_MAGIC, - historySize: 50 + historySize: 50, }); assert.strictEqual(r3.replMode, repl.REPL_MODE_MAGIC); diff --git a/test/parallel/test-repl-persistent-history.js b/test/parallel/test-repl-persistent-history.js index 4d0330272ab3c6..d672d920f2e113 100644 --- a/test/parallel/test-repl-persistent-history.js +++ b/test/parallel/test-repl-persistent-history.js @@ -76,40 +76,40 @@ 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: {}, test: [UP, '\'42\'', ENTER], expected: [prompt, '\'', '4', '2', '\'', '\'42\'\n', prompt, prompt], - clean: false + clean: false, }, { // Requires the above test case env: {}, test: [UP, UP, ENTER], - expected: [prompt, `${prompt}'42'`, '\'42\'\n', prompt] + expected: [prompt, `${prompt}'42'`, '\'42\'\n', prompt], }, { env: { NODE_REPL_HISTORY: historyPath, NODE_REPL_HISTORY_SIZE: 1 }, test: [UP, UP, CLEAR], - expected: [prompt, `${prompt}'you look fabulous today'`, prompt] + expected: [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() { @@ -122,7 +122,7 @@ const tests = [ }, env: { NODE_REPL_HISTORY: emptyHiddenHistoryPath }, test: [UP], - expected: [prompt] + expected: [prompt], }, { before: function before() { @@ -131,7 +131,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() { @@ -142,8 +142,8 @@ const tests = [ }, env: {}, test: [UP], - expected: [prompt, homedirErr, prompt, replDisabled, prompt] - } + expected: [prompt, homedirErr, prompt, replDisabled, prompt], + }, ]; const numtests = tests.length; @@ -205,11 +205,11 @@ function runTest(assertCleaned) { throw err; } next(); - } + }, }), prompt: 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-preprocess-top-level-await.js b/test/parallel/test-repl-preprocess-top-level-await.js index 2a173b7339b8c7..ed1fe90e43e459 100644 --- a/test/parallel/test-repl-preprocess-top-level-await.js +++ b/test/parallel/test-repl-preprocess-top-level-await.js @@ -60,7 +60,7 @@ const testCases = [ [ 'var a = await 1; let b = 2; const c = 3;', '(async () => { void (a = await 1); void (b = 2); void (c = 3); })()' ], [ 'let o = await 1, p', - '(async () => { void ( (o = await 1), (p=undefined)) })()' ] + '(async () => { void ( (o = await 1), (p=undefined)) })()' ], ]; for (const [input, expected] of testCases) { diff --git a/test/parallel/test-repl-pretty-custom-stack.js b/test/parallel/test-repl-pretty-custom-stack.js index be102c1d677a9c..3dc18ebc52c049 100644 --- a/test/parallel/test-repl-pretty-custom-stack.js +++ b/test/parallel/test-repl-pretty-custom-stack.js @@ -18,7 +18,7 @@ function run({ command, expected }) { input: inputStream, output: outputStream, terminal: false, - useColors: false + useColors: false, }); r.write(`${command}\n`); @@ -46,25 +46,25 @@ const tests = [ // test .load for a file that throws command: `.load ${fixtures.path('repl-pretty-stack.js')}`, expected: 'Error: Whoops!--->\nrepl:9:24--->\nd (repl:12:3)--->\nc ' + - '(repl:9:3)--->\nb (repl:6:3)--->\na (repl:3:3)\n' + '(repl:9:3)--->\nb (repl:6:3)--->\na (repl:3:3)\n', }, { command: 'let x y;', - expected: 'let x y;\n ^\n\nSyntaxError: Unexpected identifier\n' + expected: 'let x y;\n ^\n\nSyntaxError: Unexpected identifier\n', }, { command: 'throw new Error(\'Whoops!\')', - expected: 'Error: Whoops!\n' + expected: 'Error: Whoops!\n', }, { command: 'foo = bar;', - expected: 'ReferenceError: bar is not defined\n' + expected: 'ReferenceError: bar is not defined\n', }, // test anonymous IIFE { command: '(function() { throw new Error(\'Whoops!\'); })()', - expected: 'Error: Whoops!--->\nrepl:1:21\n' - } + expected: 'Error: Whoops!--->\nrepl:1:21\n', + }, ]; tests.forEach(run); diff --git a/test/parallel/test-repl-pretty-stack.js b/test/parallel/test-repl-pretty-stack.js index 0fc6b3ada04c79..46cf96ae6b3c34 100644 --- a/test/parallel/test-repl-pretty-stack.js +++ b/test/parallel/test-repl-pretty-stack.js @@ -18,7 +18,7 @@ function run({ command, expected }) { input: inputStream, output: outputStream, terminal: false, - useColors: false + useColors: false, }); r.write(`${command}\n`); @@ -31,25 +31,25 @@ const tests = [ // test .load for a file that throws command: `.load ${fixtures.path('repl-pretty-stack.js')}`, expected: 'Error: Whoops!\n at repl:9:24\n at d (repl:12:3)\n ' + - 'at c (repl:9:3)\n at b (repl:6:3)\n at a (repl:3:3)\n' + 'at c (repl:9:3)\n at b (repl:6:3)\n at a (repl:3:3)\n', }, { command: 'let x y;', - expected: 'let x y;\n ^\n\nSyntaxError: Unexpected identifier\n\n' + expected: 'let x y;\n ^\n\nSyntaxError: Unexpected identifier\n\n', }, { command: 'throw new Error(\'Whoops!\')', - expected: 'Error: Whoops!\n' + expected: 'Error: Whoops!\n', }, { command: 'foo = bar;', - expected: 'ReferenceError: bar is not defined\n' + expected: 'ReferenceError: bar is not defined\n', }, // test anonymous IIFE { command: '(function() { throw new Error(\'Whoops!\'); })()', - expected: 'Error: Whoops!\n at repl:1:21\n' - } + expected: 'Error: Whoops!\n at repl:1:21\n', + }, ]; tests.forEach(run); diff --git a/test/parallel/test-repl-reset-event.js b/test/parallel/test-repl-reset-event.js index 83ab7fd6a3ec52..32d3a64cfd2ec9 100644 --- a/test/parallel/test-repl-reset-event.js +++ b/test/parallel/test-repl-reset-event.js @@ -34,7 +34,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) { @@ -57,7 +57,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-save-load.js b/test/parallel/test-repl-save-load.js index 3778ffac3ec379..9bfcd18aa48a05 100644 --- a/test/parallel/test-repl-save-load.js +++ b/test/parallel/test-repl-save-load.js @@ -38,7 +38,7 @@ const testMe = repl.start('', putIn); const testFile = [ 'var top = function() {', - 'var inner = {one:1};' + 'var inner = {one:1};', ]; const saveFileName = join(tmpdir.path, 'test.save.js'); @@ -57,7 +57,7 @@ assert.strictEqual(fs.readFileSync(saveFileName, 'utf8'), const cmds = [ 'function testSave() {', 'return "saved";', - '}' + '}', ]; const putIn = new common.ArrayStream(); const replServer = repl.start('', putIn); diff --git a/test/parallel/test-repl-sigint-nested-eval.js b/test/parallel/test-repl-sigint-nested-eval.js index 7f15b7dfeb8b9d..1e87cb97471f94 100644 --- a/test/parallel/test-repl-sigint-nested-eval.js +++ b/test/parallel/test-repl-sigint-nested-eval.js @@ -10,7 +10,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 818111c39bf578..f3232e10856b2e 100644 --- a/test/parallel/test-repl-sigint.js +++ b/test/parallel/test-repl-sigint.js @@ -10,7 +10,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-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 6485f8bd17f58b..6cfa24cd74f0c1 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -53,7 +53,7 @@ testMe._domain.on('error', function(err) { putIn.run(['.clear']); putIn.run([ 'var inner = {', - 'one:1' + 'one:1', ]); testMe.complete('inner.o', getNoResultsFunction()); @@ -73,7 +73,7 @@ putIn.run(['.clear']); putIn.run([ 'var inner = ( true ', '?', - '{one: 1} : ' + '{one: 1} : ', ]); testMe.complete('inner.o', getNoResultsFunction()); @@ -82,7 +82,7 @@ putIn.run(['.clear']); // Tab Complete will return a simple local variable putIn.run([ 'var top = function() {', - 'var inner = {one:1};' + 'var inner = {one:1};', ]); testMe.complete('inner.o', common.mustCall(function(error, data) { assert.deepStrictEqual(data, works); @@ -100,7 +100,7 @@ putIn.run([ 'var top = function() {', 'var inner = {', ' one:1', - '};' + '};', ]); testMe.complete('inner.o', common.mustCall(function(error, data) { assert.deepStrictEqual(data, works); @@ -114,7 +114,7 @@ putIn.run([ 'var top = function(one, two) {', 'var inner = {', ' one:1', - '};' + '};', ]); testMe.complete('inner.o', common.mustCall(function(error, data) { assert.deepStrictEqual(data, works); @@ -129,7 +129,7 @@ putIn.run([ '(function test () {', 'var inner = {', ' one:1', - '};' + '};', ]); testMe.complete('inner.o', common.mustCall(function(error, data) { assert.deepStrictEqual(data, works); @@ -144,7 +144,7 @@ putIn.run([ ' one, two) {', 'var inner = {', ' one:1', - '};' + '};', ]); testMe.complete('inner.o', getNoResultsFunction()); @@ -157,7 +157,7 @@ putIn.run([ '{', 'var inner = {', ' one:1', - '};' + '};', ]); testMe.complete('inner.o', getNoResultsFunction()); @@ -171,7 +171,7 @@ putIn.run([ '{', 'var inner = {', ' one:1', - '};' + '};', ]); testMe.complete('inner.o', getNoResultsFunction()); @@ -179,7 +179,7 @@ putIn.run(['.clear']); // make sure tab completion works on non-Objects putIn.run([ - 'var str = "test";' + 'var str = "test";', ]); testMe.complete('str.len', common.mustCall(function(error, data) { assert.deepStrictEqual(data, [['str.length'], 'str.len']); @@ -298,7 +298,7 @@ testMe.complete('require(\'n', common.mustCall(function(error, data) { putIn.run(['.clear']); putIn.run([ - 'var custom = "test";' + 'var custom = "test";', ]); testMe.complete('cus', common.mustCall(function(error, data) { assert.deepStrictEqual(data, [['custom'], 'cus']); @@ -309,7 +309,7 @@ testMe.complete('cus', common.mustCall(function(error, data) { putIn.run(['.clear']); putIn.run([ - 'var proxy = new Proxy({}, {ownKeys: () => { throw new Error(); }});' + 'var proxy = new Proxy({}, {ownKeys: () => { throw new Error(); }});', ]); testMe.complete('proxy.', common.mustCall(function(error, data) { @@ -394,7 +394,7 @@ const warningRegEx = new RegExp( putIn.run([ 'var ele = [];', 'for (let i = 0; i < 1e6 + 1; i++) ele[i] = 0;', - 'ele.biu = 1;' + 'ele.biu = 1;', ]); } else if (type === Buffer) { putIn.run(['var ele = Buffer.alloc(1e6 + 1); ele.biu = 1;']); @@ -435,7 +435,7 @@ testMe.complete('Buffer.prototype.', common.mustCall()); const testNonGlobal = repl.start({ input: putIn, output: putIn, - useGlobal: false + useGlobal: false, }); const builtins = [['Infinity', '', 'Int16Array', 'Int32Array', @@ -459,7 +459,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 @@ -467,7 +467,7 @@ const testCustomCompleterSyncMode = repl.start({ testCustomCompleterSyncMode.complete('', common.mustCall((error, data) => { assert.deepStrictEqual(data, [ customCompletions, - '' + '', ]); })); @@ -475,7 +475,7 @@ testCustomCompleterSyncMode.complete('', common.mustCall((error, data) => { testCustomCompleterSyncMode.complete('a', common.mustCall((error, data) => { assert.deepStrictEqual(data, [ 'aaa aa1 aa2'.split(' '), - 'a' + 'a', ]); })); @@ -489,7 +489,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 @@ -497,7 +497,7 @@ const testCustomCompleterAsyncMode = repl.start({ testCustomCompleterAsyncMode.complete('', common.mustCall((error, data) => { assert.deepStrictEqual(data, [ customCompletions, - '' + '', ]); })); @@ -505,7 +505,7 @@ testCustomCompleterAsyncMode.complete('', common.mustCall((error, data) => { testCustomCompleterAsyncMode.complete('a', common.mustCall((error, data) => { assert.deepStrictEqual(data, [ 'aaa aa1 aa2'.split(' '), - 'a' + 'a', ]); })); @@ -514,7 +514,7 @@ const editorStream = new common.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 a7edb66a81a1f8..6aa0f4b5470dde 100644 --- a/test/parallel/test-repl-top-level-await.js +++ b/test/parallel/test-repl-top-level-await.js @@ -60,7 +60,7 @@ const testMe = repl.start({ stream: putIn, terminal: true, useColors: false, - breakEvalOnSigint: true + breakEvalOnSigint: true, }); function runAndWait(cmds, lookFor) { @@ -80,7 +80,7 @@ async function ordinaryTests() { // https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-top-level-await.js?rcl=5d0ea979f0ba87655b7ef0e03b58fa3c04986ba6 putIn.run([ 'function foo(x) { return x; }', - 'function koo() { return Promise.resolve(4); }' + 'function koo() { return Promise.resolve(4); }', ]); const testCases = [ [ 'await Promise.resolve(0)', '0' ], @@ -131,7 +131,7 @@ async function ordinaryTests() { [ 'let o = await 1, p', 'undefined' ], [ 'p', 'undefined' ], [ 'let q = 1, s = await 2', 'undefined' ], - [ 's', '2' ] + [ 's', '2' ], ]; for (const [input, expected, options = {}] of testCases) { @@ -151,18 +151,18 @@ async function ctrlCTest() { putIn.run([ `const timeout = (msecs) => new Promise((resolve) => { setTimeout(resolve, msecs).unref(); - });` + });`, ]); console.log('Testing Ctrl+C'); assert.deepStrictEqual(await runAndWait([ 'await timeout(100000)', - { ctrl: true, name: 'c' } + { ctrl: true, name: 'c' }, ]), [ 'await timeout(100000)\r', 'Thrown: Error [ERR_SCRIPT_EXECUTION_INTERRUPTED]: ' + 'Script execution was interrupted by `SIGINT`.', - PROMPT + PROMPT, ]); } diff --git a/test/parallel/test-repl-underscore.js b/test/parallel/test-repl-underscore.js index 91f32223e180b9..f5a8b586fc5d05 100644 --- a/test/parallel/test-repl-underscore.js +++ b/test/parallel/test-repl-underscore.js @@ -40,7 +40,7 @@ function testSloppyMode() { '30', '30', '40', - '30' + '30', ]); } @@ -73,7 +73,7 @@ function testStrictMode() { '30', 'undefined', 'undefined', - '30' + '30', ]); } @@ -106,7 +106,7 @@ function testMagicMode() { '30', 'undefined', '50', - '30' + '30', ]); } @@ -128,7 +128,7 @@ function testResetContext() { 'Clearing context...', '10', '20', - '20' + '20', ]); } @@ -169,7 +169,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 c76505272b2682..aa3eb87834fb99 100644 --- a/test/parallel/test-repl-use-global.js +++ b/test/parallel/test-repl-use-global.js @@ -11,7 +11,7 @@ const assert = require('assert'); const globalTestCases = [ [false, 'undefined'], [true, '\'tacos\''], - [undefined, 'undefined'] + [undefined, 'undefined'], ]; const globalTest = (useGlobal, cb, output) => (err, repl) => { @@ -76,7 +76,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 cb167372ef52fd..7c08f34f49f3dd 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -105,125 +105,125 @@ 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: /^ReferenceError:\s/ - } + expect: /^ReferenceError:\s/, + }, ]; const errorTests = [ // Uncaught error throws and prints out { send: 'throw new Error(\'test error\');', - expect: /^Error: test error/ + expect: /^Error: test error/, }, // 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: /^SyntaxError: / + expect: /^SyntaxError: /, }, // Can handle multiline template literals { send: '`io.js', - expect: '... ' + expect: '... ', }, // Special REPL commands still available { send: '.break', - expect: '' + expect: '', }, // Template expressions can cross lines { send: '`io.js ${"1.0"', - expect: '... ' + expect: '... ', }, { send: '+ ".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: [/^SyntaxError: /, ''] + expect: [/^SyntaxError: /, ''], }, // end of input to JSON.parse error is special case of syntax error, // should throw { send: 'JSON.parse(\'066\');', - expect: [/^SyntaxError: /, ''] + expect: [/^SyntaxError: /, ''], }, // should throw { send: 'JSON.parse(\'{\');', - expect: [/^SyntaxError: /, ''] + expect: [/^SyntaxError: /, ''], }, // invalid RegExps are a special case of syntax error, // should throw { send: '/(/;', - expect: /^SyntaxError: / + expect: /^SyntaxError: /, }, // invalid RegExp modifiers are a special case of syntax error, // should throw (GH-4012) { send: 'new RegExp("foo", "wrong modifier");', - expect: [/^SyntaxError: /, ''] + expect: [/^SyntaxError: /, ''], }, // strict mode syntax errors should be caught (GH-5178) { @@ -233,8 +233,8 @@ const errorTests = [ kArrow, '', /^SyntaxError: /, - '' - ] + '', + ], }, { send: '(function(a, a, b) { "use strict"; return a + b + c; })()', @@ -243,8 +243,8 @@ const errorTests = [ kArrow, '', /^SyntaxError: /, - '' - ] + '', + ], }, { send: '(function() { "use strict"; with (this) {} })()', @@ -253,8 +253,8 @@ const errorTests = [ kArrow, '', /^SyntaxError: /, - '' - ] + '', + ], }, { send: '(function() { "use strict"; var x; delete x; })()', @@ -263,8 +263,8 @@ const errorTests = [ kArrow, '', /^SyntaxError: /, - '' - ] + '', + ], }, { send: '(function() { "use strict"; eval = 17; })()', @@ -273,8 +273,8 @@ const errorTests = [ kArrow, '', /^SyntaxError: /, - '' - ] + '', + ], }, { send: '(function() { "use strict"; if (true) function f() { } })()', @@ -283,97 +283,97 @@ const errorTests = [ kArrow, '', /^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]' + expect: '[Function]', }, // Multiline object { send: '{ a: ', - expect: '... ' + expect: '... ', }, { send: '1 }', - expect: '{ a: 1 }' + expect: '{ a: 1 }', }, // Multiline anonymous function with comment { send: '(function() {', - expect: '... ' + expect: '... ', }, { send: '// blah', - expect: '... ' + expect: '... ', }, { send: 'return 1;', - expect: '... ' + expect: '... ', }, { send: '})()', - expect: '1' + expect: '1', }, // Multiline function call { send: 'function f(){}; f(f(1,', - expect: '... ' + expect: '... ', }, { send: '2)', - expect: '... ' + expect: '... ', }, { send: ')', - expect: 'undefined' + expect: 'undefined', }, // npm prompt error message { send: 'npm install foobar', expect: [ 'npm should be run outside of the node repl, in your normal shell.', - '(Press Control-D to exit.)' - ] + '(Press Control-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 { @@ -383,13 +383,13 @@ const errorTests = [ kArrow, '', /^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. @@ -397,22 +397,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 { @@ -425,88 +425,88 @@ const errorTests = [ /\.help/, /\.load/, /\.save/, - /'thefourtheye'/ - ] + /'thefourtheye'/, + ], }, // 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. @@ -517,29 +517,29 @@ const errorTests = [ /^ at .*/, /^ at .*/, /^ at .*/, - /^ at .*/ - ] + /^ at .*/, + ], }, // 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 @@ -550,17 +550,17 @@ const errorTests = [ kArrow, '', /^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 { @@ -570,8 +570,8 @@ const errorTests = [ kArrow, '', /^SyntaxError: /, - '' - ] + '', + ], }, // Avoid emitting stack trace { @@ -581,96 +581,96 @@ const errorTests = [ kArrow, '', /^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 { send: '...[]\n', - expect: '... ... ' + expect: '... ... ', }, // bring back the repl to prompt { send: '.break', - expect: '' - } + expect: '', + }, ]; 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', + }, ]; (async function() { @@ -725,7 +725,7 @@ function startTCPRepl() { return Promise.all([ new Promise((resolve) => resolveSocket = resolve), - new Promise((resolve) => resolveReplServer = resolve) + new Promise((resolve) => resolveReplServer = resolve), ]); } @@ -743,7 +743,7 @@ function startUnixRepl() { prompt: prompt_unix, input: socket, output: socket, - useGlobal: true + useGlobal: true, }); replServer.context.message = message; resolveReplServer(replServer); @@ -768,7 +768,7 @@ function startUnixRepl() { return Promise.all([ new Promise((resolve) => resolveSocket = resolve), - new Promise((resolve) => resolveReplServer = resolve) + new Promise((resolve) => resolveReplServer = resolve), ]); } diff --git a/test/parallel/test-require-deps-deprecation.js b/test/parallel/test-require-deps-deprecation.js index b588fa4da9ee3f..d7dbc9a55de26a 100644 --- a/test/parallel/test-require-deps-deprecation.js +++ b/test/parallel/test-require-deps-deprecation.js @@ -18,14 +18,14 @@ const deprecatedModules = [ 'v8/tools/profile_view', 'v8/tools/splaytree', 'v8/tools/tickprocessor', - 'v8/tools/tickprocessor-driver' + 'v8/tools/tickprocessor-driver', ]; // Newly added deps that do not have a deprecation wrapper around it would // throw an error, but no warning would be emitted. const deps = [ 'acorn/dist/acorn', - 'acorn/dist/walk' + 'acorn/dist/walk', ]; common.expectWarning('DeprecationWarning', deprecatedModules.map((m) => { diff --git a/test/parallel/test-require-resolve.js b/test/parallel/test-require-resolve.js index 2916f3709e3b15..078c25db31430e 100644 --- a/test/parallel/test-require-resolve.js +++ b/test/parallel/test-require-resolve.js @@ -45,13 +45,13 @@ const re = /^The "request" argument must be of type string\. Received type \w+$/ () => { require.resolve(value); }, { code: 'ERR_INVALID_ARG_TYPE', - message: re + message: re, }); common.expectsError( () => { require.resolve.paths(value); }, { code: 'ERR_INVALID_ARG_TYPE', - message: re + message: re, }); }); diff --git a/test/parallel/test-require-symlink.js b/test/parallel/test-require-symlink.js index d245c21dd1fdb4..6e009d948a19d5 100644 --- a/test/parallel/test-require-symlink.js +++ b/test/parallel/test-require-symlink.js @@ -76,7 +76,7 @@ function test() { // Also verify that symlinks works for setting preserve via env variables const childEnv = spawn(node, [linkScript], { - env: Object.assign({}, process.env, { NODE_PRESERVE_SYMLINKS: '1' }) + env: Object.assign({}, process.env, { NODE_PRESERVE_SYMLINKS: '1' }), }); childEnv.on('close', function(code, signal) { assert.strictEqual(code, 0); 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-stdin-script-child.js b/test/parallel/test-stdin-script-child.js index 06adc9e113eda7..14dc9ace624d0d 100644 --- a/test/parallel/test-stdin-script-child.js +++ b/test/parallel/test-stdin-script-child.js @@ -6,8 +6,8 @@ const { spawn } = require('child_process'); for (const args of [[], ['-']]) { const child = spawn(process.execPath, args, { env: Object.assign({}, 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-stdout-close-catch.js b/test/parallel/test-stdout-close-catch.js index e9b559c9f24cd0..7b6c26bd35b1b3 100644 --- a/test/parallel/test-stdout-close-catch.js +++ b/test/parallel/test-stdout-close-catch.js @@ -16,7 +16,7 @@ let output = ''; const outputExpect = { code: 'EPIPE', errno: 'EPIPE', - syscall: 'write' + syscall: 'write', }; child.stderr.on('data', function(c) { diff --git a/test/parallel/test-stream-big-push.js b/test/parallel/test-stream-big-push.js index 503e830f49fac8..51393794703b23 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-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-duplex-destroy.js b/test/parallel/test-stream-duplex-destroy.js index 00e334d64b5693..23903fdc7c5547 100644 --- a/test/parallel/test-stream-duplex-destroy.js +++ b/test/parallel/test-stream-duplex-destroy.js @@ -8,7 +8,7 @@ const { inherits } = require('util'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); duplex.resume(); @@ -23,7 +23,7 @@ const { inherits } = require('util'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); duplex.resume(); @@ -42,7 +42,7 @@ const { inherits } = require('util'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); duplex._destroy = common.mustCall(function(err, cb) { @@ -69,7 +69,7 @@ const { inherits } = require('util'); destroy: common.mustCall(function(err, cb) { assert.strictEqual(err, expected); cb(); - }) + }), }); duplex.resume(); @@ -86,7 +86,7 @@ const { inherits } = require('util'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); duplex._destroy = common.mustCall(function(err, cb) { @@ -101,7 +101,7 @@ const { inherits } = require('util'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); duplex.resume(); @@ -131,7 +131,7 @@ const { inherits } = require('util'); { const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, - read() {} + read() {}, }); const expected = new Error('kaboom'); @@ -155,7 +155,7 @@ const { inherits } = require('util'); const duplex = new Duplex({ write(chunk, enc, cb) { cb(); }, read() {}, - allowHalfOpen: true + allowHalfOpen: true, }); duplex.resume(); diff --git a/test/parallel/test-stream-inheritance.js b/test/parallel/test-stream-inheritance.js index a687ea9da054c9..f03b91ddfde38f 100644 --- a/test/parallel/test-stream-inheritance.js +++ b/test/parallel/test-stream-inheritance.js @@ -53,7 +53,7 @@ common.expectsError( { code: 'ERR_ASSERTION', type: 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 37acead9969443..7e988a128ae8b4 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 263e6b6801f68b..4ac097aacd85ec 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 @@ -22,7 +22,7 @@ const writable = new stream.Writable({ } cb(); - }, 3) + }, 3), }); // A readable stream which produces two buffers. @@ -32,7 +32,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-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 1f8564182a3107..a4812ffa65e2f0 100644 --- a/test/parallel/test-stream-pipe-flow.js +++ b/test/parallel/test-stream-pipe-flow.js @@ -12,13 +12,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()); @@ -34,7 +34,7 @@ const { Readable, Writable, PassThrough } = require('stream'); read: () => { if (missing--) rs.push({}); else rs.push(null); - } + }, }); const pt = rs @@ -59,7 +59,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-same-destination-twice.js b/test/parallel/test-stream-pipe-same-destination-twice.js index 1824c0606451a2..032df7b1be5477 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-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 b1801a1db3e580..db57fee3e150f8 100644 --- a/test/parallel/test-stream-readable-async-iterators.js +++ b/test/parallel/test-stream-readable-async-iterators.js @@ -12,7 +12,7 @@ async function tests() { const max = 5; const readable = new Readable({ objectMode: true, - read() {} + read() {}, }); const iter = readable[Symbol.asyncIterator](); @@ -41,7 +41,7 @@ async function tests() { console.log('read without for..await deferred'); const readable = new Readable({ objectMode: true, - read() {} + read() {}, }); const iter = readable[Symbol.asyncIterator](); @@ -82,7 +82,7 @@ async function tests() { const max = 3; const readable = new Readable({ objectMode: true, - read() {} + read() {}, }); const iter = readable[Symbol.asyncIterator](); @@ -127,7 +127,7 @@ async function tests() { if (++readed === max) { this.push(null); } - } + }, }); for await (const k of readable) { @@ -144,7 +144,7 @@ async function tests() { objectMode: true, read() { this.destroy(new Error('kaboom from read')); - } + }, }); let err; @@ -170,7 +170,7 @@ async function tests() { this.destroy(new Error('kaboom')); }); } - } + }, }); let received = 0; @@ -195,7 +195,7 @@ async function tests() { objectMode: true, read() { this.push('hello'); - } + }, }); let err = null; @@ -219,7 +219,7 @@ async function tests() { read() { this.push('hello'); this.destroy(new Error('kaboom')); - } + }, }); let received = 0; @@ -252,7 +252,7 @@ async function tests() { this.push(null); } }); - } + }, }); for await (const k of readable) { @@ -275,7 +275,7 @@ async function tests() { this.push(null); } }); - } + }, }); let expected = ''; diff --git a/test/parallel/test-stream-readable-destroy.js b/test/parallel/test-stream-readable-destroy.js index def20d26c34080..a4ea6a5e689937 100644 --- a/test/parallel/test-stream-readable-destroy.js +++ b/test/parallel/test-stream-readable-destroy.js @@ -7,7 +7,7 @@ const { inherits } = require('util'); { const read = new Readable({ - read() {} + read() {}, }); read.resume(); @@ -19,7 +19,7 @@ const { inherits } = require('util'); { const read = new Readable({ - read() {} + read() {}, }); read.resume(); @@ -36,7 +36,7 @@ const { inherits } = require('util'); { const read = new Readable({ - read() {} + read() {}, }); read._destroy = common.mustCall(function(err, cb) { @@ -61,7 +61,7 @@ const { inherits } = require('util'); destroy: common.mustCall(function(err, cb) { assert.strictEqual(err, expected); cb(); - }) + }), }); const expected = new Error('kaboom'); @@ -77,7 +77,7 @@ const { inherits } = require('util'); { const read = new Readable({ - read() {} + read() {}, }); read._destroy = common.mustCall(function(err, cb) { @@ -91,7 +91,7 @@ const { inherits } = require('util'); { const read = new Readable({ - read() {} + read() {}, }); read.resume(); @@ -116,7 +116,7 @@ const { inherits } = require('util'); { const read = new Readable({ - read() {} + read() {}, }); const expected = new Error('kaboom'); @@ -137,7 +137,7 @@ const { inherits } = require('util'); { const read = new Readable({ - read() {} + read() {}, }); read.resume(); @@ -164,7 +164,7 @@ const { inherits } = require('util'); { // destroy and destroy callback const read = new Readable({ - read() {} + read() {}, }); read.resume(); diff --git a/test/parallel/test-stream-readable-emittedReadable.js b/test/parallel/test-stream-readable-emittedReadable.js index 5b9affc59fbbf2..957299bd3114ba 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 33b912e71ec98f..868f6b650e4637 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-invalid-chunk.js b/test/parallel/test-stream-readable-invalid-chunk.js index fcd7414bb66632..7f56c558e8d371 100644 --- a/test/parallel/test-stream-readable-invalid-chunk.js +++ b/test/parallel/test-stream-readable-invalid-chunk.js @@ -4,13 +4,13 @@ const common = require('../common'); const stream = require('stream'); const readable = new stream.Readable({ - read: () => {} + read: () => {}, }); function checkError(fn) { common.expectsError(fn, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); } diff --git a/test/parallel/test-stream-readable-needReadable.js b/test/parallel/test-stream-readable-needReadable.js index 7058e123f07823..afc79faeebb30f 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-no-unneeded-readable.js b/test/parallel/test-stream-readable-no-unneeded-readable.js index 13ee2b498c4b96..72905f3af85546 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 505327e247da38..7d951670403ca7 100644 --- a/test/parallel/test-stream-readable-pause-and-resume.js +++ b/test/parallel/test-stream-readable-pause-and-resume.js @@ -13,7 +13,7 @@ const rs = new Readable({ return process.nextTick(() => rs.push({})); rs.push({}); rs.push(null); - } + }, }); rs.on('end', common.mustCall()); diff --git a/test/parallel/test-stream-readable-reading-readingMore.js b/test/parallel/test-stream-readable-reading-readingMore.js index 0af2eeb71f2b1b..ef82adf587cd42 100644 --- a/test/parallel/test-stream-readable-reading-readingMore.js +++ b/test/parallel/test-stream-readable-reading-readingMore.js @@ -4,7 +4,7 @@ const assert = require('assert'); 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-with-unimplemented-_read.js b/test/parallel/test-stream-readable-with-unimplemented-_read.js index e9619a31e2f298..a39f9b4f28e426 100644 --- a/test/parallel/test-stream-readable-with-unimplemented-_read.js +++ b/test/parallel/test-stream-readable-with-unimplemented-_read.js @@ -7,5 +7,5 @@ const readable = new stream.Readable(); common.expectsError(() => readable.read(), { code: 'ERR_STREAM_READ_NOT_IMPLEMENTED', type: Error, - message: '_read() is not implemented' + message: '_read() 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 83c799b92fba25..26699ee85e8f72 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({ type: 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 14c173b4ccfec5..f49931d33f742f 100644 --- a/test/parallel/test-stream-transform-constructor-set-methods.js +++ b/test/parallel/test-stream-transform-constructor-set-methods.js @@ -19,7 +19,7 @@ const _flush = common.mustCall((next) => { const t = new Transform({ transform: _transform, flush: _flush, - final: _final + final: _final, }); strictEqual(t._transform, _transform); @@ -36,5 +36,5 @@ common.expectsError(() => { }, { type: Error, code: 'ERR_METHOD_NOT_IMPLEMENTED', - message: 'The _transform method is not implemented' + message: 'The _transform method is not implemented', }); diff --git a/test/parallel/test-stream-transform-destroy.js b/test/parallel/test-stream-transform-destroy.js index c42fe1d6f96d08..be4ceb08061012 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 7dbd06d60c3625..df6c3394d48368 100644 --- a/test/parallel/test-stream-transform-final-sync.js +++ b/test/parallel/test-stream-transform-final-sync.js @@ -79,7 +79,7 @@ const t = new stream.Transform({ assert.strictEqual(state, 15, 'flushCallback part 2'); 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 22128b4d9a9f7b..f253f2c5890c8b 100644 --- a/test/parallel/test-stream-transform-final.js +++ b/test/parallel/test-stream-transform-final.js @@ -81,7 +81,7 @@ const t = new stream.Transform({ assert.strictEqual(state, 15, 'flushCallback part 2'); 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 6d6aedd3a72bf8..773827de0ae816 100644 --- a/test/parallel/test-stream-transform-flush-data.js +++ b/test/parallel/test-stream-transform-flush-data.js @@ -18,7 +18,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 f931d4f6ceb928..6a19d6715271c5 100644 --- a/test/parallel/test-stream-transform-split-highwatermark.js +++ b/test/parallel/test-stream-transform-split-highwatermark.js @@ -69,7 +69,7 @@ testTransform(0, 0, { }, { type: TypeError, code: 'ERR_INVALID_OPT_VALUE', - message: 'The value "NaN" is invalid for option "readableHighWaterMark"' + message: 'The value "NaN" is invalid for option "readableHighWaterMark"', }); common.expectsError(() => { @@ -77,7 +77,7 @@ testTransform(0, 0, { }, { type: TypeError, code: 'ERR_INVALID_OPT_VALUE', - message: 'The value "NaN" is invalid for option "writableHighWaterMark"' + message: 'The value "NaN" is invalid for option "writableHighWaterMark"', }); } 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 f2977b285f4db3..69682b5a707575 100644 --- a/test/parallel/test-stream-unshift-read-race.js +++ b/test/parallel/test-stream-unshift-read-race.js @@ -73,7 +73,7 @@ function pushError() { }, { code: 'ERR_STREAM_PUSH_AFTER_EOF', type: Error, - message: 'stream.push() after EOF' + message: 'stream.push() after EOF', }); } @@ -91,7 +91,7 @@ r.on('end', common.mustCall(function() { }, { code: 'ERR_STREAM_UNSHIFT_AFTER_END_EVENT', type: Error, - message: 'stream.unshift() after end event' + message: 'stream.unshift() after end event', }); w.end(); })); diff --git a/test/parallel/test-stream-wrap-encoding.js b/test/parallel/test-stream-wrap-encoding.js index ce6f95fa27d68f..824f968cc3e080 100644 --- a/test/parallel/test-stream-wrap-encoding.js +++ b/test/parallel/test-stream-wrap-encoding.js @@ -7,7 +7,7 @@ const Duplex = require('stream').Duplex; { const stream = new Duplex({ read() {}, - write() {} + write() {}, }); stream.setEncoding('ascii'); @@ -17,7 +17,7 @@ const Duplex = require('stream').Duplex; wrap.on('error', common.expectsError({ type: 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'); @@ -27,7 +27,7 @@ const Duplex = require('stream').Duplex; const stream = new Duplex({ read() {}, write() {}, - objectMode: true + objectMode: true, }); const wrap = new StreamWrap(stream); @@ -35,7 +35,7 @@ const Duplex = require('stream').Duplex; wrap.on('error', common.expectsError({ type: 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 5312596afac40d..13c4e216975929 100644 --- a/test/parallel/test-stream-wrap.js +++ b/test/parallel/test-stream-wrap.js @@ -11,7 +11,7 @@ function testShutdown(callback) { read: function() { }, write: function() { - } + }, }); const wrap = new StreamWrap(stream); diff --git a/test/parallel/test-stream-writable-change-default-encoding.js b/test/parallel/test-stream-writable-change-default-encoding.js index 4fc1970a9d05db..5073b7564d43b5 100644 --- a/test/parallel/test-stream-writable-change-default-encoding.js +++ b/test/parallel/test-stream-writable-change-default-encoding.js @@ -63,7 +63,7 @@ common.expectsError(function changeDefaultEncodingToInvalidValue() { }, { type: TypeError, code: 'ERR_UNKNOWN_ENCODING', - message: 'Unknown encoding: [object Object]' + message: 'Unknown encoding: [object Object]', }); (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 425cd88ed7a336..f8dbb6537ee2ac 100644 --- a/test/parallel/test-stream-writable-constructor-set-methods.js +++ b/test/parallel/test-stream-writable-constructor-set-methods.js @@ -31,7 +31,7 @@ const w2 = new Writable(); w2.on('error', common.expectsError({ type: Error, code: 'ERR_METHOD_NOT_IMPLEMENTED', - message: 'The _write method is not implemented' + message: 'The _write method is not implemented', })); w2.end(Buffer.from('blerg')); diff --git a/test/parallel/test-stream-writable-destroy.js b/test/parallel/test-stream-writable-destroy.js index 46c48511177813..57146dd2251f5f 100644 --- a/test/parallel/test-stream-writable-destroy.js +++ b/test/parallel/test-stream-writable-destroy.js @@ -7,7 +7,7 @@ const { inherits } = require('util'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.on('finish', common.mustCall()); @@ -18,7 +18,7 @@ const { inherits } = require('util'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); const expected = new Error('kaboom'); @@ -34,7 +34,7 @@ const { inherits } = require('util'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write._destroy = function(err, cb) { @@ -59,7 +59,7 @@ const { inherits } = require('util'); destroy: common.mustCall(function(err, cb) { assert.strictEqual(err, expected); cb(); - }) + }), }); const expected = new Error('kaboom'); @@ -75,7 +75,7 @@ const { inherits } = require('util'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write._destroy = common.mustCall(function(err, cb) { @@ -89,7 +89,7 @@ const { inherits } = require('util'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write._destroy = common.mustCall(function(err, cb) { @@ -113,7 +113,7 @@ const { inherits } = require('util'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); const expected = new Error('kaboom'); @@ -135,7 +135,7 @@ const { inherits } = require('util'); { // double error case const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.on('error', common.mustCall()); @@ -148,7 +148,7 @@ const { inherits } = require('util'); { const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.destroyed = true; @@ -174,7 +174,7 @@ const { inherits } = require('util'); { // destroy and destroy callback const write = new Writable({ - write(chunk, enc, cb) { cb(); } + write(chunk, enc, cb) { cb(); }, }); write.destroy(); @@ -191,7 +191,7 @@ const { inherits } = require('util'); // called again. const write = new Writable({ write: common.mustNotCall(), - final: common.mustCall((cb) => cb(), 2) + final: common.mustCall((cb) => cb(), 2), }); write.end(); diff --git a/test/parallel/test-stream-writable-needdrain-state.js b/test/parallel/test-stream-writable-needdrain-state.js index ea5617d997d5ed..cd0eeb59696986 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 63e122a3b496e1..3bf00836776bee 100644 --- a/test/parallel/test-stream-writable-null.js +++ b/test/parallel/test-stream-writable-null.js @@ -23,7 +23,7 @@ common.expectsError( { code: 'ERR_STREAM_NULL_VALUES', type: TypeError, - message: 'May not write null values to stream' + message: 'May not write null values to stream', } ); @@ -39,7 +39,7 @@ common.expectsError( }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); 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 a0d344440ee7bb..6929ba4e68ae39 100644 --- a/test/parallel/test-stream-writev.js +++ b/test/parallel/test-stream-writev.js @@ -71,13 +71,13 @@ function test(decode, uncork, multi, next) { { encoding: 'buffer', chunk: [10, 97, 110, 100, 32, 116, 104, 101, 110, 46, 46, 46] }, { encoding: 'buffer', - chunk: [250, 206, 190, 167, 222, 173, 190, 239, 222, 202, 251, 173] } + chunk: [250, 206, 190, 167, 222, 173, 190, 239, 222, 202, 251, 173] }, ] : [ { encoding: 'ascii', chunk: 'hello, ' }, { encoding: 'utf8', chunk: 'world' }, { encoding: 'buffer', chunk: [33] }, { encoding: 'latin1', chunk: '\nand then...' }, - { encoding: 'hex', chunk: 'facebea7deadbeefdecafbad' } + { encoding: 'hex', chunk: 'facebea7deadbeefdecafbad' }, ]; let actualChunks; @@ -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(); 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 f58ea4a32a1e7d..d0372a003c5c6a 100644 --- a/test/parallel/test-stream2-objects.js +++ b/test/parallel/test-stream2-objects.js @@ -71,7 +71,7 @@ function fromArray(list) { r.pipe(toArray(common.mustCall(function(list) { assert.deepStrictEqual(list, [ { one: '1' }, - { two: '2' } + { two: '2' }, ]); }))); } @@ -96,7 +96,7 @@ function fromArray(list) { r.pipe(toArray(common.mustCall(function(list) { assert.deepStrictEqual(list, [ { one: '1' }, - { two: '2' } + { two: '2' }, ]); }))); } @@ -115,7 +115,7 @@ function fromArray(list) { r.pipe(toArray(common.mustCall(function(list) { assert.deepStrictEqual(list, [ { one: '1' }, - { two: '2' } + { two: '2' }, ]); }))); } @@ -123,7 +123,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']; @@ -140,7 +140,7 @@ function fromArray(list) { { // Verify read(0) behavior for object streams const r = new Readable({ - objectMode: true + objectMode: true, }); r._read = common.mustNotCall(); @@ -155,7 +155,7 @@ function fromArray(list) { { // Verify the behavior of pushing falsey values const r = new Readable({ - objectMode: true + objectMode: true, }); r._read = common.mustNotCall(); @@ -173,7 +173,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']; @@ -204,7 +204,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++) { @@ -252,7 +252,7 @@ function fromArray(list) { { // Verify that strings can be written as objects const w = new Writable({ - objectMode: true + objectMode: true, }); const list = []; @@ -276,7 +276,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 33645df8a5541c..332aa71d129046 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-transform.js b/test/parallel/test-stream2-transform.js index 8484e8ddb74603..c24fae07313ddd 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -28,7 +28,7 @@ const Transform = require('_stream_transform'); { // Verify writable side consumption const tx = new Transform({ - highWaterMark: 10 + highWaterMark: 10, }); let transformed = 0; @@ -408,7 +408,7 @@ const Transform = require('_stream_transform'); { foo: 'bar' }, 100, 'string', - { nested: { things: [ { foo: 'bar' }, 100, 'string' ] } } + { nested: { things: [ { foo: 'bar' }, 100, 'string' ] } }, ]; let ended = false; @@ -449,7 +449,7 @@ const Transform = require('_stream_transform'); { foo: 'bar' }, 100, 'string', - { nested: { things: [ { foo: 'bar' }, 100, 'string' ] } } + { nested: { things: [ { foo: 'bar' }, 100, 'string' ] } }, ]; let ended = false; 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 6d4f5e9f7e4781..4eb3098c50b3f0 100644 --- a/test/parallel/test-stream2-writable.js +++ b/test/parallel/test-stream2-writable.js @@ -51,7 +51,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() { @@ -88,7 +88,7 @@ for (let i = 0; i < chunks.length; i++) { { // Verify write backpressure const tw = new TestWriter({ - highWaterMark: 50 + highWaterMark: 50, }); let drains = 0; @@ -121,7 +121,7 @@ for (let i = 0; i < chunks.length; i++) { { // Verify write buffersize const tw = new TestWriter({ - highWaterMark: 100 + highWaterMark: 100, }); const encodings = @@ -153,7 +153,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) { @@ -200,7 +200,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() { diff --git a/test/parallel/test-streams-highwatermark.js b/test/parallel/test-streams-highwatermark.js index 377fe08e90d3f8..6f7d4b60fd548c 100644 --- a/test/parallel/test-streams-highwatermark.js +++ b/test/parallel/test-streams-highwatermark.js @@ -25,7 +25,8 @@ for (const invalidHwm of [true, false, '5', {}, -5, NaN]) { }, { type: TypeError, code: 'ERR_INVALID_OPT_VALUE', - message: `The value "${invalidHwm}" is invalid for option "highWaterMark"` + message: `The value "${invalidHwm}" is invalid for option ` + + '"highWaterMark"', }); } } diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js index 0e7ea8ffdd56a6..971f3e38e228b1 100644 --- a/test/parallel/test-string-decoder.js +++ b/test/parallel/test-string-decoder.js @@ -147,7 +147,7 @@ common.expectsError( { code: 'ERR_UNKNOWN_ENCODING', type: TypeError, - message: 'Unknown encoding: 1' + message: 'Unknown encoding: 1', } ); @@ -156,7 +156,7 @@ common.expectsError( { code: 'ERR_UNKNOWN_ENCODING', type: TypeError, - message: 'Unknown encoding: test' + message: 'Unknown encoding: test', } ); diff --git a/test/parallel/test-timers-active.js b/test/parallel/test-timers-active.js index a98d32c0b042d1..ac79c6fc1e1ca0 100644 --- a/test/parallel/test-timers-active.js +++ b/test/parallel/test-timers-active.js @@ -6,7 +6,7 @@ const active = require('timers').active; // active() should create timers for these const legitTimers = [ { _idleTimeout: 0 }, - { _idleTimeout: 1 } + { _idleTimeout: 1 }, ]; legitTimers.forEach(function(legit) { diff --git a/test/parallel/test-timers-enroll-invalid-msecs.js b/test/parallel/test-timers-enroll-invalid-msecs.js index 384ab0ab257908..3b324a9bf4cd72 100644 --- a/test/parallel/test-timers-enroll-invalid-msecs.js +++ b/test/parallel/test-timers-enroll-invalid-msecs.js @@ -8,13 +8,13 @@ const timers = require('timers'); [], 'foo', () => { }, - Symbol('foo') + Symbol('foo'), ].forEach((val) => { common.expectsError( () => timers.enroll({}, val), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, } ); }); @@ -22,7 +22,7 @@ const timers = require('timers'); [ -1, Infinity, - NaN + NaN, ].forEach((val) => { common.expectsError( () => timers.enroll({}, val), @@ -31,7 +31,7 @@ const timers = require('timers'); type: 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-queue-throw.js b/test/parallel/test-timers-immediate-queue-throw.js index 9929b27ab2fea3..27b9709fde978b 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 = { type: Error, - message: 'setImmediate Err' + message: 'setImmediate Err', }; process.once('uncaughtException', common.expectsError(errObj)); diff --git a/test/parallel/test-timers-max-duration-warning.js b/test/parallel/test-timers-max-duration-warning.js index c978cf29c3fe4d..d5f4a4acbe7f0f 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-throw-when-cb-not-function.js b/test/parallel/test-timers-throw-when-cb-not-function.js index 9f7f653d3d3afc..be61570c0c450b 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 = common.expectsError({ code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }, 18); assert.throws(doSetTimeout('foo'), errMessage); 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 ce63ad8d2968e7..04ba7bcc154111 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 84dd75025d6c0d..bdeb99e3171655 100644 --- a/test/parallel/test-timers-unref-remove-other-unref-timers.js +++ b/test/parallel/test-timers-unref-remove-other-unref-timers.js @@ -10,13 +10,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 d3ae27e83551c7..e005f5820ee688 100644 --- a/test/parallel/test-timers-unref-throw-then-ref.js +++ b/test/parallel/test-timers-unref-throw-then-ref.js @@ -3,7 +3,7 @@ const common = require('../common'); const assert = require('assert'); process.once('uncaughtException', common.expectsError({ - message: 'Timeout Error' + message: 'Timeout Error', })); let called = false; diff --git a/test/parallel/test-timers.js b/test/parallel/test-timers.js index 1aa5d351a4d4bd..0c066fe2ff2f84 100644 --- a/test/parallel/test-timers.js +++ b/test/parallel/test-timers.js @@ -48,7 +48,7 @@ const inputs = [ 1, 1.0, 2147483648, // browser behavior: timeouts > 2^31-1 run on next tick - 12345678901234 // ditto + 12345678901234, // ditto ]; const timeouts = []; 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 8eb88db6291457..5987448c328c44 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 c686d68a182e3d..6fadf41f1d650e 100644 --- a/test/parallel/test-tls-alert-handling.js +++ b/test/parallel/test-tls-alert-handling.js @@ -23,7 +23,7 @@ function loadPEM(n) { const opts = { key: loadPEM('agent2-key'), - cert: loadPEM('agent2-cert') + cert: loadPEM('agent2-cert'), }; const max_iter = 20; @@ -46,7 +46,7 @@ server.listen(0, common.mustCall(function() { function sendClient() { const client = tls.connect(server.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }); client.on('data', common.mustCall(function() { if (iter++ === 2) sendBADTLSRecord(); @@ -71,7 +71,7 @@ function sendBADTLSRecord() { const socket = net.connect(server.address().port); const client = tls.connect({ socket: socket, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { socket.write(BAD_RECORD); socket.end(); diff --git a/test/parallel/test-tls-alert.js b/test/parallel/test-tls-alert.js index 8e78e748525257..5bfd27dd844974 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-alpn-server-client.js b/test/parallel/test-tls-alpn-server-client.js index 44699b20533f9d..5519cc546bd86c 100644 --- a/test/parallel/test-tls-alpn-server-client.js +++ b/test/parallel/test-tls-alpn-server-client.js @@ -66,18 +66,18 @@ function runTest(clientsOptions, serverOptions, cb) { function Test1() { const serverOptions = { ALPNProtocols: ['a', 'b', 'c'], - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{ ALPNProtocols: ['a', 'b', 'c'], - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }, { ALPNProtocols: ['c', 'b', 'e'], - NPNProtocols: ['c', 'b', 'e'] + NPNProtocols: ['c', 'b', 'e'], }, { ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], - NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + NPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -102,15 +102,15 @@ function Test1() { function Test2() { const serverOptions = { ALPNProtocols: ['a', 'b', 'c'], - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{ - ALPNProtocols: ['a', 'b', 'c'] + ALPNProtocols: ['a', 'b', 'c'], }, { - ALPNProtocols: ['c', 'b', 'e'] + ALPNProtocols: ['c', 'b', 'e'], }, { - ALPNProtocols: ['first-priority-unsupported', 'x', 'y'] + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -135,15 +135,15 @@ function Test2() { function Test3() { const serverOptions = { ALPNProtocols: ['a', 'b', 'c'], - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{ - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }, { - NPPNProtocols: ['c', 'b', 'e'] + NPPNProtocols: ['c', 'b', 'e'], }, { - NPPNProtocols: ['first-priority-unsupported', 'x', 'y'] + NPPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -168,7 +168,7 @@ function Test3() { function Test4() { const serverOptions = { ALPNProtocols: ['a', 'b', 'c'], - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{}, {}, {}]; @@ -194,18 +194,18 @@ function Test4() { // Server: ALPN, Client: ALPN/NPN function Test5() { const serverOptions = { - ALPNProtocols: ['a', 'b', 'c'] + ALPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{ ALPNProtocols: ['a', 'b', 'c'], - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }, { ALPNProtocols: ['c', 'b', 'e'], - NPNProtocols: ['c', 'b', 'e'] + NPNProtocols: ['c', 'b', 'e'], }, { ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], - NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + NPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -227,15 +227,15 @@ function Test5() { // Server: ALPN, Client: ALPN function Test6() { const serverOptions = { - ALPNProtocols: ['a', 'b', 'c'] + ALPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{ - ALPNProtocols: ['a', 'b', 'c'] + ALPNProtocols: ['a', 'b', 'c'], }, { - ALPNProtocols: ['c', 'b', 'e'] + ALPNProtocols: ['c', 'b', 'e'], }, { - ALPNProtocols: ['first-priority-unsupported', 'x', 'y'] + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -256,15 +256,15 @@ function Test6() { // Server: ALPN, Client: NPN function Test7() { const serverOptions = { - ALPNProtocols: ['a', 'b', 'c'] + ALPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{ - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }, { - NPNProtocols: ['c', 'b', 'e'] + NPNProtocols: ['c', 'b', 'e'], }, { - NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + NPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -286,7 +286,7 @@ function Test7() { // Server: ALPN, Client: Nothing function Test8() { const serverOptions = { - ALPNProtocols: ['a', 'b', 'c'] + ALPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{}, {}, {}]; @@ -310,18 +310,18 @@ function Test8() { // Server: NPN, Client: ALPN/NPN function Test9() { const serverOptions = { - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{ ALPNrotocols: ['a', 'b', 'c'], - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }, { ALPNProtocols: ['c', 'b', 'e'], - NPNProtocols: ['c', 'b', 'e'] + NPNProtocols: ['c', 'b', 'e'], }, { ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], - NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + NPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -343,15 +343,15 @@ function Test9() { // Server: NPN, Client: ALPN function Test10() { const serverOptions = { - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{ - ALPNProtocols: ['a', 'b', 'c'] + ALPNProtocols: ['a', 'b', 'c'], }, { - ALPNProtocols: ['c', 'b', 'e'] + ALPNProtocols: ['c', 'b', 'e'], }, { - ALPNProtocols: ['first-priority-unsupported', 'x', 'y'] + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -372,15 +372,15 @@ function Test10() { // Server: NPN, Client: NPN function Test11() { const serverOptions = { - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{ - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }, { - NPNProtocols: ['c', 'b', 'e'] + NPNProtocols: ['c', 'b', 'e'], }, { - NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + NPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -402,7 +402,7 @@ function Test11() { // Server: NPN, Client: Nothing function Test12() { const serverOptions = { - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{}, {}, {}]; @@ -429,13 +429,13 @@ function Test13() { const clientsOptions = [{ ALPNrotocols: ['a', 'b', 'c'], - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }, { ALPNProtocols: ['c', 'b', 'e'], - NPNProtocols: ['c', 'b', 'e'] + NPNProtocols: ['c', 'b', 'e'], }, { ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], - NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + NPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -459,11 +459,11 @@ function Test14() { const serverOptions = {}; const clientsOptions = [{ - ALPNrotocols: ['a', 'b', 'c'] + ALPNrotocols: ['a', 'b', 'c'], }, { - ALPNProtocols: ['c', 'b', 'e'] + ALPNProtocols: ['c', 'b', 'e'], }, { - ALPNProtocols: ['first-priority-unsupported', 'x', 'y'] + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { @@ -487,11 +487,11 @@ function Test15() { const serverOptions = {}; const clientsOptions = [{ - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }, { - NPNProtocols: ['c', 'b', 'e'] + NPNProtocols: ['c', 'b', 'e'], }, { - NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + NPNProtocols: ['first-priority-unsupported', 'x', 'y'], }]; runTest(clientsOptions, serverOptions, function(results) { 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 2e1fbe54ae4afc..6a1fc5dc12c6d8 100644 --- a/test/parallel/test-tls-async-cb-after-socket-end.js +++ b/test/parallel/test-tls-async-cb-after-socket-end.js @@ -10,7 +10,7 @@ const tls = require('tls'); const options = { secureOptions: SSL_OP_NO_TICKET, key: fixtures.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + cert: fixtures.readSync('test_cert.pem'), }; const server = tls.createServer(options, function(c) { @@ -33,7 +33,7 @@ server.listen(0, function() { const clientOpts = { port: this.address().port, rejectUnauthorized: false, - session: false + session: false, }; const s1 = tls.connect(clientOpts, function() { diff --git a/test/parallel/test-tls-basic-validations.js b/test/parallel/test-tls-basic-validations.js index 501cfd91d0ed87..b265024bbaac25 100644 --- a/test/parallel/test-tls-basic-validations.js +++ b/test/parallel/test-tls-basic-validations.js @@ -26,7 +26,7 @@ common.expectsError(() => tls.createServer({ handshakeTimeout: 'abcd' }), { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "timeout" argument must be of type number' + message: 'The "timeout" argument must be of type number', } ); @@ -43,7 +43,7 @@ common.expectsError( () => tls.createSecurePair({}), { code: 'ERR_ASSERTION', - message: 'context.context must be a NativeSecureContext' + message: 'context.context must be a NativeSecureContext', } ); diff --git a/test/parallel/test-tls-buffersize.js b/test/parallel/test-tls-buffersize.js index c94b95d7b32d31..e31601e67808bf 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 3b4f3e7db74115..22ddce7fe5b022 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 { - assert, connect, keys + assert, 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 aeb37a8696cf69..e214e5b0800d56 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 9cd33fcff64145..82de68d2235d0e 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-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 1623e70a2af2ec..fd747f60bbb194 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', }, // Wildcards in CN @@ -68,193 +68,193 @@ 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: { subjectaltname: 'DNS:omg.com', subject: { CN: '*.a.com' } }, error: 'Host: b.a.com. is not in the cert\'s altnames: ' + - 'DNS:omg.com' + 'DNS:omg.com', }, { 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', }, // 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-cipher-list.js b/test/parallel/test-tls-cipher-list.js index 4a39ee9391a7c1..1f7a1eb834abf4 100644 --- a/test/parallel/test-tls-cipher-list.js +++ b/test/parallel/test-tls-cipher-list.js @@ -12,7 +12,7 @@ function doCheck(arg, check) { let out = ''; arg = arg.concat([ '-pe', - 'require("crypto").constants.defaultCipherList' + 'require("crypto").constants.defaultCipherList', ]); spawn(process.execPath, arg, {}) .on('error', common.mustNotCall()) 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 be6777b1ae0049..093ccf5bba6621 100644 --- a/test/parallel/test-tls-client-getephemeralkeyinfo.js +++ b/test/parallel/test-tls-client-getephemeralkeyinfo.js @@ -20,7 +20,7 @@ function loadDHParam(n) { const cipherlist = { 'NOT_PFS': 'AES128-SHA256', 'DH': 'DHE-RSA-AES128-GCM-SHA256', - 'ECDH': 'ECDHE-RSA-AES128-GCM-SHA256' + 'ECDH': 'ECDHE-RSA-AES128-GCM-SHA256', }; function test(size, type, name, next) { @@ -31,7 +31,7 @@ function test(size, type, name, next) { const options = { key: key, cert: cert, - ciphers: cipher + ciphers: cipher, }; if (type === 'DH') options.dhparam = loadDHParam(size); @@ -49,7 +49,7 @@ function test(size, type, name, next) { server.listen(0, '127.0.0.1', common.mustCall(function() { const client = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, 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 3017d30e6c5e9e..a231e09ecf6401 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 955d97da6fb6fc..6cc2be3d1a558f 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.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + cert: fixtures.readSync('test_cert.pem'), }; const server = tls.createServer(options, common.mustCall(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() { assert(!socket.authorized); socket.end(); @@ -58,7 +58,7 @@ function unauthorized() { function rejectUnauthorized() { const socket = tls.connect(server.address().port, { - servername: 'localhost' + servername: 'localhost', }, common.mustNotCall()); socket.on('error', common.mustCall(function(err) { console.error(err); @@ -70,7 +70,7 @@ function rejectUnauthorized() { function authorized() { const socket = tls.connect(server.address().port, { ca: [fixtures.readSync('test_cert.pem')], - servername: 'localhost' + servername: 'localhost', }, common.mustCall(function() { assert(socket.authorized); socket.end(); diff --git a/test/parallel/test-tls-client-resume.js b/test/parallel/test-tls-client-resume.js index d99c11a3e67790..2bac2f06ccab4a 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 @@ -48,7 +48,7 @@ server.listen(0, function() { let session1 = null; const client1 = tls.connect({ port: this.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { console.log('connect1'); assert.ok(!client1.isSessionReused(), 'Session *should not* be reused.'); @@ -61,7 +61,7 @@ server.listen(0, function() { const opts = { port: server.address().port, rejectUnauthorized: false, - session: session1 + session: session1, }; const client2 = tls.connect(opts, function() { diff --git a/test/parallel/test-tls-client-verify.js b/test/parallel/test-tls-client-verify.js index 83b9142dea9266..000fe03a7f8e31 100644 --- a/test/parallel/test-tls-client-verify.js +++ b/test/parallel/test-tls-client-verify.js @@ -35,8 +35,8 @@ const testCases = servers: [ { ok: true, key: 'agent1-key', cert: 'agent1-cert' }, { ok: false, key: 'agent2-key', cert: 'agent2-cert' }, - { ok: false, key: 'agent3-key', cert: 'agent3-cert' } - ] + { ok: false, key: 'agent3-key', cert: 'agent3-cert' }, + ], }, { ca: [], @@ -45,8 +45,8 @@ const testCases = servers: [ { ok: false, key: 'agent1-key', cert: 'agent1-cert' }, { ok: false, key: 'agent2-key', cert: 'agent2-cert' }, - { ok: false, key: 'agent3-key', cert: 'agent3-cert' } - ] + { ok: false, key: 'agent3-key', cert: 'agent3-cert' }, + ], }, { ca: ['ca1-cert', 'ca2-cert'], @@ -55,9 +55,9 @@ const testCases = servers: [ { ok: true, key: 'agent1-key', cert: 'agent1-cert' }, { ok: false, key: 'agent2-key', cert: 'agent2-cert' }, - { ok: true, key: 'agent3-key', cert: 'agent3-cert' } - ] - } + { ok: true, key: 'agent3-key', cert: 'agent3-cert' }, + ], + }, ]; @@ -127,7 +127,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 0209a51fc78d31..c446063c2db47b 100644 --- a/test/parallel/test-tls-clientcertengine-unsupported.js +++ b/test/parallel/test-tls-clientcertengine-unsupported.js @@ -21,7 +21,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-notify.js b/test/parallel/test-tls-close-notify.js index 5ce7145540562d..ff18ad2eb640c9 100644 --- a/test/parallel/test-tls-close-notify.js +++ b/test/parallel/test-tls-close-notify.js @@ -30,14 +30,14 @@ 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) { // Send close-notify without shutting down TCP socket if (c._handle.shutdownSSL() !== 1) c._handle.shutdownSSL(); }).listen(0, common.mustCall(function() { const c = tls.connect(this.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { // Ensure that we receive 'end' event anyway c.on('end', common.mustCall(function() { diff --git a/test/parallel/test-tls-cnnic-whitelist.js b/test/parallel/test-tls-cnnic-whitelist.js index d118567089d44d..2be869a21137bf 100644 --- a/test/parallel/test-tls-cnnic-whitelist.js +++ b/test/parallel/test-tls-cnnic-whitelist.js @@ -21,14 +21,14 @@ const testCases = [ // rootCA. serverOpts: { key: loadPEM('agent7-key'), - cert: loadPEM('agent7-cert') + cert: loadPEM('agent7-cert'), }, clientOpts: { port: undefined, rejectUnauthorized: true, - ca: [loadPEM('fake-cnnic-root-cert')] + ca: [loadPEM('fake-cnnic-root-cert')], }, - errorCode: 'CERT_REVOKED' + errorCode: 'CERT_REVOKED', }, // Test 1: for the fix of node#2061 // agent6-cert.pem is signed by intermediate cert of ca3. @@ -40,14 +40,14 @@ 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', + }, ]; function runTest(tindex) { diff --git a/test/parallel/test-tls-connect-given-socket.js b/test/parallel/test-tls-connect-given-socket.js index 5fc5603dd1653b..a6a0007a33f97a 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.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + cert: fixtures.readSync('test_cert.pem'), }; 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-no-host.js b/test/parallel/test-tls-connect-no-host.js index f6384743ac7081..fac4de9a0bf923 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.readSync('test_key.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 0c6ae2b660d502..cf809c754b7bdd 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-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 fc5eaaa884c578..7ce64380340cba 100644 --- a/test/parallel/test-tls-delayed-attach.js +++ b/test/parallel/test-tls-delayed-attach.js @@ -34,14 +34,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(function(c) { setTimeout(function() { const s = new tls.TLSSocket(c, { isServer: true, - secureContext: tls.createSecureContext(options) + secureContext: tls.createSecureContext(options), }); s.on('data', function(chunk) { @@ -55,7 +55,7 @@ const server = net.createServer(function(c) { }, 200); }).listen(0, function() { const c = tls.connect(this.address().port, { - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { 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 177f6f2eb2db19..37f6f63ff50f76 100644 --- a/test/parallel/test-tls-dhe.js +++ b/test/parallel/test-tls-dhe.js @@ -55,7 +55,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 b688079a58af50..f325e502dd1a38 100644 --- a/test/parallel/test-tls-disable-renegotiation.js +++ b/test/parallel/test-tls-disable-renegotiation.js @@ -12,7 +12,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.Server(options, common.mustCall((socket) => { @@ -20,7 +20,7 @@ const server = tls.Server(options, common.mustCall((socket) => { common.expectsError({ type: 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(); @@ -43,7 +43,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 eaa7e1da6de5f1..4e2f76a5da3de9 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-disable.js b/test/parallel/test-tls-ecdh-disable.js index 7726a0655edd02..cfceae3dc5e9c5 100644 --- a/test/parallel/test-tls-ecdh-disable.js +++ b/test/parallel/test-tls-ecdh-disable.js @@ -44,7 +44,7 @@ const options = { key: readKey('agent2-key.pem'), cert: readKey('agent2-cert.pem'), ciphers: 'ECDHE-RSA-AES128-SHA', - ecdhCurve: false + ecdhCurve: false, }; common.expectWarning('DeprecationWarning', diff --git a/test/parallel/test-tls-ecdh-multiple.js b/test/parallel/test-tls-ecdh-multiple.js index dee75f972167a5..da7a4b850a03c2 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 @@ -66,7 +66,7 @@ process.on('exit', function() { const unsupportedCurves = [ 'wap-wsg-idm-ecid-wtls1', 'c2pnb163v1', - 'prime192v3' + 'prime192v3', ]; // Brainpool is not supported in FIPS mode diff --git a/test/parallel/test-tls-ecdh.js b/test/parallel/test-tls-ecdh.js index 170031b2f79db0..4aab17397b221d 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 48f9a52463d3a4..3275cb41b87c04 100644 --- a/test/parallel/test-tls-empty-sni-context.js +++ b/test/parallel/test-tls-empty-sni-context.js @@ -13,7 +13,7 @@ const tls = require('tls'); const options = { SNICallback: (name, callback) => { callback(null, tls.createSecureContext()); - } + }, }; const server = tls.createServer(options, (c) => { @@ -25,7 +25,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-env-extra-ca.js b/test/parallel/test-tls-env-extra-ca.js index c4f647a735d72f..23c8f7e369196a 100644 --- a/test/parallel/test-tls-env-extra-ca.js +++ b/test/parallel/test-tls-env-extra-ca.js @@ -35,7 +35,7 @@ const server = tls.createServer(options, common.mustCall(function(s) { const env = Object.assign({}, 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 8f6d1c5c6d8a46..2eea2d4d177ab3 100644 --- a/test/parallel/test-tls-error-servername.js +++ b/test/parallel/test-tls-error-servername.js @@ -19,7 +19,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) => { @@ -27,7 +27,7 @@ const client = connect({ client.setServername(value); }, { code: 'ERR_INVALID_ARG_TYPE', - message: 'The "name" argument must be of type string' + message: 'The "name" argument must be of type string', }); }); @@ -35,12 +35,12 @@ const server = new TLSSocket(serverSide, { isServer: true, key, cert, - ca + ca, }); common.expectsError(() => { 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-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-getcipher.js b/test/parallel/test-tls-getcipher.js index 3ba33faf42369d..0d49540838ec79 100644 --- a/test/parallel/test-tls-getcipher.js +++ b/test/parallel/test-tls-getcipher.js @@ -36,7 +36,7 @@ const options = { key: fixtures.readKey('agent2-key.pem'), cert: fixtures.readKey('agent2-cert.pem'), ciphers: cipher_list.join(':'), - honorCipherOrder: true + honorCipherOrder: true, }; const server = tls.createServer(options, common.mustCall()); @@ -46,7 +46,7 @@ server.listen(0, '127.0.0.1', common.mustCall(function() { host: '127.0.0.1', port: this.address().port, ciphers: cipher_list.join(':'), - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { const cipher = client.getCipher(); assert.strictEqual(cipher.name, cipher_list[0]); diff --git a/test/parallel/test-tls-getprotocol.js b/test/parallel/test-tls-getprotocol.js index bf75eb8a398647..11a0e43f8a72db 100644 --- a/test/parallel/test-tls-getprotocol.js +++ b/test/parallel/test-tls-getprotocol.js @@ -13,12 +13,12 @@ const fixtures = require('../common/fixtures'); const clientConfigs = [ { secureProtocol: 'TLSv1_method', version: 'TLSv1' }, { secureProtocol: 'TLSv1_1_method', version: 'TLSv1.1' }, - { secureProtocol: 'TLSv1_2_method', version: 'TLSv1.2' } + { secureProtocol: 'TLSv1_2_method', version: 'TLSv1.2' }, ]; const serverConfig = { key: fixtures.readSync('/keys/agent2-key.pem'), - cert: fixtures.readSync('/keys/agent2-cert.pem') + cert: fixtures.readSync('/keys/agent2-cert.pem'), }; const server = tls.createServer(serverConfig, common.mustCall(function() { @@ -30,7 +30,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(function() { diff --git a/test/parallel/test-tls-handshake-error.js b/test/parallel/test-tls-handshake-error.js index 776004cf228f31..849b7dc0badf66 100644 --- a/test/parallel/test-tls-handshake-error.js +++ b/test/parallel/test-tls-handshake-error.js @@ -13,12 +13,12 @@ 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() { const c = tls.connect({ port: this.address().port, - ciphers: 'RC4' + ciphers: 'RC4', }, common.mustNotCall()); c.on('error', common.mustCall(function(err) { diff --git a/test/parallel/test-tls-hello-parser-failure.js b/test/parallel/test-tls-hello-parser-failure.js index 4a7d8999c78d39..5879174d84ff78 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.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + cert: fixtures.readSync('test_cert.pem'), }; const bonkers = Buffer.alloc(1024 * 1024, 42); diff --git a/test/parallel/test-tls-honorcipherorder.js b/test/parallel/test-tls-honorcipherorder.js index 60029bb4bd64b8..87c4a855f561b6 100644 --- a/test/parallel/test-tls-honorcipherorder.js +++ b/test/parallel/test-tls-honorcipherorder.js @@ -25,7 +25,7 @@ function test(honorCipherOrder, clientCipher, expectedCipher, cb) { cert: fixtures.readKey('agent2-cert.pem'), ciphers: 'AES256-SHA256:AES128-GCM-SHA256:AES128-SHA256:' + 'ECDHE-RSA-AES128-GCM-SHA256', - honorCipherOrder: !!honorCipherOrder + honorCipherOrder: !!honorCipherOrder, }; const server = tls.createServer(soptions, function(cleartextStream) { @@ -38,7 +38,7 @@ function test(honorCipherOrder, clientCipher, expectedCipher, cb) { server.listen(0, localhost, 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 f28f92373c5500..51704959f24d76 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.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + cert: fixtures.readSync('test_cert.pem'), }; 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 754b02ba0bae99..e9492f845eb170 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-js-stream.js b/test/parallel/test-tls-js-stream.js index 908f4c48876a56..fe2837c3838785 100644 --- a/test/parallel/test-tls-js-stream.js +++ b/test/parallel/test-tls-js-stream.js @@ -13,12 +13,12 @@ const tls = require('tls'); const connected = { client: 0, - server: 0 + server: 0, }; const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, function(c) { console.log('new client'); connected.server++; @@ -47,12 +47,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, }, 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 b0c8affadefe95..d9705c5d524aee 100644 --- a/test/parallel/test-tls-key-mismatch.js +++ b/test/parallel/test-tls-key-mismatch.js @@ -34,7 +34,7 @@ const errorMessageRegex = 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-max-send-fragment.js b/test/parallel/test-tls-max-send-fragment.js index eca995d66483b5..22eb38056ae794 100644 --- a/test/parallel/test-tls-max-send-fragment.js +++ b/test/parallel/test-tls-max-send-fragment.js @@ -35,7 +35,7 @@ const maxChunk = 768; const server = tls.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, function(c) { // Lower and upper limits assert(!c.setMaxSendFragment(511)); @@ -47,7 +47,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-multi-key.js b/test/parallel/test-tls-multi-key.js index 8c0722f858c748..9d1bce2169e0dd 100644 --- a/test/parallel/test-tls-multi-key.js +++ b/test/parallel/test-tls-multi-key.js @@ -36,7 +36,7 @@ const options = { cert: [ fixtures.readKey('agent1-cert.pem'), fixtures.readKey('ec-cert.pem'), - ] + ], }; const ciphers = []; @@ -46,12 +46,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, }, function() { ciphers.push(ecdsa.getCipher()); const rsa = tls.connect(server.address().port, { ciphers: 'ECDHE-RSA-AES256-GCM-SHA384', - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { ciphers.push(rsa.getCipher()); ecdsa.end(); @@ -64,9 +64,9 @@ const server = tls.createServer(options, function(conn) { process.on('exit', function() { assert.deepStrictEqual(ciphers, [{ name: 'ECDHE-ECDSA-AES256-GCM-SHA384', - version: 'TLSv1/SSLv3' + version: 'TLSv1/SSLv3', }, { name: 'ECDHE-RSA-AES256-GCM-SHA384', - version: 'TLSv1/SSLv3' + version: 'TLSv1/SSLv3', }]); }); diff --git a/test/parallel/test-tls-multi-pfx.js b/test/parallel/test-tls-multi-pfx.js index f750aec325c957..32cbf9a2d72803 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.pem'), - passphrase: 'sample' + passphrase: 'sample', }, - fixtures.readKey('ec-pfx.pem') - ] + fixtures.readKey('ec-pfx.pem'), + ], }; 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(); @@ -42,9 +42,9 @@ const server = tls.createServer(options, function(conn) { process.on('exit', function() { assert.deepStrictEqual(ciphers, [{ name: 'ECDHE-ECDSA-AES256-GCM-SHA384', - version: 'TLSv1/SSLv3' + version: 'TLSv1/SSLv3', }, { name: 'ECDHE-RSA-AES256-GCM-SHA384', - version: 'TLSv1/SSLv3' + version: 'TLSv1/SSLv3', }]); }); diff --git a/test/parallel/test-tls-net-connect-prefer-path.js b/test/parallel/test-tls-net-connect-prefer-path.js index 263501ae0330ac..6dc324ad2ac545 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.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + key: fixtures.readSync('test_key.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 c6ad117831e5a6..5107abac042e4b 100644 --- a/test/parallel/test-tls-no-cert-required.js +++ b/test/parallel/test-tls-no-cert-required.js @@ -43,7 +43,7 @@ common.expectsError(() => tls.createServer('this is not valid'), { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options" argument must be of type Object' + message: 'The "options" argument must be of type Object', } ); 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-npn-server-client.js b/test/parallel/test-tls-npn-server-client.js index 518e881f9c0c15..a06eb80779328d 100644 --- a/test/parallel/test-tls-npn-server-client.js +++ b/test/parallel/test-tls-npn-server-client.js @@ -46,7 +46,7 @@ const serverOptions = { crl: loadPEM('ca2-crl'), })); }, - NPNProtocols: ['a', 'b', 'c'] + NPNProtocols: ['a', 'b', 'c'], }; const clientsOptions = [{ @@ -55,27 +55,27 @@ const clientsOptions = [{ cert: serverOptions.cert, crl: serverOptions.crl, NPNProtocols: ['a', 'b', 'c'], - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, key: serverOptions.key, cert: serverOptions.cert, crl: serverOptions.crl, NPNProtocols: ['c', 'b', 'e'], - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, key: serverOptions.key, cert: serverOptions.cert, crl: serverOptions.crl, - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, key: serverOptions.key, cert: serverOptions.cert, crl: serverOptions.crl, NPNProtocols: ['first-priority-unsupported', 'x', 'y'], - rejectUnauthorized: false + rejectUnauthorized: false, }]; const serverResults = []; diff --git a/test/parallel/test-tls-ocsp-callback.js b/test/parallel/test-tls-ocsp-callback.js index 9a6df6fb5b2c5b..512f81358fdbb7 100644 --- a/test/parallel/test-tls-ocsp-callback.js +++ b/test/parallel/test-tls-ocsp-callback.js @@ -48,7 +48,7 @@ function test(testOptions, cb) { const options = { key, cert, - ca: [ca] + ca: [ca], }; let requestCount = 0; let clientSecure = 0; @@ -90,7 +90,7 @@ function test(testOptions, cb) { requestOCSP: testOptions.ocsp !== false, secureOptions: testOptions.ocsp === false ? SSL_OP_NO_TICKET : 0, - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { clientSecure++; }); @@ -125,7 +125,7 @@ function test(testOptions, cb) { const tests = [ { response: false }, { response: 'hello world' }, - { ocsp: false } + { ocsp: false }, ]; if (!common.hasFipsCrypto) { 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-options-boolean-check.js b/test/parallel/test-tls-options-boolean-check.js index 53f595e0de50e5..7270057b473c40 100644 --- a/test/parallel/test-tls-options-boolean-check.js +++ b/test/parallel/test-tls-options-boolean-check.js @@ -62,7 +62,7 @@ const invalidCertRE = /^The "cert" argument must be one of type string, Buffer, [[keyStr, keyStr2], false], [false, [certStr, certStr2]], [[{ pem: keyBuff }], false], - [[{ pem: keyBuff }, { pem: keyBuff }], false] + [[{ pem: keyBuff }, { pem: keyBuff }], false], ].forEach(([key, cert]) => { tls.createServer({ key, cert }); }); @@ -93,14 +93,14 @@ const invalidCertRE = /^The "cert" argument must be one of type string, Buffer, [[true, false], [certBuff, certBuff2], invalidKeyRE], [[keyStr, keyStr2], [true, false], invalidCertRE], [[keyStr, keyStr2], true, invalidCertRE], - [true, [certBuff, certBuff2], invalidKeyRE] + [true, [certBuff, certBuff2], invalidKeyRE], ].forEach(([key, cert, message]) => { common.expectsError(() => { tls.createServer({ key, cert }); }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message + message, }); }); @@ -125,14 +125,14 @@ const invalidCertRE = /^The "cert" argument must be one of type string, Buffer, [keyBuff, certBuff, {}], [keyBuff, certBuff, 1], [keyBuff, certBuff, true], - [keyBuff, certBuff, [caCert, true]] + [keyBuff, certBuff, [caCert, true]], ].forEach(([key, cert, ca]) => { common.expectsError(() => { tls.createServer({ key, cert, ca }); }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "ca" argument must be one of type string, Buffer, TypedArray, or DataView$/ + message: /^The "ca" argument must be one of type string, Buffer, TypedArray, or DataView$/, }); }); @@ -143,14 +143,14 @@ const invalidCertRE = /^The "cert" argument must be one of type string, Buffer, [keyBuff, certBuff, {}], [keyBuff, certBuff, 1], [keyBuff, certBuff, true], - [keyBuff, certBuff, [caCert, true]] + [keyBuff, certBuff, [caCert, true]], ].forEach(([key, cert, ca]) => { common.expectsError(() => { tls.createServer({ key, cert, ca }); }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: /^The "ca" argument must be one of type string, Buffer, TypedArray, or DataView$/ + message: /^The "ca" argument must be one of type string, Buffer, TypedArray, or DataView$/, }); }); @@ -161,7 +161,7 @@ const invalidCertRE = /^The "cert" argument must be one of type string, Buffer, [false, false, false], [undefined, undefined, undefined], ['', '', ''], - [0, 0, 0] + [0, 0, 0], ].forEach(([key, cert, ca]) => { tls.createSecureContext({ key, cert, ca }); }); diff --git a/test/parallel/test-tls-over-http-tunnel.js b/test/parallel/test-tls-over-http-tunnel.js index f3f2bb3f2726ed..ff1970febe75e7 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(200, res.statusCode); diff --git a/test/parallel/test-tls-parse-cert-string.js b/test/parallel/test-tls-parse-cert-string.js index 78e570d0889c8f..5e1a5d402aa184 100644 --- a/test/parallel/test-tls-parse-cert-string.js +++ b/test/parallel/test-tls-parse-cert-string.js @@ -25,7 +25,7 @@ common.hijackStderr(noOutput); O: 'Node.js Foundation', OU: 'Node.js', CN: 'ca1', - emailAddress: 'ry@clouds.org' + emailAddress: 'ry@clouds.org', }); } @@ -36,7 +36,7 @@ common.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 b183309af71457..54fcd4739687ea 100644 --- a/test/parallel/test-tls-passphrase.js +++ b/test/parallel/test-tls-passphrase.js @@ -43,7 +43,7 @@ const server = tls.Server({ cert: cert, ca: [cert], requestCert: true, - rejectUnauthorized: true + rejectUnauthorized: true, }, function(s) { s.end(); }); @@ -55,14 +55,14 @@ server.listen(0, common.mustCall(function() { key: passKey, passphrase: 'passphrase', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ port: this.address().port, key: rawKey, cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ @@ -70,7 +70,7 @@ server.listen(0, common.mustCall(function() { key: rawKey, passphrase: 'ignored', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); // Buffer[] @@ -79,14 +79,14 @@ server.listen(0, common.mustCall(function() { key: [passKey], passphrase: 'passphrase', cert: [cert], - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ port: this.address().port, key: [rawKey], cert: [cert], - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ @@ -94,7 +94,7 @@ server.listen(0, common.mustCall(function() { key: [rawKey], passphrase: 'ignored', cert: [cert], - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); // string @@ -103,14 +103,14 @@ server.listen(0, common.mustCall(function() { key: passKey.toString(), passphrase: 'passphrase', cert: cert.toString(), - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ port: this.address().port, key: rawKey.toString(), cert: cert.toString(), - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ @@ -118,7 +118,7 @@ server.listen(0, common.mustCall(function() { key: rawKey.toString(), passphrase: 'ignored', cert: cert.toString(), - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); // String[] @@ -127,14 +127,14 @@ server.listen(0, common.mustCall(function() { key: [passKey.toString()], passphrase: 'passphrase', cert: [cert.toString()], - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ port: this.address().port, key: [rawKey.toString()], cert: [cert.toString()], - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ @@ -142,7 +142,7 @@ server.listen(0, common.mustCall(function() { key: [rawKey.toString()], passphrase: 'ignored', cert: [cert.toString()], - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); // Object[] @@ -150,7 +150,7 @@ server.listen(0, common.mustCall(function() { port: this.address().port, key: [{ pem: passKey, passphrase: 'passphrase' }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ @@ -158,7 +158,7 @@ server.listen(0, common.mustCall(function() { key: [{ pem: passKey, passphrase: 'passphrase' }], passphrase: 'ignored', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ @@ -166,28 +166,28 @@ server.listen(0, common.mustCall(function() { key: [{ pem: passKey }], passphrase: 'passphrase', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ port: this.address().port, key: [{ pem: passKey.toString(), passphrase: 'passphrase' }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ port: this.address().port, key: [{ pem: rawKey, passphrase: 'ignored' }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ port: this.address().port, key: [{ pem: rawKey.toString(), passphrase: 'ignored' }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ @@ -195,7 +195,7 @@ server.listen(0, common.mustCall(function() { key: [{ pem: rawKey }], passphrase: 'ignored', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ @@ -203,21 +203,21 @@ server.listen(0, common.mustCall(function() { key: [{ pem: rawKey.toString() }], passphrase: 'ignored', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ port: this.address().port, key: [{ pem: rawKey }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); tls.connect({ port: this.address().port, key: [{ pem: rawKey.toString() }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall()); })).unref(); @@ -229,7 +229,7 @@ assert.throws(function() { port: server.address().port, key: passKey, cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessagePassword); @@ -238,7 +238,7 @@ assert.throws(function() { port: server.address().port, key: [passKey], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessagePassword); @@ -247,7 +247,7 @@ assert.throws(function() { port: server.address().port, key: [{ pem: passKey }], cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessagePassword); @@ -260,7 +260,7 @@ assert.throws(function() { key: passKey, passphrase: 'invalid', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessageDecrypt); @@ -270,7 +270,7 @@ assert.throws(function() { key: [passKey], passphrase: 'invalid', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessageDecrypt); @@ -280,7 +280,7 @@ assert.throws(function() { key: [{ pem: passKey }], passphrase: 'invalid', cert: cert, - rejectUnauthorized: false + rejectUnauthorized: false, }); }, errMessageDecrypt); @@ -290,6 +290,6 @@ assert.throws(function() { key: [{ pem: passKey, passphrase: 'invalid' }], passphrase: 'passphrase', // 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 e246acff807a91..51f22af4dfe6b6 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.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + cert: fixtures.readSync('test_cert.pem'), }; 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 19c7cde42cdc16..8806f619fc8c34 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, function(cleartext) { @@ -41,7 +41,7 @@ const server = tls.createServer(options, function(cleartext) { 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(); diff --git a/test/parallel/test-tls-peer-certificate-multi-keys.js b/test/parallel/test-tls-peer-certificate-multi-keys.js index b178daa2ba9328..aa94560df65c79 100644 --- a/test/parallel/test-tls-peer-certificate-multi-keys.js +++ b/test/parallel/test-tls-peer-certificate-multi-keys.js @@ -31,7 +31,7 @@ const fixtures = require('../common/fixtures'); const options = { key: fixtures.readSync('agent.key'), - cert: fixtures.readSync('multi-alice.crt') + cert: fixtures.readSync('multi-alice.crt'), }; const server = tls.createServer(options, function(cleartext) { @@ -40,7 +40,7 @@ const server = tls.createServer(options, function(cleartext) { 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(); console.error(util.inspect(peerCert)); diff --git a/test/parallel/test-tls-peer-certificate.js b/test/parallel/test-tls-peer-certificate.js index e5de378675f29a..cf9d3b3e15034c 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-gh-5100-regr.js b/test/parallel/test-tls-pfx-gh-5100-regr.js index 199d4bdf22778c..eed77ddbee1b84 100644 --- a/test/parallel/test-tls-pfx-gh-5100-regr.js +++ b/test/parallel/test-tls-pfx-gh-5100-regr.js @@ -15,7 +15,7 @@ const server = tls.createServer({ pfx: pfx, passphrase: 'sample', requestCert: true, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function(c) { assert.strictEqual(c.authorizationError, null); c.end(); @@ -24,7 +24,7 @@ const server = tls.createServer({ port: this.address().port, pfx: pfx, passphrase: 'sample', - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { client.end(); server.close(); diff --git a/test/parallel/test-tls-regr-gh-5108.js b/test/parallel/test-tls-regr-gh-5108.js index 402a6014d1396c..24f738f2ee58be 100644 --- a/test/parallel/test-tls-regr-gh-5108.js +++ b/test/parallel/test-tls-regr-gh-5108.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'), }; @@ -19,7 +19,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-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-securepair-fiftharg.js b/test/parallel/test-tls-securepair-fiftharg.js index 185dc43d941ca6..0c4753889144bf 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.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + key: fixtures.readSync('test_key.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-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-verify.js b/test/parallel/test-tls-server-verify.js index eeea8b030da719..d2c1dee036d206 100644 --- a/test/parallel/test-tls-server-verify.js +++ b/test/parallel/test-tls-server-verify.js @@ -53,8 +53,8 @@ const testCases = [{ name: 'agent1', shouldReject: false, shouldAuth: false }, { name: 'agent2', shouldReject: false, shouldAuth: false }, { name: 'agent3', shouldReject: false, shouldAuth: false }, - { name: 'nocert', shouldReject: false, shouldAuth: false } - ] + { name: 'nocert', shouldReject: false, shouldAuth: false }, + ], }, { title: 'Allow both authed and unauthed connections with CA1', @@ -66,8 +66,8 @@ const testCases = [{ name: 'agent1', shouldReject: false, shouldAuth: true }, { name: 'agent2', shouldReject: false, shouldAuth: false }, { name: 'agent3', shouldReject: false, shouldAuth: false }, - { name: 'nocert', shouldReject: false, shouldAuth: false } - ] + { name: 'nocert', shouldReject: false, shouldAuth: false }, + ], }, { title: 'Do not request certs at connection. Do that later', @@ -79,8 +79,8 @@ const testCases = [{ name: 'agent1', shouldReject: false, shouldAuth: true }, { name: 'agent2', shouldReject: false, shouldAuth: false }, { name: 'agent3', shouldReject: false, shouldAuth: false }, - { name: 'nocert', shouldReject: false, shouldAuth: false } - ] + { name: 'nocert', shouldReject: false, shouldAuth: false }, + ], }, { title: 'Allow only authed connections with CA1', @@ -92,8 +92,8 @@ const testCases = [{ name: 'agent1', shouldReject: false, shouldAuth: true }, { name: 'agent2', shouldReject: true }, { name: 'agent3', shouldReject: true }, - { name: 'nocert', shouldReject: true } - ] + { name: 'nocert', shouldReject: true }, + ], }, { title: 'Allow only authed connections with CA1 and CA2', @@ -105,8 +105,8 @@ const testCases = [{ name: 'agent1', shouldReject: false, shouldAuth: true }, { name: 'agent2', shouldReject: true }, { name: 'agent3', shouldReject: false, shouldAuth: true }, - { name: 'nocert', shouldReject: true } - ] + { name: 'nocert', shouldReject: true }, + ], }, @@ -122,9 +122,9 @@ const testCases = { name: 'agent3', shouldReject: false, shouldAuth: true }, // Agent4 has a cert in the CRL. { name: 'agent4', shouldReject: true, shouldAuth: false }, - { name: 'nocert', shouldReject: true } - ] - } + { name: 'nocert', shouldReject: true }, + ], + }, ]; function filenamePEM(n) { @@ -271,7 +271,7 @@ function runTest(port, testIndex) { ca: cas, crl: crl, requestCert: tcase.requestCert, - rejectUnauthorized: tcase.rejectUnauthorized + rejectUnauthorized: tcase.rejectUnauthorized, }; /* @@ -298,7 +298,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 7778dd03100857..cb98aa2f584c9e 100644 --- a/test/parallel/test-tls-session-cache.js +++ b/test/parallel/test-tls-session-cache.js @@ -48,7 +48,7 @@ function doTest(testOptions, callback) { cert, ca: [cert], requestCert: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; let requestCount = 0; let resumeCount = 0; @@ -102,7 +102,7 @@ function doTest(testOptions, callback) { '-servername', 'ohgod', '-key', fixtures.path('agent.key'), '-cert', fixtures.path('agent.crt'), - '-reconnect' + '-reconnect', ].concat(testOptions.tickets ? [] : '-no_ticket'); // for the performance and stability issue in s_client on Windows @@ -111,7 +111,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.js b/test/parallel/test-tls-set-ciphers.js index abb5f21909cc63..0efa0e8c9557b6 100644 --- a/test/parallel/test-tls-set-ciphers.js +++ b/test/parallel/test-tls-set-ciphers.js @@ -36,7 +36,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', }; const reply = 'I AM THE WALRUS'; // something recognizable diff --git a/test/parallel/test-tls-set-encoding.js b/test/parallel/test-tls-set-encoding.js index b3aa52a22a73f3..5a8bd449abac1d 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 @@ -47,7 +47,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-sni-option.js b/test/parallel/test-tls-sni-option.js index b3a5adb47cd6d0..9b764f0925e39a 100644 --- a/test/parallel/test-tls-sni-option.js +++ b/test/parallel/test-tls-sni-option.js @@ -54,22 +54,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, + }, }; const clientsOptions = [{ @@ -78,35 +78,35 @@ const clientsOptions = [{ cert: loadPEM('agent1-cert'), ca: [loadPEM('ca1-cert')], servername: 'a.example.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, key: loadPEM('agent4-key'), cert: loadPEM('agent4-cert'), ca: [loadPEM('ca1-cert')], servername: 'a.example.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, key: loadPEM('agent2-key'), cert: loadPEM('agent2-cert'), ca: [loadPEM('ca2-cert')], servername: 'b.example.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, key: loadPEM('agent3-key'), cert: loadPEM('agent3-cert'), ca: [loadPEM('ca1-cert')], servername: 'c.wrong.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, key: loadPEM('agent3-key'), cert: loadPEM('agent3-cert'), ca: [loadPEM('ca1-cert')], servername: 'c.another.com', - rejectUnauthorized: false + rejectUnauthorized: false, }]; const serverResults = []; @@ -171,15 +171,15 @@ process.on('exit', function() { { sni: 'a.example.com', authorized: true }, { sni: 'b.example.com', authorized: false }, { sni: 'c.wrong.com', authorized: false }, - null + null, ]); assert.deepStrictEqual(clientResults, [true, true, true, false, false]); assert.deepStrictEqual(clientErrors, [ null, null, null, null, 'Client network socket disconnected before secure TLS ' + - 'connection was established' + 'connection was established', ]); assert.deepStrictEqual(serverErrors, [ - null, null, null, null, 'Invalid SNI context' + null, null, null, null, 'Invalid SNI context', ]); }); diff --git a/test/parallel/test-tls-sni-server-client.js b/test/parallel/test-tls-sni-server-client.js index ef1bc09cc0d63f..c99541826d912f 100644 --- a/test/parallel/test-tls-sni-server-client.js +++ b/test/parallel/test-tls-sni-server-client.js @@ -38,50 +38,50 @@ 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'), + }, }; const clientsOptions = [{ port: undefined, ca: [loadPEM('ca1-cert')], servername: 'a.example.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, ca: [loadPEM('ca2-cert')], servername: 'b.test.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, ca: [loadPEM('ca2-cert')], servername: 'a.b.test.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, ca: [loadPEM('ca1-cert')], servername: 'c.wrong.com', - rejectUnauthorized: false + rejectUnauthorized: false, }, { port: undefined, ca: [loadPEM('ca1-cert')], servername: 'chain.example.com', - rejectUnauthorized: false + rejectUnauthorized: false, }]; const serverResults = []; @@ -123,7 +123,7 @@ function startTest() { process.on('exit', function() { assert.deepStrictEqual(serverResults, [ 'a.example.com', 'b.test.com', 'a.b.test.com', 'c.wrong.com', - 'chain.example.com' + 'chain.example.com', ]); assert.deepStrictEqual(clientResults, [true, true, false, false, true]); }); diff --git a/test/parallel/test-tls-socket-close.js b/test/parallel/test-tls-socket-close.js index debaca213bb0e2..b05204756991aa 100644 --- a/test/parallel/test-tls-socket-close.js +++ b/test/parallel/test-tls-socket-close.js @@ -37,7 +37,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-npn-options-parsing.js b/test/parallel/test-tls-socket-constructor-alpn-npn-options-parsing.js index fec06c94eec11f..3c0a88d8c184e1 100644 --- a/test/parallel/test-tls-socket-constructor-alpn-npn-options-parsing.js +++ b/test/parallel/test-tls-socket-constructor-alpn-npn-options-parsing.js @@ -12,7 +12,7 @@ const tls = require('tls'); new tls.TLSSocket(null, { ALPNProtocols: ['http/1.1'], - NPNProtocols: ['http/1.1'] + NPNProtocols: ['http/1.1'], }); if (!process.features.tls_npn) @@ -37,13 +37,13 @@ const server = net.createServer(common.mustCall((s) => { key, cert, ALPNProtocols: ['http/1.1'], - NPNProtocols: ['http/1.1'] + NPNProtocols: ['http/1.1'], }); tlsSocket.on('secure', common.mustCall(() => { protocols.push({ alpnProtocol: tlsSocket.alpnProtocol, - npnProtocol: tlsSocket.npnProtocol + npnProtocol: tlsSocket.npnProtocol, }); tlsSocket.end(); })); @@ -53,12 +53,12 @@ server.listen(0, common.mustCall(() => { const alpnOpts = { port: server.address().port, rejectUnauthorized: false, - ALPNProtocols: ['h2', 'http/1.1'] + ALPNProtocols: ['h2', 'http/1.1'], }; const npnOpts = { port: server.address().port, rejectUnauthorized: false, - NPNProtocols: ['h2', 'http/1.1'] + NPNProtocols: ['h2', 'http/1.1'], }; tls.connect(alpnOpts, function() { @@ -71,7 +71,7 @@ server.listen(0, common.mustCall(() => { assert.deepStrictEqual(protocols, [ { alpnProtocol: 'http/1.1', npnProtocol: false }, - { alpnProtocol: false, npnProtocol: 'http/1.1' } + { alpnProtocol: false, npnProtocol: 'http/1.1' }, ]); }); }); diff --git a/test/parallel/test-tls-socket-default-options.js b/test/parallel/test-tls-socket-default-options.js index f086377b0faa20..67bf49faed40a7 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 9d30bc17b96b65..a3c907873b9559 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 86075f6a350872..af7c04b05f39cd 100644 --- a/test/parallel/test-tls-startcom-wosign-whitelist.js +++ b/test/parallel/test-tls-startcom-wosign-whitelist.js @@ -18,28 +18,28 @@ 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_OK' + errorCode: 'CERT_OK', }, { // 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-ticket-cluster.js b/test/parallel/test-tls-ticket-cluster.js index a139cccad34075..baec1d4132944f 100644 --- a/test/parallel/test-tls-ticket-cluster.js +++ b/test/parallel/test-tls-ticket-cluster.js @@ -43,7 +43,7 @@ if (cluster.isMaster) { console.error('[master] connecting', workerPort); const c = tls.connect(workerPort, { session: lastSession, - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { lastSession = c.getSession(); c.end(); diff --git a/test/parallel/test-tls-ticket.js b/test/parallel/test-tls-ticket.js index 187dd22cee6b76..51be8483d610fc 100644 --- a/test/parallel/test-tls-ticket.js +++ b/test/parallel/test-tls-ticket.js @@ -44,7 +44,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); c.end(); @@ -88,7 +88,7 @@ function start(callback) { function connect() { const s = tls.connect(shared.address().port, { session: sess, - rejectUnauthorized: false + rejectUnauthorized: false, }, function() { sess = sess || s.getSession(); 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-wrap-econnreset-localaddress.js b/test/parallel/test-tls-wrap-econnreset-localaddress.js index 9df145ac374ab7..d19860fd68eab5 100644 --- a/test/parallel/test-tls-wrap-econnreset-localaddress.js +++ b/test/parallel/test-tls-wrap-econnreset-localaddress.js @@ -15,7 +15,7 @@ const server = net.createServer((c) => { 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 6ae2c39c59b8d9..a029abc4104054 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-zero-clear-in.js b/test/parallel/test-tls-zero-clear-in.js index b2a07960d4138c..0fa88191c26e9e 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.readSync('test_key.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-binding.js b/test/parallel/test-trace-events-binding.js index fc4e7f99f87c1b..4f558fee4990e8 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, { 'first-value': 20, - 'second-value': 30 + 'second-value': 30, }); assert.strictEqual(traces[2].pid, proc.pid); diff --git a/test/parallel/test-trace-events-file-pattern.js b/test/parallel/test-trace-events-file-pattern.js index 46059ad31d58b2..7bfde099873f69 100644 --- a/test/parallel/test-trace-events-file-pattern.js +++ b/test/parallel/test-trace-events-file-pattern.js @@ -16,7 +16,7 @@ const proc = cp.spawn(process.execPath, [ '--trace-event-file-pattern', // eslint-disable-next-line no-template-curly-in-string '${pid}-${rotation}-${pid}-${rotation}.tracing.log', - '-e', CODE + '-e', CODE, ]); proc.once('exit', common.mustCall(() => { diff --git a/test/parallel/test-trace-events-perf.js b/test/parallel/test-trace-events-perf.js index e73579f87eec02..efa11ae1ecb27b 100644 --- a/test/parallel/test-trace-events-perf.js +++ b/test/parallel/test-trace-events-perf.js @@ -27,22 +27,22 @@ if (process.argv[2] === 'child') { const expectedMarks = ['A', 'B']; const expectedBegins = [ { cat: 'node.perf,node.perf.timerify', name: 'f' }, - { cat: 'node.perf,node.perf.usertiming', name: 'A to B' } + { cat: 'node.perf,node.perf.usertiming', name: 'A to B' }, ]; const expectedEnds = [ { cat: 'node.perf,node.perf.timerify', name: 'f' }, - { cat: 'node.perf,node.perf.usertiming', name: 'A to B' } + { cat: 'node.perf,node.perf.usertiming', name: 'A to B' }, ]; const proc = cp.fork(__filename, [ - 'child' + 'child', ], { execArgv: [ '--trace-events-enabled', '--trace-event-categories', - 'node.perf' - ] + 'node.perf', + ], }); proc.once('exit', common.mustCall(() => { diff --git a/test/parallel/test-tty-backwards-api.js b/test/parallel/test-tty-backwards-api.js index 547184728ebaf8..a8ee958bca91b8 100644 --- a/test/parallel/test-tty-backwards-api.js +++ b/test/parallel/test-tty-backwards-api.js @@ -6,7 +6,7 @@ const TTY = process.binding('tty_wrap').TTY = function() {}; TTY.prototype = { setBlocking: noop, - getWindowSize: noop + getWindowSize: noop, }; const { WriteStream } = require('tty'); @@ -15,7 +15,7 @@ const methods = [ 'cursorTo', 'moveCursor', 'clearLine', - 'clearScreenDown' + 'clearScreenDown', ]; methods.forEach((method) => { diff --git a/test/parallel/test-ttywrap-invalid-fd.js b/test/parallel/test-ttywrap-invalid-fd.js index adf88cbde659ce..6c4000bae92042 100644 --- a/test/parallel/test-ttywrap-invalid-fd.js +++ b/test/parallel/test-ttywrap-invalid-fd.js @@ -10,7 +10,7 @@ common.expectsError( { code: 'ERR_INVALID_FD', type: RangeError, - message: '"fd" must be a positive integer: -1' + message: '"fd" must be a positive integer: -1', } ); @@ -27,7 +27,7 @@ common.expectsError( }, { code: 'ERR_SYSTEM_ERROR', type: SystemError, - message + message, } ); @@ -39,7 +39,7 @@ common.expectsError( }, { code: 'ERR_SYSTEM_ERROR', type: SystemError, - message + message, }); } @@ -48,6 +48,6 @@ common.expectsError( { code: 'ERR_INVALID_FD', type: RangeError, - message: '"fd" must be a positive integer: -1' + message: '"fd" must be a positive integer: -1', } ); diff --git a/test/parallel/test-types.js b/test/parallel/test-types.js index ea8adc6cb17d3a..d81daa67b250c3 100644 --- a/test/parallel/test-types.js +++ b/test/parallel/test-types.js @@ -28,20 +28,20 @@ const stealthyUint8Array = const all = [ primitive, arrayBuffer, dataView, int32Array, uint8Array, buffer, fakeDataView, fakeInt32Array, fakeUint8Array, fakeBuffer, - stealthyDataView, stealthyInt32Array, stealthyUint8Array + stealthyDataView, stealthyInt32Array, stealthyUint8Array, ]; const expected = { isArrayBufferView: [ dataView, int32Array, uint8Array, buffer, - stealthyDataView, stealthyInt32Array, stealthyUint8Array + stealthyDataView, stealthyInt32Array, stealthyUint8Array, ], isTypedArray: [ - int32Array, uint8Array, buffer, stealthyInt32Array, stealthyUint8Array + int32Array, uint8Array, buffer, stealthyInt32Array, stealthyUint8Array, ], isUint8Array: [ - uint8Array, buffer, stealthyUint8Array - ] + uint8Array, buffer, stealthyUint8Array, + ], }; for (const testedFunc of Object.keys(expected)) { diff --git a/test/parallel/test-url-domain-ascii-unicode.js b/test/parallel/test-url-domain-ascii-unicode.js index 49259a7ab0f4c4..737294c241fbfe 100644 --- a/test/parallel/test-url-domain-ascii-unicode.js +++ b/test/parallel/test-url-domain-ascii-unicode.js @@ -18,7 +18,7 @@ const domainWithASCII = [ ['名がドメイン.com', 'xn--v8jxj3d1dzdz08w.com'], ['افغانستا.icom.museum', 'xn--mgbaal8b0b9b2b.icom.museum'], ['الجزائر.icom.fake', 'xn--lgbbat1ad8j.icom.fake'], - ['भारत.org', 'xn--h2brj9c.org'] + ['भारत.org', 'xn--h2brj9c.org'], ]; domainWithASCII.forEach((pair) => { diff --git a/test/parallel/test-url-format-invalid-input.js b/test/parallel/test-url-format-invalid-input.js index 4f0f1a11d70988..5fd8f27261761e 100644 --- a/test/parallel/test-url-format-invalid-input.js +++ b/test/parallel/test-url-format-invalid-input.js @@ -10,7 +10,7 @@ const throwsObjsAndReportTypes = new Map([ [false, 'boolean'], [0, 'number'], [function() {}, 'function'], - [Symbol('foo'), 'symbol'] + [Symbol('foo'), 'symbol'], ]); for (const [urlObject, type] of throwsObjsAndReportTypes) { @@ -20,7 +20,7 @@ for (const [urlObject, type] of throwsObjsAndReportTypes) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "urlObject" argument must be one of type Object or string. ' + - `Received type ${type}` + `Received type ${type}`, }); } assert.strictEqual(url.format(''), ''); diff --git a/test/parallel/test-url-format-whatwg.js b/test/parallel/test-url-format-whatwg.js index c26000cb5666e9..a0e15c898f6419 100644 --- a/test/parallel/test-url-format-whatwg.js +++ b/test/parallel/test-url-format-whatwg.js @@ -24,7 +24,7 @@ assert.strictEqual( const expectedErr = common.expectsError({ code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options" argument must be of type Object' + message: 'The "options" argument must be of type Object', }, 4); assert.throws(() => url.format(myURL, true), expectedErr); assert.throws(() => url.format(myURL, 1), expectedErr); diff --git a/test/parallel/test-url-format.js b/test/parallel/test-url-format.js index 1f62792dfbcd78..cdbc349c76b226 100644 --- a/test/parallel/test-url-format.js +++ b/test/parallel/test-url-format.js @@ -14,7 +14,7 @@ const formatTests = { hostname: 'example.com', search: '?', query: {}, - pathname: '/' + pathname: '/', }, 'http://example.com?foo=bar#frag': { href: 'http://example.com/?foo=bar#frag', @@ -24,7 +24,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', @@ -34,7 +34,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', @@ -44,7 +44,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', @@ -54,7 +54,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', @@ -62,13 +62,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', @@ -76,61 +76,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': { @@ -140,13 +140,13 @@ 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', }, // Encode context-specific delimiters in path and query, but do not touch @@ -158,9 +158,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 @@ -168,9 +168,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', }, // `?` and `#` in path and search @@ -203,7 +203,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 @@ -214,7 +214,7 @@ const formatTests = { host: '', hostname: '', pathname: '/node', - path: '/node' + path: '/node', }, // greater than or equal to 63 characters after `.` in hostname @@ -225,7 +225,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 @@ -233,7 +233,7 @@ const formatTests = { href: 'file:///home/user', protocol: 'file', pathname: '/home/user', - path: '/home/user' + path: '/home/user', }, // surrogate in auth @@ -242,8 +242,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 0e12fe52516f16..9fee96689e9f23 100644 --- a/test/parallel/test-url-parse-format.js +++ b/test/parallel/test-url-parse-format.js @@ -11,7 +11,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': { @@ -22,7 +22,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': { @@ -35,7 +35,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': { @@ -46,7 +46,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', }, @@ -57,7 +57,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/': { @@ -67,7 +67,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'HTTP://www.example.com': { @@ -77,7 +77,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://www.ExAmPlE.com/': { @@ -87,7 +87,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://user:pw@www.ExAmPlE.com/': { @@ -98,7 +98,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://USER:PW@www.ExAmPlE.com/': { @@ -109,7 +109,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://user@www.example.com/': { @@ -120,7 +120,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://user%3Apw@www.example.com/': { @@ -131,7 +131,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, 'http://x.com/path?that\'s#all, folks': { @@ -144,7 +144,7 @@ const parseTests = { query: 'that%27s', pathname: '/path', hash: '#all,%20folks', - path: '/path?that%27s' + path: '/path?that%27s', }, 'HTTP://X.COM/Y': { @@ -154,7 +154,7 @@ const parseTests = { host: 'x.com', hostname: 'x.com', pathname: '/Y', - path: '/Y' + path: '/Y', }, // whitespace in the front @@ -165,7 +165,7 @@ const parseTests = { host: 'www.example.com', hostname: 'www.example.com', pathname: '/', - path: '/' + path: '/', }, // + not an invalid host character @@ -177,7 +177,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. @@ -191,7 +191,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. @@ -205,7 +205,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': { @@ -216,7 +216,7 @@ const parseTests = { hostname: 'x...y...', hash: '#p', pathname: '/', - path: '/' + path: '/', }, 'http://x/p/"quoted"': { @@ -226,13 +226,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': { @@ -244,7 +244,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=': { @@ -254,7 +254,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=': { @@ -267,7 +267,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=': { @@ -280,7 +280,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': { @@ -290,7 +290,7 @@ const parseTests = { pathname: '/etc/passwd', hostname: '', host: '', - path: '/etc/passwd' + path: '/etc/passwd', }, 'file://localhost/etc/passwd': { @@ -300,7 +300,7 @@ const parseTests = { pathname: '/etc/passwd', hostname: 'localhost', host: 'localhost', - path: '/etc/passwd' + path: '/etc/passwd', }, 'file://foo/etc/passwd': { @@ -310,7 +310,7 @@ const parseTests = { pathname: '/etc/passwd', hostname: 'foo', host: 'foo', - path: '/etc/passwd' + path: '/etc/passwd', }, 'file:///etc/node/': { @@ -320,7 +320,7 @@ const parseTests = { pathname: '/etc/node/', hostname: '', host: '', - path: '/etc/node/' + path: '/etc/node/', }, 'file://localhost/etc/node/': { @@ -330,7 +330,7 @@ const parseTests = { pathname: '/etc/node/', hostname: 'localhost', host: 'localhost', - path: '/etc/node/' + path: '/etc/node/', }, 'file://foo/etc/node/': { @@ -340,14 +340,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': { @@ -362,7 +362,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': { @@ -376,7 +376,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': { @@ -385,7 +385,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': { @@ -395,7 +395,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': { @@ -406,14 +406,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': { @@ -421,7 +421,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': { @@ -436,7 +436,7 @@ const parseTests = { search: '?search=foo', query: 'search=foo', hash: '#bar', - path: '/path?search=foo' + path: '/path?search=foo', }, 'svn+ssh://foo/bar': { @@ -446,7 +446,7 @@ const parseTests = { protocol: 'svn+ssh:', pathname: '/bar', path: '/bar', - slashes: true + slashes: true, }, 'dash-test://foo/bar': { @@ -456,7 +456,7 @@ const parseTests = { protocol: 'dash-test:', pathname: '/bar', path: '/bar', - slashes: true + slashes: true, }, 'dash-test:foo/bar': { @@ -465,7 +465,7 @@ const parseTests = { hostname: 'foo', protocol: 'dash-test:', pathname: '/bar', - path: '/bar' + path: '/bar', }, 'dot.test://foo/bar': { @@ -475,7 +475,7 @@ const parseTests = { protocol: 'dot.test:', pathname: '/bar', path: '/bar', - slashes: true + slashes: true, }, 'dot.test:foo/bar': { @@ -484,7 +484,7 @@ const parseTests = { hostname: 'foo', protocol: 'dot.test:', pathname: '/bar', - path: '/bar' + path: '/bar', }, // IDNA tests @@ -495,7 +495,7 @@ const parseTests = { host: 'www.xn--wgv71a119e.com', hostname: 'www.xn--wgv71a119e.com', pathname: '/', - path: '/' + path: '/', }, 'http://example.Bücher.com/': { @@ -505,7 +505,7 @@ const parseTests = { host: 'example.xn--bcher-kva.com', hostname: 'example.xn--bcher-kva.com', pathname: '/', - path: '/' + path: '/', }, 'http://www.Äffchen.com/': { @@ -515,7 +515,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': { @@ -528,7 +528,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/': { @@ -538,7 +538,7 @@ const parseTests = { host: 'xn--slier-bsa.com', hostname: 'xn--slier-bsa.com', pathname: '/', - path: '/' + path: '/', }, 'http://ليهمابتكلموشعربي؟.ي؟/': { @@ -548,7 +548,7 @@ const parseTests = { host: 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', hostname: 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', pathname: '/', - path: '/' + path: '/', }, 'http://➡.ws/➡': { @@ -558,7 +558,7 @@ const parseTests = { host: 'xn--hgi.ws', hostname: 'xn--hgi.ws', pathname: '/➡', - path: '/➡' + path: '/➡', }, 'http://bucket_name.s3.amazonaws.com/image.jpg': { @@ -568,7 +568,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': { @@ -578,7 +578,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 @@ -587,7 +587,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 @@ -595,14 +595,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]': { @@ -612,7 +612,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/': { @@ -623,7 +623,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': { @@ -635,7 +635,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': { @@ -649,7 +649,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 @@ -660,7 +660,7 @@ const parseTests = { hostname: 'example.com', href: 'http://example.com/', pathname: '/', - path: '/' + path: '/', }, 'http://example.com:/a/b.html': { @@ -670,7 +670,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': { @@ -682,7 +682,7 @@ const parseTests = { search: '?a=b', query: 'a=b', pathname: '/', - path: '/?a=b' + path: '/?a=b', }, 'http://example.com:#abc': { @@ -693,7 +693,7 @@ const parseTests = { href: 'http://example.com/#abc', hash: '#abc', pathname: '/', - path: '/' + path: '/', }, 'http://[fe80::1]:/a/b?a=b#abc': { @@ -706,7 +706,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': { @@ -805,7 +805,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/': { @@ -816,7 +816,7 @@ const parseTests = { hostname: 'c', href: 'http://a%40b@c/', path: '/', - pathname: '/' + pathname: '/', }, 'http://a@b?@c': { @@ -829,7 +829,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': { @@ -843,7 +843,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': { @@ -858,7 +858,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 @@ -874,7 +874,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://*': { @@ -889,8 +889,8 @@ const parseTests = { query: null, pathname: '/*', path: '/*', - href: 'https:///*' - } + href: 'https:///*', + }, }; for (const u in parseTests) { diff --git a/test/parallel/test-url-parse-invalid-input.js b/test/parallel/test-url-parse-invalid-input.js index d2c7a1135a68fe..45e6c330b935ed 100644 --- a/test/parallel/test-url-parse-invalid-input.js +++ b/test/parallel/test-url-parse-invalid-input.js @@ -14,14 +14,14 @@ const url = require('url'); [[], 'object'], [{}, 'object'], [() => {}, 'function'], - [Symbol('foo'), 'symbol'] + [Symbol('foo'), 'symbol'], ].forEach(([val, type]) => { common.expectsError(() => { url.parse(val); }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: `The "url" argument must be of type string. Received type ${type}` + message: `The "url" argument must be of type string. Received type ${type}`, }); }); 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-relative.js b/test/parallel/test-url-relative.js index bd690c27afc777..6904a11cd921ac 100644 --- a/test/parallel/test-url-relative.js +++ b/test/parallel/test-url-relative.js @@ -54,7 +54,7 @@ const relativeTests = [ 'http://example.com/a/b/c/d'], ['/foo/bar/baz', '/../etc/passwd', '/etc/passwd'], ['http://localhost', 'file:///Users/foo', 'file:///Users/foo'], - ['http://localhost', 'file://foo/Users', 'file://foo/Users'] + ['http://localhost', 'file://foo/Users', 'file://foo/Users'], ]; relativeTests.forEach(function(relativeTest) { const a = url.resolve(relativeTest[0], relativeTest[1]); @@ -78,7 +78,7 @@ const bases = [ 'http://a/b/c/d;p?q=1/2', 'http://a/b/c/d;p=1/2?q', 'fred:///s//a/b/c', - 'http:///s//a/b/c' + 'http:///s//a/b/c', ]; //[to, from, result] @@ -373,7 +373,7 @@ const relativeTests2 = [ 'https://user:password@example.com/foo'], // No path at all - ['#hash1', '#hash2', '#hash1'] + ['#hash1', '#hash2', '#hash1'], ]; relativeTests2.forEach(function(relativeTest) { const a = url.resolve(relativeTest[1], relativeTest[0]); diff --git a/test/parallel/test-util-callbackify.js b/test/parallel/test-util-callbackify.js index d8b2de314c9c49..7c5866193b021e 100644 --- a/test/parallel/test-util-callbackify.js +++ b/test/parallel/test-util-callbackify.js @@ -20,7 +20,7 @@ const values = [ Symbol('I am a symbol'), function ok() {}, ['array', 'with', 4, 'values'], - new Error('boo') + new Error('boo'), ]; { @@ -53,7 +53,7 @@ const values = [ return { then(onRes, onRej) { onRes(value); - } + }, }; } @@ -115,7 +115,7 @@ const values = [ return { then(onRes, onRej) { onRej(value); - } + }, }; } @@ -236,7 +236,7 @@ const values = [ }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "original" argument must be of type Function' + message: 'The "original" argument must be of type Function', }); }); } @@ -257,7 +257,7 @@ const values = [ }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The last argument must be of type Function' + message: 'The last argument must be of type Function', }); }); } diff --git a/test/parallel/test-util-deprecate-invalid-code.js b/test/parallel/test-util-deprecate-invalid-code.js index 057e095424dd3f..69abc80c8783f1 100644 --- a/test/parallel/test-util-deprecate-invalid-code.js +++ b/test/parallel/test-util-deprecate-invalid-code.js @@ -7,6 +7,6 @@ const util = require('util'); common.expectsError(() => util.deprecate(() => {}, 'message', notString), { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "code" argument must be of type string' + message: 'The "code" argument must be of type string', }); }); diff --git a/test/parallel/test-util-format.js b/test/parallel/test-util-format.js index fd686cb6d355ad..a73731d1155060 100644 --- a/test/parallel/test-util-format.js +++ b/test/parallel/test-util-format.js @@ -105,19 +105,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'); @@ -240,7 +240,7 @@ assert.strictEqual(util.format('abc%', 1), 'abc% 1'); 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$/); diff --git a/test/parallel/test-util-inherits.js b/test/parallel/test-util-inherits.js index afbd504bebbf42..73a082cec9a63c 100644 --- a/test/parallel/test-util-inherits.js +++ b/test/parallel/test-util-inherits.js @@ -80,7 +80,7 @@ common.expectsError(function() { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "superCtor.prototype" property must be of type Function' + message: 'The "superCtor.prototype" property must be of type Function', }); common.expectsError(function() { @@ -88,7 +88,7 @@ common.expectsError(function() { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "superCtor" argument must be of type Function' + message: 'The "superCtor" argument must be of type Function', }); common.expectsError(function() { @@ -96,5 +96,5 @@ common.expectsError(function() { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "ctor" argument must be of type Function' + message: 'The "ctor" argument must be of type Function', }); diff --git a/test/parallel/test-util-inspect-proxy.js b/test/parallel/test-util-inspect-proxy.js index bc53c1fe688fd5..514368fa15a460 100644 --- a/test/parallel/test-util-inspect-proxy.js +++ b/test/parallel/test-util-inspect-proxy.js @@ -8,7 +8,7 @@ const opts = { showProxy: true }; const target = {}; const handler = { - get: function() { throw new Error('Getter should not be called'); } + get: function() { throw new Error('Getter should not be called'); }, }; const proxyObj = new Proxy(target, handler); diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index b2c8207de54c83..2eb95fd5fb84cd 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -248,7 +248,7 @@ for (const showHidden of [true, false]) { assert.strictEqual( util.inspect(Object.create({}, { visible: { value: 1, enumerable: true }, - hidden: { value: 2 } + hidden: { value: 2 }, }), { showHidden: true }), '{ visible: 1, [hidden]: 2 }' ); @@ -256,7 +256,7 @@ assert.strictEqual( assert.strictEqual( util.inspect(Object.create(null, { name: { value: 'Tim', enumerable: true }, - hidden: { value: 'secret' } + hidden: { value: 'secret' }, }), { showHidden: true }), "{ name: 'Tim', [hidden]: 'secret' }" ); @@ -264,7 +264,7 @@ assert.strictEqual( assert.strictEqual( util.inspect(Object.create(null, { name: { value: 'Tim', enumerable: true }, - hidden: { value: 'secret' } + hidden: { value: 'secret' }, })), '{ name: \'Tim\' }' ); @@ -297,7 +297,7 @@ assert.strictEqual( 'growingLength', { enumerable: true, - get: function() { this.push(true); return this.length; } + get: function() { this.push(true); return this.length; }, } ); Object.defineProperty( @@ -305,7 +305,7 @@ assert.strictEqual( '-1', { enumerable: true, - value: -1 + value: -1, } ); assert.strictEqual(util.inspect(value), @@ -371,7 +371,7 @@ assert.strictEqual( 'true,', "'4294967296': true,", "'4294967295': true,", - "'4294967297': true ]" + "'4294967297': true ]", ].join('\n ')); } @@ -473,19 +473,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), '{ [a]: [Getter] }'); assert.strictEqual(util.inspect(setter, true), '{ [b]: [Setter] }'); @@ -571,7 +571,7 @@ util.inspect([{ inspect: () => 123 }]); '\\\\\\': 3, '\\\\\\\\': 4, '\n': 5, - '\r': 6 + '\r': 6, }; const y = ['a', 'b', 'c']; @@ -722,7 +722,7 @@ util.inspect({ hasOwnProperty: null }); // [util.inspect.custom] takes precedence over inspect. const subject = { [util.inspect.custom]() { return 123; }, - inspect() { return 456; } + inspect() { return 456; }, }; assert.strictEqual( @@ -774,7 +774,7 @@ util.inspect({ hasOwnProperty: null }); baz: 35, b: { a: 35 }, veryLongKey: 'very long value', - evenLongerKey: ['with even longer value in array'] + evenLongerKey: ['with even longer value in array'], }); } @@ -1026,7 +1026,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] }'); } @@ -1134,7 +1134,7 @@ if (typeof Symbol !== 'undefined') { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options" argument must be of type Object' + message: 'The "options" argument must be of type Object', } ); @@ -1143,7 +1143,7 @@ if (typeof Symbol !== 'undefined') { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options" argument must be of type Object' + message: 'The "options" argument must be of type Object', } ); } @@ -1183,7 +1183,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\' }'); @@ -1212,7 +1212,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 }); @@ -1251,7 +1251,7 @@ util.inspect(process); ' \'za\' => 1,', ' \'zb\' => \'test\'', ' }', - '}' + '}', ].join('\n'); assert.strictEqual(out, expect); @@ -1262,7 +1262,7 @@ util.inspect(process); ' \'adipiscing elit, sed do \' +', ' \'eiusmod tempor incididunt \' +', ' \'ut labore et dolore magna \' +', - ' \'aliqua.\'' + ' \'aliqua.\'', ].join('\n'); assert.strictEqual(out, expect); @@ -1278,7 +1278,7 @@ util.inspect(process); expect = [ '\'12 45 78 01 34 \' +', ' \'67 90 23 56 89 \' +', - ' \'123456789012345678901234567890\'' + ' \'123456789012345678901234567890\'', ].join('\n'); assert.strictEqual(out, expect); @@ -1288,7 +1288,7 @@ util.inspect(process); expect = [ '\'12 45 78 01 34 \' +', ' \'67 90 23 56 89 \' +', - ' \'1234567890123 0\'' + ' \'1234567890123 0\'', ].join('\n'); assert.strictEqual(out, expect); @@ -1299,7 +1299,7 @@ util.inspect(process); '\'12 45 78 01 34 \' +', ' \'67 90 23 56 89 \' +', ' \'12345678901234567 \' +', - ' \'0\'' + ' \'0\'', ].join('\n'); assert.strictEqual(out, expect); @@ -1310,7 +1310,7 @@ util.inspect(process); '{', ' a: [Function],', ' b: [Number: 3]', - '}' + '}', ].join('\n'); assert.strictEqual(out, expect); @@ -1322,7 +1322,7 @@ util.inspect(process); " [name]: ''", ' },', ' b: [Number: 3]', - '}' + '}', ].join('\n'); assert.strictEqual(out, expect); diff --git a/test/parallel/test-util-internal.js b/test/parallel/test-util-internal.js index ac7cf12229487a..c949a08daf18e7 100644 --- a/test/parallel/test-util-internal.js +++ b/test/parallel/test-util-internal.js @@ -9,7 +9,7 @@ const { getHiddenValue, setHiddenValue, arrow_message_private_symbol: kArrowMessagePrivateSymbolIndex, - safeGetenv + safeGetenv, } = process.binding('util'); for (const oneEnv in process.env) { diff --git a/test/parallel/test-util-log.js b/test/parallel/test-util-log.js index 907a361e97ecb8..4eaac1dd506ed9 100644 --- a/test/parallel/test-util-log.js +++ b/test/parallel/test-util-log.js @@ -42,7 +42,7 @@ const tests = [ { input: function() {}, output: '[Function: input]' }, { input: parseInt('not a number', 10), output: 'NaN' }, { input: { answer: 42 }, output: '{ answer: 42 }' }, - { input: [1, 2, 3], output: '[ 1, 2, 3 ]' } + { input: [1, 2, 3], output: '[ 1, 2, 3 ]' }, ]; // test util.log() diff --git a/test/parallel/test-util-promisify.js b/test/parallel/test-util-promisify.js index 235d5c40db7677..a462597fccd0c6 100644 --- a/test/parallel/test-util-promisify.js +++ b/test/parallel/test-util-promisify.js @@ -181,7 +181,7 @@ const stat = promisify(fs.stat); }), b.then(assert.fail, function(e) { assert.strictEqual(err, e); - }) + }), ]); } @@ -191,6 +191,6 @@ const stat = promisify(fs.stat); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "original" argument must be of type Function' + message: 'The "original" argument must be of type Function', }); }); diff --git a/test/parallel/test-util.js b/test/parallel/test-util.js index 3b2729c107b4b1..63104c9ca865ff 100644 --- a/test/parallel/test-util.js +++ b/test/parallel/test-util.js @@ -146,7 +146,7 @@ common.expectWarning('DeprecationWarning', [ 'util.print is deprecated. Use console.log instead.', 'util.puts is deprecated. Use console.log instead.', 'util.debug is deprecated. Use console.error instead.', - 'util.error is deprecated. Use console.error instead.' + 'util.error is deprecated. Use console.error instead.', ]); util.print('test'); diff --git a/test/parallel/test-uv-errno.js b/test/parallel/test-uv-errno.js index d3b4f79db3eca0..c19bdb55ce1581 100644 --- a/test/parallel/test-uv-errno.js +++ b/test/parallel/test-uv-errno.js @@ -4,7 +4,7 @@ const common = require('../common'); const assert = require('assert'); const { getSystemErrorName, - _errnoException + _errnoException, } = require('util'); const uv = process.binding('uv'); @@ -30,7 +30,7 @@ function runTest(fn) { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "err" argument must be of type number. ' + - `Received type ${typeof err}` + `Received type ${typeof err}`, }); }); @@ -42,7 +42,7 @@ function runTest(fn) { type: 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-flag-type-check.js b/test/parallel/test-v8-flag-type-check.js index 67a34b51f2ac36..21b627e3467663 100644 --- a/test/parallel/test-v8-flag-type-check.js +++ b/test/parallel/test-v8-flag-type-check.js @@ -8,7 +8,7 @@ const v8 = require('v8'); { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "flags" argument must be of type string' + message: 'The "flags" argument must be of type string', } ); }); diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js index ad8666ee3ba877..a847860978d17a 100644 --- a/test/parallel/test-v8-serdes.js +++ b/test/parallel/test-v8-serdes.js @@ -17,7 +17,7 @@ const objects = [ undefined, null, 42, - circular + circular, ]; const hostObject = new (process.binding('js_stream').JSStream)(); diff --git a/test/parallel/test-v8-stats.js b/test/parallel/test-v8-stats.js index 02182e2816bbc7..e979e202520a2a 100644 --- a/test/parallel/test-v8-stats.js +++ b/test/parallel/test-v8-stats.js @@ -25,7 +25,7 @@ const expectedHeapSpaces = [ 'old_space', 'code_space', 'map_space', - 'large_object_space' + 'large_object_space', ]; const heapSpaceStatistics = v8.getHeapSpaceStatistics(); const actualHeapSpaceNames = heapSpaceStatistics.map((s) => s.space_name); diff --git a/test/parallel/test-vm-basic.js b/test/parallel/test-vm-basic.js index 3a74cb38d26402..355d882c588b8d 100644 --- a/test/parallel/test-vm-basic.js +++ b/test/parallel/test-vm-basic.js @@ -46,7 +46,7 @@ result = vm.runInContext( assert.deepStrictEqual(sandbox2, { foo: 'bar', baz: 'bar', - typeofProcess: 'undefined' + typeofProcess: 'undefined', }); assert.strictEqual(result, 'function'); @@ -76,7 +76,7 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options" argument must be of type object. Received type null' + message: 'The "options" argument must be of type object. Received type null', }); common.expectsError(() => { @@ -84,7 +84,8 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, - message: 'The "options" argument must be of type object. Received type string' + message: 'The "options" argument must be of type object. ' + + 'Received type string', }); common.expectsError(() => { @@ -93,7 +94,7 @@ common.expectsError(() => { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.name" property must be of type string. ' + - 'Received type null' + 'Received type null', }); common.expectsError(() => { @@ -102,7 +103,7 @@ common.expectsError(() => { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.origin" property must be of type string. ' + - 'Received type null' + 'Received type null', }); common.expectsError(() => { @@ -111,7 +112,7 @@ common.expectsError(() => { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.contextName" property must be of type string. ' + - 'Received type null' + 'Received type null', }); common.expectsError(() => { @@ -120,5 +121,5 @@ common.expectsError(() => { code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.contextOrigin" property must be of type string. ' + - 'Received type null' + 'Received type null', }); diff --git a/test/parallel/test-vm-cached-data.js b/test/parallel/test-vm-cached-data.js index 5302d73c2df617..176afd1af38008 100644 --- a/test/parallel/test-vm-cached-data.js +++ b/test/parallel/test-vm-cached-data.js @@ -43,7 +43,7 @@ function testProduceConsume() { // It should consume code cache const script = new vm.Script(source, { - cachedData: data + cachedData: data, }); assert(!script.cachedDataRejected); assert.strictEqual(script.runInThisContext()(), 'original'); @@ -64,7 +64,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'); @@ -77,7 +77,7 @@ function testRejectSlice() { const data = produce(source).slice(4); const script = new vm.Script(source, { - cachedData: data + cachedData: data, }); assert(script.cachedDataRejected); } @@ -86,6 +86,6 @@ testRejectSlice(); // It should throw on non-Buffer cachedData assert.throws(() => { new vm.Script('function abc() {}', { - cachedData: 'ohai' + cachedData: 'ohai', }); }, /^TypeError: options\.cachedData must be a Buffer instance$/); diff --git a/test/parallel/test-vm-context.js b/test/parallel/test-vm-context.js index 368a40cbd42c03..8cc75eace7194d 100644 --- a/test/parallel/test-vm-context.js +++ b/test/parallel/test-vm-context.js @@ -70,7 +70,7 @@ const contextifiedSandboxErrorMsg = [undefined, nonContextualSandboxErrorMsg], [null, nonContextualSandboxErrorMsg], [0, nonContextualSandboxErrorMsg], [0.0, nonContextualSandboxErrorMsg], ['', nonContextualSandboxErrorMsg], - [{}, contextifiedSandboxErrorMsg], [[], contextifiedSandboxErrorMsg] + [{}, contextifiedSandboxErrorMsg], [[], contextifiedSandboxErrorMsg], ].forEach((e) => { assert.throws(() => { script.runInContext(e[0]); }, e[1]); assert.throws(() => { vm.runInContext('', e[0]); }, e[1]); @@ -98,7 +98,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-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 e946b3fc5e463c..3df281cd698920 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-module-basic.js b/test/parallel/test-vm-module-basic.js index 4bbe0a95ee6724..f541e921ae429f 100644 --- a/test/parallel/test-vm-module-basic.js +++ b/test/parallel/test-vm-module-basic.js @@ -28,7 +28,7 @@ common.crashOnUnhandledRejection(); assert.deepStrictEqual(context, { foo: 'bar', baz: 'bar', - typeofProcess: 'undefined' + typeofProcess: 'undefined', }); assert.strictEqual(result.result, 'function'); }()); diff --git a/test/parallel/test-vm-module-errors.js b/test/parallel/test-vm-module-errors.js index 424d35e8aaf67a..acd1780acbb2a6 100644 --- a/test/parallel/test-vm-module-errors.js +++ b/test/parallel/test-vm-module-errors.js @@ -40,29 +40,29 @@ async function checkArgType() { new Module(); }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); for (const invalidOptions of [ - 0, 1, null, true, 'str', () => {}, { url: 0 }, Symbol.iterator + 0, 1, null, true, 'str', () => {}, { url: 0 }, Symbol.iterator, ]) { common.expectsError(() => { new Module('', invalidOptions); }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); } for (const invalidLinker of [ - 0, 1, undefined, null, true, 'str', {}, Symbol.iterator + 0, 1, undefined, null, true, 'str', {}, Symbol.iterator, ]) { await expectsRejection(async () => { const m = new Module(''); await m.link(invalidLinker); }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); } } @@ -75,7 +75,7 @@ async function checkModuleState() { assert.strictEqual(m.linkingStatus, 'linked'); await m.link(common.mustNotCall()); }, { - code: 'ERR_VM_MODULE_ALREADY_LINKED' + code: 'ERR_VM_MODULE_ALREADY_LINKED', }); await expectsRejection(async () => { @@ -84,14 +84,14 @@ async function checkModuleState() { assert.strictEqual(m.linkingStatus, 'linking'); await m.link(common.mustNotCall()); }, { - code: 'ERR_VM_MODULE_ALREADY_LINKED' + code: 'ERR_VM_MODULE_ALREADY_LINKED', }); common.expectsError(() => { const m = new Module(''); m.instantiate(); }, { - code: 'ERR_VM_MODULE_NOT_LINKED' + code: 'ERR_VM_MODULE_NOT_LINKED', }); await expectsRejection(async () => { @@ -104,7 +104,7 @@ async function checkModuleState() { } assert.fail('Unreachable'); }, { - code: 'ERR_VM_MODULE_NOT_LINKED' + code: 'ERR_VM_MODULE_NOT_LINKED', }); { @@ -116,7 +116,7 @@ async function checkModuleState() { common.expectsError(() => { m.instantiate(); }, { - code: 'ERR_VM_MODULE_NOT_LINKED' + code: 'ERR_VM_MODULE_NOT_LINKED', }); return new Module(''); })); @@ -129,7 +129,8 @@ async function checkModuleState() { await m.evaluate(); }, { code: 'ERR_VM_MODULE_STATUS', - message: 'Module status must be one of instantiated, evaluated, and errored' + message: 'Module status must be one of ' + + 'instantiated, evaluated, and errored', }); await expectsRejection(async () => { @@ -137,7 +138,8 @@ async function checkModuleState() { await m.evaluate(); }, { code: 'ERR_VM_MODULE_STATUS', - message: 'Module status must be one of instantiated, evaluated, and errored' + message: 'Module status must be one of ' + + 'instantiated, evaluated, and errored', }); common.expectsError(() => { @@ -145,7 +147,7 @@ async function checkModuleState() { m.error; }, { code: 'ERR_VM_MODULE_STATUS', - message: 'Module status must be errored' + message: 'Module status must be errored', }); await expectsRejection(async () => { @@ -155,7 +157,7 @@ async function checkModuleState() { m.error; }, { code: 'ERR_VM_MODULE_STATUS', - message: 'Module status must be errored' + message: 'Module status must be errored', }); common.expectsError(() => { @@ -163,7 +165,7 @@ async function checkModuleState() { m.namespace; }, { code: 'ERR_VM_MODULE_STATUS', - message: 'Module status must not be uninstantiated or instantiating' + message: 'Module status must not be uninstantiated or instantiating', }); await expectsRejection(async () => { @@ -171,7 +173,7 @@ async function checkModuleState() { m.namespace; }, { code: 'ERR_VM_MODULE_STATUS', - message: 'Module status must not be uninstantiated or instantiating' + message: 'Module status must not be uninstantiated or instantiating', }); } @@ -187,7 +189,7 @@ async function checkLinking() { } assert.fail('Unreachable'); }, { - code: 'ERR_VM_MODULE_NOT_MODULE' + code: 'ERR_VM_MODULE_NOT_MODULE', }); await expectsRejection(async () => { @@ -203,7 +205,7 @@ async function checkLinking() { } assert.fail('Unreachable'); }, { - code: 'ERR_VM_MODULE_DIFFERENT_CONTEXT' + code: 'ERR_VM_MODULE_DIFFERENT_CONTEXT', }); await expectsRejection(async () => { @@ -219,7 +221,7 @@ async function checkLinking() { const rootModule = new Module('import "errored";'); await rootModule.link(common.mustCall(() => erroredModule)); }, { - code: 'ERR_VM_MODULE_LINKING_ERRORED' + code: 'ERR_VM_MODULE_LINKING_ERRORED', }); } diff --git a/test/parallel/test-vm-module-link.js b/test/parallel/test-vm-module-link.js index 843c1fdc517787..25ef2eedd1467f 100644 --- a/test/parallel/test-vm-module-link.js +++ b/test/parallel/test-vm-module-link.js @@ -107,7 +107,7 @@ async function circular2() { './b.mjs': ` export * from './a.mjs'; export var fromB; - ` + `, }; const moduleMap = new Map(); const rootModule = new Module(sourceMap.root, { url: 'vm:root' }); 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-sigint-existing-handler.js b/test/parallel/test-vm-sigint-existing-handler.js index 79a4d556ac05d6..2fe13f980fbf73 100644 --- a/test/parallel/test-vm-sigint-existing-handler.js +++ b/test/parallel/test-vm-sigint-existing-handler.js @@ -11,7 +11,7 @@ const spawn = require('child_process').spawn; const methods = [ 'runInThisContext', - 'runInContext' + 'runInContext', ]; if (process.argv[2] === 'child') { @@ -69,7 +69,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 9935b3d04b57a8..fab4e18349d133 100644 --- a/test/parallel/test-vm-sigint.js +++ b/test/parallel/test-vm-sigint.js @@ -33,7 +33,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-syntax-error-message.js b/test/parallel/test-vm-syntax-error-message.js index 5a16239f5653e9..c49ff6aeb1925e 100644 --- a/test/parallel/test-vm-syntax-error-message.js +++ b/test/parallel/test-vm-syntax-error-message.js @@ -8,7 +8,7 @@ const p = child_process.spawn(process.execPath, [ 'vm = require("vm");' + 'context = vm.createContext({});' + 'try { vm.runInContext("throw new Error(\'boo\')", context); } ' + - 'catch (e) { console.log(e.message); }' + 'catch (e) { console.log(e.message); }', ]); p.stderr.on('data', common.mustNotCall()); diff --git a/test/parallel/test-vm-syntax-error-stderr.js b/test/parallel/test-vm-syntax-error-stderr.js index 137d5de432b398..528479063c811c 100644 --- a/test/parallel/test-vm-syntax-error-stderr.js +++ b/test/parallel/test-vm-syntax-error-stderr.js @@ -9,7 +9,7 @@ const wrong_script = fixtures.path('cert.pem'); const p = child_process.spawn(process.execPath, [ '-e', 'require(process.argv[1]);', - wrong_script + wrong_script, ]); p.stdout.on('data', common.mustNotCall()); diff --git a/test/parallel/test-vm-timeout.js b/test/parallel/test-vm-timeout.js index 51239ffed58efd..7551889dc5f6d2 100644 --- a/test/parallel/test-vm-timeout.js +++ b/test/parallel/test-vm-timeout.js @@ -48,7 +48,7 @@ assert.throws(function() { 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'); @@ -59,7 +59,7 @@ assert.throws(function() { const context = { runInVM: function(timeout) { vm.runInNewContext('while(true) {}', context, { timeout }); - } + }, }; vm.runInNewContext('runInVM(10000)', context, { timeout: 100 }); throw new Error('Test 6 failed'); @@ -70,7 +70,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-wasm-simple.js b/test/parallel/test-wasm-simple.js index 02a97ec2c9455f..937f55369e7a2a 100644 --- a/test/parallel/test-wasm-simple.js +++ b/test/parallel/test-wasm-simple.js @@ -14,6 +14,6 @@ WebAssembly.instantiate(buffer, {}).then((results) => { assert.strictEqual( results.instance.exports.addTwo(10, 20), 30, - 'Exported function should add two numbers.', + 'Exported function should add two numbers.' ); }); diff --git a/test/parallel/test-whatwg-encoding-fatal-streaming.js b/test/parallel/test-whatwg-encoding-fatal-streaming.js index 0b510126affe3a..26b2b44901ebb0 100644 --- a/test/parallel/test-whatwg-encoding-fatal-streaming.js +++ b/test/parallel/test-whatwg-encoding-fatal-streaming.js @@ -9,7 +9,7 @@ if (!common.hasIntl) const assert = require('assert'); const { - TextDecoder + TextDecoder, } = require('util'); @@ -17,7 +17,7 @@ const { [ { encoding: 'utf-8', sequence: [0xC0] }, { encoding: 'utf-16le', sequence: [0x00] }, - { encoding: 'utf-16be', sequence: [0x00] } + { encoding: 'utf-16be', sequence: [0x00] }, ].forEach((testCase) => { const data = new Uint8Array([testCase.sequence]); common.expectsError( @@ -28,7 +28,7 @@ const { code: 'ERR_ENCODING_INVALID_ENCODED_DATA', type: TypeError, message: - `The encoded data was not valid for encoding ${testCase.encoding}` + `The encoded data was not valid for encoding ${testCase.encoding}`, } ); @@ -55,7 +55,7 @@ const { code: 'ERR_ENCODING_INVALID_ENCODED_DATA', type: TypeError, message: - 'The encoded data was not valid for encoding utf-16le' + 'The encoded data was not valid for encoding utf-16le', } ); @@ -67,7 +67,7 @@ const { code: 'ERR_ENCODING_INVALID_ENCODED_DATA', type: 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-internals.js b/test/parallel/test-whatwg-encoding-internals.js index d025642365ff73..c9a35a4e69b267 100644 --- a/test/parallel/test-whatwg-encoding-internals.js +++ b/test/parallel/test-whatwg-encoding-internals.js @@ -11,16 +11,16 @@ const { getEncodingFromLabel } = require('internal/encoding'); const mappings = { 'utf-8': [ 'unicode-1-1-utf-8', - 'utf8' + 'utf8', ], 'utf-16be': [], 'utf-16le': [ - 'utf-16' + 'utf-16', ], 'ibm866': [ '866', 'cp866', - 'csibm866' + 'csibm866', ], 'iso-8859-2': [ 'csisolatin2', @@ -30,7 +30,7 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'iso_8859-2', 'iso_8859-2:1987', 'l2', - 'latin2' + 'latin2', ], 'iso-8859-3': [ 'csisolatin3', @@ -40,7 +40,7 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'iso_8859-3', 'iso_8859-3:1988', 'l3', - 'latin3' + 'latin3', ], 'iso-8859-4': [ 'csisolatin4', @@ -50,7 +50,7 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'iso_8859-4', 'iso_8859-4:1988', 'l4', - 'latin4' + 'latin4', ], 'iso-8859-5': [ 'csisolatincyrillic', @@ -59,7 +59,7 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'iso8859-5', 'iso88595', 'iso_8859-5', - 'iso_8859-5:1988' + 'iso_8859-5:1988', ], 'iso-8859-6': [ 'arabic', @@ -74,7 +74,7 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'iso8859-6', 'iso88596', 'iso_8859-6', - 'iso_8859-6:1987' + 'iso_8859-6:1987', ], 'iso-8859-7': [ 'csisolatingreek', @@ -87,7 +87,7 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'iso88597', 'iso_8859-7', 'iso_8859-7:1987', - 'sun_eu_greek' + 'sun_eu_greek', ], 'iso-8859-8': [ 'csiso88598e', @@ -99,11 +99,11 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'iso88598', 'iso_8859-8', 'iso_8859-8:1988', - 'visual' + 'visual', ], 'iso-8859-8-i': [ 'csiso88598i', - 'logical' + 'logical', ], 'iso-8859-10': [ 'csisolatin6', @@ -111,51 +111,51 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'iso8859-10', 'iso885910', 'l6', - 'latin6' + 'latin6', ], 'iso-8859-13': [ 'iso8859-13', - 'iso885913' + 'iso885913', ], 'iso-8859-14': [ 'iso8859-14', - 'iso885914' + 'iso885914', ], 'iso-8859-15': [ 'csisolatin9', 'iso8859-15', 'iso885915', 'iso_8859-15', - 'l9' + 'l9', ], 'koi8-r': [ 'cskoi8r', 'koi', 'koi8', - 'koi8_r' + 'koi8_r', ], 'koi8-u': [ - 'koi8-ru' + 'koi8-ru', ], 'macintosh': [ 'csmacintosh', 'mac', - 'x-mac-roman' + 'x-mac-roman', ], 'windows-874': [ 'dos-874', 'iso-8859-11', 'iso8859-11', 'iso885911', - 'tis-620' + 'tis-620', ], 'windows-1250': [ 'cp1250', - 'x-cp1250' + 'x-cp1250', ], 'windows-1251': [ 'cp1251', - 'x-cp1251' + 'x-cp1251', ], 'windows-1252': [ 'ansi_x3.4-1968', @@ -173,11 +173,11 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'l1', 'latin1', 'us-ascii', - 'x-cp1252' + 'x-cp1252', ], 'windows-1253': [ 'cp1253', - 'x-cp1253' + 'x-cp1253', ], 'windows-1254': [ 'cp1254', @@ -190,26 +190,26 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'iso_8859-9:1989', 'l5', 'latin5', - 'x-cp1254' + 'x-cp1254', ], 'windows-1255': [ 'cp1255', - 'x-cp1255' + 'x-cp1255', ], 'windows-1256': [ 'cp1256', - 'x-cp1256' + 'x-cp1256', ], 'windows-1257': [ 'cp1257', - 'x-cp1257' + 'x-cp1257', ], 'windows-1258': [ 'cp1258', - 'x-cp1258' + 'x-cp1258', ], 'x-mac-cyrillic': [ - 'x-mac-ukrainian' + 'x-mac-ukrainian', ], 'gbk': [ 'chinese', @@ -219,21 +219,21 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'gb_2312', 'gb_2312-80', 'iso-ir-58', - 'x-gbk' + 'x-gbk', ], 'gb18030': [ ], 'big5': [ 'big5-hkscs', 'cn-big5', 'csbig5', - 'x-x-big5' + 'x-x-big5', ], 'euc-jp': [ 'cseucpkdfmtjapanese', - 'x-euc-jp' + 'x-euc-jp', ], 'iso-2022-jp': [ - 'csiso2022jp' + 'csiso2022jp', ], 'shift_jis': [ 'csshiftjis', @@ -242,7 +242,7 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'shift-jis', 'sjis', 'windows-31j', - 'x-sjis' + 'x-sjis', ], 'euc-kr': [ ' euc-kr \t', @@ -255,8 +255,8 @@ const { getEncodingFromLabel } = require('internal/encoding'); 'ks_c_5601-1989', 'ksc5601', 'ksc_5601', - 'windows-949' - ] + 'windows-949', + ], }; Object.entries(mappings).forEach((i) => { const enc = i[0]; diff --git a/test/parallel/test-whatwg-encoding-surrogates-utf8.js b/test/parallel/test-whatwg-encoding-surrogates-utf8.js index 5fbdd0d83b944d..dd4f3fffdab48b 100644 --- a/test/parallel/test-whatwg-encoding-surrogates-utf8.js +++ b/test/parallel/test-whatwg-encoding-surrogates-utf8.js @@ -7,7 +7,7 @@ require('../common'); const assert = require('assert'); const { TextDecoder, - TextEncoder + TextEncoder, } = require('util'); const badStrings = [ @@ -15,38 +15,38 @@ const badStrings = [ input: 'abc123', expected: [0x61, 0x62, 0x63, 0x31, 0x32, 0x33], decoded: 'abc123', - name: 'Sanity check' + name: 'Sanity check', }, { input: '\uD800', expected: [0xef, 0xbf, 0xbd], decoded: '\uFFFD', - name: 'Surrogate half (low)' + name: 'Surrogate half (low)', }, { input: '\uDC00', expected: [0xef, 0xbf, 0xbd], decoded: '\uFFFD', - name: 'Surrogate half (high)' + name: 'Surrogate half (high)', }, { input: 'abc\uD800123', expected: [0x61, 0x62, 0x63, 0xef, 0xbf, 0xbd, 0x31, 0x32, 0x33], decoded: 'abc\uFFFD123', - name: 'Surrogate half (low), in a string' + name: 'Surrogate half (low), in a string', }, { input: 'abc\uDC00123', expected: [0x61, 0x62, 0x63, 0xef, 0xbf, 0xbd, 0x31, 0x32, 0x33], decoded: 'abc\uFFFD123', - name: 'Surrogate half (high), in a string' + name: 'Surrogate half (high), in a string', }, { input: '\uDC00\uD800', expected: [0xef, 0xbf, 0xbd, 0xef, 0xbf, 0xbd], decoded: '\uFFFD\uFFFD', - name: 'Wrong order' - } + name: 'Wrong order', + }, ]; badStrings.forEach((t) => { diff --git a/test/parallel/test-whatwg-encoding-textdecoder-fatal.js b/test/parallel/test-whatwg-encoding-textdecoder-fatal.js index cfb595e78e6b40..a3324427d00c28 100644 --- a/test/parallel/test-whatwg-encoding-textdecoder-fatal.js +++ b/test/parallel/test-whatwg-encoding-textdecoder-fatal.js @@ -9,7 +9,7 @@ if (!common.hasIntl) const assert = require('assert'); const { - TextDecoder + TextDecoder, } = require('util'); const bad = [ @@ -80,7 +80,7 @@ bad.forEach((t) => { .decode(new Uint8Array(t.input)); }, { code: 'ERR_ENCODING_INVALID_ENCODED_DATA', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-whatwg-encoding-textdecoder-ignorebom.js b/test/parallel/test-whatwg-encoding-textdecoder-ignorebom.js index 0e3cd3025d040a..2f35e9c7ac8744 100644 --- a/test/parallel/test-whatwg-encoding-textdecoder-ignorebom.js +++ b/test/parallel/test-whatwg-encoding-textdecoder-ignorebom.js @@ -6,25 +6,25 @@ const common = require('../common'); const assert = require('assert'); const { - TextDecoder + TextDecoder, } = require('util'); const cases = [ { encoding: 'utf-8', bytes: [0xEF, 0xBB, 0xBF, 0x61, 0x62, 0x63], - skipNoIntl: false + skipNoIntl: false, }, { encoding: 'utf-16le', bytes: [0xFF, 0xFE, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00], - skipNoIntl: false + skipNoIntl: false, }, { encoding: 'utf-16be', bytes: [0xFE, 0xFF, 0x00, 0x61, 0x00, 0x62, 0x00, 0x63], - skipNoIntl: true - } + skipNoIntl: true, + }, ]; cases.forEach((testCase) => { diff --git a/test/parallel/test-whatwg-encoding-textdecoder-streaming.js b/test/parallel/test-whatwg-encoding-textdecoder-streaming.js index e446d56ffd2abb..61d1177c79bcbb 100644 --- a/test/parallel/test-whatwg-encoding-textdecoder-streaming.js +++ b/test/parallel/test-whatwg-encoding-textdecoder-streaming.js @@ -6,7 +6,7 @@ const common = require('../common'); const assert = require('assert'); const { - TextDecoder + TextDecoder, } = require('util'); const string = @@ -25,7 +25,7 @@ const octets = { 0x00, 0x00, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x80, 0x00, 0xFF, 0x01, 0x00, 0x10, 0x00, 0xFF, 0xFD, 0xD8, 0x00, 0xDC, 0x00, 0xDB, 0xFF, - 0xDF, 0xFF] + 0xDF, 0xFF], }; Object.keys(octets).forEach((encoding) => { diff --git a/test/parallel/test-whatwg-encoding-textdecoder-utf16-surrogates.js b/test/parallel/test-whatwg-encoding-textdecoder-utf16-surrogates.js index fcf6a82e90fd85..833e97fe0cb6d9 100644 --- a/test/parallel/test-whatwg-encoding-textdecoder-utf16-surrogates.js +++ b/test/parallel/test-whatwg-encoding-textdecoder-utf16-surrogates.js @@ -9,7 +9,7 @@ if (!common.hasIntl) const assert = require('assert'); const { - TextDecoder + TextDecoder, } = require('util'); const bad = [ @@ -17,32 +17,32 @@ 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', + }, ]; bad.forEach((t) => { @@ -57,7 +57,7 @@ bad.forEach((t) => { .decode(new Uint8Array(t.input)); }, { code: 'ERR_ENCODING_INVALID_ENCODED_DATA', - type: TypeError + type: TypeError, } ); }); diff --git a/test/parallel/test-whatwg-encoding-textdecoder.js b/test/parallel/test-whatwg-encoding-textdecoder.js index e87364de1e91f7..62a424f9373967 100644 --- a/test/parallel/test-whatwg-encoding-textdecoder.js +++ b/test/parallel/test-whatwg-encoding-textdecoder.js @@ -57,7 +57,7 @@ if (common.hasIntl) { code: 'ERR_ENCODING_INVALID_ENCODED_DATA', type: TypeError, message: 'The encoded data was not valid ' + - 'for encoding utf-8' + 'for encoding utf-8', }); }); @@ -72,7 +72,8 @@ if (common.hasIntl) { { code: 'ERR_NO_ICU', type: 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', }); } @@ -104,7 +105,7 @@ if (common.hasIntl) { const expectedError = { code: 'ERR_INVALID_THIS', type: TypeError, - message: 'Value of "this" must be of type TextDecoder' + message: 'Value of "this" must be of type TextDecoder', }; inspectFn.call(instance, Infinity, {}); @@ -145,7 +146,7 @@ const sample = 'z\xA2\u6C34\uD834\uDD1E\uF8FF\uDBFF\uDFFD\uFFFE'; 0x7A, 0xC2, 0xA2, 0xE6, 0xB0, 0xB4, 0xF0, 0x9D, 0x84, 0x9E, 0xEF, 0xA3, 0xBF, 0xF4, 0x8F, 0xBF, 0xBD, 0xEF, - 0xBF, 0xBE + 0xBF, 0xBE, ]; const encoded = new TextEncoder().encode(string); assert.deepStrictEqual([].slice.call(encoded), bytes); @@ -163,7 +164,7 @@ testDecodeSample( [ 0x7A, 0x00, 0xA2, 0x00, 0x34, 0x6C, 0x34, 0xD8, 0x1E, 0xDD, 0xFF, 0xF8, - 0xFF, 0xDB, 0xFD, 0xDF, 0xFE, 0xFF + 0xFF, 0xDB, 0xFD, 0xDF, 0xFE, 0xFF, ] ); @@ -174,7 +175,7 @@ if (common.hasIntl) { [ 0x00, 0x7A, 0x00, 0xA2, 0x6C, 0x34, 0xD8, 0x34, 0xDD, 0x1E, 0xF8, 0xFF, - 0xDB, 0xFF, 0xDF, 0xFD, 0xFF, 0xFE + 0xDB, 0xFF, 0xDF, 0xFD, 0xFF, 0xFE, ] ); } @@ -185,7 +186,7 @@ testDecodeSample( [ 0x7A, 0x00, 0xA2, 0x00, 0x34, 0x6C, 0x34, 0xD8, 0x1E, 0xDD, 0xFF, 0xF8, - 0xFF, 0xDB, 0xFD, 0xDF, 0xFE, 0xFF + 0xFF, 0xDB, 0xFD, 0xDF, 0xFE, 0xFF, ] ); @@ -196,14 +197,14 @@ testDecodeSample( 'utf8', 'utf-16be', 'utf-16le', - 'utf-16' + 'utf-16', ].forEach((i) => { ['\u0000', '\u000b', '\u00a0', '\u2028', '\u2029'].forEach((ws) => { common.expectsError( () => new TextDecoder(`${ws}${i}`), { code: 'ERR_ENCODING_NOT_SUPPORTED', - type: RangeError + type: RangeError, } ); @@ -211,7 +212,7 @@ testDecodeSample( () => new TextDecoder(`${i}${ws}`), { code: 'ERR_ENCODING_NOT_SUPPORTED', - type: RangeError + type: RangeError, } ); @@ -219,7 +220,7 @@ testDecodeSample( () => new TextDecoder(`${ws}${i}${ws}`), { code: 'ERR_ENCODING_NOT_SUPPORTED', - type: RangeError + type: RangeError, } ); }); diff --git a/test/parallel/test-whatwg-encoding-textencoder-utf16-surrogates.js b/test/parallel/test-whatwg-encoding-textencoder-utf16-surrogates.js index 9ef3c0c2360b67..7365fd8d74cc5f 100644 --- a/test/parallel/test-whatwg-encoding-textencoder-utf16-surrogates.js +++ b/test/parallel/test-whatwg-encoding-textencoder-utf16-surrogates.js @@ -7,40 +7,40 @@ require('../common'); const assert = require('assert'); const { TextDecoder, - TextEncoder + TextEncoder, } = require('util'); const bad = [ { input: '\uD800', expected: '\uFFFD', - name: 'lone surrogate lead' + name: 'lone surrogate lead', }, { input: '\uDC00', expected: '\uFFFD', - name: 'lone surrogate trail' + name: 'lone surrogate trail', }, { input: '\uD800\u0000', expected: '\uFFFD\u0000', - name: 'unmatched surrogate lead' + name: 'unmatched surrogate lead', }, { input: '\uDC00\u0000', expected: '\uFFFD\u0000', - name: 'unmatched surrogate trail' + name: 'unmatched surrogate trail', }, { input: '\uDC00\uD800', expected: '\uFFFD\uFFFD', - name: 'swapped surrogate pair' + name: 'swapped surrogate pair', }, { input: '\uD834\uDD1E', expected: '\uD834\uDD1E', - name: 'properly encoded MUSICAL SYMBOL G CLEF (U+1D11E)' - } + name: 'properly encoded MUSICAL SYMBOL G CLEF (U+1D11E)', + }, ]; bad.forEach((t) => { diff --git a/test/parallel/test-whatwg-encoding-textencoder.js b/test/parallel/test-whatwg-encoding-textencoder.js index 5514b714bd9b6e..dd5e1d5e66e670 100644 --- a/test/parallel/test-whatwg-encoding-textencoder.js +++ b/test/parallel/test-whatwg-encoding-textencoder.js @@ -45,7 +45,7 @@ assert(TextEncoder); const expectedError = { code: 'ERR_INVALID_THIS', type: 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-url-constructor.js b/test/parallel/test-whatwg-url-constructor.js index 16bcac74cc6bcd..b6ee0193a89611 100644 --- a/test/parallel/test-whatwg-url-constructor.js +++ b/test/parallel/test-whatwg-url-constructor.js @@ -11,7 +11,7 @@ const { test, assert_equals, assert_true, assert_throws } = require('../common/wpt'); const request = { - response: require(fixtures.path('url-tests')) + response: require(fixtures.path('url-tests')), }; /* The following tests are copied from WPT. Modifications to them should be diff --git a/test/parallel/test-whatwg-url-global.js b/test/parallel/test-whatwg-url-global.js index b4e85a49ad6343..f8747a117ee369 100644 --- a/test/parallel/test-whatwg-url-global.js +++ b/test/parallel/test-whatwg-url-global.js @@ -10,7 +10,7 @@ assert.deepStrictEqual( value: URL, writable: true, configurable: true, - enumerable: false + enumerable: false, } ); @@ -20,6 +20,6 @@ assert.deepStrictEqual( value: URLSearchParams, writable: true, configurable: true, - enumerable: false + enumerable: false, } ); diff --git a/test/parallel/test-whatwg-url-origin.js b/test/parallel/test-whatwg-url-origin.js index 8a5ad6d3154f8f..54e0724ef4a220 100644 --- a/test/parallel/test-whatwg-url-origin.js +++ b/test/parallel/test-whatwg-url-origin.js @@ -10,7 +10,7 @@ const URL = require('url').URL; const { test, assert_equals } = require('../common/wpt'); const request = { - response: require(fixtures.path('url-tests')) + response: require(fixtures.path('url-tests')), }; /* The following tests are copied from WPT. Modifications to them should be diff --git a/test/parallel/test-whatwg-url-parsing.js b/test/parallel/test-whatwg-url-parsing.js index 928ac5d6a6c658..91caa10399528e 100644 --- a/test/parallel/test-whatwg-url-parsing.js +++ b/test/parallel/test-whatwg-url-parsing.js @@ -22,7 +22,7 @@ const failureTests = tests.filter((test) => test.failure).concat([ { input: null }, { input: new Date() }, { input: new RegExp() }, - { input: () => {} } + { input: () => {} }, ]); const expectedError = common.expectsError( diff --git a/test/parallel/test-whatwg-url-properties.js b/test/parallel/test-whatwg-url-properties.js index d6caae511aed47..76799d28bfb2c4 100644 --- a/test/parallel/test-whatwg-url-properties.js +++ b/test/parallel/test-whatwg-url-properties.js @@ -156,7 +156,7 @@ assert.strictEqual(url.searchParams, oldParams); { expected: 'ws://example.org', url: 'ws://example.org/foo' }, { expected: 'wss://example.org', url: 'wss://example.org/foo' }, { expected: 'null', url: 'file:///tmp/mock/path' }, - { expected: 'null', url: 'npm://nodejs/rules' } + { expected: 'null', url: 'npm://nodejs/rules' }, ].forEach((test) => { assert.strictEqual(new URL(test.url).origin, test.expected); }); diff --git a/test/parallel/test-whatwg-url-searchparams-append.js b/test/parallel/test-whatwg-url-searchparams-append.js index 03e7205fb2cb51..5eab25dbe020ca 100644 --- a/test/parallel/test-whatwg-url-searchparams-append.js +++ b/test/parallel/test-whatwg-url-searchparams-append.js @@ -57,19 +57,19 @@ test(function() { }, { code: 'ERR_INVALID_THIS', type: TypeError, - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); common.expectsError(() => { params.append('a'); }, { code: 'ERR_MISSING_ARGS', type: 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-searchparams-constructor.js b/test/parallel/test-whatwg-url-searchparams-constructor.js index b6e720cc7fb04c..01dd7a703d5dc4 100644 --- a/test/parallel/test-whatwg-url-searchparams-constructor.js +++ b/test/parallel/test-whatwg-url-searchparams-constructor.js @@ -5,7 +5,7 @@ const assert = require('assert'); const URLSearchParams = require('url').URLSearchParams; const { test, assert_equals, assert_true, - assert_false, assert_throws, assert_array_equals + assert_false, assert_throws, assert_array_equals, } = require('../common/wpt'); /* The following tests are copied from WPT. Modifications to them should be @@ -196,7 +196,7 @@ function makeIterableFunc(array) { return Object.assign(() => {}, { [Symbol.iterator]() { return array[Symbol.iterator](); - } + }, }); } @@ -204,12 +204,12 @@ function makeIterableFunc(array) { const iterableError = common.expectsError({ code: 'ERR_ARG_NOT_ITERABLE', type: TypeError, - message: 'Query pairs must be iterable' + message: 'Query pairs must be iterable', }); const tupleError = common.expectsError({ code: 'ERR_INVALID_TUPLE', type: TypeError, - message: 'Each query pair must be an iterable [name, value] tuple' + message: 'Each query pair must be an iterable [name, value] tuple', }, 6); let params; @@ -239,7 +239,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-searchparams-delete.js b/test/parallel/test-whatwg-url-searchparams-delete.js index 042ecb5d889beb..341eb3ade42f0c 100644 --- a/test/parallel/test-whatwg-url-searchparams-delete.js +++ b/test/parallel/test-whatwg-url-searchparams-delete.js @@ -67,19 +67,19 @@ test(function() { }, { code: 'ERR_INVALID_THIS', type: TypeError, - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); common.expectsError(() => { params.delete(); }, { code: 'ERR_MISSING_ARGS', type: 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-searchparams-entries.js b/test/parallel/test-whatwg-url-searchparams-entries.js index fc3086545870ee..30a82b7e3a2781 100644 --- a/test/parallel/test-whatwg-url-searchparams-entries.js +++ b/test/parallel/test-whatwg-url-searchparams-entries.js @@ -11,19 +11,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, }); common.expectsError(() => { @@ -31,12 +31,12 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_THIS', type: TypeError, - message: 'Value of "this" must be of type URLSearchParamsIterator' + message: 'Value of "this" must be of type URLSearchParamsIterator', }); common.expectsError(() => { params.entries.call(undefined); }, { code: 'ERR_INVALID_THIS', type: 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-searchparams-foreach.js b/test/parallel/test-whatwg-url-searchparams-foreach.js index 53c35da263f5ab..0d9cc9061ad8e2 100644 --- a/test/parallel/test-whatwg-url-searchparams-foreach.js +++ b/test/parallel/test-whatwg-url-searchparams-foreach.js @@ -54,6 +54,6 @@ test(function() { }, { code: 'ERR_INVALID_THIS', type: 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-searchparams-get.js b/test/parallel/test-whatwg-url-searchparams-get.js index e14bdc7e74fc8d..271239138101a7 100644 --- a/test/parallel/test-whatwg-url-searchparams-get.js +++ b/test/parallel/test-whatwg-url-searchparams-get.js @@ -42,19 +42,19 @@ test(function() { }, { code: 'ERR_INVALID_THIS', type: TypeError, - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); common.expectsError(() => { params.get(); }, { code: 'ERR_MISSING_ARGS', type: 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-searchparams-getall.js b/test/parallel/test-whatwg-url-searchparams-getall.js index a4692c22f1b21d..fb5adecf07289a 100644 --- a/test/parallel/test-whatwg-url-searchparams-getall.js +++ b/test/parallel/test-whatwg-url-searchparams-getall.js @@ -47,19 +47,19 @@ test(function() { }, { code: 'ERR_INVALID_THIS', type: TypeError, - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); common.expectsError(() => { params.getAll(); }, { code: 'ERR_MISSING_ARGS', type: 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-searchparams-has.js b/test/parallel/test-whatwg-url-searchparams-has.js index 47c6b6f7bae98f..e621a832bcd246 100644 --- a/test/parallel/test-whatwg-url-searchparams-has.js +++ b/test/parallel/test-whatwg-url-searchparams-has.js @@ -45,19 +45,19 @@ test(function() { }, { code: 'ERR_INVALID_THIS', type: TypeError, - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); common.expectsError(() => { params.has(); }, { code: 'ERR_MISSING_ARGS', type: 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-searchparams-keys.js b/test/parallel/test-whatwg-url-searchparams-keys.js index e4428eb3e98f6b..424bd206963848 100644 --- a/test/parallel/test-whatwg-url-searchparams-keys.js +++ b/test/parallel/test-whatwg-url-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, }); common.expectsError(() => { @@ -32,12 +32,12 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_THIS', type: TypeError, - message: 'Value of "this" must be of type URLSearchParamsIterator' + message: 'Value of "this" must be of type URLSearchParamsIterator', }); common.expectsError(() => { params.keys.call(undefined); }, { code: 'ERR_INVALID_THIS', type: 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-searchparams-set.js b/test/parallel/test-whatwg-url-searchparams-set.js index 1bca12e31bcc28..dd1af47c445e28 100644 --- a/test/parallel/test-whatwg-url-searchparams-set.js +++ b/test/parallel/test-whatwg-url-searchparams-set.js @@ -43,19 +43,19 @@ test(function() { }, { code: 'ERR_INVALID_THIS', type: TypeError, - message: 'Value of "this" must be of type URLSearchParams' + message: 'Value of "this" must be of type URLSearchParams', }); common.expectsError(() => { params.set('a'); }, { code: 'ERR_MISSING_ARGS', type: 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-searchparams-sort.js b/test/parallel/test-whatwg-url-searchparams-sort.js index 1122f08dcc0434..d299593d81c756 100644 --- a/test/parallel/test-whatwg-url-searchparams-sort.js +++ b/test/parallel/test-whatwg-url-searchparams-sort.js @@ -77,7 +77,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-searchparams-stringifier.js b/test/parallel/test-whatwg-url-searchparams-stringifier.js index e3bfbdcf1982d8..4e127fc0e3f66e 100644 --- a/test/parallel/test-whatwg-url-searchparams-stringifier.js +++ b/test/parallel/test-whatwg-url-searchparams-stringifier.js @@ -130,6 +130,6 @@ test(function() { }, { code: 'ERR_INVALID_THIS', type: 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-searchparams-values.js b/test/parallel/test-whatwg-url-searchparams-values.js index e44b7f5e11267d..85a2c2e59f4c0e 100644 --- a/test/parallel/test-whatwg-url-searchparams-values.js +++ b/test/parallel/test-whatwg-url-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, }); common.expectsError(() => { @@ -32,12 +32,12 @@ common.expectsError(() => { }, { code: 'ERR_INVALID_THIS', type: TypeError, - message: 'Value of "this" must be of type URLSearchParamsIterator' + message: 'Value of "this" must be of type URLSearchParamsIterator', }); common.expectsError(() => { params.values.call(undefined); }, { code: 'ERR_INVALID_THIS', type: 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-searchparams.js b/test/parallel/test-whatwg-url-searchparams.js index 0b72c08d0b887f..1a8d1fc5928edd 100644 --- a/test/parallel/test-whatwg-url-searchparams.js +++ b/test/parallel/test-whatwg-url-searchparams.js @@ -75,7 +75,7 @@ sp.forEach(function() { { const callbackErr = common.expectsError({ code: 'ERR_INVALID_CALLBACK', - type: TypeError + type: TypeError, }, 2); assert.throws(() => sp.forEach(), callbackErr); assert.throws(() => sp.forEach(1), callbackErr); diff --git a/test/parallel/test-whatwg-url-setters.js b/test/parallel/test-whatwg-url-setters.js index 7655e4a2578bb1..c1631ef56c35eb 100644 --- a/test/parallel/test-whatwg-url-setters.js +++ b/test/parallel/test-whatwg-url-setters.js @@ -15,7 +15,7 @@ const additionalTestCases = require(fixtures.path('url-setter-tests-additional.js')); const request = { - response: require(fixtures.path('url-setter-tests')) + response: require(fixtures.path('url-setter-tests')), }; /* The following tests are copied from WPT. Modifications to them should be @@ -110,7 +110,7 @@ startURLSettersTests() 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-toascii.js b/test/parallel/test-whatwg-url-toascii.js index c85b092c1d250c..948a167600194d 100644 --- a/test/parallel/test-whatwg-url-toascii.js +++ b/test/parallel/test-whatwg-url-toascii.js @@ -10,7 +10,7 @@ const { URL } = require('url'); const { test, assert_equals, assert_throws } = require('../common/wpt'); const request = { - response: require(fixtures.path('url-toascii')) + response: require(fixtures.path('url-toascii')), }; /* The following tests are copied from WPT. Modifications to them should be diff --git a/test/parallel/test-wrap-js-stream-exceptions.js b/test/parallel/test-wrap-js-stream-exceptions.js index 57ecd70189d106..a1398cde000b64 100644 --- a/test/parallel/test-wrap-js-stream-exceptions.js +++ b/test/parallel/test-wrap-js-stream-exceptions.js @@ -13,7 +13,7 @@ const socket = new JSStreamWrap(new Duplex({ read: common.mustCall(), write: common.mustCall((buffer, data, cb) => { throw new Error('exception!'); - }) + }), })); assert.throws(() => socket.end('foo'), /Error: write EPROTO/); diff --git a/test/parallel/test-zlib-bytes-read.js b/test/parallel/test-zlib-bytes-read.js index 6262c2514954d0..15a13c670a1440 100644 --- a/test/parallel/test-zlib-bytes-read.js +++ b/test/parallel/test-zlib-bytes-read.js @@ -25,7 +25,7 @@ for (const method of [ ['createGzip', 'createGunzip', false], ['createGzip', 'createUnzip', false], ['createDeflate', 'createInflate', true], - ['createDeflateRaw', 'createInflateRaw', true] + ['createDeflateRaw', 'createInflateRaw', true], ]) { let compWriter; let compData = Buffer.alloc(0); diff --git a/test/parallel/test-zlib-const.js b/test/parallel/test-zlib-const.js index d25a1ca6be033a..342c8c712a475b 100644 --- a/test/parallel/test-zlib-const.js +++ b/test/parallel/test-zlib-const.js @@ -7,13 +7,13 @@ const zlib = require('zlib'); assert.strictEqual(zlib.constants.Z_OK, 0, [ 'Expected Z_OK to be 0;', - `got ${zlib.constants.Z_OK}` + `got ${zlib.constants.Z_OK}`, ].join(' ')); zlib.constants.Z_OK = 1; assert.strictEqual(zlib.constants.Z_OK, 0, [ 'Z_OK should be immutable.', - `Expected to get 0, got ${zlib.constants.Z_OK}` + `Expected to get 0, got ${zlib.constants.Z_OK}`, ].join(' ')); assert.strictEqual(zlib.codes.Z_OK, 0, @@ -22,17 +22,17 @@ zlib.codes.Z_OK = 1; assert.strictEqual(zlib.codes.Z_OK, 0, [ 'Z_OK should be immutable.', - `Expected to get 0, got ${zlib.codes.Z_OK}` + `Expected to get 0, got ${zlib.codes.Z_OK}`, ].join(' ')); zlib.codes = { Z_OK: 1 }; assert.strictEqual(zlib.codes.Z_OK, 0, [ 'Z_OK should be immutable.', - `Expected to get 0, got ${zlib.codes.Z_OK}` + `Expected to get 0, got ${zlib.codes.Z_OK}`, ].join(' ')); assert.ok(Object.isFrozen(zlib.codes), [ 'Expected zlib.codes to be frozen, but Object.isFrozen', - `returned ${Object.isFrozen(zlib.codes)}` + `returned ${Object.isFrozen(zlib.codes)}`, ].join(' ')); diff --git a/test/parallel/test-zlib-convenience-methods.js b/test/parallel/test-zlib-convenience-methods.js index 1cc393914a947e..5d6d28853d9a66 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 [ @@ -45,7 +45,7 @@ for (const [type, expect] of [ ['Buffer', expectBuf], ...common.getBufferSources(expectBuf).map((obj) => [obj[Symbol.toStringTag], obj] - ) + ), ]) { for (const method of [ ['gzip', 'gunzip', 'Gzip', 'Gunzip'], diff --git a/test/parallel/test-zlib-deflate-constructors.js b/test/parallel/test-zlib-deflate-constructors.js index 5d5e9fb4a2edd1..d33e1f8be1baa0 100644 --- a/test/parallel/test-zlib-deflate-constructors.js +++ b/test/parallel/test-zlib-deflate-constructors.js @@ -19,7 +19,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.chunkSize" property must be of type number. ' + - 'Received type string' + 'Received type string', } ); @@ -29,7 +29,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.windowBits" property must be of type number. ' + - 'Received type string' + 'Received type string', } ); @@ -63,7 +63,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.level" property must be of type number. ' + - 'Received type string' + 'Received type string', } ); @@ -104,7 +104,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "level" argument must be of type number. ' + - 'Received type string' + 'Received type string', } ); @@ -145,7 +145,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.memLevel" property must be of type number. ' + - 'Received type string' + 'Received type string', } ); @@ -186,7 +186,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.strategy" property must be of type number. ' + - 'Received type string' + 'Received type string', } ); @@ -234,7 +234,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "strategy" argument must be of type number. ' + - 'Received type string' + 'Received type string', } ); @@ -275,7 +275,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: RangeError, message: 'The value of "strategy" is out of range. It must ' + - 'be >= 0 and <= 4. Received -2' + 'be >= 0 and <= 4. Received -2', } ); @@ -306,6 +306,6 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.dictionary" property must be one of type Buffer, ' + - 'TypedArray, DataView, or ArrayBuffer. Received type string' + 'TypedArray, DataView, or ArrayBuffer. Received type string', } ); diff --git a/test/parallel/test-zlib-deflate-raw-inherits.js b/test/parallel/test-zlib-deflate-raw-inherits.js index a24726a3fbe465..5c7f3a3de800a7 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 38b8a5b4926e51..452a81cb5e7d32 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-dictionary.js b/test/parallel/test-zlib-dictionary.js index b7f6a138555237..55dfdf91ee1905 100644 --- a/test/parallel/test-zlib-dictionary.js +++ b/test/parallel/test-zlib-dictionary.js @@ -39,14 +39,14 @@ const spdyDict = Buffer.from([ 'ndayTuesdayWednesdayThursdayFridaySaturdaySundayJanFebMarAprMayJunJulAugSe', 'pOctNovDecchunkedtext/htmlimage/pngimage/jpgimage/gifapplication/xmlapplic', 'ation/xhtmltext/plainpublicmax-agecharset=iso-8859-1utf-8gzipdeflateHTTP/1', - '.1statusversionurl\0' + '.1statusversionurl\0', ].join('')); const input = [ 'HTTP/1.1 200 Ok', 'Server: node.js', 'Content-Length: 0', - '' + '', ].join('\r\n'); function basicDictionaryTest(spdyDict) { diff --git a/test/parallel/test-zlib-empty-buffer.js b/test/parallel/test-zlib-empty-buffer.js index 8b299f8728282d..2235e05373515b 100644 --- a/test/parallel/test-zlib-empty-buffer.js +++ b/test/parallel/test-zlib-empty-buffer.js @@ -14,7 +14,7 @@ common.crashOnUnhandledRejection(); [ zlib.gzipSync, zlib.gunzipSync, 'gzip sync' ], [ promisify(zlib.deflateRaw), promisify(zlib.inflateRaw), 'raw' ], [ promisify(zlib.deflate), promisify(zlib.inflate), 'deflate' ], - [ promisify(zlib.gzip), promisify(zlib.gunzip), 'gzip' ] + [ promisify(zlib.gzip), promisify(zlib.gunzip), 'gzip' ], ]) { const compressed = await compress(emptyBuffer); const decompressed = await decompress(compressed); diff --git a/test/parallel/test-zlib-failed-init.js b/test/parallel/test-zlib-failed-init.js index 4834c82b7d3a74..c157239c63e47e 100644 --- a/test/parallel/test-zlib-failed-init.js +++ b/test/parallel/test-zlib-failed-init.js @@ -11,7 +11,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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', } ); @@ -31,7 +31,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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 0619eecf3ce669..de57bddcfa342f 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 67c58b95d3105e..816f93a3c3db8d 100644 --- a/test/parallel/test-zlib-flush-flags.js +++ b/test/parallel/test-zlib-flush-flags.js @@ -10,7 +10,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.flush" property must be of type number. ' + - 'Received type string' + 'Received type string', } ); @@ -20,7 +20,7 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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', } ); @@ -32,7 +32,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "options.finishFlush" property must be of type number. ' + - 'Received type string' + 'Received type string', } ); @@ -42,6 +42,6 @@ common.expectsError( code: 'ERR_OUT_OF_RANGE', type: 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-flush-multiple-scheduled.js b/test/parallel/test-zlib-flush-multiple-scheduled.js index 19548672389fde..d5294e960b8ce9 100644 --- a/test/parallel/test-zlib-flush-multiple-scheduled.js +++ b/test/parallel/test-zlib-flush-multiple-scheduled.js @@ -5,7 +5,7 @@ const assert = require('assert'); const zlib = require('zlib'); const { - Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH + Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH, } = zlib.constants; common.crashOnUnhandledRejection(); diff --git a/test/parallel/test-zlib-from-concatenated-gzip.js b/test/parallel/test-zlib-from-concatenated-gzip.js index 9433fcffa866d8..700889225cb313 100644 --- a/test/parallel/test-zlib-from-concatenated-gzip.js +++ b/test/parallel/test-zlib-from-concatenated-gzip.js @@ -15,7 +15,7 @@ const defEncoded = zlib.gzipSync(def); const data = Buffer.concat([ abcEncoded, - defEncoded + defEncoded, ]); assert.strictEqual(zlib.gunzipSync(data).toString(), (abc + def)); @@ -33,7 +33,7 @@ zlib.unzip(data, common.mustCall((err, result) => { // Multi-member support does not apply to zlib inflate/deflate. zlib.unzip(Buffer.concat([ zlib.deflateSync('abc'), - zlib.deflateSync('def') + zlib.deflateSync('def'), ]), common.mustCall((err, result) => { assert.ifError(err); assert.strictEqual(result.toString(), abc); @@ -78,7 +78,7 @@ fs.createReadStream(pmmFileGz) // first write: write "abc" + the first bytes of "def" unzip.write(Buffer.concat([ - abcEncoded, defEncoded.slice(0, offset) + abcEncoded, defEncoded.slice(0, offset), ])); // write remaining bytes of "def" 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 48d9e441429eeb..5c361e9c6947ea 100644 --- a/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js +++ b/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js @@ -9,7 +9,7 @@ const zlib = require('zlib'); let data = Buffer.concat([ zlib.gzipSync('abc'), zlib.gzipSync('def'), - Buffer.alloc(10) + Buffer.alloc(10), ]); assert.strictEqual(zlib.gunzipSync(data).toString(), 'abcdef'); @@ -29,7 +29,7 @@ data = Buffer.concat([ zlib.gzipSync('abc'), zlib.gzipSync('def'), Buffer.from([0x1f, 0x8b, 0xff, 0xff]), - Buffer.alloc(10) + Buffer.alloc(10), ]); assert.throws( @@ -41,7 +41,7 @@ zlib.gunzip(data, common.mustCall((err, result) => { common.expectsError({ code: 'Z_DATA_ERROR', type: Error, - message: 'unknown compression method' + message: 'unknown compression method', })(err); assert.strictEqual(result, undefined); })); @@ -51,7 +51,7 @@ zlib.gunzip(data, common.mustCall((err, result) => { data = Buffer.concat([ zlib.gzipSync('abc'), zlib.gzipSync('def'), - Buffer.from([0x1f, 0x8b, 0xff, 0xff]) + Buffer.from([0x1f, 0x8b, 0xff, 0xff]), ]); assert.throws( diff --git a/test/parallel/test-zlib-invalid-input.js b/test/parallel/test-zlib-invalid-input.js index 1b081d919e9068..334b39af0d7643 100644 --- a/test/parallel/test-zlib-invalid-input.js +++ b/test/parallel/test-zlib-invalid-input.js @@ -30,7 +30,7 @@ const nonStringInputs = [ 1, true, { a: 1 }, - ['a'] + ['a'], ]; // zlib.Unzip classes need to get valid data, or else they'll throw. @@ -38,7 +38,7 @@ const unzips = [ zlib.Unzip(), zlib.Gunzip(), zlib.Inflate(), - zlib.InflateRaw() + zlib.InflateRaw(), ]; nonStringInputs.forEach(common.mustCall((input) => { diff --git a/test/parallel/test-zlib-not-string-or-buffer.js b/test/parallel/test-zlib-not-string-or-buffer.js index 489bc07f5d051b..1700ea65c99f10 100644 --- a/test/parallel/test-zlib-not-string-or-buffer.js +++ b/test/parallel/test-zlib-not-string-or-buffer.js @@ -13,7 +13,7 @@ const zlib = require('zlib'); code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "buffer" argument must be one of type string, Buffer, ' + - 'TypedArray, DataView, or ArrayBuffer' + 'TypedArray, DataView, or ArrayBuffer', } ); }); diff --git a/test/parallel/test-zlib-truncated.js b/test/parallel/test-zlib-truncated.js index e04ef7e3d8367a..461948088aa0a5 100644 --- a/test/parallel/test-zlib-truncated.js +++ b/test/parallel/test-zlib-truncated.js @@ -21,7 +21,7 @@ const errMessage = /unexpected end of file/; { comp: 'gzip', decomp: 'gunzip', decompSync: 'gunzipSync' }, { comp: 'gzip', decomp: 'unzip', decompSync: 'unzipSync' }, { comp: 'deflate', decomp: 'inflate', decompSync: 'inflateSync' }, - { comp: 'deflateRaw', decomp: 'inflateRaw', decompSync: 'inflateRawSync' } + { comp: 'deflateRaw', decomp: 'inflateRaw', decompSync: 'inflateRawSync' }, ].forEach(function(methods) { zlib[methods.comp](inputString, function(err, compressed) { assert.ifError(err); diff --git a/test/parallel/test-zlib-unzip-one-byte-chunks.js b/test/parallel/test-zlib-unzip-one-byte-chunks.js index be3b5dda818cf6..3d3d9c37ff0198 100644 --- a/test/parallel/test-zlib-unzip-one-byte-chunks.js +++ b/test/parallel/test-zlib-unzip-one-byte-chunks.js @@ -5,7 +5,7 @@ const zlib = require('zlib'); const data = Buffer.concat([ zlib.gzipSync('abc'), - zlib.gzipSync('def') + zlib.gzipSync('def'), ]); const resultBuffers = []; diff --git a/test/parallel/test-zlib-write-after-close.js b/test/parallel/test-zlib-write-after-close.js index 88d6643da8b994..8acf09c74381f0 100644 --- a/test/parallel/test-zlib-write-after-close.js +++ b/test/parallel/test-zlib-write-after-close.js @@ -31,7 +31,7 @@ zlib.gzip('hello', common.mustCall(function(err, out) { { code: 'ERR_ZLIB_BINDING_CLOSED', type: Error, - message: 'zlib binding closed' + message: 'zlib binding closed', } ); })); diff --git a/test/parallel/test-zlib.js b/test/parallel/test-zlib.js index 1b6855a0b92062..8b6fd10b58f8de 100644 --- a/test/parallel/test-zlib.js +++ b/test/parallel/test-zlib.js @@ -32,7 +32,7 @@ let zlibPairs = [ [zlib.Gzip, zlib.Gunzip], [zlib.Deflate, zlib.Unzip], [zlib.Gzip, zlib.Unzip], - [zlib.DeflateRaw, zlib.InflateRaw] + [zlib.DeflateRaw, zlib.InflateRaw], ]; // how fast to trickle through the slowstream diff --git a/test/pseudo-tty/test-tty-stdout-end.js b/test/pseudo-tty/test-tty-stdout-end.js index 2ec7ca9114db6f..089989a75e13bc 100644 --- a/test/pseudo-tty/test-tty-stdout-end.js +++ b/test/pseudo-tty/test-tty-stdout-end.js @@ -4,7 +4,7 @@ const common = require('../common'); process.on('uncaughtException', common.expectsError({ code: 'ERR_STDOUT_CLOSE', type: Error, - message: 'process.stdout cannot be closed' + message: 'process.stdout cannot be closed', })); process.stdout.end(); diff --git a/test/pummel/test-crypto-dh.js b/test/pummel/test-crypto-dh.js index f64f982c0e1100..fbca9215c0e9dd 100644 --- a/test/pummel/test-crypto-dh.js +++ b/test/pummel/test-crypto-dh.js @@ -62,7 +62,7 @@ const hashes = { modp15: '7bdd39e5cdbb9748113933e5c2623b559c534e74', modp16: 'daea5277a7ad0116e734a8e0d2f297ef759d1161', modp17: '3b62aaf0142c2720f0bf26a9589b0432c00eadc1', - modp18: 'a870b491bbbec9b131ae9878d07449d32e54f160' + modp18: 'a870b491bbbec9b131ae9878d07449d32e54f160', }; for (const name in hashes) { diff --git a/test/pummel/test-hash-seed.js b/test/pummel/test-hash-seed.js index fd59bbe5e0653c..a2fbf9892cd8bc 100644 --- a/test/pummel/test-hash-seed.js +++ b/test/pummel/test-hash-seed.js @@ -11,7 +11,7 @@ const seeds = []; for (let i = 0; i < REPETITIONS; ++i) { const seed = spawnSync(process.execPath, [targetScript], { - encoding: 'utf8' + encoding: 'utf8', }).stdout.trim(); seeds.push(seed); } diff --git a/test/pummel/test-http-many-keep-alive-connections.js b/test/pummel/test-http-many-keep-alive-connections.js index cb9f9946844912..49bd3b5dedff42 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(common.PORT, function connect() { port: common.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 2c1cbf61988ec6..b9d13713321ecc 100644 --- a/test/pummel/test-http-upload-timeout.js +++ b/test/pummel/test-http-upload-timeout.js @@ -52,7 +52,7 @@ server.listen(common.PORT, '127.0.0.1', function() { const request = http.request({ port: common.PORT, method: 'POST', - path: '/' + path: '/', }); function ping() { diff --git a/test/pummel/test-https-ci-reneg-attack.js b/test/pummel/test-https-ci-reneg-attack.js index 9e132b7df9a488..47a436afee1e37 100644 --- a/test/pummel/test-https-ci-reneg-attack.js +++ b/test/pummel/test-https-ci-reneg-attack.js @@ -49,7 +49,7 @@ const LIMITS = [0, 1, 2, 3, 5, 10, 16]; function test(next) { const options = { cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + key: fixtures.readSync('test_key.pem'), }; let seenError = false; diff --git a/test/pummel/test-https-large-response.js b/test/pummel/test-https-large-response.js index d72fd2a65ba877..44c393c62b2fd5 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(common.PORT, common.mustCall(function() { https.get({ port: common.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 ad0b56c1f3c7b1..e49a23b5993c7c 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.readSync('test_key.pem'), - cert: fixtures.readSync('test_cert.pem') + cert: fixtures.readSync('test_cert.pem'), }; const buf = Buffer.allocUnsafe(1024 * 1024); @@ -47,7 +47,7 @@ server.listen(common.PORT, function() { const req = https.request({ method: 'POST', port: common.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 479ec12948175e..794a0509ea6445 100644 --- a/test/pummel/test-keep-alive.js +++ b/test/pummel/test-keep-alive.js @@ -35,7 +35,7 @@ const body = 'hello world\n'; const server = http.createServer(function(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 4021a53736421b..b457fc643213c7 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-ci-reneg-attack.js b/test/pummel/test-tls-ci-reneg-attack.js index dede8ec9db7056..9125eeab51394b 100644 --- a/test/pummel/test-tls-ci-reneg-attack.js +++ b/test/pummel/test-tls-ci-reneg-attack.js @@ -48,7 +48,7 @@ const LIMITS = [0, 1, 2, 3, 5, 10, 16]; function test(next) { const options = { cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + key: fixtures.readSync('test_key.pem'), }; let seenError = false; diff --git a/test/pummel/test-tls-connect-memleak.js b/test/pummel/test-tls-connect-memleak.js index 1ef131d6876ac4..54032a651b97c0 100644 --- a/test/pummel/test-tls-connect-memleak.js +++ b/test/pummel/test-tls-connect-memleak.js @@ -39,7 +39,7 @@ assert.strictEqual( tls.createServer({ cert: fixtures.readSync('test_cert.pem'), - key: fixtures.readSync('test_key.pem') + key: fixtures.readSync('test_key.pem'), }).listen(common.PORT); { diff --git a/test/pummel/test-tls-server-large-request.js b/test/pummel/test-tls-server-large-request.js index 5d3a0615bad6e2..37d1c54653472a 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(common.PORT, common.mustCall(function() { const client1 = tls.connect({ port: common.PORT, - rejectUnauthorized: false + rejectUnauthorized: false, }, common.mustCall(function() { client1.end(request); })); diff --git a/test/pummel/test-tls-session-timeout.js b/test/pummel/test-tls-session-timeout.js index 49c38102fc5c5c..2f805684ea8fcf 100644 --- a/test/pummel/test-tls-session-timeout.js +++ b/test/pummel/test-tls-session-timeout.js @@ -56,7 +56,7 @@ function doTest() { key: key, cert: cert, ca: [cert], - sessionTimeout: SESSION_TIMEOUT + sessionTimeout: SESSION_TIMEOUT, }; // We need to store a sample session ticket in the fixtures directory because @@ -79,10 +79,10 @@ function doTest() { 's_client', '-connect', `localhost:${common.PORT}`, '-sess_in', sessionFileName, - '-sess_out', sessionFileName + '-sess_out', sessionFileName, ]; const client = spawn(common.opensslCli, flags, { - stdio: ['ignore', 'pipe', 'ignore'] + stdio: ['ignore', 'pipe', 'ignore'], }); let clientOutput = ''; diff --git a/test/pummel/test-tls-throttle.js b/test/pummel/test-tls-throttle.js index af588dfa91fb94..2b32a9549a8ee3 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(common.PORT, function() { const client = tls.connect({ port: common.PORT, - rejectUnauthorized: false + rejectUnauthorized: false, }); client.on('data', function(d) { diff --git a/test/sequential/test-benchmark-buffer.js b/test/sequential/test-benchmark-buffer.js index 4eb4415a61dd7f..050551848c271c 100644 --- a/test/sequential/test-benchmark-buffer.js +++ b/test/sequential/test-benchmark-buffer.js @@ -23,6 +23,6 @@ runBenchmark('buffers', 'source=array', 'type=', 'value=0', - 'withTotalLength=0' + 'withTotalLength=0', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/sequential/test-benchmark-http.js b/test/sequential/test-benchmark-http.js index e23a4a1753b00d..8456a6d5b33799 100644 --- a/test/sequential/test-benchmark-http.js +++ b/test/sequential/test-benchmark-http.js @@ -23,9 +23,9 @@ runBenchmark('http', 'method=write', 'n=1', 'res=normal', - 'type=asc' + 'type=asc', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1, - duration: 0 + duration: 0, }); diff --git a/test/sequential/test-benchmark-net.js b/test/sequential/test-benchmark-net.js index 5d3d283fc7903e..575ec597dd38c0 100644 --- a/test/sequential/test-benchmark-net.js +++ b/test/sequential/test-benchmark-net.js @@ -12,6 +12,6 @@ runBenchmark('net', [ 'dur=0', 'len=1024', - 'type=buf' + 'type=buf', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/sequential/test-benchmark-tls.js b/test/sequential/test-benchmark-tls.js index 3545955e3ab5b0..182d3a03b0a23a 100644 --- a/test/sequential/test-benchmark-tls.js +++ b/test/sequential/test-benchmark-tls.js @@ -20,9 +20,9 @@ runBenchmark('tls', 'dur=0.1', 'n=1', 'size=2', - 'type=asc' + 'type=asc', ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1, - duration: 0 + duration: 0, }); diff --git a/test/sequential/test-buffer-creation-regression.js b/test/sequential/test-buffer-creation-regression.js index 8c3a09848c9fa9..4f68dc57f90250 100644 --- a/test/sequential/test-buffer-creation-regression.js +++ b/test/sequential/test-buffer-creation-regression.js @@ -17,7 +17,7 @@ function test(arrayBuffer, offset, length) { const acceptableOOMErrors = [ 'Array buffer allocation failed', - 'Invalid array buffer length' + 'Invalid array buffer length', ]; const length = 1000; diff --git a/test/sequential/test-child-process-execsync.js b/test/sequential/test-child-process-execsync.js index fff5b8e9f0a98b..2eb5fc4404a099 100644 --- a/test/sequential/test-child-process-execsync.js +++ b/test/sequential/test-child-process-execsync.js @@ -84,7 +84,7 @@ assert.strictEqual(ret, `${msg}\n`); const args = [ '-e', - `console.log("${msg}");` + `console.log("${msg}");`, ]; ret = execFileSync(process.execPath, args); @@ -123,7 +123,7 @@ assert.strictEqual(ret, `${msg}\n`); 'signal', 'status', 'stderr', - 'stdout' + 'stdout', ]); assert.throws(() => { diff --git a/test/sequential/test-cluster-inspect-brk.js b/test/sequential/test-cluster-inspect-brk.js index 95c9b3c51177e1..8be8893df0d3c9 100644 --- a/test/sequential/test-cluster-inspect-brk.js +++ b/test/sequential/test-cluster-inspect-brk.js @@ -14,7 +14,7 @@ if (cluster.isMaster) { cluster.setupMaster({ execArgv: execArgv, - stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe'] + stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe'], }); const worker = cluster.fork(); diff --git a/test/sequential/test-crypto-timing-safe-equal.js b/test/sequential/test-crypto-timing-safe-equal.js index 08cfc04755d638..7dc943d3e60333 100644 --- a/test/sequential/test-crypto-timing-safe-equal.js +++ b/test/sequential/test-crypto-timing-safe-equal.js @@ -23,7 +23,7 @@ common.expectsError( { code: 'ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH', type: RangeError, - message: 'Input buffers must have the same length' + message: 'Input buffers must have the same length', } ); @@ -33,7 +33,7 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "a" argument must be one of type Buffer, TypedArray, or DataView' + 'The "a" argument must be one of type Buffer, TypedArray, or DataView', } ); @@ -43,6 +43,6 @@ common.expectsError( code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: - 'The "b" argument must be one of type Buffer, TypedArray, or DataView' + 'The "b" argument must be one of type Buffer, TypedArray, or DataView', } ); diff --git a/test/sequential/test-debugger-repeat-last.js b/test/sequential/test-debugger-repeat-last.js index 42638e5d2ebf12..5bdcc7dc8c8642 100644 --- a/test/sequential/test-debugger-repeat-last.js +++ b/test/sequential/test-debugger-repeat-last.js @@ -9,7 +9,7 @@ const fixture = path('debugger-repeat-last.js'); const args = [ 'inspect', `--port=${common.PORT}`, - fixture + fixture, ]; const proc = spawn(process.execPath, args, { stdio: 'pipe' }); diff --git a/test/sequential/test-fs-readfile-tostring-fail.js b/test/sequential/test-fs-readfile-tostring-fail.js index 88cf7347efbfdf..65fee542423c4d 100644 --- a/test/sequential/test-fs-readfile-tostring-fail.js +++ b/test/sequential/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', }); const size = kStringMaxLength / 200; 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 53d67b24797770..8f8b7e1378e3dc 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-server-consumed-timeout.js b/test/sequential/test-http-server-consumed-timeout.js index 56217226503be1..d98618ad0191de 100644 --- a/test/sequential/test-http-server-consumed-timeout.js +++ b/test/sequential/test-http-server-consumed-timeout.js @@ -30,7 +30,7 @@ const server = http.createServer((req, res) => { server.listen(0, common.mustCall(() => { const req = http.request({ port: server.address().port, - method: 'POST' + method: 'POST', }, (res) => { const interval = setInterval(() => { intervalWasInvoked = true; 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 d6d3bf935db801..6a07356d8b84dc 100644 --- a/test/sequential/test-http2-max-session-memory.js +++ b/test/sequential/test-http2-max-session-memory.js @@ -30,7 +30,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', type: 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-ping-flood.js b/test/sequential/test-http2-ping-flood.js index 5b47d51be9c5a8..f2a69f32611646 100644 --- a/test/sequential/test-http2-ping-flood.js +++ b/test/sequential/test-http2-ping-flood.js @@ -20,7 +20,7 @@ server.on('session', common.mustCall((session) => { session.on('error', common.expectsError({ code: 'ERR_HTTP2_ERROR', message: - 'Flooding was detected in this HTTP/2 session, and it must be closed' + 'Flooding was detected in this HTTP/2 session, and it must be closed', })); session.on('close', common.mustCall(() => { server.close(); diff --git a/test/sequential/test-http2-settings-flood.js b/test/sequential/test-http2-settings-flood.js index bad4cec9a8d509..b2bf4d7ca97c8b 100644 --- a/test/sequential/test-http2-settings-flood.js +++ b/test/sequential/test-http2-settings-flood.js @@ -19,7 +19,7 @@ server.on('session', common.mustCall((session) => { session.on('error', common.expectsError({ code: 'ERR_HTTP2_ERROR', message: - 'Flooding was detected in this HTTP/2 session, and it must be closed' + 'Flooding was detected in this HTTP/2 session, and it must be closed', })); session.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 910e7a0fc497bd..3ada05d0e2c374 100644 --- a/test/sequential/test-http2-timeout-large-write-file.js +++ b/test/sequential/test-http2-timeout-large-write-file.js @@ -36,13 +36,13 @@ const fd = fs.openSync(filepath, 'r'); 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 a15fb46af6d28a..d28f09ddb0df78 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-keep-alive-large-write.js b/test/sequential/test-https-keep-alive-large-write.js index 79381ba8735756..dec89936ce8309 100644 --- a/test/sequential/test-https-keep-alive-large-write.js +++ b/test/sequential/test-https-keep-alive-large-write.js @@ -14,14 +14,14 @@ let socket; const server = https.createServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }, common.mustCall((req, res) => { const content = Buffer.alloc(writeSize, 0x44); 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.listen(0, common.mustCall(() => { https.get({ path: '/', port: server.address().port, - rejectUnauthorized: false + rejectUnauthorized: false, }, (res) => { res.once('data', () => { socket._onTimeout(); diff --git a/test/sequential/test-https-server-keep-alive-timeout.js b/test/sequential/test-https-server-keep-alive-timeout.js index 3c18d325c15b93..f67214660b4015 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-async-hook-setup-at-inspect-brk.js b/test/sequential/test-inspector-async-hook-setup-at-inspect-brk.js index e0c3b4dcb86e37..1867a36f80484a 100644 --- a/test/sequential/test-inspector-async-hook-setup-at-inspect-brk.js +++ b/test/sequential/test-inspector-async-hook-setup-at-inspect-brk.js @@ -39,7 +39,7 @@ async function runTests() { 'params': { 'maxDepth': 10 } }, { 'method': 'Debugger.setBlackboxPatterns', 'params': { 'patterns': [] } }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]); await skipBreakpointAtStart(session); await checkAsyncStackTrace(session); diff --git a/test/sequential/test-inspector-async-hook-setup-at-signal.js b/test/sequential/test-inspector-async-hook-setup-at-signal.js index e0b87b0ebb162c..3eedecb741a90f 100644 --- a/test/sequential/test-inspector-async-hook-setup-at-signal.js +++ b/test/sequential/test-inspector-async-hook-setup-at-signal.js @@ -43,7 +43,7 @@ async function setupTimeoutForStackTrace(session) { await session.send([ { 'method': 'Runtime.evaluate', 'params': { expression: 'setupTimeoutWithBreak()' } }, - { 'method': 'Debugger.resume' } + { 'method': 'Debugger.resume' }, ]); } @@ -67,7 +67,7 @@ async function runTests() { 'params': { 'maxDepth': 10 } }, { 'method': 'Debugger.setBlackboxPatterns', 'params': { 'patterns': [] } }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]); await waitForInitialSetup(session); diff --git a/test/sequential/test-inspector-async-stack-traces-promise-then.js b/test/sequential/test-inspector-async-stack-traces-promise-then.js index e803be7167f592..2c2d4e8d232b6d 100644 --- a/test/sequential/test-inspector-async-stack-traces-promise-then.js +++ b/test/sequential/test-inspector-async-stack-traces-promise-then.js @@ -29,7 +29,7 @@ async function runTests() { 'params': { 'maxDepth': 10 } }, { 'method': 'Debugger.setBlackboxPatterns', 'params': { 'patterns': [] } }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]); await session.waitForBreakOnLine(0, '[eval]'); diff --git a/test/sequential/test-inspector-async-stack-traces-set-interval.js b/test/sequential/test-inspector-async-stack-traces-set-interval.js index 326032d40b20e6..51448df5384281 100644 --- a/test/sequential/test-inspector-async-stack-traces-set-interval.js +++ b/test/sequential/test-inspector-async-stack-traces-set-interval.js @@ -35,7 +35,7 @@ async function runTests() { 'params': { 'maxDepth': 10 } }, { 'method': 'Debugger.setBlackboxPatterns', 'params': { 'patterns': [] } }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]); await skipFirstBreakpoint(session); diff --git a/test/sequential/test-inspector-bindings.js b/test/sequential/test-inspector-bindings.js index bf97d8b5124e86..ca62880902ba54 100644 --- a/test/sequential/test-inspector-bindings.js +++ b/test/sequential/test-inspector-bindings.js @@ -22,7 +22,7 @@ function checkScope(session, scopeId) { 'objectId': scopeId, 'ownProperties': false, 'accessorPropertiesOnly': false, - 'generatePreview': true + 'generatePreview': true, }, scopeCallback); } @@ -60,7 +60,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++; @@ -96,7 +96,7 @@ function testSampleDebugSession() { 'lineNumber': 12, 'url': path.resolve(__dirname, __filename), 'columnNumber': 0, - 'condition': '' + 'condition': '', }); debuggedFunction(); diff --git a/test/sequential/test-inspector-break-e.js b/test/sequential/test-inspector-break-e.js index 8db403ad2cd0d0..7a396e7132af66 100644 --- a/test/sequential/test-inspector-break-e.js +++ b/test/sequential/test-inspector-break-e.js @@ -14,7 +14,7 @@ async function runTests() { await session.send([ { 'method': 'Runtime.enable' }, { 'method': 'Debugger.enable' }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]); await session.waitForBreakOnLine(0, '[eval]'); await session.runToCompletion(); diff --git a/test/sequential/test-inspector-break-when-eval.js b/test/sequential/test-inspector-break-when-eval.js index b14e01a30185ed..d110db5bb39f98 100644 --- a/test/sequential/test-inspector-break-when-eval.js +++ b/test/sequential/test-inspector-break-when-eval.js @@ -28,8 +28,8 @@ async function breakOnLine(session) { 'params': { 'lineNumber': 9, 'url': script, 'columnNumber': 0, - 'condition': '' - } + 'condition': '', + }, }, { 'method': 'Runtime.evaluate', 'params': { 'expression': 'sum()', @@ -40,9 +40,9 @@ async function breakOnLine(session) { 'returnByValue': false, 'generatePreview': true, 'userGesture': true, - 'awaitPromise': false - } - } + 'awaitPromise': false, + }, + }, ]; session.send(commands); await session.waitForBreakOnLine(9, script); diff --git a/test/sequential/test-inspector-contexts.js b/test/sequential/test-inspector-contexts.js index fb59e9dee14892..f04b6d74df4a7c 100644 --- a/test/sequential/test-inspector-contexts.js +++ b/test/sequential/test-inspector-contexts.js @@ -78,7 +78,7 @@ async function testContextCreatedAndDestroyed() { 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-debug-brk-flag.js b/test/sequential/test-inspector-debug-brk-flag.js index 61eb4f97c655dc..cc512576a832f0 100644 --- a/test/sequential/test-inspector-debug-brk-flag.js +++ b/test/sequential/test-inspector-debug-brk-flag.js @@ -20,7 +20,7 @@ async function testBreakpointOnStart(session) { 'params': { 'interval': 100 } }, { 'method': 'Debugger.setBlackboxPatterns', 'params': { 'patterns': [] } }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]; session.send(commands); diff --git a/test/sequential/test-inspector-exception.js b/test/sequential/test-inspector-exception.js index 3f83b37c7265a8..abff5d8761affa 100644 --- a/test/sequential/test-inspector-exception.js +++ b/test/sequential/test-inspector-exception.js @@ -25,7 +25,7 @@ async function testBreakpointOnStart(session) { 'params': { 'interval': 100 } }, { 'method': 'Debugger.setBlackboxPatterns', 'params': { 'patterns': [] } }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]; await session.send(commands); diff --git a/test/sequential/test-inspector-module.js b/test/sequential/test-inspector-module.js index f97d71297971f7..9ab923eb11b3a6 100644 --- a/test/sequential/test-inspector-module.js +++ b/test/sequential/test-inspector-module.js @@ -13,7 +13,7 @@ common.expectsError( { code: 'ERR_INSPECTOR_NOT_CONNECTED', type: Error, - message: 'Session is not connected' + message: 'Session is not connected', } ); @@ -28,7 +28,7 @@ session.post('Runtime.evaluate', { expression: '2 + 2' }); type: TypeError, message: 'The "method" argument must be of type string. ' + - `Received type ${typeof i}` + `Received type ${typeof i}`, } ); }); @@ -41,7 +41,7 @@ session.post('Runtime.evaluate', { expression: '2 + 2' }); type: TypeError, message: 'The "params" argument must be of type Object. ' + - `Received type ${typeof i}` + `Received type ${typeof i}`, } ); }); @@ -51,7 +51,7 @@ common.expectsError( { code: 'ERR_INSPECTOR_ALREADY_CONNECTED', type: Error, - message: 'The inspector is already connected' + message: 'The inspector is already connected', } ); diff --git a/test/sequential/test-inspector-not-blocked-on-idle.js b/test/sequential/test-inspector-not-blocked-on-idle.js index 3b1befe35df199..d1e7ae8aa4e577 100644 --- a/test/sequential/test-inspector-not-blocked-on-idle.js +++ b/test/sequential/test-inspector-not-blocked-on-idle.js @@ -12,7 +12,7 @@ async function runTests() { const session = await node.connectInspectorSession(); await session.send([ { 'method': 'Debugger.enable' }, - { 'method': 'Debugger.pause' } + { 'method': 'Debugger.pause' }, ]); session.disconnect(); node.kill(); diff --git a/test/sequential/test-inspector-port-cluster.js b/test/sequential/test-inspector-port-cluster.js index 87469aa7ff77c5..6198c6cdbcb21c 100644 --- a/test/sequential/test-inspector-port-cluster.js +++ b/test/sequential/test-inspector-port-cluster.js @@ -21,7 +21,7 @@ let offset = 0; function testRunnerMain() { let defaultPortCase = spawnMaster({ execArgv: ['--inspect'], - workers: [{ expectedPort: 9230 }] + workers: [{ expectedPort: 9230 }], }); spawnMaster({ @@ -30,8 +30,8 @@ function testRunnerMain() { { expectedPort: 65535 }, { expectedPort: 1024 }, { expectedPort: 1025 }, - { expectedPort: 1026 } - ] + { expectedPort: 1026 }, + ], }); let port = debuggerPort + offset++ * 5; @@ -41,36 +41,36 @@ function testRunnerMain() { workers: [ { expectedPort: port + 1 }, { expectedPort: port + 2 }, - { expectedPort: port + 3 } - ] + { expectedPort: port + 3 }, + ], }); port = debuggerPort + offset++ * 5; spawnMaster({ execArgv: ['--inspect', `--inspect-port=${port}`], - workers: [{ expectedPort: port + 1 }] + workers: [{ expectedPort: port + 1 }], }); port = debuggerPort + offset++ * 5; spawnMaster({ execArgv: ['--inspect', `--debug-port=${port}`], - workers: [{ expectedPort: port + 1 }] + workers: [{ expectedPort: port + 1 }], }); port = debuggerPort + offset++ * 5; spawnMaster({ 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; spawnMaster({ 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) { @@ -78,14 +78,14 @@ function testRunnerMain() { spawnMaster({ execArgv: [`--inspect=[::]:${port}`], - workers: [{ expectedPort: port + 1, expectedHost: '::' }] + workers: [{ expectedPort: port + 1, expectedHost: '::' }], }); port = debuggerPort + offset++ * 5; spawnMaster({ execArgv: [`--inspect=[::1]:${port}`], - workers: [{ expectedPort: port + 1, expectedHost: '::1' }] + workers: [{ expectedPort: port + 1, expectedHost: '::1' }], }); } @@ -97,7 +97,7 @@ function testRunnerMain() { spawnMaster({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: port + 2 }, - workers: [{ expectedPort: port + 2 }] + workers: [{ expectedPort: port + 2 }], }); port = debuggerPort + offset++ * 5; @@ -107,8 +107,8 @@ function testRunnerMain() { clusterSettings: { inspectPort: 'addTwo' }, workers: [ { expectedPort: port + 2 }, - { expectedPort: port + 4 } - ] + { expectedPort: port + 4 }, + ], }); port = debuggerPort + offset++ * 5; @@ -116,7 +116,7 @@ function testRunnerMain() { spawnMaster({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'string' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -124,7 +124,7 @@ function testRunnerMain() { spawnMaster({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'null' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -132,7 +132,7 @@ function testRunnerMain() { spawnMaster({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'bignumber' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -140,7 +140,7 @@ function testRunnerMain() { spawnMaster({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'negativenumber' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -148,7 +148,7 @@ function testRunnerMain() { spawnMaster({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'bignumberfunc' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -156,7 +156,7 @@ function testRunnerMain() { spawnMaster({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'strfunc' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -165,8 +165,8 @@ function testRunnerMain() { execArgv: [], clusterSettings: { inspectPort: port, execArgv: ['--inspect'] }, workers: [ - { expectedPort: port } - ] + { expectedPort: port }, + ], }); port = debuggerPort + offset++ * 5; @@ -177,8 +177,8 @@ function testRunnerMain() { workers: [ { expectedInitialPort: 0 }, { expectedInitialPort: 0 }, - { expectedInitialPort: 0 } - ] + { expectedInitialPort: 0 }, + ], }); port = debuggerPort + offset++ * 5; @@ -189,8 +189,8 @@ function testRunnerMain() { workers: [ { expectedInitialPort: 0 }, { expectedInitialPort: 0 }, - { expectedInitialPort: 0 } - ] + { expectedInitialPort: 0 }, + ], }); defaultPortCase.then(() => { @@ -199,8 +199,8 @@ function testRunnerMain() { execArgv: ['--inspect'], clusterSettings: { inspectPort: port + 2 }, workers: [ - { expectedInitialPort: port + 2 } - ] + { expectedInitialPort: port + 2 }, + ], }); }); } @@ -325,9 +325,9 @@ function spawnMaster({ execArgv, workers, clusterSettings = {} }) { env: Object.assign({}, process.env, { workers: JSON.stringify(workers), clusterSettings: JSON.stringify(clusterSettings), - testProcess: true + testProcess: true, }), - execArgv + execArgv, }).on('exit', common.mustCall((code, signal) => { checkExitCode(code, signal); resolve(); diff --git a/test/sequential/test-inspector-scriptparsed-context.js b/test/sequential/test-inspector-scriptparsed-context.js index abffbfe5fc67f2..5b11d42a835ecd 100644 --- a/test/sequential/test-inspector-scriptparsed-context.js +++ b/test/sequential/test-inspector-scriptparsed-context.js @@ -60,7 +60,7 @@ async function runTests() { const session = await instance.connectInspectorSession(); await session.send([ { 'method': 'Debugger.enable' }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]); await session.waitForBreakOnLine(0, '[eval]'); diff --git a/test/sequential/test-inspector.js b/test/sequential/test-inspector.js index 23b4dcb9618a44..954e23b2cee86b 100644 --- a/test/sequential/test-inspector.js +++ b/test/sequential/test-inspector.js @@ -70,7 +70,7 @@ async function testBreakpointOnStart(session) { 'params': { 'interval': 100 } }, { 'method': 'Debugger.setBlackboxPatterns', 'params': { 'patterns': [] } }, - { 'method': 'Runtime.runIfWaitingForDebugger' } + { 'method': 'Runtime.runIfWaitingForDebugger' }, ]; await session.send(commands); @@ -84,8 +84,8 @@ async function testBreakpoint(session) { 'params': { 'lineNumber': 5, 'url': session.scriptPath(), 'columnNumber': 0, - 'condition': '' - } + 'condition': '', + }, }, { 'method': 'Debugger.resume' }, ]; @@ -107,8 +107,8 @@ async function testBreakpoint(session) { 'objectId': scopeId, 'ownProperties': false, 'accessorPropertiesOnly': false, - 'generatePreview': true - } + 'generatePreview': true, + }, }); assertScopeValues(response, { t: 1001, k: 1 }); @@ -120,16 +120,16 @@ async function testBreakpoint(session) { 'includeCommandLineAPI': true, 'silent': false, 'returnByValue': false, - 'generatePreview': true - } + 'generatePreview': true, + }, }); assert.strictEqual(1002, result.value); result = (await session.send({ 'method': 'Runtime.evaluate', 'params': { - 'expression': '5 * 5' - } + 'expression': '5 * 5', + }, })).result; assert.strictEqual(25, result.value); } @@ -145,8 +145,8 @@ async function testI18NCharacters(session) { 'includeCommandLineAPI': true, 'silent': false, 'returnByValue': false, - 'generatePreview': true - } + 'generatePreview': true, + }, }); await session.waitForConsoleOutput('log', [chars]); } @@ -164,8 +164,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); @@ -177,10 +177,10 @@ async function testCommandLineAPI(session) { 'expression': [ 'typeof require.resolve === "function"', 'typeof require.extensions === "object"', - 'typeof require.cache === "object"' + 'typeof require.cache === "object"', ].join(' && '), - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.strictEqual(result.result.value, true); @@ -195,8 +195,8 @@ async function testCommandLineAPI(session) { require(${testModuleStr}), { old: 'yes' } ) === require(${testModuleStr})`, - 'includeCommandLineAPI': true - } + 'includeCommandLineAPI': true, + }, }); checkException(result); assert.strictEqual(result.result.value, true); @@ -207,8 +207,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), @@ -218,8 +218,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); @@ -228,8 +228,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), {}); @@ -238,8 +238,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), {}); @@ -253,13 +253,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( @@ -270,8 +270,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 7bc8428fac5939..066bf0b240ea30 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -157,7 +157,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', }; }; @@ -226,7 +226,7 @@ try { assert.deepStrictEqual(json, { name: 'package-name', version: '1.2.3', - main: 'package-main-module' + main: 'package-main-module', }); } @@ -249,21 +249,21 @@ try { assert.deepStrictEqual(children, { 'common/index.js': { 'common/fixtures.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': {}, @@ -271,13 +271,13 @@ try { 'fixtures/packages/main/package-main-module.js': {}, 'fixtures/packages/main-index/package-main-module/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/throws_error.js': {}, @@ -296,10 +296,10 @@ try { '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 205ff872cd8090..10ccf0b0578e89 100644 --- a/test/sequential/test-net-connect-local-error.js +++ b/test/sequential/test-net-connect-local-error.js @@ -9,7 +9,7 @@ const expectedErrorCodes = ['ECONNREFUSED', 'EADDRINUSE']; const client = net.connect({ port: common.PORT, localPort: common.PORT + 1, - localAddress: common.localhostIPv4 + localAddress: common.localhostIPv4, }); client.on('error', common.mustCall(function onError(err) { diff --git a/test/sequential/test-net-listen-shared-ports.js b/test/sequential/test-net-listen-shared-ports.js index be33821bf6518c..b457f4d1209585 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.isMaster) { 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 8bc323510a4da6..fc2fdd57593d11 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-pipe.js b/test/sequential/test-pipe.js index bc2084295d738d..190da83df56047 100644 --- a/test/sequential/test-pipe.js +++ b/test/sequential/test-pipe.js @@ -99,7 +99,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-regress-GH-1726.js b/test/sequential/test-regress-GH-1726.js index 1291dec261ccf6..0f502103d16608 100644 --- a/test/sequential/test-regress-GH-1726.js +++ b/test/sequential/test-regress-GH-1726.js @@ -39,7 +39,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-regress-GH-784.js b/test/sequential/test-regress-GH-784.js index 4b285020d45a35..ff295144e58992 100644 --- a/test/sequential/test-regress-GH-784.js +++ b/test/sequential/test-regress-GH-784.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-regress-GH-877.js b/test/sequential/test-regress-GH-877.js index c717c2dd74f444..cb40c54e805182 100644 --- a/test/sequential/test-regress-GH-877.js +++ b/test/sequential/test-regress-GH-877.js @@ -42,7 +42,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-repl-timeout-throw.js b/test/sequential/test-repl-timeout-throw.js index 3636b93ddfc2b2..642cd0ed7a9f48 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 2f1fb32323bdcb..ab87c896dc5c77 100644 --- a/test/sequential/test-tls-connect.js +++ b/test/sequential/test-tls-connect.js @@ -54,7 +54,7 @@ const tls = require('tls'); cert: cert, key: key, port: common.PORT, - ciphers: 'rick-128-roll' + ciphers: 'rick-128-roll', }, common.mustNotCall()); conn.on( diff --git a/test/sequential/test-tls-lookup.js b/test/sequential/test-tls-lookup.js index 568ba1350675e1..84519a1f11089b 100644 --- a/test/sequential/test-tls-lookup.js +++ b/test/sequential/test-tls-lookup.js @@ -9,14 +9,14 @@ const tls = require('tls'); const opts = { host: 'localhost', port: common.PORT, - lookup: input + lookup: input, }; common.expectsError(function() { tls.connect(opts); }, { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError + type: TypeError, }); }); @@ -26,7 +26,7 @@ function connectDoesNotThrow(input) { const opts = { host: 'localhost', port: common.PORT, - lookup: input + lookup: input, }; tls.connect(opts); diff --git a/test/sequential/test-util-debug.js b/test/sequential/test-util-debug.js index c79f99ff283c28..dc576ae32bc92b 100644 --- a/test/sequential/test-util-debug.js +++ b/test/sequential/test-util-debug.js @@ -60,7 +60,7 @@ function test(environ, shouldWrite, section) { const spawn = require('child_process').spawn; const child = spawn(process.execPath, [__filename, 'child', section], { - env: Object.assign(process.env, { NODE_DEBUG: environ }) + env: Object.assign(process.env, { NODE_DEBUG: environ }), }); if (shouldWrite) { diff --git a/test/tick-processor/test-tick-processor-builtin.js b/test/tick-processor/test-tick-processor-builtin.js index 3d4e1b9d236030..88ce8b808f7a5d 100644 --- a/test/tick-processor/test-tick-processor-builtin.js +++ b/test/tick-processor/test-tick-processor-builtin.js @@ -16,5 +16,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 26daf60aa3c1ce..88069dec91506b 100644 --- a/test/tick-processor/test-tick-processor-cpp-core.js +++ b/test/tick-processor/test-tick-processor-cpp-core.js @@ -16,5 +16,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 3348b6f11b2e67..9cabc8d2eb7a31 100644 --- a/test/tick-processor/test-tick-processor-polyfill-brokenfile.js +++ b/test/tick-processor/test-tick-processor-polyfill-brokenfile.js @@ -36,9 +36,9 @@ const proc = cp.spawn(process.execPath, [ '--no_logfile_per_isolate', '--logfile=-', '--prof', - '-pe', code + '-pe', code, ], { - stdio: ['ignore', 'pipe', 'inherit'] + stdio: ['ignore', 'pipe', 'inherit'], }); let ticks = ''; @@ -52,7 +52,7 @@ function runPolyfill(content) { const child = cp.spawnSync( `${process.execPath}`, [ - '--prof-process', LOG_FILE + '--prof-process', LOG_FILE, ]); assert(WARN_REG_EXP.test(child.stderr.toString())); assert(WARN_DETAIL_REG_EXP.test(child.stderr.toString())); diff --git a/test/tick-processor/test-tick-processor-preprocess-flag.js b/test/tick-processor/test-tick-processor-preprocess-flag.js index 93367361aceea3..8c1e3fbaa2243a 100644 --- a/test/tick-processor/test-tick-processor-preprocess-flag.js +++ b/test/tick-processor/test-tick-processor-preprocess-flag.js @@ -17,5 +17,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 182f8c957c820a..c3257f738a0c44 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 33944655258bef..91307d16928889 100644 --- a/test/tick-processor/tick-processor-base.js +++ b/test/tick-processor/tick-processor-base.js @@ -15,9 +15,9 @@ function runTest(test) { '--no_logfile_per_isolate', '--logfile=-', '--prof', - '-pe', test.code + '-pe', test.code, ], { - stdio: [ 'ignore', 'pipe', 'inherit' ] + stdio: [ 'ignore', 'pipe', 'inherit' ], }); let ticks = ''; @@ -37,9 +37,9 @@ function match(pattern, parent, ticks, flags = []) { '--prof-process', '--call-graph-size=10', ...flags, - LOG_FILE + LOG_FILE, ], { - stdio: [ 'ignore', 'pipe', 'inherit' ] + stdio: [ 'ignore', 'pipe', 'inherit' ], }); let out = ''; diff --git a/tools/doc/addon-verify.js b/tools/doc/addon-verify.js index 2e72abb77f925f..87b5bd876bc49d 100644 --- a/tools/doc/addon-verify.js +++ b/tools/doc/addon-verify.js @@ -19,7 +19,7 @@ tokens.forEach((token) => { if (token.type === 'heading' && token.text) { currentHeader = token.text; addons[currentHeader] = { - files: {} + files: {}, }; } if (token.type === 'code') { @@ -75,7 +75,7 @@ ${files[name].replace( return { path: path.resolve(dir, name), name: name, - content: files[name] + content: files[name], }; }); @@ -88,10 +88,10 @@ ${files[name].replace( defines: [ 'V8_DEPRECATION_WARNINGS=1' ], sources: files.map(function(file) { return file.name; - }) - } - ] - }) + }), + }, + ], + }), }); fs.mkdir(dir, function() { diff --git a/tools/doc/html.js b/tools/doc/html.js index f2e7ed396b7cc4..7af648b2db1aa4 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -39,7 +39,7 @@ renderer.heading = function(text, level) { return `${text}\n`; }; marked.setOptions({ - renderer: renderer + renderer: renderer, }); // TODO(chrisdickinson): never stop vomitting / fix this. @@ -216,7 +216,7 @@ function altDocs(filename) { { num: '5.x' }, { num: '4.x', lts: true }, { num: '0.12.x' }, - { num: '0.10.x' } + { num: '0.10.x' }, ]; const host = 'https://nodejs.org'; diff --git a/tools/doc/json.js b/tools/doc/json.js index 2966e4c3d91916..50f49479eb71e4 100644 --- a/tools/doc/json.js +++ b/tools/doc/json.js @@ -35,7 +35,7 @@ renderer.heading = function(text, level) { return `${text}\n`; }; marked.setOptions({ - renderer: renderer + renderer: renderer, }); function doJSON(input, filename, cb) { diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 1a7698ad6a3c5d..9db1100e017cb3 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 jsGlobalTypes = [ 'Array', 'ArrayBuffer', 'AsyncFunction', 'DataView', 'Date', 'Error', @@ -19,7 +19,7 @@ const jsGlobalTypes = [ 'Promise', 'Proxy', 'RangeError', 'ReferenceError', 'RegExp', 'Set', 'SharedArrayBuffer', 'SyntaxError', 'TypeError', 'TypedArray', 'URIError', 'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray', 'WeakMap', - 'WeakSet' + 'WeakSet', ]; const typeMap = { 'Iterable': @@ -91,7 +91,7 @@ const typeMap = { 'tls.TLSSocket': 'tls.html#tls_class_tls_tlssocket', 'URL': 'url.html#url_the_whatwg_url_api', - 'URLSearchParams': 'url.html#url_class_urlsearchparams' + 'URLSearchParams': 'url.html#url_class_urlsearchparams', }; const arrayPart = /(?:\[])+$/; @@ -132,5 +132,5 @@ module.exports = { }); return typeLinks.length ? typeLinks.join(' | ') : typeInput; - } + }, }; 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/buffer-constructor.js b/tools/eslint-rules/buffer-constructor.js index 412fdaa934664b..a9f4d2c0e359b3 100644 --- a/tools/eslint-rules/buffer-constructor.js +++ b/tools/eslint-rules/buffer-constructor.js @@ -15,6 +15,6 @@ const astSelector = 'NewExpression[callee.name="Buffer"],' + module.exports = function(context) { return { - [astSelector]: (node) => context.report(node, msg) + [astSelector]: (node) => context.report(node, msg), }; }; diff --git a/tools/eslint-rules/crypto-check.js b/tools/eslint-rules/crypto-check.js index 42b17b0c80a225..3b4f2ed0126faa 100644 --- a/tools/eslint-rules/crypto-check.js +++ b/tools/eslint-rules/crypto-check.js @@ -92,7 +92,7 @@ module.exports = function(context) { '}' ); } - } + }, }); }); } @@ -101,6 +101,6 @@ module.exports = function(context) { 'CallExpression': (node) => testCryptoUsage(node), 'IfStatement:exit': (node) => testIfStatement(node), 'MemberExpression:exit': (node) => testMemberExpression(node), - 'Program:exit': (node) => reportIfMissingCheck(node) + 'Program:exit': (node) => reportIfMissingCheck(node), }; }; diff --git a/tools/eslint-rules/documented-errors.js b/tools/eslint-rules/documented-errors.js index 0dbabb0673aa4b..df4eee79550a51 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/inspector-check.js b/tools/eslint-rules/inspector-check.js index 00a2dd02963558..ba3b60305fa723 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,6 +56,6 @@ module.exports = function(context) { return { 'CallExpression': (node) => testInspectorUsage(context, node), 'MemberExpression': (node) => checkMemberExpression(context, node), - 'Program:exit': (node) => reportIfMissing(context, node) + 'Program:exit': (node) => reportIfMissing(context, node), }; }; diff --git a/tools/eslint-rules/lowercase-name-for-primitive.js b/tools/eslint-rules/lowercase-name-for-primitive.js index d3a5243c37895f..195be1137e9063 100644 --- a/tools/eslint-rules/lowercase-name-for-primitive.js +++ b/tools/eslint-rules/lowercase-name-for-primitive.js @@ -13,7 +13,7 @@ const astSelector = 'NewExpression[callee.property.name="TypeError"]' + '[arguments.0.value="ERR_INVALID_ARG_TYPE"]'; const primitives = [ - 'number', 'string', 'boolean', 'null', 'undefined' + 'number', 'string', 'boolean', 'null', 'undefined', ]; module.exports = function(context) { @@ -45,13 +45,13 @@ module.exports = function(context) { node, `'${lowercaseName}'` ); - } + }, }); } } return { - [astSelector]: (node) => checkNamesArgument(node) + [astSelector]: (node) => checkNamesArgument(node), }; }; diff --git a/tools/eslint-rules/no-let-in-for-declaration.js b/tools/eslint-rules/no-let-in-for-declaration.js index 1ae49a48dee8a2..6ebaa085ecb288 100644 --- a/tools/eslint-rules/no-let-in-for-declaration.js +++ b/tools/eslint-rules/no-let-in-for-declaration.js @@ -26,7 +26,7 @@ module.exports = { node, message, fix: (fixer) => - fixer.replaceText(sourceCode.getFirstToken(node), 'var') + fixer.replaceText(sourceCode.getFirstToken(node), 'var'), }); } @@ -34,5 +34,5 @@ module.exports = { [forSelector]: (node) => report(node.init), [forInOfSelector]: (node) => report(node.left), }; - } + }, }; diff --git a/tools/eslint-rules/no-unescaped-regexp-dot.js b/tools/eslint-rules/no-unescaped-regexp-dot.js index d0c575071297fb..71122de7d71bde 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 e67aac7cd91e82..a66661e06e4516 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) => { @@ -51,11 +51,11 @@ module.exports = (context) => { node, suggestion ? `${suggestion}` : '' ); - } + }, }); }; return { - Program: (node) => reportIfError(node, context.getSourceCode()) + Program: (node) => reportIfError(node, context.getSourceCode()), }; }; diff --git a/tools/eslint-rules/number-isnan.js b/tools/eslint-rules/number-isnan.js index 885c38be8b2384..67336cd4d04608 100644 --- a/tools/eslint-rules/number-isnan.js +++ b/tools/eslint-rules/number-isnan.js @@ -9,6 +9,6 @@ module.exports = function(context) { } return { - [astSelector]: report + [astSelector]: report, }; }; diff --git a/tools/eslint-rules/prefer-assert-iferror.js b/tools/eslint-rules/prefer-assert-iferror.js index 399ee7403a6c88..c25fd84554f3ca 100644 --- a/tools/eslint-rules/prefer-assert-iferror.js +++ b/tools/eslint-rules/prefer-assert-iferror.js @@ -52,10 +52,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 2917d40de40810..0b7be985f3aff7 100644 --- a/tools/eslint-rules/prefer-assert-methods.js +++ b/tools/eslint-rules/prefer-assert-methods.js @@ -16,7 +16,7 @@ const preferedAssertMethod = { '===': 'strictEqual', '!==': 'notStrictEqual', '==': 'equal', - '!=': 'notEqual' + '!=': 'notEqual', }; module.exports = function(context) { @@ -36,9 +36,9 @@ module.exports = function(context) { node, `assert.${assertMethod}(${left}, ${right});` ); - } + }, }); } - } + }, }; }; diff --git a/tools/eslint-rules/prefer-common-expectserror.js b/tools/eslint-rules/prefer-common-expectserror.js index f33241697a68ef..1c7c25c499fc00 100644 --- a/tools/eslint-rules/prefer-common-expectserror.js +++ b/tools/eslint-rules/prefer-common-expectserror.js @@ -16,6 +16,6 @@ const astSelector = module.exports = function(context) { return { - [astSelector]: (node) => context.report(node, msg) + [astSelector]: (node) => context.report(node, msg), }; }; 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-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-buffer.js b/tools/eslint-rules/require-buffer.js index c6040b43a181fb..53da5debc626ea 100644 --- a/tools/eslint-rules/require-buffer.js +++ b/tools/eslint-rules/require-buffer.js @@ -19,7 +19,7 @@ module.exports = function(context) { const rangeNeedle = hasUseStrict ? useStrict.lastIndex : firstLOC; return fixer.insertTextBeforeRange([rangeNeedle], BUFFER_REQUIRE); - } + }, }); } @@ -30,6 +30,6 @@ module.exports = function(context) { if (variable) { variable.references.forEach(flagIt); } - } + }, }; }; diff --git a/tools/eslint-rules/required-modules.js b/tools/eslint-rules/required-modules.js index 948c46c036d99d..d1194dc452d20a 100644 --- a/tools/eslint-rules/required-modules.js +++ b/tools/eslint-rules/required-modules.js @@ -83,7 +83,7 @@ module.exports = function(context) { ); }); } - } + }, }; if (isESM) { @@ -111,7 +111,7 @@ module.exports = function(context) { module.exports.schema = { 'type': 'array', 'additionalItems': { - 'type': 'string' + 'type': 'string', }, - 'uniqueItems': true + 'uniqueItems': true, }; diff --git a/tools/license2rtf.js b/tools/license2rtf.js index e08cf1e5c25be6..db76eae086b21a 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/lint-js.js b/tools/lint-js.js index 69e5dd10e1a23a..b52097560c074a 100644 --- a/tools/lint-js.js +++ b/tools/lint-js.js @@ -35,7 +35,7 @@ if (cluster.isMaster) { var curPath = 'Starting ...'; var showProgress = true; const globOptions = { - nodir: true + nodir: true, }; const workerConfig = {}; var startTime;