diff options
Diffstat (limited to 'test')
178 files changed, 330 insertions, 330 deletions
diff --git a/test/addons/openssl-client-cert-engine/test.js b/test/addons/openssl-client-cert-engine/test.js index 6466b0fd9d..1320e7b945 100644 --- a/test/addons/openssl-client-cert-engine/test.js +++ b/test/addons/openssl-client-cert-engine/test.js @@ -38,7 +38,7 @@ const server = https.createServer(serverOptions, (req, res) => { host: common.localhostIPv4, port: server.address().port, path: '/test', - clientCertEngine: engine, // engine will provide key+cert + clientCertEngine: engine, // `engine` will provide key+cert rejectUnauthorized: false, // Prevent failing on self-signed certificates headers: {} }; diff --git a/test/async-hooks/test-async-await.js b/test/async-hooks/test-async-await.js index 8aee59a36f..19a22d3076 100644 --- a/test/async-hooks/test-async-await.js +++ b/test/async-hooks/test-async-await.js @@ -12,7 +12,7 @@ const initHooks = require('./init-hooks'); const util = require('util'); const sleep = util.promisify(setTimeout); -// either 'inited' or 'resolved' +// Either 'inited' or 'resolved' const promisesInitState = new Map(); // Either 'before' or 'after' AND asyncId must be present in the other map const promisesExecutionState = new Map(); diff --git a/test/async-hooks/test-graph.signal.js b/test/async-hooks/test-graph.signal.js index c2f889e7b0..67bf1cf6d8 100644 --- a/test/async-hooks/test-graph.signal.js +++ b/test/async-hooks/test-graph.signal.js @@ -13,7 +13,7 @@ const { exec } = require('child_process'); const hooks = initHooks(); hooks.enable(); -const interval = setInterval(() => {}, 9999); // keep event loop open +const interval = setInterval(() => {}, 9999); // Keep event loop open process.on('SIGUSR2', common.mustCall(onsigusr2, 2)); let count = 0; @@ -35,7 +35,7 @@ function onsigusr2() { } function onsigusr2Again() { - clearInterval(interval); // let the event loop close + clearInterval(interval); // Let the event loop close } process.on('exit', onexit); diff --git a/test/async-hooks/test-graph.statwatcher.js b/test/async-hooks/test-graph.statwatcher.js index 3067045d2b..96376926a6 100644 --- a/test/async-hooks/test-graph.statwatcher.js +++ b/test/async-hooks/test-graph.statwatcher.js @@ -10,16 +10,16 @@ const hooks = initHooks(); hooks.enable(); function onchange() { } -// install first file watcher +// Install first file watcher fs.watchFile(__filename, onchange); -// install second file watcher +// Install second file watcher fs.watchFile(commonPath, onchange); -// remove first file watcher +// Remove first file watcher fs.unwatchFile(__filename); -// remove second file watcher +// Remove second file watcher fs.unwatchFile(commonPath); process.on('exit', onexit); diff --git a/test/async-hooks/test-immediate.js b/test/async-hooks/test-immediate.js index 7b51902f77..fa9475abae 100644 --- a/test/async-hooks/test-immediate.js +++ b/test/async-hooks/test-immediate.js @@ -9,7 +9,7 @@ const { checkInvocations } = require('./hook-checks'); const hooks = initHooks(); hooks.enable(); -// install first immediate +// Install first immediate setImmediate(common.mustCall(onimmediate)); const as = hooks.activitiesOfTypes('Immediate'); @@ -29,7 +29,7 @@ function onimmediate() { checkInvocations(imd1, { init: 1, before: 1 }, 'imd1: when first set immediate triggered'); - // install second immediate + // Install second immediate setImmediate(common.mustCall(onimmediateTwo)); as = hooks.activitiesOfTypes('Immediate'); assert.strictEqual(as.length, 2); diff --git a/test/async-hooks/test-statwatcher.js b/test/async-hooks/test-statwatcher.js index 92832a4680..d67bef26eb 100644 --- a/test/async-hooks/test-statwatcher.js +++ b/test/async-hooks/test-statwatcher.js @@ -22,7 +22,7 @@ const hooks = initHooks(); hooks.enable(); function onchange() {} -// install first file watcher +// Install first file watcher const w1 = fs.watchFile(file1, { interval: 10 }, onchange); let as = hooks.activitiesOfTypes('STATWATCHER'); @@ -35,7 +35,7 @@ assert.strictEqual(statwatcher1.triggerAsyncId, 1); checkInvocations(statwatcher1, { init: 1 }, 'watcher1: when started to watch file'); -// install second file watcher +// Install second file watcher const w2 = fs.watchFile(file2, { interval: 10 }, onchange); as = hooks.activitiesOfTypes('STATWATCHER'); assert.strictEqual(as.length, 2); diff --git a/test/async-hooks/test-timers.setTimeout.js b/test/async-hooks/test-timers.setTimeout.js index 748fa5565e..540c88abad 100644 --- a/test/async-hooks/test-timers.setTimeout.js +++ b/test/async-hooks/test-timers.setTimeout.js @@ -10,7 +10,7 @@ const TIMEOUT = common.platformTimeout(100); const hooks = initHooks(); hooks.enable(); -// install first timeout +// Install first timeout setTimeout(common.mustCall(ontimeout), TIMEOUT); const as = hooks.activitiesOfTypes('Timeout'); assert.strictEqual(as.length, 1); diff --git a/test/async-hooks/test-ttywrap.readstream.js b/test/async-hooks/test-ttywrap.readstream.js index bf81a3266c..e6fb3cdc28 100644 --- a/test/async-hooks/test-ttywrap.readstream.js +++ b/test/async-hooks/test-ttywrap.readstream.js @@ -3,7 +3,7 @@ const common = require('../common'); const assert = require('assert'); -// general hook test setup +// General hook test setup const tick = require('../common/tick'); const initHooks = require('./init-hooks'); const { checkInvocations } = require('./hook-checks'); diff --git a/test/async-hooks/test-ttywrap.writestream.js b/test/async-hooks/test-ttywrap.writestream.js index 44f32e80f0..bcc164c659 100644 --- a/test/async-hooks/test-ttywrap.writestream.js +++ b/test/async-hooks/test-ttywrap.writestream.js @@ -3,7 +3,7 @@ const common = require('../common'); const assert = require('assert'); -// general hook test setup +// General hook test setup const tick = require('../common/tick'); const initHooks = require('./init-hooks'); const { checkInvocations } = require('./hook-checks'); diff --git a/test/common/index.js b/test/common/index.js index d6a24dd944..b0e7e0cd11 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -795,7 +795,7 @@ module.exports = { if (opensslCli !== null) return opensslCli; if (process.config.variables.node_shared_openssl) { - // use external command + // Use external command opensslCli = 'openssl'; } else { // Use command built from sources included in Node.js repository diff --git a/test/es-module/test-esm-preserve-symlinks-main.js b/test/es-module/test-esm-preserve-symlinks-main.js index 38ef5d8fcc..239fdddc2e 100644 --- a/test/es-module/test-esm-preserve-symlinks-main.js +++ b/test/es-module/test-esm-preserve-symlinks-main.js @@ -52,6 +52,6 @@ function doTest(flags, done) { // First test the commonjs module loader doTest([], () => { - // now test the new loader + // Now test the new loader doTest(['--experimental-modules'], () => {}); }); diff --git a/test/js-native-api/test_general/test.js b/test/js-native-api/test_general/test.js index f0be79085b..44b672cdc1 100644 --- a/test/js-native-api/test_general/test.js +++ b/test/js-native-api/test_general/test.js @@ -18,12 +18,12 @@ class ExtendedClass extends BaseClass { const baseObject = new BaseClass(); const extendedObject = new ExtendedClass(); -// test napi_strict_equals +// Test napi_strict_equals assert.ok(test_general.testStrictEquals(val1, val1)); assert.strictEqual(test_general.testStrictEquals(val1, val2), false); assert.ok(test_general.testStrictEquals(val2, val3)); -// test napi_get_prototype +// Test napi_get_prototype assert.strictEqual(test_general.testGetPrototype(baseObject), Object.getPrototypeOf(baseObject)); assert.strictEqual(test_general.testGetPrototype(extendedObject), diff --git a/test/js-native-api/test_number/test.js b/test/js-native-api/test_number/test.js index a7a6009852..808d1d9d5c 100644 --- a/test/js-native-api/test_number/test.js +++ b/test/js-native-api/test_number/test.js @@ -4,7 +4,7 @@ const assert = require('assert'); const test_number = require(`./build/${common.buildType}/test_number`); -// testing api calls for number +// Testing api calls for number function testNumber(num) { assert.strictEqual(num, test_number.Test(num)); } diff --git a/test/js-native-api/test_string/test.js b/test/js-native-api/test_string/test.js index 86fdc16406..1be34212a1 100644 --- a/test/js-native-api/test_string/test.js +++ b/test/js-native-api/test_string/test.js @@ -2,7 +2,7 @@ const common = require('../../common'); const assert = require('assert'); -// testing api calls for string +// Testing api calls for string const test_string = require(`./build/${common.buildType}/test_string`); const empty = ''; diff --git a/test/js-native-api/test_symbol/test1.js b/test/js-native-api/test_symbol/test1.js index 9232210c46..c0a4634c88 100644 --- a/test/js-native-api/test_symbol/test1.js +++ b/test/js-native-api/test_symbol/test1.js @@ -2,7 +2,7 @@ const common = require('../../common'); const assert = require('assert'); -// testing api calls for symbol +// Testing api calls for symbol const test_symbol = require(`./build/${common.buildType}/test_symbol`); const sym = test_symbol.New('test'); diff --git a/test/js-native-api/test_symbol/test2.js b/test/js-native-api/test_symbol/test2.js index 8bc731b40c..2060409b9b 100644 --- a/test/js-native-api/test_symbol/test2.js +++ b/test/js-native-api/test_symbol/test2.js @@ -2,7 +2,7 @@ const common = require('../../common'); const assert = require('assert'); -// testing api calls for symbol +// Testing api calls for symbol const test_symbol = require(`./build/${common.buildType}/test_symbol`); const fooSym = test_symbol.New('foo'); diff --git a/test/js-native-api/test_symbol/test3.js b/test/js-native-api/test_symbol/test3.js index a7c6c18c02..445fa3f891 100644 --- a/test/js-native-api/test_symbol/test3.js +++ b/test/js-native-api/test_symbol/test3.js @@ -2,7 +2,7 @@ const common = require('../../common'); const assert = require('assert'); -// testing api calls for symbol +// Testing api calls for symbol const test_symbol = require(`./build/${common.buildType}/test_symbol`); assert.notStrictEqual(test_symbol.New(), test_symbol.New()); diff --git a/test/known_issues/test-vm-ownkeys.js b/test/known_issues/test-vm-ownkeys.js index 12d3ba7470..f245b0f7b5 100644 --- a/test/known_issues/test-vm-ownkeys.js +++ b/test/known_issues/test-vm-ownkeys.js @@ -24,5 +24,5 @@ const ctx = vm.createContext(sandbox); const nativeKeys = vm.runInNewContext('Reflect.ownKeys(this);'); const ownKeys = vm.runInContext('Reflect.ownKeys(this);', ctx); const restKeys = ownKeys.filter((key) => !nativeKeys.includes(key)); -// this should not fail +// This should not fail assert.deepStrictEqual(Array.from(restKeys), ['a', 'b', sym1, sym2]); diff --git a/test/known_issues/test-vm-ownpropertynames.js b/test/known_issues/test-vm-ownpropertynames.js index cb8184babc..d1c03186ab 100644 --- a/test/known_issues/test-vm-ownpropertynames.js +++ b/test/known_issues/test-vm-ownpropertynames.js @@ -24,5 +24,5 @@ const ctx = vm.createContext(sandbox); const nativeNames = vm.runInNewContext('Object.getOwnPropertyNames(this);'); const ownNames = vm.runInContext('Object.getOwnPropertyNames(this);', ctx); const restNames = ownNames.filter((name) => !nativeNames.includes(name)); -// this should not fail +// This should not fail assert.deepStrictEqual(Array.from(restNames), ['a', 'b']); diff --git a/test/known_issues/test-vm-ownpropertysymbols.js b/test/known_issues/test-vm-ownpropertysymbols.js index f11c4999cd..2f50162790 100644 --- a/test/known_issues/test-vm-ownpropertysymbols.js +++ b/test/known_issues/test-vm-ownpropertysymbols.js @@ -24,5 +24,5 @@ const ctx = vm.createContext(sandbox); const nativeSym = vm.runInNewContext('Object.getOwnPropertySymbols(this);'); const ownSym = vm.runInContext('Object.getOwnPropertySymbols(this);', ctx); const restSym = ownSym.filter((sym) => !nativeSym.includes(sym)); -// this should not fail +// This should not fail assert.deepStrictEqual(Array.from(restSym), [sym1, sym2]); diff --git a/test/message/throw_custom_error.js b/test/message/throw_custom_error.js index 7290df53e1..3e0e6a271c 100644 --- a/test/message/throw_custom_error.js +++ b/test/message/throw_custom_error.js @@ -22,6 +22,6 @@ 'use strict'; require('../common'); -// custom error throwing +// Custom error throwing // eslint-disable-next-line no-throw-literal throw ({ name: 'MyCustomError', message: 'This is a custom message' }); diff --git a/test/message/throw_non_error.js b/test/message/throw_non_error.js index e7d2f54b85..fc1a568015 100644 --- a/test/message/throw_non_error.js +++ b/test/message/throw_non_error.js @@ -22,6 +22,6 @@ 'use strict'; require('../common'); -// custom error throwing +// Custom error throwing // eslint-disable-next-line no-throw-literal throw ({ foo: 'bar' }); diff --git a/test/parallel/test-assert-deep.js b/test/parallel/test-assert-deep.js index 5b71173478..3675a18a28 100644 --- a/test/parallel/test-assert-deep.js +++ b/test/parallel/test-assert-deep.js @@ -356,7 +356,7 @@ assertNotDeepOrStrict( new Map([['1', 5], [0, 5], ['0', 5]]) ); -// undefined value in Map +// Undefined value in Map assertDeepAndStrictEqual( new Map([[1, undefined]]), new Map([[1, undefined]]) diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index ddf2edd896..8369936b4d 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -537,7 +537,7 @@ assert.strictEqual(Buffer.from('A', 'base64').length, 0); { - // test an invalid slice end. + // Test an invalid slice end. const b = Buffer.from([1, 2, 3, 4, 5]); const b2 = b.toString('hex', 1, 10000); const b3 = b.toString('hex', 1, 5); @@ -737,7 +737,7 @@ assert.strictEqual(x.inspect(), '<Buffer 81 a3 66 6f 6f a3 62 61 72>'); } { - // test for buffer overrun + // Test for buffer overrun const buf = Buffer.from([0, 0, 0, 0, 0]); // length: 5 const sub = buf.slice(0, 4); // length: 4 assert.strictEqual(sub.write('12345', 'latin1'), 4); @@ -747,7 +747,7 @@ assert.strictEqual(x.inspect(), '<Buffer 81 a3 66 6f 6f a3 62 61 72>'); } { - // test alloc with fill option + // Test alloc with fill option const buf = Buffer.alloc(5, '800A', 'hex'); assert.strictEqual(buf[0], 128); assert.strictEqual(buf[1], 10); diff --git a/test/parallel/test-buffer-compare-offset.js b/test/parallel/test-buffer-compare-offset.js index 47e5f3041e..8c590f52ed 100644 --- a/test/parallel/test-buffer-compare-offset.js +++ b/test/parallel/test-buffer-compare-offset.js @@ -48,7 +48,7 @@ assert.strictEqual(a.compare(b, 0, 7, 4, 6), -1); // zero length target assert.strictEqual(a.compare(b, 0, null), 1); -// coerces to targetEnd == 5 +// Coerces to targetEnd == 5 assert.strictEqual(a.compare(b, 0, { valueOf: () => 5 }), -1); // zero length target diff --git a/test/parallel/test-buffer-copy.js b/test/parallel/test-buffer-copy.js index b356097437..9810c9824b 100644 --- a/test/parallel/test-buffer-copy.js +++ b/test/parallel/test-buffer-copy.js @@ -128,7 +128,7 @@ common.expectsError( } } -// throw with negative sourceEnd +// Throw with negative sourceEnd common.expectsError( () => b.copy(c, 0, -1), errorProperty); diff --git a/test/parallel/test-buffer-includes.js b/test/parallel/test-buffer-includes.js index 605f988de5..5bad445ade 100644 --- a/test/parallel/test-buffer-includes.js +++ b/test/parallel/test-buffer-includes.js @@ -88,7 +88,7 @@ assert.strictEqual( true ); -// test base64 encoding +// Test base64 encoding assert.strictEqual( Buffer.from(b.toString('base64'), 'base64') .includes('ZA==', 0, 'base64'), @@ -112,7 +112,7 @@ assert.strictEqual( true ); -// test latin1 encoding +// Test latin1 encoding assert.strictEqual( Buffer.from(b.toString('latin1'), 'latin1') .includes('d', 0, 'latin1'), @@ -124,7 +124,7 @@ assert.strictEqual( true ); -// test binary encoding +// Test binary encoding assert.strictEqual( Buffer.from(b.toString('binary'), 'binary') .includes('d', 0, 'binary'), diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index 44353c1276..3f0449ceb0 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -96,7 +96,7 @@ assert.strictEqual( 3 ); -// test base64 encoding +// Test base64 encoding assert.strictEqual( Buffer.from(b.toString('base64'), 'base64') .indexOf('ZA==', 0, 'base64'), @@ -120,7 +120,7 @@ assert.strictEqual( 3 ); -// test latin1 encoding +// Test latin1 encoding assert.strictEqual( Buffer.from(b.toString('latin1'), 'latin1') .indexOf('d', 0, 'latin1'), @@ -147,7 +147,7 @@ assert.strictEqual( 0 ); -// test binary encoding +// Test binary encoding assert.strictEqual( Buffer.from(b.toString('binary'), 'binary') .indexOf('d', 0, 'binary'), diff --git a/test/parallel/test-buffer-iterator.js b/test/parallel/test-buffer-iterator.js index 72b775c713..0016b021c0 100644 --- a/test/parallel/test-buffer-iterator.js +++ b/test/parallel/test-buffer-iterator.js @@ -6,7 +6,7 @@ const buffer = Buffer.from([1, 2, 3, 4, 5]); let arr; let b; -// buffers should be iterable +// Buffers should be iterable arr = []; diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js index 1dbc217bda..baab6107c4 100644 --- a/test/parallel/test-buffer-slow.js +++ b/test/parallel/test-buffer-slow.js @@ -7,7 +7,7 @@ const SlowBuffer = buffer.SlowBuffer; const ones = [1, 1, 1, 1]; -// should create a Buffer +// Should create a Buffer let sb = SlowBuffer(4); assert(sb instanceof Buffer); assert.strictEqual(sb.length, 4); @@ -19,7 +19,7 @@ for (const [key, value] of sb.entries()) { // underlying ArrayBuffer should have the same length assert.strictEqual(sb.buffer.byteLength, 4); -// should work without new +// Should work without new sb = SlowBuffer(4); assert(sb instanceof Buffer); assert.strictEqual(sb.length, 4); @@ -28,7 +28,7 @@ for (const [key, value] of sb.entries()) { assert.deepStrictEqual(value, ones[key]); } -// should work with edge cases +// Should work with edge cases assert.strictEqual(SlowBuffer(0).length, 0); try { assert.strictEqual( diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index f0bebd61ef..9c9ed2d0e8 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -73,7 +73,7 @@ function typeName(value) { }); } -// test that we can call spawn +// Test that we can call spawn const child = new ChildProcess(); child.spawn({ file: process.execPath, diff --git a/test/parallel/test-child-process-disconnect.js b/test/parallel/test-child-process-disconnect.js index 7ba30b28db..fb8a2dd0ea 100644 --- a/test/parallel/test-child-process-disconnect.js +++ b/test/parallel/test-child-process-disconnect.js @@ -80,7 +80,7 @@ if (process.argv[2] === 'child') { // The process should also self terminate without using signals child.on('exit', common.mustCall()); - // when child is listening + // When child is listening child.on('message', function(obj) { if (obj && obj.msg === 'ready') { @@ -90,7 +90,7 @@ if (process.argv[2] === 'child') { socket.on('data', function(data) { data = data.toString(); - // ready to be disconnected + // Ready to be disconnected if (data === 'ready') { child.disconnect(); assert.throws( @@ -101,7 +101,7 @@ if (process.argv[2] === 'child') { return; } - // disconnect is emitted + // 'disconnect' is emitted childFlag = (data === 'true'); }); diff --git a/test/parallel/test-child-process-exec-error.js b/test/parallel/test-child-process-exec-error.js index cb8ace0a9b..eaddeb6614 100644 --- a/test/parallel/test-child-process-exec-error.js +++ b/test/parallel/test-child-process-exec-error.js @@ -32,9 +32,9 @@ function test(fn, code) { } if (common.isWindows) { - test(child_process.exec, 1); // exit code of cmd.exe + test(child_process.exec, 1); // Exit code of cmd.exe } else { - test(child_process.exec, 127); // exit code of /bin/sh + test(child_process.exec, 127); // Exit code of /bin/sh } test(child_process.execFile, 'ENOENT'); diff --git a/test/parallel/test-child-process-fork-net-server.js b/test/parallel/test-child-process-fork-net-server.js index 340b3075f9..9d39e149af 100644 --- a/test/parallel/test-child-process-fork-net-server.js +++ b/test/parallel/test-child-process-fork-net-server.js @@ -124,7 +124,7 @@ if (process.argv[2] === 'child') { } } else if (msg.what === 'connection') { - // child got connection + // Child got connection connections.done(); } else if (msg.what === 'close') { child.removeListener('message', messageHandlers); diff --git a/test/parallel/test-child-process-fork-net.js b/test/parallel/test-child-process-fork-net.js index 90ce482309..6607d79816 100644 --- a/test/parallel/test-child-process-fork-net.js +++ b/test/parallel/test-child-process-fork-net.js @@ -48,7 +48,7 @@ if (process.argv[2] === 'child') { console.error(`[${id}] socket.end ${m}`); }); - // store the unfinished socket + // Store the unfinished socket if (m === 'write') { needEnd.push(socket); } diff --git a/test/parallel/test-child-process-spawnsync-input.js b/test/parallel/test-child-process-spawnsync-input.js index 6e4a22c0e3..d1a602460e 100644 --- a/test/parallel/test-child-process-spawnsync-input.js +++ b/test/parallel/test-child-process-spawnsync-input.js @@ -29,7 +29,7 @@ const spawnSync = require('child_process').spawnSync; const msgOut = 'this is stdout'; const msgErr = 'this is stderr'; -// this is actually not os.EOL? +// This is actually not os.EOL? const msgOutBuf = Buffer.from(`${msgOut}\n`); const msgErrBuf = Buffer.from(`${msgErr}\n`); diff --git a/test/parallel/test-child-process-stdio-inherit.js b/test/parallel/test-child-process-stdio-inherit.js index dfffb70c58..034a077016 100644 --- a/test/parallel/test-child-process-stdio-inherit.js +++ b/test/parallel/test-child-process-stdio-inherit.js @@ -51,6 +51,6 @@ function grandparent() { } function parent() { - // should not immediately exit. + // Should not immediately exit. spawn('cat', [], { stdio: 'inherit' }); } diff --git a/test/parallel/test-cluster-bind-twice.js b/test/parallel/test-cluster-bind-twice.js index 4ef319ae80..7bd818a5e1 100644 --- a/test/parallel/test-cluster-bind-twice.js +++ b/test/parallel/test-cluster-bind-twice.js @@ -102,7 +102,7 @@ if (!id) { })); }, 2)); } else { - assert(0); // bad command line argument + assert(0); // Bad command line argument } function startWorker() { diff --git a/test/parallel/test-cluster-disconnect.js b/test/parallel/test-cluster-disconnect.js index 51cbb43c63..3d1f14257b 100644 --- a/test/parallel/test-cluster-disconnect.js +++ b/test/parallel/test-cluster-disconnect.js @@ -37,7 +37,7 @@ if (cluster.isWorker) { const servers = 2; const serverPorts = new Set(); - // test a single TCP server + // Test a single TCP server const testConnection = (port, cb) => { const socket = net.connect(port, '127.0.0.1', () => { // buffer result diff --git a/test/parallel/test-cluster-eaccess.js b/test/parallel/test-cluster-eaccess.js index 4c2d284293..cf6eae1d38 100644 --- a/test/parallel/test-cluster-eaccess.js +++ b/test/parallel/test-cluster-eaccess.js @@ -66,7 +66,7 @@ if (cluster.isMaster && process.argv.length !== 3) { server.on('error', function(err) { // Message to child process tells it to exit cp.send('end'); - // propagate error to parent + // Propagate error to parent process.send(err); }); })); diff --git a/test/parallel/test-cluster-master-kill.js b/test/parallel/test-cluster-master-kill.js index 2cc8003981..3c22e07ede 100644 --- a/test/parallel/test-cluster-master-kill.js +++ b/test/parallel/test-cluster-master-kill.js @@ -26,7 +26,7 @@ const cluster = require('cluster'); if (cluster.isWorker) { - // keep the worker alive + // Keep the worker alive const http = require('http'); http.Server().listen(0, '127.0.0.1'); @@ -39,7 +39,7 @@ if (cluster.isWorker) { pid: worker.process.pid }); - // terminate the cluster process + // Terminate the cluster process worker.once('listening', common.mustCall(() => { setTimeout(() => { process.exit(0); @@ -67,7 +67,7 @@ if (cluster.isWorker) { // Make sure that the master died on purpose assert.strictEqual(code, 0); - // check worker process status + // Check worker process status const pollWorker = () => { alive = common.isAlive(pid); if (alive) { diff --git a/test/parallel/test-cluster-worker-exit.js b/test/parallel/test-cluster-worker-exit.js index ba9c4f8775..f93a3f5870 100644 --- a/test/parallel/test-cluster-worker-exit.js +++ b/test/parallel/test-cluster-worker-exit.js @@ -116,7 +116,7 @@ if (cluster.isWorker) { }; } -// some helper functions ... +// Some helper functions ... function checkResults(expected_results, results) { for (const k in expected_results) { diff --git a/test/parallel/test-cluster-worker-kill.js b/test/parallel/test-cluster-worker-kill.js index 1f2978bdb5..0cd6d0321c 100644 --- a/test/parallel/test-cluster-worker-kill.js +++ b/test/parallel/test-cluster-worker-kill.js @@ -103,7 +103,7 @@ if (cluster.isWorker) { }); } -// some helper functions ... +// Some helper functions ... function checkResults(expected_results, results) { for (const k in expected_results) { diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index 65e1645f7b..8f259b7c94 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -134,7 +134,7 @@ console.dir(custom_inspect, { showHidden: false }); console.dir({ foo: { bar: { baz: true } } }, { depth: 0 }); console.dir({ foo: { bar: { baz: true } } }, { depth: 1 }); -// test console.dirxml() +// Test console.dirxml() console.dirxml(custom_inspect, custom_inspect); console.dirxml( { foo: { bar: { baz: true } } }, @@ -142,7 +142,7 @@ console.dirxml( { foo: { bar: { quux: true } } } ); -// test console.trace() +// Test console.trace() console.trace('This is a %j %d', { formatted: 'trace' }, 10, 'foo'); // Test console.time() and console.timeEnd() output diff --git a/test/parallel/test-crypto-cipher-decipher.js b/test/parallel/test-crypto-cipher-decipher.js index e7ab8f73b0..ce6ea4e3b8 100644 --- a/test/parallel/test-crypto-cipher-decipher.js +++ b/test/parallel/test-crypto-cipher-decipher.js @@ -36,7 +36,7 @@ function testCipher1(key) { assert.strictEqual(txt, plaintext); - // streaming cipher interface + // Streaming cipher interface // NB: In real life, it's not guaranteed that you can get all of it // in a single read() like this. But in this case, we know it's // quite small, so there's no harm. diff --git a/test/parallel/test-crypto-cipheriv-decipheriv.js b/test/parallel/test-crypto-cipheriv-decipheriv.js index b0ad7a97da..d9cc725da1 100644 --- a/test/parallel/test-crypto-cipheriv-decipheriv.js +++ b/test/parallel/test-crypto-cipheriv-decipheriv.js @@ -23,7 +23,7 @@ function testCipher1(key, iv) { assert.strictEqual(txt, plaintext, `encryption/decryption with key ${key} and iv ${iv}`); - // streaming cipher interface + // Streaming cipher interface // NB: In real life, it's not guaranteed that you can get all of it // in a single read() like this. But in this case, we know it's // quite small, so there's no harm. diff --git a/test/parallel/test-crypto-dh.js b/test/parallel/test-crypto-dh.js index 5a63667c99..ead77d6a30 100644 --- a/test/parallel/test-crypto-dh.js +++ b/test/parallel/test-crypto-dh.js @@ -230,7 +230,7 @@ if (availableCurves.has('prime256v1') && availableCurves.has('secp256k1')) { assert(firstByte === 2 || firstByte === 3); firstByte = ecdh1.getPublicKey('buffer', 'hybrid')[0]; assert(firstByte === 6 || firstByte === 7); - // format value should be string + // Format value should be string common.expectsError( () => ecdh1.getPublicKey('buffer', 10), diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js index 7a164dffe9..64964cc7ae 100644 --- a/test/parallel/test-crypto-keygen.js +++ b/test/parallel/test-crypto-keygen.js @@ -606,7 +606,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); }); } - // cipher of invalid type. + // Cipher of invalid type. for (const cipher of [0, true, {}]) { common.expectsError(() => generateKeyPairSync('rsa', { modulusLength: 4096, diff --git a/test/parallel/test-crypto-padding-aes256.js b/test/parallel/test-crypto-padding-aes256.js index d6c395f0a4..14d853bdfd 100644 --- a/test/parallel/test-crypto-padding-aes256.js +++ b/test/parallel/test-crypto-padding-aes256.js @@ -46,7 +46,7 @@ function decrypt(val, pad) { // echo 0123456789abcdef0123456789abcdef \ // | openssl enc -e -aes256 -nopad -K <key> -iv <iv> \ // | openssl enc -d -aes256 -nopad -K <key> -iv <iv> -let plaintext = '0123456789abcdef0123456789abcdef'; // multiple of block size +let plaintext = '0123456789abcdef0123456789abcdef'; // Multiple of block size let encrypted = encrypt(plaintext, false); let decrypted = decrypt(encrypted, false); assert.strictEqual(decrypted, plaintext); diff --git a/test/parallel/test-crypto-scrypt.js b/test/parallel/test-crypto-scrypt.js index 55b5aeaf8f..e1d0ddf10c 100644 --- a/test/parallel/test-crypto-scrypt.js +++ b/test/parallel/test-crypto-scrypt.js @@ -97,9 +97,9 @@ const good = [ const bad = [ { N: 1, p: 1, r: 1 }, // N < 2 { N: 3, p: 1, r: 1 }, // Not power of 2. - { N: 1, cost: 1 }, // both N and cost - { p: 1, parallelization: 1 }, // both p and parallelization - { r: 1, blockSize: 1 } // both r and blocksize + { N: 1, cost: 1 }, // Both N and cost + { p: 1, parallelization: 1 }, // Both p and parallelization + { r: 1, blockSize: 1 } // Both r and blocksize ]; // Test vectors where 128*N*r exceeds maxmem. diff --git a/test/parallel/test-debugger-pid.js b/test/parallel/test-debugger-pid.js index e11d23152f..f269ff310b 100644 --- a/test/parallel/test-debugger-pid.js +++ b/test/parallel/test-debugger-pid.js @@ -6,7 +6,7 @@ const spawn = require('child_process').spawn; let buffer = ''; -// connect to debug agent +// Connect to debug agent const interfacer = spawn(process.execPath, ['debug', '-p', '655555']); interfacer.stdout.setEncoding('utf-8'); diff --git a/test/parallel/test-dgram-bind.js b/test/parallel/test-dgram-bind.js index 0b8447c311..e3b358bdd2 100644 --- a/test/parallel/test-dgram-bind.js +++ b/test/parallel/test-dgram-bind.js @@ -38,6 +38,6 @@ socket.on('listening', common.mustCall(() => { socket.close(); })); -const result = socket.bind(); // should not throw +const result = socket.bind(); // Should not throw. -assert.strictEqual(result, socket); // should have returned itself +assert.strictEqual(result, socket); // Should have returned itself. diff --git a/test/parallel/test-dgram-close-in-listening.js b/test/parallel/test-dgram-close-in-listening.js index 16432d85d6..ae3ab71d7e 100644 --- a/test/parallel/test-dgram-close-in-listening.js +++ b/test/parallel/test-dgram-close-in-listening.js @@ -13,7 +13,7 @@ socket.on('listening', function() { socket.close(); }); -// get a random port for send +// Get a random port for send const portGetter = dgram.createSocket('udp4') .bind(0, 'localhost', common.mustCall(() => { // Adds a listener to 'listening' to send the data when diff --git a/test/parallel/test-dgram-close-is-not-callback.js b/test/parallel/test-dgram-close-is-not-callback.js index 69c166f42f..bfb0bcd2bb 100644 --- a/test/parallel/test-dgram-close-is-not-callback.js +++ b/test/parallel/test-dgram-close-is-not-callback.js @@ -6,7 +6,7 @@ const buf = Buffer.alloc(1024, 42); const socket = dgram.createSocket('udp4'); -// get a random port for send +// Get a random port for send const portGetter = dgram.createSocket('udp4') .bind(0, 'localhost', common.mustCall(() => { socket.send(buf, 0, buf.length, diff --git a/test/parallel/test-dgram-close.js b/test/parallel/test-dgram-close.js index 7b49cee73b..3a91069c30 100644 --- a/test/parallel/test-dgram-close.js +++ b/test/parallel/test-dgram-close.js @@ -34,7 +34,7 @@ const buf = Buffer.alloc(1024, 42); let socket = dgram.createSocket('udp4'); const { handle } = socket[kStateSymbol]; -// get a random port for send +// Get a random port for send const portGetter = dgram.createSocket('udp4') .bind(0, 'localhost', common.mustCall(() => { socket.send(buf, 0, buf.length, diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js index 5e18ad44ae..2654c8bca2 100644 --- a/test/parallel/test-file-write-stream2.js +++ b/test/parallel/test-file-write-stream2.js @@ -106,7 +106,7 @@ for (let i = 0; i < 11; i++) { const ret = file.write(String(i)); console.error(`${i} ${ret}`); - // return false when i hits 10 + // Return false when i hits 10 assert.strictEqual(ret, i !== 10); } cb_occurred += 'write '; diff --git a/test/parallel/test-fs-error-messages.js b/test/parallel/test-fs-error-messages.js index 370b4f4697..05e4515ad4 100644 --- a/test/parallel/test-fs-error-messages.js +++ b/test/parallel/test-fs-error-messages.js @@ -190,7 +190,7 @@ function re(literals, ...values) { ); } -// link nonexistent file +// Link nonexistent file { const validateError = (err) => { assert.strictEqual(nonexistentFile, err.path); @@ -308,7 +308,7 @@ function re(literals, ...values) { ); } -// rename non-empty directory +// Rename non-empty directory { const validateError = (err) => { assert.strictEqual(existingDir, err.path); diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index 2a15627a0f..9bd2df1801 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -98,7 +98,7 @@ function nextdir() { const pathname = path.join(tmpdir.path, nextdir(), nextdir()); fs.mkdirSync(pathname, { recursive: true }); - // should not cause an error. + // Should not cause an error. fs.mkdirSync(pathname, { recursive: true }); const exists = fs.existsSync(pathname); @@ -143,7 +143,7 @@ function nextdir() { })); } -// mkdirp when path is a file. +// `mkdirp` when path is a file. { const pathname = path.join(tmpdir.path, nextdir(), nextdir()); diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js index 2e6ba0e8a2..c12b013519 100644 --- a/test/parallel/test-fs-promises.js +++ b/test/parallel/test-fs-promises.js @@ -143,7 +143,7 @@ async function getHandle(dest) { assert.deepStrictEqual((await readFile(dest)).toString(), 'hello'); } - // invalid change of ownership + // Invalid change of ownership { const handle = await getHandle(dest); @@ -181,7 +181,7 @@ async function getHandle(dest) { }); } - // set modification times + // Set modification times { const handle = await getHandle(dest); @@ -271,7 +271,7 @@ async function getHandle(dest) { await unlink(newFile); } - // mkdir when options is number. + // `mkdir` when options is number. { const dir = path.join(tmpDir, nextdir()); await mkdir(dir, 777); @@ -279,7 +279,7 @@ async function getHandle(dest) { assert(stats.isDirectory()); } - // mkdir when options is string. + // `mkdir` when options is string. { const dir = path.join(tmpDir, nextdir()); await mkdir(dir, '777'); @@ -295,7 +295,7 @@ async function getHandle(dest) { assert(stats.isDirectory()); } - // mkdirp when path is a file. + // `mkdirp` when path is a file. { const dir = path.join(tmpDir, nextdir(), nextdir()); await mkdir(path.dirname(dir)); diff --git a/test/parallel/test-fs-realpath-on-substed-drive.js b/test/parallel/test-fs-realpath-on-substed-drive.js index 1c86dc3649..d5c684f33c 100644 --- a/test/parallel/test-fs-realpath-on-substed-drive.js +++ b/test/parallel/test-fs-realpath-on-substed-drive.js @@ -12,7 +12,7 @@ const spawnSync = require('child_process').spawnSync; let result; -// create a subst drive +// Create a subst drive const driveLetters = 'ABCDEFGHIJKLMNOPQRSTUWXYZ'; let drive; let i; diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js index 48294d4a62..d12c8a28d2 100644 --- a/test/parallel/test-fs-realpath.js +++ b/test/parallel/test-fs-realpath.js @@ -41,7 +41,7 @@ tmpdir.refresh(); let root = '/'; let assertEqualPath = assert.strictEqual; if (common.isWindows) { - // something like "C:\\" + // Something like "C:\\" root = process.cwd().substr(0, 3); assertEqualPath = function(path_left, path_right, message) { assert diff --git a/test/parallel/test-http-agent-getname.js b/test/parallel/test-http-agent-getname.js index 31dc255ba5..ab946a4bde 100644 --- a/test/parallel/test-http-agent-getname.js +++ b/test/parallel/test-http-agent-getname.js @@ -9,7 +9,7 @@ const tmpdir = require('../common/tmpdir'); const agent = new http.Agent(); -// default to localhost +// Default to localhost assert.strictEqual( agent.getName({ port: 80, diff --git a/test/parallel/test-http-agent-keepalive.js b/test/parallel/test-http-agent-keepalive.js index 7e2cef4e3e..5902c58679 100644 --- a/test/parallel/test-http-agent-keepalive.js +++ b/test/parallel/test-http-agent-keepalive.js @@ -119,7 +119,7 @@ function remoteError() { server.listen(0, common.mustCall(() => { name = `localhost:${server.address().port}:`; - // request first, and keep alive + // Request first, and keep alive get('/first', common.mustCall((res) => { assert.strictEqual(res.statusCode, 200); res.on('data', checkDataAndSockets); diff --git a/test/parallel/test-http-client-override-global-agent.js b/test/parallel/test-http-client-override-global-agent.js index c36c9d26a8..f046abaa74 100644 --- a/test/parallel/test-http-client-override-global-agent.js +++ b/test/parallel/test-http-client-override-global-agent.js @@ -14,7 +14,7 @@ server.listen(0, common.mustCall(() => { http.globalAgent = agent; makeRequest(); - assert(agent.sockets.hasOwnProperty(name)); // agent has indeed been used + assert(agent.sockets.hasOwnProperty(name)); // Agent has indeed been used })); function makeRequest() { diff --git a/test/parallel/test-http-client-timeout-agent.js b/test/parallel/test-http-client-timeout-agent.js index 154f788c18..66c0c0f6b9 100644 --- a/test/parallel/test-http-client-timeout-agent.js +++ b/test/parallel/test-http-client-timeout-agent.js @@ -36,7 +36,7 @@ const server = http.createServer((req, res) => { const m = /\/(.*)/.exec(req.url); const reqid = parseInt(m[1], 10); if (reqid % 2) { - // do not reply the request + // Do not reply the request } else { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.write(reqid.toString()); diff --git a/test/parallel/test-http-many-ended-pipelines.js b/test/parallel/test-http-many-ended-pipelines.js index d17090cec9..eb6f1341c5 100644 --- a/test/parallel/test-http-many-ended-pipelines.js +++ b/test/parallel/test-http-many-ended-pipelines.js @@ -22,7 +22,7 @@ 'use strict'; require('../common'); -// no warnings should happen! +// No warnings should happen! const trace = console.trace; console.trace = function() { trace.apply(console, arguments); diff --git a/test/parallel/test-http-outgoing-internal-headers.js b/test/parallel/test-http-outgoing-internal-headers.js index 2cebfe9e2b..13bb8efc29 100644 --- a/test/parallel/test-http-outgoing-internal-headers.js +++ b/test/parallel/test-http-outgoing-internal-headers.js @@ -10,14 +10,14 @@ const warn = 'OutgoingMessage.prototype._headers is deprecated'; common.expectWarning('DeprecationWarning', warn, 'DEP0066'); { - // tests for _headers get method + // Tests for _headers get method const outgoingMessage = new OutgoingMessage(); outgoingMessage.getHeaders = common.mustCall(); outgoingMessage._headers; } { - // tests for _headers set method + // Tests for _headers set method const outgoingMessage = new OutgoingMessage(); outgoingMessage._headers = { host: 'risingstack.com', diff --git a/test/parallel/test-http-res-write-end-dont-take-array.js b/test/parallel/test-http-res-write-end-dont-take-array.js index d7000f6fd2..8bebfc14e4 100644 --- a/test/parallel/test-http-res-write-end-dont-take-array.js +++ b/test/parallel/test-http-res-write-end-dont-take-array.js @@ -30,9 +30,9 @@ server.once('request', common.mustCall((req, res) => { server.on('request', common.mustCall((req, res) => { res.end(Buffer.from('asdf')); })); - // write should accept string + // `res.write()` should accept `string`. res.write('string'); - // write should accept buffer + // `res.write()` should accept `buffer`. res.write(Buffer.from('asdf')); const expectedError = { @@ -40,7 +40,7 @@ server.once('request', common.mustCall((req, res) => { name: 'TypeError', }; - // Write should not accept an Array + // `res.write()` should not accept an Array. assert.throws( () => { res.write(['array']); @@ -48,7 +48,7 @@ server.once('request', common.mustCall((req, res) => { expectedError ); - // End should not accept an Array + // `res.end()` should not accept an Array. assert.throws( () => { res.end(['moo']); @@ -56,12 +56,12 @@ server.once('request', common.mustCall((req, res) => { expectedError ); - // end should accept string + // `res.end()` should accept `string`. res.end('string'); })); server.listen(0, function() { - // Just make a request, other tests handle responses + // Just make a request, other tests handle responses. http.get({ port: this.address().port }, (res) => { res.resume(); // Do it again to test .end(Buffer); diff --git a/test/parallel/test-http-set-cookies.js b/test/parallel/test-http-set-cookies.js index 7a57523b04..613da4742a 100644 --- a/test/parallel/test-http-set-cookies.js +++ b/test/parallel/test-http-set-cookies.js @@ -59,7 +59,7 @@ server.on('listening', function() { }); }); - // two set-cookie headers + // Two set-cookie headers http.get({ port: this.address().port, path: '/two' }, function(res) { assert.deepStrictEqual(res.headers['set-cookie'], ['A', 'B']); diff --git a/test/parallel/test-http-slow-headers-keepalive.js b/test/parallel/test-http-slow-headers-keepalive.js index 5552f33f77..4e62b59168 100644 --- a/test/parallel/test-http-slow-headers-keepalive.js +++ b/test/parallel/test-http-slow-headers-keepalive.js @@ -33,7 +33,7 @@ server.once('timeout', common.mustCall((socket) => { server.listen(0, () => { const client = net.connect(server.address().port); client.write(headers); - // finish the first request + // Finish the first request client.write('\r\n'); // second request client.write(headers); 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 7a9a486bcc..ea5793ee18 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 @@ -31,7 +31,7 @@ function check(request) { } const server = http.createServer(function(request, response) { - // run the check function + // Run the check function check(request); response.writeHead(200, {}); response.end('ok'); diff --git a/test/parallel/test-http-url.parse-auth.js b/test/parallel/test-http-url.parse-auth.js index ac09c0e1b8..2bb5311586 100644 --- a/test/parallel/test-http-url.parse-auth.js +++ b/test/parallel/test-http-url.parse-auth.js @@ -31,7 +31,7 @@ function check(request) { } const server = http.createServer(function(request, response) { - // run the check function + // Run the check function check(request); response.writeHead(200, {}); response.end('ok'); diff --git a/test/parallel/test-http-url.parse-basic.js b/test/parallel/test-http-url.parse-basic.js index e03f39aa90..71885b4bd0 100644 --- a/test/parallel/test-http-url.parse-basic.js +++ b/test/parallel/test-http-url.parse-basic.js @@ -27,7 +27,7 @@ const url = require('url'); let testURL; -// make sure the basics work +// Make sure the basics work function check(request) { // Default method should still be 'GET' assert.strictEqual(request.method, 'GET'); @@ -39,7 +39,7 @@ function check(request) { } const server = http.createServer(function(request, response) { - // run the check function + // Run the check function check(request); response.writeHead(200, {}); response.end('ok'); diff --git a/test/parallel/test-http-url.parse-https.request.js b/test/parallel/test-http-url.parse-https.request.js index 6ca9e51e82..2f18899176 100644 --- a/test/parallel/test-http-url.parse-https.request.js +++ b/test/parallel/test-http-url.parse-https.request.js @@ -36,12 +36,12 @@ const httpsOptions = { }; function check(request) { - // assert that I'm https + // Assert that I'm https assert.ok(request.socket._secureEstablished); } const server = https.createServer(httpsOptions, function(request, response) { - // run the check function + // Run the check function check(request); response.writeHead(200, {}); response.end('ok'); diff --git a/test/parallel/test-http-url.parse-path.js b/test/parallel/test-http-url.parse-path.js index 4cc5fbf48e..25e4838c4a 100644 --- a/test/parallel/test-http-url.parse-path.js +++ b/test/parallel/test-http-url.parse-path.js @@ -26,12 +26,12 @@ const http = require('http'); const url = require('url'); function check(request) { - // a path should come over + // A path should come over assert.strictEqual(request.url, '/asdf'); } const server = http.createServer(function(request, response) { - // run the check function + // Run the check function check(request); response.writeHead(200, {}); response.end('ok'); diff --git a/test/parallel/test-http-url.parse-post.js b/test/parallel/test-http-url.parse-post.js index 91a567d156..db5ee78fe6 100644 --- a/test/parallel/test-http-url.parse-post.js +++ b/test/parallel/test-http-url.parse-post.js @@ -38,7 +38,7 @@ function check(request) { } const server = http.createServer(function(request, response) { - // run the check function + // Run the check function check(request); response.writeHead(200, {}); response.end('ok'); diff --git a/test/parallel/test-http-url.parse-search.js b/test/parallel/test-http-url.parse-search.js index d10713f5f1..0759c779d3 100644 --- a/test/parallel/test-http-url.parse-search.js +++ b/test/parallel/test-http-url.parse-search.js @@ -31,7 +31,7 @@ function check(request) { } const server = http.createServer(function(request, response) { - // run the check function + // Run the check function check(request); response.writeHead(200, {}); response.end('ok'); diff --git a/test/parallel/test-http-write-callbacks.js b/test/parallel/test-http-write-callbacks.js index a4f23e12cb..3730e57936 100644 --- a/test/parallel/test-http-write-callbacks.js +++ b/test/parallel/test-http-write-callbacks.js @@ -51,7 +51,7 @@ server.on('checkContinue', (req, res) => { server.close(); assert.strictEqual(req.method, 'PUT'); res.writeContinue(() => { - // continue has been written + // Continue has been written req.on('end', () => { res.write('asdf', (er) => { assert.ifError(er); diff --git a/test/parallel/test-http2-binding.js b/test/parallel/test-http2-binding.js index 8c2826e5fb..82eafc0de9 100644 --- a/test/parallel/test-http2-binding.js +++ b/test/parallel/test-http2-binding.js @@ -22,7 +22,7 @@ assert.strictEqual(settings.maxFrameSize, 16384); assert.strictEqual(binding.nghttp2ErrorString(-517), 'GOAWAY has already been sent'); -// assert constants are present +// Assert constants are present assert(binding.constants); assert.strictEqual(typeof binding.constants, 'object'); const constants = binding.constants; diff --git a/test/parallel/test-http2-client-destroy.js b/test/parallel/test-http2-client-destroy.js index e7ea37e152..fe2c9591c7 100644 --- a/test/parallel/test-http2-client-destroy.js +++ b/test/parallel/test-http2-client-destroy.js @@ -100,7 +100,7 @@ const Countdown = require('../common/countdown'); })); } -// test destroy before goaway +// Test destroy before goaway { const server = h2.createServer(); server.on('stream', common.mustCall((stream) => { @@ -120,7 +120,7 @@ const Countdown = require('../common/countdown'); })); } -// test destroy before connect +// Test destroy before connect { const server = h2.createServer(); server.on('stream', common.mustNotCall()); @@ -138,7 +138,7 @@ const Countdown = require('../common/countdown'); })); } -// test close before connect +// Test close before connect { const server = h2.createServer(); @@ -151,7 +151,7 @@ const Countdown = require('../common/countdown'); })); const req = client.request(); - // should throw goaway error + // Should throw goaway error req.on('error', common.expectsError({ code: 'ERR_HTTP2_GOAWAY_SESSION', type: Error, diff --git a/test/parallel/test-http2-client-socket-destroy.js b/test/parallel/test-http2-client-socket-destroy.js index a91c6da28d..2cc6ef1e4e 100644 --- a/test/parallel/test-http2-client-socket-destroy.js +++ b/test/parallel/test-http2-client-socket-destroy.js @@ -19,7 +19,7 @@ server.on('stream', common.mustCall((stream) => { stream.on('close', common.mustCall()); stream.respond(); stream.write(body); - // purposefully do not end() + // Purposefully do not end() })); server.listen(0, common.mustCall(function() { @@ -27,7 +27,7 @@ server.listen(0, common.mustCall(function() { const req = client.request(); req.on('response', common.mustCall(() => { - // send a premature socket close + // Send a premature socket close client[kSocket].destroy(); })); diff --git a/test/parallel/test-http2-compat-serverresponse-end.js b/test/parallel/test-http2-compat-serverresponse-end.js index e7972c2fe0..e0a49ca23a 100644 --- a/test/parallel/test-http2-compat-serverresponse-end.js +++ b/test/parallel/test-http2-compat-serverresponse-end.js @@ -166,7 +166,7 @@ const { const request = client.request(headers); request.on('response', mustCall((headers, flags) => { strictEqual(headers[HTTP2_HEADER_STATUS], HTTP_STATUS_OK); - strictEqual(flags, 5); // the end of stream flag is set + strictEqual(flags, 5); // The end of stream flag is set strictEqual(headers.foo, 'bar'); })); request.on('data', mustNotCall()); @@ -231,7 +231,7 @@ const { const request = client.request(headers); request.on('response', mustCall((headers, flags) => { strictEqual(headers[HTTP2_HEADER_STATUS], HTTP_STATUS_OK); - strictEqual(flags, 5); // the end of stream flag is set + strictEqual(flags, 5); // The end of stream flag is set strictEqual(headers.foo, 'bar'); })); request.on('data', mustNotCall()); @@ -266,7 +266,7 @@ const { const request = client.request(headers); request.on('response', mustCall((headers, flags) => { strictEqual(headers[HTTP2_HEADER_STATUS], HTTP_STATUS_OK); - strictEqual(flags, 5); // the end of stream flag is set + strictEqual(flags, 5); // The end of stream flag is set strictEqual(headers.foo, 'bar'); })); request.on('data', mustNotCall()); @@ -306,7 +306,7 @@ const { const request = client.request(headers); request.on('response', mustCall((headers, flags) => { strictEqual(headers[HTTP2_HEADER_STATUS], HTTP_STATUS_OK); - strictEqual(flags, 5); // the end of stream flag is set + strictEqual(flags, 5); // The end of stream flag is set strictEqual(headers.foo, 'bar'); })); request.on('data', mustNotCall()); @@ -339,7 +339,7 @@ const { const request = client.request(headers); request.on('response', mustCall((headers, flags) => { strictEqual(headers[HTTP2_HEADER_STATUS], HTTP_STATUS_OK); - strictEqual(flags, 5); // the end of stream flag is set + strictEqual(flags, 5); // The end of stream flag is set })); request.on('data', mustNotCall()); request.on('end', mustCall(() => { diff --git a/test/parallel/test-http2-compat-serverresponse-flushheaders.js b/test/parallel/test-http2-compat-serverresponse-flushheaders.js index d155b07863..6927b3754b 100644 --- a/test/parallel/test-http2-compat-serverresponse-flushheaders.js +++ b/test/parallel/test-http2-compat-serverresponse-flushheaders.js @@ -15,7 +15,7 @@ server.listen(0, common.mustCall(function() { const port = server.address().port; server.once('request', common.mustCall(function(request, response) { assert.strictEqual(response.headersSent, false); - assert.strictEqual(response._header, false); // alias for headersSent + assert.strictEqual(response._header, false); // Alias for headersSent response.flushHeaders(); assert.strictEqual(response.headersSent, true); assert.strictEqual(response._header, true); diff --git a/test/parallel/test-http2-compat-write-head-destroyed.js b/test/parallel/test-http2-compat-write-head-destroyed.js index 4576119ee7..842bf0e9ab 100644 --- a/test/parallel/test-http2-compat-write-head-destroyed.js +++ b/test/parallel/test-http2-compat-write-head-destroyed.js @@ -8,7 +8,7 @@ const http2 = require('http2'); // Check that writeHead, write and end do not crash in compatibility mode const server = http2.createServer(common.mustCall((req, res) => { - // destroy the stream first + // Destroy the stream first req.stream.destroy(); res.writeHead(200); diff --git a/test/parallel/test-http2-connect.js b/test/parallel/test-http2-connect.js index bef4ff7960..a2f30f974e 100644 --- a/test/parallel/test-http2-connect.js +++ b/test/parallel/test-http2-connect.js @@ -55,7 +55,7 @@ const { connect: netConnect } = require('net'); })); } -// check for https as protocol +// Check for https as protocol { const authority = 'https://localhost'; // A socket error may or may not be reported, keep this as a non-op diff --git a/test/parallel/test-http2-head-request.js b/test/parallel/test-http2-head-request.js index a56abf3c90..c8103e7190 100644 --- a/test/parallel/test-http2-head-request.js +++ b/test/parallel/test-http2-head-request.js @@ -49,7 +49,7 @@ server.listen(0, () => { req.on('response', common.mustCall((headers, flags) => { assert.strictEqual(headers[HTTP2_HEADER_STATUS], 200); - assert.strictEqual(flags, 5); // the end of stream flag is set + assert.strictEqual(flags, 5); // The end of stream flag is set })); req.on('data', common.mustNotCall()); req.on('end', common.mustCall(() => { diff --git a/test/parallel/test-http2-session-settings.js b/test/parallel/test-http2-session-settings.js index 6061808082..46ba1753e2 100644 --- a/test/parallel/test-http2-session-settings.js +++ b/test/parallel/test-http2-session-settings.js @@ -101,7 +101,7 @@ server.listen( ); }); - // error checks for enablePush + // Error checks for enablePush [1, {}, 'test', [], null, Infinity, NaN].forEach((i) => { common.expectsError( () => client.settings({ enablePush: i }), diff --git a/test/parallel/test-http2-session-unref.js b/test/parallel/test-http2-session-unref.js index 0381971c0e..dcfbccf215 100644 --- a/test/parallel/test-http2-session-unref.js +++ b/test/parallel/test-http2-session-unref.js @@ -35,7 +35,7 @@ server.listen(0, common.mustCall(() => { client.unref(); } - // unref destroyed client + // Unref destroyed client { const client = http2.connect(`http://localhost:${port}`); @@ -45,7 +45,7 @@ server.listen(0, common.mustCall(() => { })); } - // unref destroyed client + // Unref destroyed client { const client = http2.connect(`http://localhost:${port}`, { createConnection: common.mustCall(() => clientSide) diff --git a/test/parallel/test-https-agent-create-connection.js b/test/parallel/test-https-agent-create-connection.js index c0b50cef01..1bb3da5f1e 100644 --- a/test/parallel/test-https-agent-create-connection.js +++ b/test/parallel/test-https-agent-create-connection.js @@ -59,7 +59,7 @@ function createServer() { })); } -// use port and option connect +// Use port and option connect { const server = createServer(); server.listen(0, common.mustCall(() => { @@ -103,7 +103,7 @@ function createServer() { })); } -// options is null +// `options` is null { const server = createServer(); server.listen(0, common.mustCall(() => { @@ -118,7 +118,7 @@ function createServer() { })); } -// options is undefined +// `options` is undefined { const server = createServer(); server.listen(0, common.mustCall(() => { diff --git a/test/parallel/test-https-agent-getname.js b/test/parallel/test-https-agent-getname.js index 5c95da549b..dabb08f074 100644 --- a/test/parallel/test-https-agent-getname.js +++ b/test/parallel/test-https-agent-getname.js @@ -15,7 +15,7 @@ assert.strictEqual( 'localhost:::::::::::::::::::' ); -// pass all options arguments +// Pass all options arguments const options = { host: '0.0.0.0', port: 443, diff --git a/test/parallel/test-https-argument-of-creating.js b/test/parallel/test-https-argument-of-creating.js index c46dd204c5..6f1564826e 100644 --- a/test/parallel/test-https-argument-of-creating.js +++ b/test/parallel/test-https-argument-of-creating.js @@ -10,7 +10,7 @@ const tls = require('tls'); const dftProtocol = {}; -// test for immutable `opts` +// Test for immutable `opts` { const opts = { foo: 'bar', ALPNProtocols: [ 'http/1.1' ] }; const server = https.createServer(opts); diff --git a/test/parallel/test-https-client-override-global-agent.js b/test/parallel/test-https-client-override-global-agent.js index 0aaab0d7b3..a4bb273275 100644 --- a/test/parallel/test-https-client-override-global-agent.js +++ b/test/parallel/test-https-client-override-global-agent.js @@ -25,7 +25,7 @@ server.listen(0, common.mustCall(() => { https.globalAgent = agent; makeRequest(); - assert(agent.sockets.hasOwnProperty(name)); // agent has indeed been used + assert(agent.sockets.hasOwnProperty(name)); // Agent has indeed been used })); function makeRequest() { diff --git a/test/parallel/test-https-client-renegotiation-limit.js b/test/parallel/test-https-client-renegotiation-limit.js index 3527c48f4b..4d3dda3d75 100644 --- a/test/parallel/test-https-client-renegotiation-limit.js +++ b/test/parallel/test-https-client-renegotiation-limit.js @@ -35,7 +35,7 @@ const fixtures = require('../common/fixtures'); // Renegotiation as a protocol feature was dropped after TLS1.2. tls.DEFAULT_MAX_VERSION = 'TLSv1.2'; -// renegotiation limits to test +// Renegotiation limits to test const LIMITS = [0, 1, 2, 3, 5, 10, 16]; { @@ -96,7 +96,7 @@ function test(next) { spam(); - // simulate renegotiation attack + // Simulate renegotiation attack function spam() { client.renegotiate({}, (err) => { assert.ifError(err); diff --git a/test/parallel/test-https-strict.js b/test/parallel/test-https-strict.js index f849ae800f..a72168289d 100644 --- a/test/parallel/test-https-strict.js +++ b/test/parallel/test-https-strict.js @@ -161,7 +161,7 @@ function makeReq(path, port, error, host, ca) { } function allListening() { - // ok, ready to start the tests! + // Ok, ready to start the tests! const port1 = server1.address().port; const port2 = server2.address().port; const port3 = server3.address().port; diff --git a/test/parallel/test-https-timeout.js b/test/parallel/test-https-timeout.js index e034adc39d..9ba621e436 100644 --- a/test/parallel/test-https-timeout.js +++ b/test/parallel/test-https-timeout.js @@ -33,7 +33,7 @@ const options = { cert: fixtures.readKey('agent1-cert.pem') }; -// a server that never replies +// A server that never replies const server = https.createServer(options, function() { console.log('Got request. Doing nothing.'); }).listen(0, common.mustCall(function() { diff --git a/test/parallel/test-icu-punycode.js b/test/parallel/test-icu-punycode.js index 35dab6232f..7e8dcf3759 100644 --- a/test/parallel/test-icu-punycode.js +++ b/test/parallel/test-icu-punycode.js @@ -9,7 +9,7 @@ const { internalBinding } = require('internal/test/binding'); const icu = internalBinding('icu'); const assert = require('assert'); -// test hasConverter method +// Test hasConverter method assert(icu.hasConverter('utf-8'), 'hasConverter should report coverter exists for utf-8'); assert(!icu.hasConverter('x'), diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index 255bf066aa..7e248bea1d 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -115,14 +115,14 @@ if (!common.hasIntl) { const collOpts = { sensitivity: 'base', ignorePunctuation: true }; const coll = new Intl.Collator(['en'], collOpts); - // ignore punctuation + // Ignore punctuation assert.strictEqual(coll.compare('blackbird', 'black-bird'), 0); - // compare less + // Compare less assert.strictEqual(coll.compare('blackbird', 'red-bird'), -1); - // compare greater + // Compare greater assert.strictEqual(coll.compare('bluebird', 'blackbird'), 1); - // ignore case + // Ignore case assert.strictEqual(coll.compare('Bluebird', 'bluebird'), 0); - // ffi ligature (contraction) + // `ffi` ligature (contraction) assert.strictEqual(coll.compare('\ufb03', 'ffi'), 0); } diff --git a/test/parallel/test-listen-fd-cluster.js b/test/parallel/test-listen-fd-cluster.js index 416adb3935..45bb03ce58 100644 --- a/test/parallel/test-listen-fd-cluster.js +++ b/test/parallel/test-listen-fd-cluster.js @@ -136,7 +136,7 @@ function master() { function worker() { console.error('worker, about to create server and listen on fd=3'); - // start a server on fd=3 + // Start a server on fd=3 http.createServer(function(req, res) { console.error('request on worker'); console.error('%s %s', req.method, req.url, req.headers); diff --git a/test/parallel/test-listen-fd-detached-inherit.js b/test/parallel/test-listen-fd-detached-inherit.js index 9f672a9a55..81c07d1263 100644 --- a/test/parallel/test-listen-fd-detached-inherit.js +++ b/test/parallel/test-listen-fd-detached-inherit.js @@ -105,7 +105,7 @@ function parent() { // Run as a child of the parent() mode. function child() { - // start a server on fd=3 + // Start a server on fd=3 http.createServer(function(req, res) { console.error('request on child'); console.error('%s %s', req.method, req.url, req.headers); diff --git a/test/parallel/test-listen-fd-detached.js b/test/parallel/test-listen-fd-detached.js index d2fa770719..efa0832304 100644 --- a/test/parallel/test-listen-fd-detached.js +++ b/test/parallel/test-listen-fd-detached.js @@ -102,7 +102,7 @@ function parent() { } function child() { - // start a server on fd=3 + // Start a server on fd=3 http.createServer(function(req, res) { console.error('request on child'); console.error('%s %s', req.method, req.url, req.headers); diff --git a/test/parallel/test-listen-fd-server.js b/test/parallel/test-listen-fd-server.js index a09a01f219..3b6a0a0fac 100644 --- a/test/parallel/test-listen-fd-server.js +++ b/test/parallel/test-listen-fd-server.js @@ -74,7 +74,7 @@ function child() { process.exit(0); }); - // start a server on fd=3 + // Start a server on fd=3 http.createServer(function(req, res) { console.error('request on child'); console.error('%s %s', req.method, req.url, req.headers); diff --git a/test/parallel/test-microtask-queue-run-immediate.js b/test/parallel/test-microtask-queue-run-immediate.js index 2d4e21f83a..577391993b 100644 --- a/test/parallel/test-microtask-queue-run-immediate.js +++ b/test/parallel/test-microtask-queue-run-immediate.js @@ -33,7 +33,7 @@ process.on('exit', function() { assert.strictEqual(done, 2); }); -// no nextTick, microtask +// No nextTick, microtask setImmediate(function() { enqueueMicrotask(function() { done++; diff --git a/test/parallel/test-microtask-queue-run.js b/test/parallel/test-microtask-queue-run.js index 7a1667819f..5281cb4f3c 100644 --- a/test/parallel/test-microtask-queue-run.js +++ b/test/parallel/test-microtask-queue-run.js @@ -33,7 +33,7 @@ process.on('exit', function() { assert.strictEqual(done, 2); }); -// no nextTick, microtask +// No nextTick, microtask setTimeout(function() { enqueueMicrotask(function() { done++; diff --git a/test/parallel/test-net-can-reset-timeout.js b/test/parallel/test-net-can-reset-timeout.js index 69f6c9288b..2fac07eab0 100644 --- a/test/parallel/test-net-can-reset-timeout.js +++ b/test/parallel/test-net-can-reset-timeout.js @@ -33,7 +33,7 @@ const server = net.createServer(common.mustCall(function(stream) { stream.once('timeout', common.mustCall(function() { console.log('timeout'); - // try to reset the timeout. + // Try to reset the timeout. stream.write('WHAT.'); })); diff --git a/test/parallel/test-net-connect-memleak.js b/test/parallel/test-net-connect-memleak.js index 4efceee0ea..2f06e56e1f 100644 --- a/test/parallel/test-net-connect-memleak.js +++ b/test/parallel/test-net-connect-memleak.js @@ -42,7 +42,7 @@ const gcListener = { ongc() { collected = true; } }; const sock = net.createConnection( server.address().port, common.mustCall(() => { - assert.strictEqual(gcObject, gcObject); // keep reference alive + assert.strictEqual(gcObject, gcObject); // Keep reference alive assert.strictEqual(collected, false); setImmediate(done, sock); })); diff --git a/test/parallel/test-net-pingpong.js b/test/parallel/test-net-pingpong.js index 4ab36fc239..99a02eda22 100644 --- a/test/parallel/test-net-pingpong.js +++ b/test/parallel/test-net-pingpong.js @@ -67,7 +67,7 @@ function pingPongTest(port, host) { socket.on('end', common.mustCall(function() { assert.strictEqual(socket.allowHalfOpen, true); - assert.strictEqual(socket.writable, true); // because allowHalfOpen + assert.strictEqual(socket.writable, true); // Because allowHalfOpen assert.strictEqual(socket.readable, false); socket.end(); })); diff --git a/test/parallel/test-net-server-listen-handle.js b/test/parallel/test-net-server-listen-handle.js index 0d59bd76ca..58f9d2ae37 100644 --- a/test/parallel/test-net-server-listen-handle.js +++ b/test/parallel/test-net-server-listen-handle.js @@ -53,7 +53,7 @@ function randomHandle(type) { assert.fail(`unable to bind ${handleName}: ${getSystemErrorName(errno)}`); } - if (!common.isWindows) { // fd doesn't work on windows + if (!common.isWindows) { // `fd` doesn't work on Windows. // err >= 0 but fd = -1, should not happen assert.notStrictEqual(handle.fd, -1, `Bound ${handleName} has fd -1 and errno ${errno}`); @@ -82,7 +82,7 @@ function randomPipes(number) { // Not a public API, used by child_process if (!common.isWindows) { // Windows doesn't support {fd: <n>} - const handles = randomPipes(2); // generate pipes in advance + const handles = randomPipes(2); // Generate pipes in advance // Test listen(pipe) net.createServer() .listen(handles[0]) @@ -120,7 +120,7 @@ if (!common.isWindows) { // Windows doesn't support {fd: <n>} } if (!common.isWindows) { // Windows doesn't support {fd: <n>} - const handles = randomPipes(6); // generate pipes in advance + const handles = randomPipes(6); // Generate pipes in advance // Test listen({handle: pipe}, cb) net.createServer() .listen({ handle: handles[0] }, closePipeServer(handles[0])); diff --git a/test/parallel/test-net-server-unref-persistent.js b/test/parallel/test-net-server-unref-persistent.js index 9b9460635d..b772782100 100644 --- a/test/parallel/test-net-server-unref-persistent.js +++ b/test/parallel/test-net-server-unref-persistent.js @@ -3,7 +3,7 @@ const common = require('../common'); const net = require('net'); const server = net.createServer(); -// unref before listening +// Unref before listening server.unref(); server.listen(); diff --git a/test/parallel/test-net-socket-local-address.js b/test/parallel/test-net-socket-local-address.js index dda2d5acad..58645322f4 100644 --- a/test/parallel/test-net-socket-local-address.js +++ b/test/parallel/test-net-socket-local-address.js @@ -1,6 +1,6 @@ 'use strict'; const common = require('../common'); -// skip test in FreeBSD jails +// Skip test in FreeBSD jails if (common.inFreeBSDJail) common.skip('In a FreeBSD jail'); diff --git a/test/parallel/test-path-relative.js b/test/parallel/test-path-relative.js index 5d5d118cc6..599381cdcc 100644 --- a/test/parallel/test-path-relative.js +++ b/test/parallel/test-path-relative.js @@ -35,7 +35,7 @@ const relativeTests = [ ] ], [ path.posix.relative, - // arguments result + // Arguments result [['/var/lib', '/var', '..'], ['/var/lib', '/bin', '../../bin'], ['/var/lib', '/var/lib', ''], diff --git a/test/parallel/test-process-kill-pid.js b/test/parallel/test-process-kill-pid.js index 698fa4cf62..6d0af8bd3e 100644 --- a/test/parallel/test-process-kill-pid.js +++ b/test/parallel/test-process-kill-pid.js @@ -23,7 +23,7 @@ const common = require('../common'); const assert = require('assert'); -// test variants of pid +// Test variants of pid // // null: TypeError // undefined: TypeError diff --git a/test/parallel/test-process-raw-debug.js b/test/parallel/test-process-raw-debug.js index 090525e18c..ba5ae74f0f 100644 --- a/test/parallel/test-process-raw-debug.js +++ b/test/parallel/test-process-raw-debug.js @@ -58,7 +58,7 @@ function parent() { } function child() { - // even when all hope is lost... + // Even when all hope is lost... process.nextTick = function() { throw new Error('No ticking!'); diff --git a/test/parallel/test-promises-unhandled-proxy-rejections.js b/test/parallel/test-promises-unhandled-proxy-rejections.js index b3cf5719cb..659db4d179 100644 --- a/test/parallel/test-promises-unhandled-proxy-rejections.js +++ b/test/parallel/test-promises-unhandled-proxy-rejections.js @@ -39,5 +39,5 @@ common.expectWarning({ UnhandledPromiseRejectionWarning: expectedPromiseWarning, }); -// ensure this doesn't crash +// Ensure this doesn't crash Promise.reject(thorny); diff --git a/test/parallel/test-promises-unhandled-symbol-rejections.js b/test/parallel/test-promises-unhandled-symbol-rejections.js index d777a13e62..460acaca57 100644 --- a/test/parallel/test-promises-unhandled-symbol-rejections.js +++ b/test/parallel/test-promises-unhandled-symbol-rejections.js @@ -23,5 +23,5 @@ common.expectWarning({ ], }); -// ensure this doesn't crash +// Ensure this doesn't crash Promise.reject(Symbol()); diff --git a/test/parallel/test-querystring-escape.js b/test/parallel/test-querystring-escape.js index 25a800a09a..fedc098124 100644 --- a/test/parallel/test-querystring-escape.js +++ b/test/parallel/test-querystring-escape.js @@ -22,7 +22,7 @@ common.expectsError( } ); -// using toString for objects +// Using toString for objects assert.strictEqual( qs.escape({ test: 5, toString: () => 'test', valueOf: () => 10 }), 'test' diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js index b26f41a466..de1768103d 100644 --- a/test/parallel/test-querystring.js +++ b/test/parallel/test-querystring.js @@ -223,7 +223,7 @@ qsNoMungeTestCases.forEach((testCase) => { assert.deepStrictEqual(qs.stringify(testCase[1], '&', '='), testCase[0]); }); -// test the nested qs-in-qs case +// Test the nested qs-in-qs case { const f = qs.parse('a=b&q=x%3Dy%26y%3Dz'); check(f, createWithNoPrototype([ @@ -254,7 +254,7 @@ qsNoMungeTestCases.forEach((testCase) => { check(f.q, expectedInternal); } -// now test stringifying +// Now test stringifying // basic qsTestCases.forEach((testCase) => { @@ -279,7 +279,7 @@ common.expectsError( } ); -// coerce numbers to string +// Coerce numbers to string assert.strictEqual(qs.stringify({ foo: 0 }), 'foo=0'); assert.strictEqual(qs.stringify({ foo: -0 }), 'foo=0'); assert.strictEqual(qs.stringify({ foo: 3 }), 'foo=3'); @@ -434,7 +434,7 @@ qsUnescapeTestCases.forEach((testCase) => { assert.strictEqual(qs.unescapeBuffer(testCase[0]).toString(), testCase[1]); }); -// test overriding .unescape +// Test overriding .unescape { const prevUnescape = qs.unescape; qs.unescape = (str) => { diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index fba215e225..5096198a71 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -73,7 +73,7 @@ function isWarned(emitter) { } { - // set crlfDelay to 5000ms + // Set crlfDelay to 5000ms const fi = new FakeInput(); const rli = new readline.Interface({ input: fi, @@ -98,7 +98,7 @@ function isWarned(emitter) { rli.close(); } - // default history size 30 + // Default history size 30 { const fi = new FakeInput(); const rli = new readline.Interface( @@ -126,7 +126,7 @@ function isWarned(emitter) { assert.ok(called); } - // sending a blank line + // Sending a blank line { const fi = new FakeInput(); const rli = new readline.Interface( @@ -531,7 +531,7 @@ function isWarned(emitter) { rli.close(); } - // calling the question callback + // Calling the question callback { let called = false; const fi = new FakeInput(); @@ -576,7 +576,7 @@ function isWarned(emitter) { rli.close(); } - // sending a multi-line question + // Sending a multi-line question { const fi = new FakeInput(); const rli = new readline.Interface( diff --git a/test/parallel/test-readline-keys.js b/test/parallel/test-readline-keys.js index f61c64043f..0f5ca4d714 100644 --- a/test/parallel/test-readline-keys.js +++ b/test/parallel/test-readline-keys.js @@ -82,7 +82,7 @@ const addKeyIntervalTest = (sequences, expectedKeys, interval = 550, return fn; }; -// regular alphanumerics +// Regular alphanumerics addTest('io.JS', [ { name: 'i', sequence: 'i' }, { name: 'o', sequence: 'o' }, @@ -91,14 +91,14 @@ addTest('io.JS', [ { name: 's', sequence: 'S', shift: true }, ]); -// named characters +// Named characters addTest('\n\r\t', [ { name: 'enter', sequence: '\n' }, { name: 'return', sequence: '\r' }, { name: 'tab', sequence: '\t' }, ]); -// space and backspace +// Space and backspace addTest('\b\x7f\x1b\b\x1b\x7f\x1b\x1b \x1b ', [ { name: 'backspace', sequence: '\b' }, { name: 'backspace', sequence: '\x7f' }, @@ -109,19 +109,19 @@ addTest('\b\x7f\x1b\b\x1b\x7f\x1b\x1b \x1b ', [ { name: 'space', sequence: '\x1b ', meta: true }, ]); -// escape key +// Escape key addTest('\x1b\x1b\x1b', [ { name: 'escape', sequence: '\x1b\x1b\x1b', meta: true }, ]); -// control keys +// Control keys addTest('\x01\x0b\x10', [ { name: 'a', sequence: '\x01', ctrl: true }, { name: 'k', sequence: '\x0b', ctrl: true }, { name: 'p', sequence: '\x10', ctrl: true }, ]); -// alt keys +// Alt keys addTest('a\x1baA\x1bA', [ { name: 'a', sequence: 'a' }, { name: 'a', sequence: '\x1ba', meta: true }, @@ -145,7 +145,7 @@ addTest('\x1b[11~\x1b[12~\x1b[13~\x1b[14~', [ { name: 'f4', sequence: '\x1b[14~', code: '[14~' }, ]); -// from Cygwin and used in libuv +// From Cygwin and used in libuv addTest('\x1b[[A\x1b[[B\x1b[[C\x1b[[D\x1b[[E', [ { name: 'f1', sequence: '\x1b[[A', code: '[[A' }, { name: 'f2', sequence: '\x1b[[B', code: '[[B' }, @@ -154,7 +154,7 @@ addTest('\x1b[[A\x1b[[B\x1b[[C\x1b[[D\x1b[[E', [ { name: 'f5', sequence: '\x1b[[E', code: '[[E' }, ]); -// common +// Common addTest('\x1b[15~\x1b[17~\x1b[18~\x1b[19~\x1b[20~\x1b[21~\x1b[23~\x1b[24~', [ { name: 'f5', sequence: '\x1b[15~', code: '[15~' }, { name: 'f6', sequence: '\x1b[17~', code: '[17~' }, @@ -188,7 +188,7 @@ addTest('\x1bOA\x1bOB\x1bOC\x1bOD\x1bOE\x1bOF\x1bOH', [ { name: 'home', sequence: '\x1bOH', code: 'OH' }, ]); -// old xterm shift-arrows +// Old xterm shift-arrows addTest('\x1bO2A\x1bO2B', [ { name: 'up', sequence: '\x1bO2A', code: 'OA', shift: true }, { name: 'down', sequence: '\x1bO2B', code: 'OB', shift: true }, @@ -224,7 +224,7 @@ addTest('\x1b[A\x1b[B\x1b[2A\x1b[2B', [ { name: 'down', sequence: '\x1b[2B', code: '[B', shift: true }, ]); -// rxvt keys with modifiers +// `rxvt` keys with modifiers. // eslint-disable-next-line max-len addTest('\x1b[20~\x1b[2$\x1b[2^\x1b[3$\x1b[3^\x1b[5$\x1b[5^\x1b[6$\x1b[6^\x1b[7$\x1b[7^\x1b[8$\x1b[8^', [ { name: 'f9', sequence: '\x1b[20~', code: '[20~' }, @@ -242,7 +242,7 @@ addTest('\x1b[20~\x1b[2$\x1b[2^\x1b[3$\x1b[3^\x1b[5$\x1b[5^\x1b[6$\x1b[6^\x1b[7$ { name: 'end', sequence: '\x1b[8^', code: '[8^', ctrl: true }, ]); -// misc +// Misc addTest('\x1b[Z', [ { name: 'tab', sequence: '\x1b[Z', code: '[Z', shift: true }, ]); @@ -277,7 +277,7 @@ addTest('\x1b[DD\x1b[2DD\x1b[2^D', [ { name: 'd', sequence: 'D', shift: true }, ]); -// color sequences +// Color sequences addTest('\x1b[31ma\x1b[39ma', [ { name: 'undefined', sequence: '\x1b[31m', code: '[31m' }, { name: 'a', sequence: 'a' }, @@ -285,7 +285,7 @@ addTest('\x1b[31ma\x1b[39ma', [ { name: 'a', sequence: 'a' }, ]); -// rxvt keys with modifiers +// `rxvt` keys with modifiers. addTest('\x1b[a\x1b[b\x1b[c\x1b[d\x1b[e', [ { name: 'up', sequence: '\x1b[a', code: '[a', shift: true }, { name: 'down', sequence: '\x1b[b', code: '[b', shift: true }, @@ -303,13 +303,13 @@ addTest('\x1bOa\x1bOb\x1bOc\x1bOd\x1bOe', [ ]); // Reduce array of addKeyIntervalTest(..) right to left -// with () => {} as initial function +// with () => {} as initial function. const runKeyIntervalTests = [ - // escape character + // Escape character addKeyIntervalTest('\x1b', [ { name: 'escape', sequence: '\x1b', meta: true } ]), - // chain of escape characters + // Chain of escape characters. addKeyIntervalTest('\x1b\x1b\x1b\x1b'.split(''), [ { name: 'escape', sequence: '\x1b', meta: true }, { name: 'escape', sequence: '\x1b', meta: true }, @@ -318,5 +318,5 @@ const runKeyIntervalTests = [ ]) ].reverse().reduce((acc, fn) => fn(acc), () => {}); -// Run key interval tests one after another +// Run key interval tests one after another. runKeyIntervalTests(); diff --git a/test/parallel/test-repl-autolibs.js b/test/parallel/test-repl-autolibs.js index 976cad8436..5cf3b14972 100644 --- a/test/parallel/test-repl-autolibs.js +++ b/test/parallel/test-repl-autolibs.js @@ -55,7 +55,7 @@ function test2() { putIn.write = function(data) { gotWrite = true; if (data.length) { - // repl response error message + // REPL response error message assert.strictEqual(data, '{}\n'); // Original value wasn't overwritten assert.strictEqual(val, global.url); diff --git a/test/parallel/test-repl-context.js b/test/parallel/test-repl-context.js index 001e2ffd4e..287d8adc29 100644 --- a/test/parallel/test-repl-context.js +++ b/test/parallel/test-repl-context.js @@ -58,7 +58,7 @@ const stream = new ArrayStream(); assert.strictEqual(server.lines[0], '_ = 500;'); assert.strictEqual(server.last, 500); - // reset the server context + // Reset the server context server.resetContext(); assert.ok(!server.underscoreAssigned); assert.strictEqual(server.lines.length, 0); diff --git a/test/parallel/test-repl-end-emits-exit.js b/test/parallel/test-repl-end-emits-exit.js index 8de0a006df..4e1f3d84f5 100644 --- a/test/parallel/test-repl-end-emits-exit.js +++ b/test/parallel/test-repl-end-emits-exit.js @@ -38,7 +38,7 @@ function testTerminalMode() { }); process.nextTick(function() { - // manually fire a ^D keypress + // Manually fire a ^D keypress stream.emit('data', '\u0004'); }); diff --git a/test/parallel/test-repl-options.js b/test/parallel/test-repl-options.js index f6f6273f37..cbb5a9a6e5 100644 --- a/test/parallel/test-repl-options.js +++ b/test/parallel/test-repl-options.js @@ -52,7 +52,7 @@ assert.strictEqual(r1.ignoreUndefined, false); assert.strictEqual(r1.replMode, repl.REPL_MODE_SLOPPY); assert.strictEqual(r1.historySize, 30); -// test r1 for backwards compact +// Test r1 for backwards compact assert.strictEqual(r1.rli.input, stream); assert.strictEqual(r1.rli.output, stream); assert.strictEqual(r1.rli.input, r1.inputStream); @@ -87,7 +87,7 @@ assert.strictEqual(r2.writer, writer); assert.strictEqual(r2.replMode, repl.REPL_MODE_STRICT); assert.strictEqual(r2.historySize, 50); -// test r2 for backwards compact +// Test r2 for backwards compact assert.strictEqual(r2.rli.input, stream); assert.strictEqual(r2.rli.output, stream); assert.strictEqual(r2.rli.input, r2.inputStream); diff --git a/test/parallel/test-repl-save-load.js b/test/parallel/test-repl-save-load.js index 74841d86ff..d36a2b74d4 100644 --- a/test/parallel/test-repl-save-load.js +++ b/test/parallel/test-repl-save-load.js @@ -99,7 +99,7 @@ let loadFile = join(tmpdir.path, 'file.does.not.exist'); putIn.write = function(data) { // Make sure I get a failed to load message and not some crazy error assert.strictEqual(data, `Failed to load:${loadFile}\n`); - // eat me to avoid work + // Eat me to avoid work putIn.write = () => {}; }; putIn.run([`.load ${loadFile}`]); diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 558b6cab47..02cd06c953 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -528,7 +528,7 @@ testCustomCompleterAsyncMode.complete('a', common.mustCall((error, data) => { ]); })); -// tab completion in editor mode +// Tab completion in editor mode const editorStream = new ArrayStream(); const editor = repl.start({ stream: editorStream, diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 1426330e20..ad674cb3ab 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -35,7 +35,7 @@ const prompt_tcp = 'node via TCP socket> '; // Absolute path to test/fixtures/a.js const moduleFilename = fixtures.path('a'); -// function for REPL to run +// Function for REPL to run global.invoke_me = function(arg) { return `invoked ${arg}`; }; @@ -358,7 +358,7 @@ const errorTests = [ send: ')', expect: 'undefined' }, - // npm prompt error message + // `npm` prompt error message. { send: 'npm install foobar', expect: [ @@ -676,7 +676,7 @@ const errorTests = [ /^SyntaxError: / ] }, - // bring back the repl to prompt + // Bring back the repl to prompt { send: '.break', expect: '' diff --git a/test/parallel/test-require-extension-over-directory.js b/test/parallel/test-require-extension-over-directory.js index cc896d7b61..9225876151 100644 --- a/test/parallel/test-require-extension-over-directory.js +++ b/test/parallel/test-require-extension-over-directory.js @@ -1,5 +1,5 @@ 'use strict'; -// fixes regression from v4 +// Fixes regression from v4 require('../common'); const assert = require('assert'); const fixtures = require('../common/fixtures'); diff --git a/test/parallel/test-require-symlink.js b/test/parallel/test-require-symlink.js index c73fdcd41e..5c9b0fbdef 100644 --- a/test/parallel/test-require-symlink.js +++ b/test/parallel/test-require-symlink.js @@ -63,12 +63,12 @@ function test() { fs.symlinkSync(linkTarget, linkDir, 'dir'); fs.symlinkSync(linkScriptTarget, linkScript); - // load symlinked-module + // Load symlinked-module const fooModule = require(path.join(tmpDirTarget, 'foo.js')); assert.strictEqual(fooModule.dep1.bar.version, 'CORRECT_VERSION'); assert.strictEqual(fooModule.dep2.bar.version, 'CORRECT_VERSION'); - // load symlinked-script as main + // Load symlinked-script as main const node = process.execPath; const child = spawn(node, ['--preserve-symlinks', linkScript]); child.on('close', function(code, signal) { diff --git a/test/parallel/test-stream-big-push.js b/test/parallel/test-stream-big-push.js index 5eabd4837e..f9e75edd3f 100644 --- a/test/parallel/test-stream-big-push.js +++ b/test/parallel/test-stream-big-push.js @@ -51,10 +51,10 @@ r._read = common.mustCall(_read, 3); r.on('end', common.mustCall()); -// push some data in to start. -// we've never gotten any read event at this point. +// Push some data in to start. +// We've never gotten any read event at this point. const ret = r.push(str); -// should be false. > hwm +// Should be false. > hwm assert(!ret); let chunk = r.read(); assert.strictEqual(chunk, str); diff --git a/test/parallel/test-stream-finished.js b/test/parallel/test-stream-finished.js index e06017920c..329b4ed42b 100644 --- a/test/parallel/test-stream-finished.js +++ b/test/parallel/test-stream-finished.js @@ -104,7 +104,7 @@ const { promisify } = require('util'); })); rs.push(null); - rs.emit('close'); // should not trigger an error + rs.emit('close'); // Should not trigger an error rs.resume(); } @@ -115,7 +115,7 @@ const { promisify } = require('util'); assert(err, 'premature close error'); })); - rs.emit('close'); // should trigger error + rs.emit('close'); // Should trigger error rs.push(null); rs.resume(); } diff --git a/test/parallel/test-stream-readable-destroy.js b/test/parallel/test-stream-readable-destroy.js index 9f56467e20..05e7dd464d 100644 --- a/test/parallel/test-stream-readable-destroy.js +++ b/test/parallel/test-stream-readable-destroy.js @@ -166,7 +166,7 @@ const assert = require('assert'); } { - // destroy and destroy callback + // Destroy and destroy callback const read = new Readable({ read() {} }); diff --git a/test/parallel/test-stream-readable-event.js b/test/parallel/test-stream-readable-event.js index e248bed4b5..4f2383508a 100644 --- a/test/parallel/test-stream-readable-event.js +++ b/test/parallel/test-stream-readable-event.js @@ -118,7 +118,7 @@ const Readable = require('stream').Readable; // #20923 const r = new Readable(); r._read = function() { - // actually doing thing here + // Actually doing thing here }; r.on('data', function() {}); diff --git a/test/parallel/test-stream-readable-pause-and-resume.js b/test/parallel/test-stream-readable-pause-and-resume.js index 505327e247..3169023d90 100644 --- a/test/parallel/test-stream-readable-pause-and-resume.js +++ b/test/parallel/test-stream-readable-pause-and-resume.js @@ -34,7 +34,7 @@ function readAndPause() { readAndPause(); rs.resume(); }); - }, 1); // only call ondata once + }, 1); // Only call ondata once rs.on('data', ondata); } diff --git a/test/parallel/test-stream-readable-reading-readingMore.js b/test/parallel/test-stream-readable-reading-readingMore.js index e57a808286..f616b46048 100644 --- a/test/parallel/test-stream-readable-reading-readingMore.js +++ b/test/parallel/test-stream-readable-reading-readingMore.js @@ -40,10 +40,10 @@ const Readable = require('stream').Readable; // If the stream has ended, we shouldn't be reading assert.strictEqual(state.ended, !state.reading); - // consume all the data + // Consume all the data while (readable.read() !== null) {} - if (expectedReadingMore.length === 0) // reached end of stream + if (expectedReadingMore.length === 0) // Reached end of stream process.nextTick(common.mustCall(onStreamEnd, 1)); }, 3)); @@ -94,7 +94,7 @@ const Readable = require('stream').Readable; readable.on('end', common.mustCall(onStreamEnd)); readable.push('pushed'); - // stop emitting 'data' events + // Stop emitting 'data' events assert.strictEqual(state.flowing, true); readable.pause(); @@ -152,7 +152,7 @@ const Readable = require('stream').Readable; process.nextTick(function() { readable.resume(); - // stop emitting 'data' events + // Stop emitting 'data' events assert.strictEqual(state.flowing, true); readable.pause(); diff --git a/test/parallel/test-stream-transform-split-highwatermark.js b/test/parallel/test-stream-transform-split-highwatermark.js index 7837b009cd..bcc33d26a6 100644 --- a/test/parallel/test-stream-transform-split-highwatermark.js +++ b/test/parallel/test-stream-transform-split-highwatermark.js @@ -12,7 +12,7 @@ function testTransform(expectedReadableHwm, expectedWritableHwm, options) { assert.strictEqual(t._writableState.highWaterMark, expectedWritableHwm); } -// test overriding defaultHwm +// Test overriding defaultHwm testTransform(666, DEFAULT, { readableHighWaterMark: 666 }); testTransform(DEFAULT, 777, { writableHighWaterMark: 777 }); testTransform(666, 777, { @@ -24,7 +24,7 @@ testTransform(666, 777, { testTransform(0, DEFAULT, { readableHighWaterMark: 0 }); testTransform(DEFAULT, 0, { writableHighWaterMark: 0 }); -// test highWaterMark overriding +// Test highWaterMark overriding testTransform(555, 555, { highWaterMark: 555, readableHighWaterMark: 666, @@ -54,7 +54,7 @@ testTransform(0, 0, { writableHighWaterMark: 777, }); -// test undefined, null +// Test undefined, null [undefined, null].forEach((v) => { testTransform(DEFAULT, DEFAULT, { readableHighWaterMark: v }); testTransform(DEFAULT, DEFAULT, { writableHighWaterMark: v }); diff --git a/test/parallel/test-stream-unshift-read-race.js b/test/parallel/test-stream-unshift-read-race.js index 69f966e05f..f7b633338c 100644 --- a/test/parallel/test-stream-unshift-read-race.js +++ b/test/parallel/test-stream-unshift-read-race.js @@ -46,7 +46,7 @@ let pushedNull = false; r._read = function(n) { assert(!pushedNull, '_read after null push'); - // every third chunk is fast + // Every third chunk is fast push(!(chunks % 3)); function push(fast) { diff --git a/test/parallel/test-stream-writable-destroy.js b/test/parallel/test-stream-writable-destroy.js index 56e1799079..a431d6d48d 100644 --- a/test/parallel/test-stream-writable-destroy.js +++ b/test/parallel/test-stream-writable-destroy.js @@ -205,7 +205,7 @@ const assert = require('assert'); } { - // destroy and destroy callback + // Destroy and destroy callback const write = new Writable({ write(chunk, enc, cb) { cb(); } }); diff --git a/test/parallel/test-stream-writableState-ending.js b/test/parallel/test-stream-writableState-ending.js index 69afd1af53..d301d355cc 100644 --- a/test/parallel/test-stream-writableState-ending.js +++ b/test/parallel/test-stream-writableState-ending.js @@ -32,6 +32,6 @@ const result = writable.end('testing function end()', () => { // End returns the writable instance assert.strictEqual(result, writable); -// ending, ended = true. +// Ending, ended = true. // finished = false. testStates(true, false, true); diff --git a/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js b/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js index 0cf9179ac4..b7375b9fa2 100644 --- a/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js +++ b/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js @@ -24,11 +24,11 @@ assert.strictEqual(writable._writableState.bufferedRequestCount, 0); writable.cork(); assert.strictEqual(writable._writableState.corked, 2); -// the first chunk is buffered +// The first chunk is buffered writable.write('first chunk'); assert.strictEqual(writable._writableState.bufferedRequestCount, 1); -// first uncork does nothing +// First uncork does nothing writable.uncork(); assert.strictEqual(writable._writableState.corked, 1); assert.strictEqual(writable._writableState.bufferedRequestCount, 1); diff --git a/test/parallel/test-stream2-push.js b/test/parallel/test-stream2-push.js index 9d209c18b9..748a77b9c4 100644 --- a/test/parallel/test-stream2-push.js +++ b/test/parallel/test-stream2-push.js @@ -97,7 +97,7 @@ writer._write = function(chunk, encoding, cb) { writer.on('finish', finish); -// now emit some chunks. +// Now emit some chunks. const chunk = 'asdfg'; diff --git a/test/parallel/test-stream2-readable-from-list.js b/test/parallel/test-stream2-readable-from-list.js index 0210a1848d..0ab7c059d6 100644 --- a/test/parallel/test-stream2-readable-from-list.js +++ b/test/parallel/test-stream2-readable-from-list.js @@ -64,7 +64,7 @@ function bufferListFromArray(arr) { ret = fromList(2, { buffer: list, length: 8 }); assert.strictEqual(ret.toString(), 'ba'); - // read more than we have. + // Read more than we have. ret = fromList(100, { buffer: list, length: 6 }); assert.strictEqual(ret.toString(), 'zykuel'); @@ -92,7 +92,7 @@ function bufferListFromArray(arr) { ret = fromList(2, { buffer: list, length: 8, decoder: true }); assert.strictEqual(ret, 'ba'); - // read more than we have. + // Read more than we have. ret = fromList(100, { buffer: list, length: 6, decoder: true }); assert.strictEqual(ret, 'zykuel'); diff --git a/test/parallel/test-stream2-readable-non-empty-end.js b/test/parallel/test-stream2-readable-non-empty-end.js index 3c0b5eb408..ba289fb912 100644 --- a/test/parallel/test-stream2-readable-non-empty-end.js +++ b/test/parallel/test-stream2-readable-non-empty-end.js @@ -59,11 +59,11 @@ test.on('readable', function() { test.read(0); function next() { - // now let's make 'end' happen + // Now let's make 'end' happen test.removeListener('end', thrower); test.on('end', common.mustCall()); - // one to get the last byte + // One to get the last byte let r = test.read(); assert(r); assert.strictEqual(r.length, 1); diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index b27b4116f3..fa24ce152d 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -178,7 +178,7 @@ const Transform = require('_stream_transform'); // Verify asymmetric transform (expand) const pt = new Transform(); - // emit each chunk 2 times. + // Emit each chunk 2 times. pt._transform = function(chunk, encoding, cb) { setTimeout(function() { pt.push(chunk); @@ -229,7 +229,7 @@ const Transform = require('_stream_transform'); }; pt._flush = function(cb) { - // just output whatever we have. + // Just output whatever we have. pt.push(Buffer.from(this.state)); this.state = ''; cb(); diff --git a/test/parallel/test-stream2-writable.js b/test/parallel/test-stream2-writable.js index af38df7e68..5b25da0b67 100644 --- a/test/parallel/test-stream2-writable.js +++ b/test/parallel/test-stream2-writable.js @@ -55,7 +55,7 @@ for (let i = 0; i < chunks.length; i++) { }); tw.on('finish', common.mustCall(function() { - // got chunks in the right order + // Got chunks in the right order assert.deepStrictEqual(tw.buffer, chunks); })); @@ -96,7 +96,7 @@ for (let i = 0; i < chunks.length; i++) { let drains = 0; tw.on('finish', common.mustCall(function() { - // got chunks in the right order + // Got chunks in the right order assert.deepStrictEqual(tw.buffer, chunks); assert.strictEqual(drains, 17); })); @@ -142,7 +142,7 @@ for (let i = 0; i < chunks.length; i++) { undefined ]; tw.on('finish', function() { - // got the expected chunks + // Got the expected chunks assert.deepStrictEqual(tw.buffer, chunks); }); @@ -181,7 +181,7 @@ for (let i = 0; i < chunks.length; i++) { undefined ]; tw.on('finish', function() { - // got the expected chunks + // Got the expected chunks assert.deepStrictEqual(tw.buffer, chunks); }); @@ -210,9 +210,9 @@ for (let i = 0; i < chunks.length; i++) { tw.on('finish', common.mustCall(function() { process.nextTick(common.mustCall(function() { - // got chunks in the right order + // Got chunks in the right order assert.deepStrictEqual(tw.buffer, chunks); - // called all callbacks + // Called all callbacks assert.deepStrictEqual(callbacks._called, chunks); })); })); diff --git a/test/parallel/test-stream3-pause-then-read.js b/test/parallel/test-stream3-pause-then-read.js index b86c015706..bfd8a20373 100644 --- a/test/parallel/test-stream3-pause-then-read.js +++ b/test/parallel/test-stream3-pause-then-read.js @@ -56,7 +56,7 @@ function push() { read100(); -// first we read 100 bytes +// First we read 100 bytes. function read100() { readn(100, onData); } @@ -77,7 +77,7 @@ function readn(n, then) { })(); } -// Then we listen to some data events +// Then we listen to some data events. function onData() { expectEndingData -= 100; console.error('onData'); @@ -85,24 +85,24 @@ function onData() { r.on('data', function od(c) { seen += c.length; if (seen >= 100) { - // seen enough + // Seen enough r.removeListener('data', od); r.pause(); if (seen > 100) { - // oh no, seen too much! - // put the extra back. + // Oh no, seen too much! + // Put the extra back. const diff = seen - 100; r.unshift(c.slice(c.length - diff)); console.error('seen too much', seen, diff); } - // Nothing should be lost in between + // Nothing should be lost in-between. setImmediate(pipeLittle); } }); } -// Just pipe 200 bytes, then unshift the extra and unpipe +// Just pipe 200 bytes, then unshift the extra and unpipe. function pipeLittle() { expectEndingData -= 200; console.error('pipe a little'); @@ -130,14 +130,14 @@ function pipeLittle() { r.pipe(w); } -// now read 1234 more bytes +// Now read 1234 more bytes. function read1234() { readn(1234, resumePause); } function resumePause() { console.error('resumePause'); - // Don't read anything, just resume and re-pause a whole bunch + // Don't read anything, just resume and re-pause a whole bunch. r.resume(); r.pause(); r.resume(); diff --git a/test/parallel/test-string-decoder-end.js b/test/parallel/test-string-decoder-end.js index 0c0c072eb9..ee0a47e357 100644 --- a/test/parallel/test-string-decoder-end.js +++ b/test/parallel/test-string-decoder-end.js @@ -86,7 +86,7 @@ function testEncoding(encoding) { } function testBuf(encoding, buf) { - // write one byte at a time. + // Write one byte at a time. let s = new SD(encoding); let res1 = ''; for (let i = 0; i < buf.length; i++) { diff --git a/test/parallel/test-stringbytes-external.js b/test/parallel/test-stringbytes-external.js index b66fb0960a..d64312f525 100644 --- a/test/parallel/test-stringbytes-external.js +++ b/test/parallel/test-stringbytes-external.js @@ -30,7 +30,7 @@ let ucs2_control = 'a\u0000'; let write_str = 'a'; -// first do basic checks +// First do basic checks let b = Buffer.from(write_str, 'ucs2'); // first check latin1 let c = b.toString('latin1'); @@ -43,7 +43,7 @@ assert.strictEqual(b[0], 0x61); assert.strictEqual(b[1], 0); assert.strictEqual(ucs2_control, c); -// now create big strings +// Now create big strings const size = 1 << 20; write_str = write_str.repeat(size); ucs2_control = ucs2_control.repeat(size); @@ -76,7 +76,7 @@ assert.strictEqual(c_bin.length, c_ucs.length); for (let i = 0; i < c_bin.length; i++) { assert.strictEqual(c_bin[i], c_ucs[i]); } -// check resultant strings +// Check resultant strings assert.strictEqual(c_bin.toString('ucs2'), c_ucs.toString('ucs2')); assert.strictEqual(c_bin.toString('latin1'), ucs2_control); assert.strictEqual(c_ucs.toString('latin1'), ucs2_control); @@ -96,7 +96,7 @@ const PRE_3OF4_APEX = Math.ceil((EXTERN_APEX / 4) * 3) - RADIOS; const pumped_string2 = slice2.toString('hex'); const decoded = Buffer.from(pumped_string, 'hex'); - // the string are the same? + // The string are the same? for (let k = 0; k < pumped_string.length; ++k) { assert.strictEqual(pumped_string[k], pumped_string2[k]); } @@ -117,7 +117,7 @@ const PRE_3OF4_APEX = Math.ceil((EXTERN_APEX / 4) * 3) - RADIOS; const pumped_string2 = slice2.toString('base64'); const decoded = Buffer.from(pumped_string, 'base64'); - // the string are the same? + // The string are the same? for (let k = 0; k < pumped_string.length - 3; ++k) { assert.strictEqual(pumped_string[k], pumped_string2[k]); } diff --git a/test/parallel/test-timers-ordering.js b/test/parallel/test-timers-ordering.js index 1f2809ab4e..6c6daecef3 100644 --- a/test/parallel/test-timers-ordering.js +++ b/test/parallel/test-timers-ordering.js @@ -44,7 +44,7 @@ function f(i) { `current ts ${now} < prev ts ${last_ts} + 1`); last_ts = now; - // schedule next iteration + // Schedule next iteration setTimeout(f, 1, i + 1); } } diff --git a/test/parallel/test-timers-uncaught-exception.js b/test/parallel/test-timers-uncaught-exception.js index 0a0eabf4c1..8bcf72e36c 100644 --- a/test/parallel/test-timers-uncaught-exception.js +++ b/test/parallel/test-timers-uncaught-exception.js @@ -24,7 +24,7 @@ const common = require('../common'); const assert = require('assert'); const errorMsg = 'BAM!'; -// the first timer throws... +// The first timer throws... setTimeout(common.mustCall(function() { throw new Error(errorMsg); }), 1); diff --git a/test/parallel/test-tls-alpn-server-client.js b/test/parallel/test-tls-alpn-server-client.js index 76604e0587..3da24c67fb 100644 --- a/test/parallel/test-tls-alpn-server-client.js +++ b/test/parallel/test-tls-alpn-server-client.js @@ -80,7 +80,7 @@ function Test1() { checkResults(results[1], { server: { ALPN: 'b' }, client: { ALPN: 'b' } }); - // nothing is selected by ALPN + // Nothing is selected by ALPN checkResults(results[2], { server: { ALPN: false }, client: { ALPN: false } }); @@ -98,15 +98,15 @@ function Test2() { const clientsOptions = [{}, {}, {}]; runTest(clientsOptions, serverOptions, function(results) { - // nothing is selected by ALPN + // Nothing is selected by ALPN checkResults(results[0], { server: { ALPN: false }, client: { ALPN: false } }); - // nothing is selected by ALPN + // Nothing is selected by ALPN checkResults(results[1], { server: { ALPN: false }, client: { ALPN: false } }); - // nothing is selected by ALPN + // Nothing is selected by ALPN checkResults(results[2], { server: { ALPN: false }, client: { ALPN: false } }); diff --git a/test/parallel/test-tls-client-renegotiation-limit.js b/test/parallel/test-tls-client-renegotiation-limit.js index 010fd8596a..38dcf5a80b 100644 --- a/test/parallel/test-tls-client-renegotiation-limit.js +++ b/test/parallel/test-tls-client-renegotiation-limit.js @@ -34,7 +34,7 @@ const fixtures = require('../common/fixtures'); // Renegotiation as a protocol feature was dropped after TLS1.2. tls.DEFAULT_MAX_VERSION = 'TLSv1.2'; -// renegotiation limits to test +// Renegotiation limits to test const LIMITS = [0, 1, 2, 3, 5, 10, 16]; { @@ -87,7 +87,7 @@ function test(next) { assert.strictEqual(hadErr, false); }); - // simulate renegotiation attack + // Simulate renegotiation attack function spam() { client.write(''); client.renegotiate({}, (err) => { diff --git a/test/parallel/test-tls-connect-memleak.js b/test/parallel/test-tls-connect-memleak.js index 0278e6c715..162d61fcdc 100644 --- a/test/parallel/test-tls-connect-memleak.js +++ b/test/parallel/test-tls-connect-memleak.js @@ -50,7 +50,7 @@ const gcListener = { ongc() { collected = true; } }; server.address().port, { rejectUnauthorized: false }, common.mustCall(() => { - assert.strictEqual(gcObject, gcObject); // keep reference alive + assert.strictEqual(gcObject, gcObject); // Keep reference alive assert.strictEqual(collected, false); setImmediate(done, sock); })); diff --git a/test/parallel/test-tls-ecdh-auto.js b/test/parallel/test-tls-ecdh-auto.js index 840063229a..7b535ecd3a 100644 --- a/test/parallel/test-tls-ecdh-auto.js +++ b/test/parallel/test-tls-ecdh-auto.js @@ -26,7 +26,7 @@ const options = { ecdhCurve: 'auto' }; -const reply = 'I AM THE WALRUS'; // something recognizable +const reply = 'I AM THE WALRUS'; // Something recognizable const server = tls.createServer(options, function(conn) { conn.end(reply); diff --git a/test/parallel/test-tls-ecdh-multiple.js b/test/parallel/test-tls-ecdh-multiple.js index d5f27a5e46..1fcfc041bd 100644 --- a/test/parallel/test-tls-ecdh-multiple.js +++ b/test/parallel/test-tls-ecdh-multiple.js @@ -26,7 +26,7 @@ const options = { ecdhCurve: 'secp256k1:prime256v1:secp521r1' }; -const reply = 'I AM THE WALRUS'; // something recognizable +const reply = 'I AM THE WALRUS'; // Something recognizable const server = tls.createServer(options, function(conn) { conn.end(reply); diff --git a/test/parallel/test-tls-ecdh.js b/test/parallel/test-tls-ecdh.js index e7d986cc9a..23767be92c 100644 --- a/test/parallel/test-tls-ecdh.js +++ b/test/parallel/test-tls-ecdh.js @@ -41,7 +41,7 @@ const options = { ecdhCurve: 'prime256v1' }; -const reply = 'I AM THE WALRUS'; // something recognizable +const reply = 'I AM THE WALRUS'; // Something recognizable const server = tls.createServer(options, common.mustCall(function(conn) { conn.end(reply); diff --git a/test/parallel/test-tls-socket-close.js b/test/parallel/test-tls-socket-close.js index 7313076889..839be2a888 100644 --- a/test/parallel/test-tls-socket-close.js +++ b/test/parallel/test-tls-socket-close.js @@ -38,7 +38,7 @@ const tlsServer = tls.createServer({ cert, key }, (socket) => { let netSocket; // plain tcp server const netServer = net.createServer((socket) => { - // if client wants to use tls + // If client wants to use tls tlsServer.emit('connection', socket); netSocket = socket; diff --git a/test/parallel/test-url-fileurltopath.js b/test/parallel/test-url-fileurltopath.js index f6a1fb4fda..74a217e8b6 100644 --- a/test/parallel/test-url-fileurltopath.js +++ b/test/parallel/test-url-fileurltopath.js @@ -53,9 +53,9 @@ assert.throws(() => url.fileURLToPath('https://a/b/c'), { let testCases; if (isWindows) { testCases = [ - // lowercase ascii alpha + // Lowercase ascii alpha { path: 'C:\\foo', fileURL: 'file:///C:/foo' }, - // uppercase ascii alpha + // Uppercase ascii alpha { path: 'C:\\FOO', fileURL: 'file:///C:/FOO' }, // dir { path: 'C:\\dir\\foo', fileURL: 'file:///C:/dir/foo' }, @@ -91,16 +91,16 @@ assert.throws(() => url.fileURLToPath('https://a/b/c'), { { path: 'C:\\foo\rbar', fileURL: 'file:///C:/foo%0Dbar' }, // latin1 { path: 'C:\\fóóbàr', fileURL: 'file:///C:/f%C3%B3%C3%B3b%C3%A0r' }, - // euro sign (BMP code point) + // Euro sign (BMP code point) { path: 'C:\\€', fileURL: 'file:///C:/%E2%82%AC' }, // Rocket emoji (non-BMP code point) { path: 'C:\\🚀', fileURL: 'file:///C:/%F0%9F%9A%80' } ]; } else { testCases = [ - // lowercase ascii alpha + // Lowercase ascii alpha { path: '/foo', fileURL: 'file:///foo' }, - // uppercase ascii alpha + // Uppercase ascii alpha { path: '/FOO', fileURL: 'file:///FOO' }, // dir { path: '/dir/foo', fileURL: 'file:///dir/foo' }, @@ -136,7 +136,7 @@ assert.throws(() => url.fileURLToPath('https://a/b/c'), { { path: '/foo\rbar', fileURL: 'file:///foo%0Dbar' }, // latin1 { path: '/fóóbàr', fileURL: 'file:///f%C3%B3%C3%B3b%C3%A0r' }, - // euro sign (BMP code point) + // Euro sign (BMP code point) { path: '/€', fileURL: 'file:///%E2%82%AC' }, // Rocket emoji (non-BMP code point) { path: '/🚀', fileURL: 'file:///%F0%9F%9A%80' }, diff --git a/test/parallel/test-url-format.js b/test/parallel/test-url-format.js index d18ff6715b..2d0132eb38 100644 --- a/test/parallel/test-url-format.js +++ b/test/parallel/test-url-format.js @@ -203,7 +203,7 @@ const formatTests = { pathname: '/fooA100%mBr', }, - // multiple `#` in search + // Multiple `#` in search 'http://example.com/?foo=bar%231%232%233&abc=%234%23%235#frag': { href: 'http://example.com/?foo=bar%231%232%233&abc=%234%23%235#frag', protocol: 'http:', diff --git a/test/parallel/test-url-parse-format.js b/test/parallel/test-url-parse-format.js index b318658feb..d802b0f6dc 100644 --- a/test/parallel/test-url-parse-format.js +++ b/test/parallel/test-url-parse-format.js @@ -157,7 +157,7 @@ const parseTests = { path: '/Y' }, - // whitespace in the front + // Whitespace in the front ' http://www.example.com/': { href: 'http://www.example.com/', protocol: 'http:', @@ -861,7 +861,7 @@ const parseTests = { href: 'http://a%0D%22%20%09%0A%3C\'b:b@c/%0D%0Ad/e?f' }, - // git urls used by npm + // Git urls used by npm 'git+ssh://git@github.com:npm/npm': { protocol: 'git+ssh:', slashes: true, diff --git a/test/parallel/test-url-pathtofileurl.js b/test/parallel/test-url-pathtofileurl.js index 1beb69b7f3..395447ab4c 100644 --- a/test/parallel/test-url-pathtofileurl.js +++ b/test/parallel/test-url-pathtofileurl.js @@ -27,9 +27,9 @@ const url = require('url'); let testCases; if (isWindows) { testCases = [ - // lowercase ascii alpha + // Lowercase ascii alpha { path: 'C:\\foo', expected: 'file:///C:/foo' }, - // uppercase ascii alpha + // Uppercase ascii alpha { path: 'C:\\FOO', expected: 'file:///C:/FOO' }, // dir { path: 'C:\\dir\\foo', expected: 'file:///C:/dir/foo' }, @@ -65,16 +65,16 @@ const url = require('url'); { path: 'C:\\foo\rbar', expected: 'file:///C:/foo%0Dbar' }, // latin1 { path: 'C:\\fóóbàr', expected: 'file:///C:/f%C3%B3%C3%B3b%C3%A0r' }, - // euro sign (BMP code point) + // Euro sign (BMP code point) { path: 'C:\\€', expected: 'file:///C:/%E2%82%AC' }, // Rocket emoji (non-BMP code point) { path: 'C:\\🚀', expected: 'file:///C:/%F0%9F%9A%80' } ]; } else { testCases = [ - // lowercase ascii alpha + // Lowercase ascii alpha { path: '/foo', expected: 'file:///foo' }, - // uppercase ascii alpha + // Uppercase ascii alpha { path: '/FOO', expected: 'file:///FOO' }, // dir { path: '/dir/foo', expected: 'file:///dir/foo' }, @@ -110,7 +110,7 @@ const url = require('url'); { path: '/foo\rbar', expected: 'file:///foo%0Dbar' }, // latin1 { path: '/fóóbàr', expected: 'file:///f%C3%B3%C3%B3b%C3%A0r' }, - // euro sign (BMP code point) + // Euro sign (BMP code point) { path: '/€', expected: 'file:///%E2%82%AC' }, // Rocket emoji (non-BMP code point) { path: '/🚀', expected: 'file:///%F0%9F%9A%80' }, diff --git a/test/parallel/test-url-relative.js b/test/parallel/test-url-relative.js index dc0362df1a..d0c4b5f42c 100644 --- a/test/parallel/test-url-relative.js +++ b/test/parallel/test-url-relative.js @@ -4,7 +4,7 @@ const assert = require('assert'); const inspect = require('util').inspect; const url = require('url'); -// when source is false +// When source is false assert.strictEqual(url.resolveObject('', 'foo'), 'foo'); /* @@ -105,11 +105,11 @@ const relativeTests2 = [ ['g/', bases[0], 'http://a/b/c/g/'], ['/g', bases[0], 'http://a/g'], ['//g', bases[0], 'http://g/'], - // changed with RFC 2396bis + // Changed with RFC 2396bis // ('?y', bases[0], 'http://a/b/c/d;p?y'], ['?y', bases[0], 'http://a/b/c/d;p?y'], ['g?y', bases[0], 'http://a/b/c/g?y'], - // changed with RFC 2396bis + // Changed with RFC 2396bis // ('#s', bases[0], CURRENT_DOC_URI + '#s'], ['#s', bases[0], 'http://a/b/c/d;p?q#s'], ['g#s', bases[0], 'http://a/b/c/g#s'], @@ -117,7 +117,7 @@ const relativeTests2 = [ [';x', bases[0], 'http://a/b/c/;x'], ['g;x', bases[0], 'http://a/b/c/g;x'], ['g;x?y#s', bases[0], 'http://a/b/c/g;x?y#s'], - // changed with RFC 2396bis + // Changed with RFC 2396bis // ('', bases[0], CURRENT_DOC_URI], ['', bases[0], 'http://a/b/c/d;p?q'], ['.', bases[0], 'http://a/b/c/'], @@ -130,10 +130,10 @@ const relativeTests2 = [ ['../../g', bases[0], 'http://a/g'], ['../../../g', bases[0], ('http://a/../g', 'http://a/g')], ['../../../../g', bases[0], ('http://a/../../g', 'http://a/g')], - // changed with RFC 2396bis + // Changed with RFC 2396bis // ('/./g', bases[0], 'http://a/./g'], ['/./g', bases[0], 'http://a/g'], - // changed with RFC 2396bis + // Changed with RFC 2396bis // ('/../g', bases[0], 'http://a/../g'], ['/../g', bases[0], 'http://a/g'], ['g.', bases[0], 'http://a/b/c/g.'], @@ -162,7 +162,7 @@ const relativeTests2 = [ ['g/', bases[1], 'http://a/b/c/g/'], ['/g', bases[1], 'http://a/g'], ['//g', bases[1], 'http://g/'], - // changed in RFC 2396bis + // Changed in RFC 2396bis // ('?y', bases[1], 'http://a/b/c/?y'], ['?y', bases[1], 'http://a/b/c/d;p?y'], ['g?y', bases[1], 'http://a/b/c/g?y'], @@ -200,9 +200,9 @@ const relativeTests2 = [ ['g', bases[3], 'fred:///s//a/b/g'], ['./g', bases[3], 'fred:///s//a/b/g'], ['g/', bases[3], 'fred:///s//a/b/g/'], - ['/g', bases[3], 'fred:///g'], // may change to fred:///s//a/g - ['//g', bases[3], 'fred://g'], // may change to fred:///s//g - ['//g/x', bases[3], 'fred://g/x'], // may change to fred:///s//g/x + ['/g', bases[3], 'fred:///g'], // May change to fred:///s//a/g + ['//g', bases[3], 'fred://g'], // May change to fred:///s//g + ['//g/x', bases[3], 'fred://g/x'], // May change to fred:///s//g/x ['///g', bases[3], 'fred:///g'], ['./', bases[3], 'fred:///s//a/b/'], ['../', bases[3], 'fred:///s//a/'], @@ -220,9 +220,9 @@ const relativeTests2 = [ ['g', bases[4], 'http:///s//a/b/g'], ['./g', bases[4], 'http:///s//a/b/g'], ['g/', bases[4], 'http:///s//a/b/g/'], - ['/g', bases[4], 'http:///g'], // may change to http:///s//a/g - ['//g', bases[4], 'http://g/'], // may change to http:///s//g - ['//g/x', bases[4], 'http://g/x'], // may change to http:///s//g/x + ['/g', bases[4], 'http:///g'], // May change to http:///s//a/g + ['//g', bases[4], 'http://g/'], // May change to http:///s//g + ['//g/x', bases[4], 'http://g/x'], // May change to http:///s//g/x ['///g', bases[4], 'http:///g'], ['./', bases[4], 'http:///s//a/b/'], ['../', bases[4], 'http:///s//a/'], diff --git a/test/parallel/test-util-callbackify.js b/test/parallel/test-util-callbackify.js index 9be3b132f9..c381924e1b 100644 --- a/test/parallel/test-util-callbackify.js +++ b/test/parallel/test-util-callbackify.js @@ -89,7 +89,7 @@ const values = [ } })); - // test a Promise factory + // Test a Promise factory function promiseFn() { return Promise.reject(value); } diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index a474fd56e4..d8739de790 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -1787,7 +1787,7 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'"); assert.strictEqual(util.inspect(date), '{ CustomDate 2010-02-14T11:48:40.000Z foo: \'bar\' }'); - // check for null prototype + // Check for null prototype Object.setPrototypeOf(date, null); assert.strictEqual(util.inspect(date), '{ [Date: null prototype] 2010-02-14T11:48:40.000Z' + @@ -1812,7 +1812,7 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'"); assert.strictEqual(util.inspect(date), '{ CustomDate Invalid Date foo: \'bar\' }'); - // check for null prototype + // Check for null prototype Object.setPrototypeOf(date, null); assert.strictEqual(util.inspect(date), '{ [Date: null prototype] Invalid Date foo: \'bar\' }'); diff --git a/test/parallel/test-util-isDeepStrictEqual.js b/test/parallel/test-util-isDeepStrictEqual.js index 071e612565..1ad64c2ff8 100644 --- a/test/parallel/test-util-isDeepStrictEqual.js +++ b/test/parallel/test-util-isDeepStrictEqual.js @@ -221,7 +221,7 @@ notUtilIsDeepStrict( new Map([['1', 5], [0, 5], ['0', 5]]) ); -// undefined value in Map +// Undefined value in Map utilIsDeepStrict( new Map([[1, undefined]]), new Map([[1, undefined]]) diff --git a/test/parallel/test-v8-coverage.js b/test/parallel/test-v8-coverage.js index f002604c48..02ace7af9c 100644 --- a/test/parallel/test-v8-coverage.js +++ b/test/parallel/test-v8-coverage.js @@ -29,7 +29,7 @@ function nextdir() { assert.strictEqual(output.stderr.toString(), ''); const fixtureCoverage = getFixtureCoverage('basic.js', coverageDirectory); assert.ok(fixtureCoverage); - // first branch executed. + // First branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); @@ -48,7 +48,7 @@ function nextdir() { assert.strictEqual(output.stderr.toString(), ''); const fixtureCoverage = getFixtureCoverage('exit-1.js', coverageDirectory); assert.ok(fixtureCoverage, 'coverage not found for file'); - // first branch executed. + // First branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); @@ -69,7 +69,7 @@ function nextdir() { assert.strictEqual(output.stderr.toString(), ''); const fixtureCoverage = getFixtureCoverage('sigint.js', coverageDirectory); assert.ok(fixtureCoverage); - // first branch executed. + // First branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); @@ -89,13 +89,13 @@ function nextdir() { const fixtureCoverage = getFixtureCoverage('subprocess.js', coverageDirectory); assert.ok(fixtureCoverage); - // first branch executed. + // First branch executed. assert.strictEqual(fixtureCoverage.functions[1].ranges[0].count, 1); // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[1].ranges[1].count, 0); } -// outputs coverage from worker. +// Outputs coverage from worker. { const coverageDirectory = path.join(tmpdir.path, nextdir()); const output = spawnSync(process.execPath, [ @@ -109,7 +109,7 @@ function nextdir() { const fixtureCoverage = getFixtureCoverage('subprocess.js', coverageDirectory); assert.ok(fixtureCoverage); - // first branch executed. + // First branch executed. assert.strictEqual(fixtureCoverage.functions[1].ranges[0].count, 1); // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[1].ranges[1].count, 0); @@ -145,7 +145,7 @@ function nextdir() { const fixtureCoverage = getFixtureCoverage('async-hooks.js', coverageDirectory); assert.ok(fixtureCoverage); - // first branch executed. + // First branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); } @@ -167,7 +167,7 @@ function nextdir() { const fixtureCoverage = getFixtureCoverage('basic.js', absoluteCoverageDirectory); assert.ok(fixtureCoverage); - // first branch executed. + // First branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); diff --git a/test/parallel/test-vm-global-property-interceptors.js b/test/parallel/test-vm-global-property-interceptors.js index 23c56018b6..01ae724460 100644 --- a/test/parallel/test-vm-global-property-interceptors.js +++ b/test/parallel/test-vm-global-property-interceptors.js @@ -60,7 +60,7 @@ assert.deepEqual(result, { g: undefined }); -// define new properties +// Define new properties vm.runInContext(` Object.defineProperty(this, 'h', {value: 'h'}); Object.defineProperty(this, 'i', {}); diff --git a/test/parallel/test-whatwg-url-custom-properties.js b/test/parallel/test-whatwg-url-custom-properties.js index ee51efd539..1fbc3ab623 100644 --- a/test/parallel/test-whatwg-url-custom-properties.js +++ b/test/parallel/test-whatwg-url-custom-properties.js @@ -9,7 +9,7 @@ const assert = require('assert'); const urlToOptions = require('internal/url').urlToOptions; const url = new URL('http://user:pass@foo.bar.com:21/aaa/zzz?l=24#test'); -const oldParams = url.searchParams; // for test of [SameObject] +const oldParams = url.searchParams; // For test of [SameObject] // To retrieve enumerable but not necessarily own properties, // we need to use the for-in loop. diff --git a/test/parallel/test-zlib-invalid-input.js b/test/parallel/test-zlib-invalid-input.js index 9b22df4778..68fa3825b9 100644 --- a/test/parallel/test-zlib-invalid-input.js +++ b/test/parallel/test-zlib-invalid-input.js @@ -54,6 +54,6 @@ unzips.forEach(common.mustCall((uz, i) => { uz.on('error', common.mustCall()); uz.on('end', common.mustNotCall); - // this will trigger error event + // This will trigger error event uz.write('this is not valid compressed data.'); }, unzips.length)); diff --git a/test/parallel/test-zlib-random-byte-pipes.js b/test/parallel/test-zlib-random-byte-pipes.js index 0816e047bb..d8d039a6d6 100644 --- a/test/parallel/test-zlib-random-byte-pipes.js +++ b/test/parallel/test-zlib-random-byte-pipes.js @@ -46,7 +46,7 @@ class RandomReadStream extends Stream { // base block size. opt.block = opt.block || 256 * 1024; - // total number of bytes to emit + // Total number of bytes to emit opt.total = opt.total || 256 * 1024 * 1024; this._remaining = opt.total; diff --git a/test/parallel/test-zlib-truncated.js b/test/parallel/test-zlib-truncated.js index d8a04d3c0c..304f76b9da 100644 --- a/test/parallel/test-zlib-truncated.js +++ b/test/parallel/test-zlib-truncated.js @@ -38,12 +38,12 @@ const errMessage = /unexpected end of file/; assert.strictEqual(toUTF8(result), inputString); }); - // sync truncated input test + // Sync truncated input test assert.throws(function() { zlib[methods.decompSync](truncated); }, errMessage); - // async truncated input test + // Async truncated input test zlib[methods.decomp](truncated, function(err, result) { assert(errMessage.test(err.message)); }); diff --git a/test/parallel/test-zlib.js b/test/parallel/test-zlib.js index 1852ae3393..509dcd2207 100644 --- a/test/parallel/test-zlib.js +++ b/test/parallel/test-zlib.js @@ -44,7 +44,7 @@ let trickle = [128, 1024, 1024 * 1024]; // several different chunk sizes let chunkSize = [128, 1024, 1024 * 16, 1024 * 1024]; -// this is every possible value. +// This is every possible value. let level = [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; let windowBits = [8, 9, 10, 11, 12, 13, 14, 15]; let memLevel = [1, 2, 3, 4, 5, 6, 7, 8, 9]; @@ -74,7 +74,7 @@ testFiles.forEach(common.mustCall((file) => { }, testFiles.length)); -// stream that saves everything +// Stream that saves everything class BufferStream extends stream.Stream { constructor() { super(); @@ -210,7 +210,7 @@ testKeys.forEach(common.mustCall((file) => { } })); - // the magic happens here. + // The magic happens here. ss.pipe(def).pipe(inf).pipe(buf); ss.end(test); }, zlibPairs.length)); diff --git a/test/pummel/test-fs-watch-file.js b/test/pummel/test-fs-watch-file.js index 70e793938a..7a8854860c 100644 --- a/test/pummel/test-fs-watch-file.js +++ b/test/pummel/test-fs-watch-file.js @@ -41,7 +41,7 @@ const filenameTwo = 'hasOwnProperty'; const filepathTwo = filenameTwo; const filepathTwoAbs = path.join(testDir, filenameTwo); -const filenameThree = 'charm'; // because the third time is +const filenameThree = 'charm'; // Because the third time is const filenameFour = 'get'; diff --git a/test/pummel/test-timers.js b/test/pummel/test-timers.js index 8a8646b323..60d6a7e692 100644 --- a/test/pummel/test-timers.js +++ b/test/pummel/test-timers.js @@ -43,7 +43,7 @@ setTimeout(common.mustCall(function() { assert.strictEqual(1000 - WINDOW < diff && diff < 1000 + WINDOW, true); }), 1000); -// this timer shouldn't execute +// This timer shouldn't execute const id = setTimeout(function() { assert.strictEqual(true, false); }, 500); clearTimeout(id); diff --git a/test/sequential/test-child-process-emfile.js b/test/sequential/test-child-process-emfile.js index e81b3a0ffe..7e31792f9d 100644 --- a/test/sequential/test-child-process-emfile.js +++ b/test/sequential/test-child-process-emfile.js @@ -64,7 +64,7 @@ proc.on('error', common.mustCall(function(err) { proc.on('exit', common.mustNotCall('"exit" event should not be emitted')); -// close one fd for LSan +// Close one fd for LSan if (openFds.length >= 1) { fs.closeSync(openFds.pop()); } diff --git a/test/sequential/test-cli-syntax-bad.js b/test/sequential/test-cli-syntax-bad.js index 1512d9df4f..8298157a57 100644 --- a/test/sequential/test-cli-syntax-bad.js +++ b/test/sequential/test-cli-syntax-bad.js @@ -35,7 +35,7 @@ const syntaxErrorRE = /^SyntaxError: \b/m; assert.strictEqual(err.code, 1, `code ${err.code} !== 1 for error:\n\n${err}`); - // no stdout should be produced + // No stdout should be produced assert.strictEqual(stdout, ''); // Stderr should have a syntax error message diff --git a/test/sequential/test-cli-syntax-file-not-found.js b/test/sequential/test-cli-syntax-file-not-found.js index b3bb9723e2..3e1f3ec561 100644 --- a/test/sequential/test-cli-syntax-file-not-found.js +++ b/test/sequential/test-cli-syntax-file-not-found.js @@ -27,7 +27,7 @@ const notFoundRE = /^Error: Cannot find module/m; const _args = args.concat(file); const cmd = [node, ..._args].join(' '); exec(cmd, common.mustCall((err, stdout, stderr) => { - // no stdout should be produced + // No stdout should be produced assert.strictEqual(stdout, ''); // `stderr` should have a module not found error message. diff --git a/test/sequential/test-cli-syntax-require.js b/test/sequential/test-cli-syntax-require.js index d99dc2ff71..c309b1f455 100644 --- a/test/sequential/test-cli-syntax-require.js +++ b/test/sequential/test-cli-syntax-require.js @@ -11,7 +11,7 @@ const node = process.execPath; // depending on the JavaScript engine. const syntaxErrorRE = /^SyntaxError: \b/m; -// should work with -r flags +// Should work with -r flags ['-c', '--check'].forEach(function(checkFlag) { ['-r', '--require'].forEach(function(requireFlag) { const preloadFile = fixtures.path('no-wrapper.js'); @@ -23,7 +23,7 @@ const syntaxErrorRE = /^SyntaxError: \b/m; assert.strictEqual(err.code, 1, `code ${err.code} !== 1 for error:\n\n${err}`); - // no stdout should be produced + // No stdout should be produced assert.strictEqual(stdout, ''); // stderr should have a syntax error message diff --git a/test/sequential/test-http-keepalive-maxsockets.js b/test/sequential/test-http-keepalive-maxsockets.js index 53d67b2479..9c98a140f6 100644 --- a/test/sequential/test-http-keepalive-maxsockets.js +++ b/test/sequential/test-http-keepalive-maxsockets.js @@ -47,7 +47,7 @@ server.listen(0, function() { assert.strictEqual(count(agent.sockets), 0); assert.strictEqual(serverSockets.length, 5); - // now make 10 more reqs. + // Now make 10 more reqs. // should use the 2 free reqs from the pool first. makeReqs(10, function(er) { assert.ifError(er); diff --git a/test/sequential/test-stream2-stderr-sync.js b/test/sequential/test-stream2-stderr-sync.js index 68d35dbdbc..7384cf6e74 100644 --- a/test/sequential/test-stream2-stderr-sync.js +++ b/test/sequential/test-stream2-stderr-sync.js @@ -53,7 +53,7 @@ function child0() { console.error('baz'); } -// using process.stderr +// Using process.stderr function child1() { process.stderr.write('child 1\n'); process.stderr.write('foo\n'); |