diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2019-03-07 01:03:53 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-03-10 00:44:40 +0100 |
commit | f8763bb077db2f0be74e353c0b4f9e353c0fffa8 (patch) | |
tree | c73128074daa65d2e72e4d2a86a5b08059888144 /test | |
parent | 01a5300f3f4f788a043f6b5fe72e2b7b641dfb6c (diff) | |
download | node-new-f8763bb077db2f0be74e353c0b4f9e353c0fffa8.tar.gz |
benchmark,doc,lib,test: capitalize comments
PR-URL: https://github.com/nodejs/node/pull/26483
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Diffstat (limited to 'test')
183 files changed, 345 insertions, 346 deletions
diff --git a/test/async-hooks/test-graph.signal.js b/test/async-hooks/test-graph.signal.js index 4c5b857fc2..c2f889e7b0 100644 --- a/test/async-hooks/test-graph.signal.js +++ b/test/async-hooks/test-graph.signal.js @@ -23,10 +23,10 @@ function onsigusr2() { count++; if (count === 1) { - // trigger same signal handler again + // Trigger same signal handler again exec(`kill -USR2 ${process.pid}`); } else { - // install another signal handler + // Install another signal handler process.removeAllListeners('SIGUSR2'); process.on('SIGUSR2', common.mustCall(onsigusr2Again)); diff --git a/test/async-hooks/test-promise.promise-before-init-hooks.js b/test/async-hooks/test-promise.promise-before-init-hooks.js index 0f74c968e6..51787b8065 100644 --- a/test/async-hooks/test-promise.promise-before-init-hooks.js +++ b/test/async-hooks/test-promise.promise-before-init-hooks.js @@ -9,7 +9,7 @@ const p = new Promise(common.mustCall(function executor(resolve) { resolve(5); })); -// init hooks after promise was created +// Init hooks after promise was created const hooks = initHooks({ allowNoInit: true }); hooks.enable(); diff --git a/test/async-hooks/test-signalwrap.js b/test/async-hooks/test-signalwrap.js index 5bc02e6dc4..b906355af7 100644 --- a/test/async-hooks/test-signalwrap.js +++ b/test/async-hooks/test-signalwrap.js @@ -42,7 +42,7 @@ function onsigusr2() { signal1, { init: 1, before: 1 }, ' signal1: when first SIGUSR2 handler is called for the first time'); - // trigger same signal handler again + // Trigger same signal handler again exec(`kill -USR2 ${process.pid}`); } else { // second invocation @@ -50,7 +50,7 @@ function onsigusr2() { signal1, { init: 1, before: 2, after: 1 }, 'signal1: when first SIGUSR2 handler is called for the second time'); - // install another signal handler + // Install another signal handler process.removeAllListeners('SIGUSR2'); process.on('SIGUSR2', common.mustCall(onsigusr2Again)); diff --git a/test/async-hooks/test-tcpwrap.js b/test/async-hooks/test-tcpwrap.js index a01a1fc4fe..3256a1598b 100644 --- a/test/async-hooks/test-tcpwrap.js +++ b/test/async-hooks/test-tcpwrap.js @@ -79,7 +79,7 @@ function ontcpConnection(serverConnection) { return; } - // only focusing on TCPCONNECTWRAP here + // Only focusing on TCPCONNECTWRAP here const tcpconnects = hooks.activitiesOfTypes('TCPCONNECTWRAP'); assert.strictEqual(tcpconnects.length, 1); tcpconnect = tcpconnects[0]; diff --git a/test/common/index.js b/test/common/index.js index ee12b641dd..ac983d0a85 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -811,7 +811,7 @@ module.exports = { const opensslCmd = spawnSync(opensslCli, ['version']); if (opensslCmd.status !== 0 || opensslCmd.error !== undefined) { - // openssl command cannot be executed + // OpenSSL command cannot be executed opensslCli = false; } return opensslCli; diff --git a/test/es-module/test-esm-preserve-symlinks-main.js b/test/es-module/test-esm-preserve-symlinks-main.js index 808b6c9a15..38ef5d8fcc 100644 --- a/test/es-module/test-esm-preserve-symlinks-main.js +++ b/test/es-module/test-esm-preserve-symlinks-main.js @@ -50,7 +50,7 @@ function doTest(flags, done) { }); } -// first test the commonjs module loader +// First test the commonjs module loader doTest([], () => { // now test the new loader doTest(['--experimental-modules'], () => {}); diff --git a/test/internet/test-dgram-broadcast-multi-process.js b/test/internet/test-dgram-broadcast-multi-process.js index a989d687b0..a2b687bddb 100644 --- a/test/internet/test-dgram-broadcast-multi-process.js +++ b/test/internet/test-dgram-broadcast-multi-process.js @@ -167,7 +167,7 @@ if (process.argv[2] !== 'child') { reuseAddr: true }); - // bind the address explicitly for sending + // Bind the address explicitly for sending // INADDR_BROADCAST to only one interface sendSocket.bind(common.PORT, bindAddress); sendSocket.on('listening', function() { diff --git a/test/js-native-api/test_function/test.js b/test/js-native-api/test_function/test.js index 6f0f168175..e89d64f61d 100644 --- a/test/js-native-api/test_function/test.js +++ b/test/js-native-api/test_function/test.js @@ -4,7 +4,7 @@ const common = require('../../common'); const assert = require('assert'); -// testing api calls for function +// Testing api calls for function const test_function = require(`./build/${common.buildType}/test_function`); function func1() { diff --git a/test/js-native-api/test_general/test.js b/test/js-native-api/test_general/test.js index 720918f964..f0be79085b 100644 --- a/test/js-native-api/test_general/test.js +++ b/test/js-native-api/test_general/test.js @@ -32,8 +32,7 @@ assert.strictEqual(test_general.testGetPrototype(extendedObject), assert.notStrictEqual(test_general.testGetPrototype(baseObject), test_general.testGetPrototype(extendedObject)); -// test version management functions -// expected version is currently 4 +// Test version management functions. The expected version is currently 4. assert.strictEqual(test_general.testGetVersion(), 4); [ @@ -91,7 +90,7 @@ assert.strictEqual(finalizeWasCalled, false, ' test_general.finalizeWasCalled() ' + `returned ${finalizeWasCalled}`); -// test napi_adjust_external_memory +// Test napi_adjust_external_memory const adjustedValue = test_general.testAdjustExternalMemory(); assert.strictEqual(typeof adjustedValue, 'number'); assert(adjustedValue > 0); diff --git a/test/js-native-api/test_handle_scope/test.js b/test/js-native-api/test_handle_scope/test.js index 53abfe178c..3935e11640 100644 --- a/test/js-native-api/test_handle_scope/test.js +++ b/test/js-native-api/test_handle_scope/test.js @@ -2,7 +2,7 @@ const common = require('../../common'); const assert = require('assert'); -// testing handle scope api calls +// Testing handle scope api calls const testHandleScope = require(`./build/${common.buildType}/test_handle_scope`); diff --git a/test/js-native-api/test_properties/test.js b/test/js-native-api/test_properties/test.js index 13a546c7b8..fa4cb587d6 100644 --- a/test/js-native-api/test_properties/test.js +++ b/test/js-native-api/test_properties/test.js @@ -33,7 +33,7 @@ assert.ok(!propertyNames.includes('readwriteAccessor2')); assert.ok(!propertyNames.includes('readonlyAccessor1')); assert.ok(!propertyNames.includes('readonlyAccessor2')); -// validate property created with symbol +// Validate property created with symbol const start = 'Symbol('.length; const end = start + 'NameKeySymbol'.length; const symbolDescription = diff --git a/test/known_issues/test-dgram-bind-shared-ports-after-port-0.js b/test/known_issues/test-dgram-bind-shared-ports-after-port-0.js index 703dd24376..5ceac4ebee 100644 --- a/test/known_issues/test-dgram-bind-shared-ports-after-port-0.js +++ b/test/known_issues/test-dgram-bind-shared-ports-after-port-0.js @@ -29,7 +29,7 @@ if (cluster.isMaster) { const worker2 = cluster.fork({ PRT1: msg.port1 }); worker2.on('message', () => process.exit(0)); worker2.on('exit', (code, signal) => { - // this is the droid we are looking for + // This is the droid we are looking for assert.strictEqual(code, 0); assert.strictEqual(signal, null); }); diff --git a/test/known_issues/test-inspector-cluster-port-clash.js b/test/known_issues/test-inspector-cluster-port-clash.js index 0c55805309..f5baedf8aa 100644 --- a/test/known_issues/test-inspector-cluster-port-clash.js +++ b/test/known_issues/test-inspector-cluster-port-clash.js @@ -29,7 +29,7 @@ function serialFork() { return new Promise((res) => { const worker = cluster.fork(); worker.on('error', (err) => assert.fail(err)); - // No common.mustCall since 1 out of 3 should fail + // No common.mustCall since 1 out of 3 should fail. worker.on('online', () => { worker.on('message', common.mustCall((message) => { ports.push(message.debugPort); @@ -50,10 +50,10 @@ function serialFork() { if (cluster.isMaster) { cluster.on('online', common.mustCall((worker) => worker.send('dbgport'), 2)); - // Block one of the ports with a listening socket + // Block one of the ports with a listening socket. const server = net.createServer(); server.listen(clashPort, common.localhostIPv4, common.mustCall(() => { - // try to fork 3 workers No.2 should fail + // Try to fork 3 workers. No.2 should fail. Promise.all([serialFork(), serialFork(), serialFork()]) .then(common.mustNotCall()) .catch((err) => console.error(err)); diff --git a/test/message/throw_in_line_with_tabs.js b/test/message/throw_in_line_with_tabs.js index fdc36b331a..ab059916b2 100644 --- a/test/message/throw_in_line_with_tabs.js +++ b/test/message/throw_in_line_with_tabs.js @@ -26,7 +26,7 @@ require('../common'); console.error('before'); (function() { - // these lines should contain tab! + // These lines should contain tab! // eslint-disable-next-line no-throw-literal throw ({ foo: 'bar' }); })(); diff --git a/test/message/v8_warning.js b/test/message/v8_warning.js index e3394cdd70..d7d1c5e7db 100644 --- a/test/message/v8_warning.js +++ b/test/message/v8_warning.js @@ -9,7 +9,7 @@ function AsmModule() { a = a | 0; b = b | 0; - // should be `return (a + b) | 0;` + // Should be `return (a + b) | 0;` return a + b; } diff --git a/test/parallel/test-assert-deep.js b/test/parallel/test-assert-deep.js index fc1ace51b3..407334d0ca 100644 --- a/test/parallel/test-assert-deep.js +++ b/test/parallel/test-assert-deep.js @@ -503,7 +503,7 @@ assertNotDeepOrStrict( m2.set(2, 'hi'); // different order m2.set(1, obj); - m2.set(3, [1, 2, 3]); // deep equal, but not reference equal. + m2.set(3, [1, 2, 3]); // Deep equal, but not reference equal. assertDeepAndStrictEqual(m1, m2); } diff --git a/test/parallel/test-async-wrap-tlssocket-asyncreset.js b/test/parallel/test-async-wrap-tlssocket-asyncreset.js index 983bce3b02..e0dd8be290 100644 --- a/test/parallel/test-async-wrap-tlssocket-asyncreset.js +++ b/test/parallel/test-async-wrap-tlssocket-asyncreset.js @@ -52,7 +52,7 @@ server.listen( assert.strictEqual(res.statusCode, 200); res2.on('error', (err) => assert.fail(err)); res2.socket.on('error', (err) => assert.fail(err)); - // this should be the end of the test + // This should be the end of the test res2.destroy(); server.close(); }) diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index c03179a769..cc5692b24b 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -54,10 +54,10 @@ assert.strictEqual(d.length, 0); // Test invalid encoding for Buffer.toString assert.throws(() => b.toString('invalid'), /Unknown encoding: invalid/); -// invalid encoding for Buffer.write +// Invalid encoding for Buffer.write assert.throws(() => b.write('test string', 0, 5, 'invalid'), /Unknown encoding: invalid/); -// unsupported arguments for Buffer.write +// Unsupported arguments for Buffer.write assert.throws(() => b.write('test', 'utf8', 0), /is no longer supported/); @@ -87,13 +87,13 @@ const outOfRangeError = { // Try to write a 0-length string beyond the end of b common.expectsError(() => b.write('', 2048), outOfBoundsError); -// throw when writing to negative offset +// Throw when writing to negative offset common.expectsError(() => b.write('a', -1), outOfBoundsError); // Throw when writing past bounds from the pool common.expectsError(() => b.write('a', 2048), outOfBoundsError); -// throw when writing to negative offset +// Throw when writing to negative offset common.expectsError(() => b.write('a', -1), outOfBoundsError); // Try to copy 0 bytes worth of data into an empty buffer @@ -192,7 +192,7 @@ Buffer.alloc(1).write('', 1, 0); } { - // also from a non-pooled instance + // Also from a non-pooled instance const b = Buffer.allocUnsafeSlow(5); const c = b.slice(0, 4); const d = c.slice(0, 2); @@ -390,7 +390,7 @@ assert.strictEqual(Buffer.from('KioqKioqKioqKioqKioqKioqKio=', 'base64').toString(), '*'.repeat(20)); -// no padding, not a multiple of 4 +// No padding, not a multiple of 4 assert.strictEqual(Buffer.from('Kg', 'base64').toString(), '*'); assert.strictEqual(Buffer.from('Kio', 'base64').toString(), '*'.repeat(2)); assert.strictEqual(Buffer.from('KioqKg', 'base64').toString(), '*'.repeat(4)); @@ -713,7 +713,7 @@ assert.strictEqual(x.inspect(), '<Buffer 81 a3 66 6f 6f a3 62 61 72>'); } { - // test offset returns are correct + // Test offset returns are correct const b = Buffer.allocUnsafe(16); assert.strictEqual(b.writeUInt32LE(0, 0), 4); assert.strictEqual(b.writeUInt16LE(0, 4), 6); @@ -818,7 +818,7 @@ common.expectsError( outOfRangeError ); -// test for common write(U)IntLE/BE +// Test for common write(U)IntLE/BE { let buf = Buffer.allocUnsafe(3); buf.writeUIntLE(0x123456, 0, 3); diff --git a/test/parallel/test-buffer-bytelength.js b/test/parallel/test-buffer-bytelength.js index 3d419b3165..c0c7228d0d 100644 --- a/test/parallel/test-buffer-bytelength.js +++ b/test/parallel/test-buffer-bytelength.js @@ -65,7 +65,7 @@ assert.strictEqual(Buffer.byteLength(float64), 64); const dv = new DataView(new ArrayBuffer(2)); assert.strictEqual(Buffer.byteLength(dv), 2); -// special case: zero length string +// Special case: zero length string assert.strictEqual(Buffer.byteLength('', 'ascii'), 0); assert.strictEqual(Buffer.byteLength('', 'HeX'), 0); diff --git a/test/parallel/test-buffer-copy.js b/test/parallel/test-buffer-copy.js index ec227a9374..b356097437 100644 --- a/test/parallel/test-buffer-copy.js +++ b/test/parallel/test-buffer-copy.js @@ -70,7 +70,7 @@ let cntr = 0; } { - // copy starting near end of b to c + // Copy starting near end of b to c b.fill(++cntr); c.fill(++cntr); const copied = b.copy(c, 0, b.length - Math.floor(c.length / 2)); @@ -113,7 +113,7 @@ bb.fill('hello crazy world'); // Try to copy from before the beginning of b. Should not throw. b.copy(c, 0, 100, 10); -// copy throws at negative sourceStart +// Copy throws at negative sourceStart common.expectsError( () => Buffer.allocUnsafe(5).copy(Buffer.allocUnsafe(5), 0, -1), errorProperty); diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index 0f7d782436..cba6af44e5 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -78,7 +78,7 @@ assert.strictEqual(b.indexOf(Buffer.from('f'), 6), -1); assert.strictEqual(Buffer.from('ff').indexOf(Buffer.from('f'), 1, 'ucs2'), -1); -// test invalid and uppercase encoding +// Test invalid and uppercase encoding assert.strictEqual(b.indexOf('b', 'utf8'), 1); assert.strictEqual(b.indexOf('b', 'UTF8'), 1); assert.strictEqual(b.indexOf('62', 'HEX'), 1); diff --git a/test/parallel/test-buffer-iterator.js b/test/parallel/test-buffer-iterator.js index 3120ff1d2a..72b775c713 100644 --- a/test/parallel/test-buffer-iterator.js +++ b/test/parallel/test-buffer-iterator.js @@ -16,7 +16,7 @@ for (b of buffer) assert.deepStrictEqual(arr, [1, 2, 3, 4, 5]); -// buffer iterators should be iterable +// Buffer iterators should be iterable arr = []; diff --git a/test/parallel/test-buffer-read.js b/test/parallel/test-buffer-read.js index 1adf030356..7b3b9eb8e2 100644 --- a/test/parallel/test-buffer-read.js +++ b/test/parallel/test-buffer-read.js @@ -2,7 +2,7 @@ const common = require('../common'); const assert = require('assert'); -// testing basic buffer read functions +// Testing basic buffer read functions const buf = Buffer.from([0xa4, 0xfd, 0x48, 0xea, 0xcf, 0xff, 0xd9, 0x01, 0xde]); function read(buff, funx, args, expected) { diff --git a/test/parallel/test-buffer-slow.js b/test/parallel/test-buffer-slow.js index 1b8de44299..8317d8c5ee 100644 --- a/test/parallel/test-buffer-slow.js +++ b/test/parallel/test-buffer-slow.js @@ -43,7 +43,7 @@ try { assert.strictEqual(SlowBuffer('6').length, 6); assert.strictEqual(SlowBuffer(true).length, 1); -// should throw with invalid length +// Should throw with invalid length const bufferMaxSizeMsg = common.expectsError({ code: 'ERR_INVALID_OPT_VALUE', type: RangeError, diff --git a/test/parallel/test-child-process-constructor.js b/test/parallel/test-child-process-constructor.js index bf7fffd9c5..f0bebd61ef 100644 --- a/test/parallel/test-child-process-constructor.js +++ b/test/parallel/test-child-process-constructor.js @@ -85,7 +85,7 @@ child.spawn({ assert.strictEqual(child.hasOwnProperty('pid'), true); assert(Number.isInteger(child.pid)); -// try killing with invalid signal +// Try killing with invalid signal common.expectsError( () => { child.kill('foo'); }, { code: 'ERR_UNKNOWN_SIGNAL', type: TypeError } diff --git a/test/parallel/test-child-process-disconnect.js b/test/parallel/test-child-process-disconnect.js index 8ca39b5790..7ba30b28db 100644 --- a/test/parallel/test-child-process-disconnect.js +++ b/test/parallel/test-child-process-disconnect.js @@ -57,7 +57,7 @@ if (process.argv[2] === 'child') { socket.write('ready'); }); - // when the server is ready tell parent + // When the server is ready tell parent server.on('listening', function() { process.send({ msg: 'ready', port: server.address().port }); }); diff --git a/test/parallel/test-child-process-double-pipe.js b/test/parallel/test-child-process-double-pipe.js index 8503ebf69c..bf640fd379 100644 --- a/test/parallel/test-child-process-double-pipe.js +++ b/test/parallel/test-child-process-double-pipe.js @@ -65,7 +65,7 @@ grep.stdin.on('drain', function(data) { echo.stdout.resume(); }); -// propagate end from echo to grep +// Propagate end from echo to grep echo.stdout.on('end', function(code) { grep.stdin.end(); }); @@ -95,7 +95,7 @@ sed.stdin.on('drain', function(data) { grep.stdout.resume(); }); -// propagate end from grep to sed +// Propagate end from grep to sed grep.stdout.on('end', function(code) { console.error('grep stdout end'); sed.stdin.end(); diff --git a/test/parallel/test-child-process-fork-ref.js b/test/parallel/test-child-process-fork-ref.js index 3eae2b242e..bbf4432af8 100644 --- a/test/parallel/test-child-process-fork-ref.js +++ b/test/parallel/test-child-process-fork-ref.js @@ -27,7 +27,7 @@ const fork = require('child_process').fork; if (process.argv[2] === 'child') { process.send('1'); - // check that child don't instantly die + // Check that child don't instantly die setTimeout(function() { process.send('2'); }, 200); diff --git a/test/parallel/test-child-process-stdio-big-write-end.js b/test/parallel/test-child-process-stdio-big-write-end.js index 00fc0471d2..07656c04ca 100644 --- a/test/parallel/test-child-process-stdio-big-write-end.js +++ b/test/parallel/test-child-process-stdio-big-write-end.js @@ -56,14 +56,14 @@ function parent() { sent += bufsize; } while (child.stdin.write(buf)); - // then write a bunch more times. + // Then write a bunch more times. for (let i = 0; i < 100; i++) { const buf = Buffer.alloc(bufsize, '.'); sent += bufsize; child.stdin.write(buf); } - // now end, before it's all flushed. + // Now end, before it's all flushed. child.stdin.end(); // now we wait... diff --git a/test/parallel/test-child-process-stdio-inherit.js b/test/parallel/test-child-process-stdio-inherit.js index b77391d87d..dfffb70c58 100644 --- a/test/parallel/test-child-process-stdio-inherit.js +++ b/test/parallel/test-child-process-stdio-inherit.js @@ -45,7 +45,7 @@ function grandparent() { child.on('close', function(code, signal) { assert.strictEqual(code, 0); assert.strictEqual(signal, null); - // cat on windows adds a \r\n at the end. + // 'cat' on windows adds a \r\n at the end. assert.strictEqual(output.trim(), input.trim()); }); } diff --git a/test/parallel/test-child-process-validate-stdio.js b/test/parallel/test-child-process-validate-stdio.js index 71edc05597..3566c8f952 100644 --- a/test/parallel/test-child-process-validate-stdio.js +++ b/test/parallel/test-child-process-validate-stdio.js @@ -11,7 +11,7 @@ const expectedError = // Should throw if string and not ignore, pipe, or inherit assert.throws(() => _validateStdio('foo'), expectedError); -// should throw if not a string or array +// Should throw if not a string or array assert.throws(() => _validateStdio(600), expectedError); // Should populate stdio with undefined if len < 3 diff --git a/test/parallel/test-cli-syntax-piped-bad.js b/test/parallel/test-cli-syntax-piped-bad.js index 864497e8f7..4fb24b24f3 100644 --- a/test/parallel/test-cli-syntax-piped-bad.js +++ b/test/parallel/test-cli-syntax-piped-bad.js @@ -25,7 +25,7 @@ syntaxArgs.forEach(function(args) { // stderr should include '[stdin]' as the filename assert(c.stderr.startsWith('[stdin]'), `${c.stderr} starts with ${stdin}`); - // no stdout or stderr should be produced + // No stdout or stderr should be produced assert.strictEqual(c.stdout, ''); // stderr should have a syntax error message diff --git a/test/parallel/test-cli-syntax-piped-good.js b/test/parallel/test-cli-syntax-piped-good.js index b3467b0372..cdadf449d8 100644 --- a/test/parallel/test-cli-syntax-piped-good.js +++ b/test/parallel/test-cli-syntax-piped-good.js @@ -18,7 +18,7 @@ syntaxArgs.forEach(function(args) { const stdin = 'throw new Error("should not get run");'; const c = spawnSync(node, args, { encoding: 'utf8', input: stdin }); - // no stdout or stderr should be produced + // No stdout or stderr should be produced assert.strictEqual(c.stdout, ''); assert.strictEqual(c.stderr, ''); diff --git a/test/parallel/test-cluster-disconnect.js b/test/parallel/test-cluster-disconnect.js index 36def06a4c..51cbb43c63 100644 --- a/test/parallel/test-cluster-disconnect.js +++ b/test/parallel/test-cluster-disconnect.js @@ -92,7 +92,7 @@ if (cluster.isWorker) { testCluster(common.mustCall(() => { // 3. disconnect cluster cluster.disconnect(common.mustCall(() => { - // run test again to confirm cleanup + // Run test again to confirm cleanup if (again) { test(); } diff --git a/test/parallel/test-cluster-eaccess.js b/test/parallel/test-cluster-eaccess.js index 7a3bc1c5cd..4c2d284293 100644 --- a/test/parallel/test-cluster-eaccess.js +++ b/test/parallel/test-cluster-eaccess.js @@ -41,7 +41,7 @@ if (cluster.isMaster && process.argv.length !== 3) { // Makes sure master is able to fork the worker cluster.on('fork', common.mustCall()); - // makes sure the worker is ready + // Makes sure the worker is ready worker.on('online', common.mustCall()); worker.on('message', common.mustCall(function(err) { @@ -71,7 +71,7 @@ if (cluster.isMaster && process.argv.length !== 3) { }); })); } else if (process.argv.length === 3) { - // child process (of cluster.worker) + // Child process (of cluster.worker) const PIPE_NAME = process.argv[2]; const server = net.createServer().listen(PIPE_NAME, common.mustCall(() => { diff --git a/test/parallel/test-cluster-listening-port.js b/test/parallel/test-cluster-listening-port.js index 84bf49fa96..40d66065d9 100644 --- a/test/parallel/test-cluster-listening-port.js +++ b/test/parallel/test-cluster-listening-port.js @@ -8,9 +8,9 @@ if (cluster.isMaster) { cluster.fork(); cluster.on('listening', common.mustCall(function(worker, address) { const port = address.port; - // ensure that the port is not 0 or null + // Ensure that the port is not 0 or null assert(port); - // ensure that the port is numerical + // Ensure that the port is numerical assert.strictEqual(typeof port, 'number'); worker.kill(); })); diff --git a/test/parallel/test-cluster-net-listen.js b/test/parallel/test-cluster-net-listen.js index f6b2c4e45a..ff102797ea 100644 --- a/test/parallel/test-cluster-net-listen.js +++ b/test/parallel/test-cluster-net-listen.js @@ -26,7 +26,7 @@ const cluster = require('cluster'); const net = require('net'); if (cluster.isMaster) { - // ensure that the worker exits peacefully + // Ensure that the worker exits peacefully cluster.fork().on('exit', common.mustCall(function(statusCode) { assert.strictEqual(statusCode, 0); })); diff --git a/test/parallel/test-common.js b/test/parallel/test-common.js index a133204437..62f4eb050f 100644 --- a/test/parallel/test-common.js +++ b/test/parallel/test-common.js @@ -26,7 +26,7 @@ const fixtures = require('../common/fixtures'); const assert = require('assert'); const { execFile } = require('child_process'); -// test for leaked global detection +// Test for leaked global detection { const p = fixtures.path('leakedGlobal.js'); execFile(process.execPath, [p], common.mustCall((err, stdout, stderr) => { diff --git a/test/parallel/test-console.js b/test/parallel/test-console.js index 4a7a2fda68..87ee8ad1ff 100644 --- a/test/parallel/test-console.js +++ b/test/parallel/test-console.js @@ -93,35 +93,35 @@ hijackStderr(function(data) { errStrings.push(data); }); -// test console.log() goes to stdout +// Test console.log() goes to stdout console.log('foo'); console.log('foo', 'bar'); console.log('%s %s', 'foo', 'bar', 'hop'); console.log({ slashes: '\\\\' }); console.log(custom_inspect); -// test console.debug() goes to stdout +// Test console.debug() goes to stdout console.debug('foo'); console.debug('foo', 'bar'); console.debug('%s %s', 'foo', 'bar', 'hop'); console.debug({ slashes: '\\\\' }); console.debug(custom_inspect); -// test console.info() goes to stdout +// Test console.info() goes to stdout console.info('foo'); console.info('foo', 'bar'); console.info('%s %s', 'foo', 'bar', 'hop'); console.info({ slashes: '\\\\' }); console.info(custom_inspect); -// test console.error() goes to stderr +// Test console.error() goes to stderr console.error('foo'); console.error('foo', 'bar'); console.error('%s %s', 'foo', 'bar', 'hop'); console.error({ slashes: '\\\\' }); console.error(custom_inspect); -// test console.warn() goes to stderr +// Test console.warn() goes to stderr console.warn('foo'); console.warn('foo', 'bar'); console.warn('%s %s', 'foo', 'bar', 'hop'); diff --git a/test/parallel/test-crypto-binary-default.js b/test/parallel/test-crypto-binary-default.js index bb0247bf58..80be4dea11 100644 --- a/test/parallel/test-crypto-binary-default.js +++ b/test/parallel/test-crypto-binary-default.js @@ -480,8 +480,8 @@ function testCipher1(key) { function testCipher2(key) { - // encryption and decryption with Base64 - // reported in https://github.com/joyent/node/issues/738 + // Encryption and decryption with Base64. + // Reported in https://github.com/joyent/node/issues/738 const plaintext = '32|RmVZZkFUVmpRRkp0TmJaUm56ZU9qcnJkaXNNWVNpTTU*|iXmckfRWZBGWWELw' + 'eCBsThSsfUHLeRe0KCsK8ooHgxie0zOINpXxfZi/oNG7uq9JWFVCk70gfzQH8ZUJ' + diff --git a/test/parallel/test-crypto-cipher-decipher.js b/test/parallel/test-crypto-cipher-decipher.js index 9f79abc705..e7ab8f73b0 100644 --- a/test/parallel/test-crypto-cipher-decipher.js +++ b/test/parallel/test-crypto-cipher-decipher.js @@ -53,16 +53,16 @@ function testCipher1(key) { function testCipher2(key) { - // encryption and decryption with Base64 - // reported in https://github.com/joyent/node/issues/738 + // Encryption and decryption with Base64. + // Reported in https://github.com/joyent/node/issues/738 const plaintext = '32|RmVZZkFUVmpRRkp0TmJaUm56ZU9qcnJkaXNNWVNpTTU*|iXmckfRWZBGWWELw' + 'eCBsThSsfUHLeRe0KCsK8ooHgxie0zOINpXxfZi/oNG7uq9JWFVCk70gfzQH8ZUJ' + 'jAfaFg**'; const cipher = crypto.createCipher('aes256', key); - // Encrypt plaintext which is in utf8 format - // to a ciphertext which will be in Base64 + // Encrypt plaintext which is in utf8 format to a ciphertext which will be in + // Base64. let ciph = cipher.update(plaintext, 'utf8', 'base64'); ciph += cipher.final('base64'); diff --git a/test/parallel/test-crypto-from-binary.js b/test/parallel/test-crypto-from-binary.js index 56d0cb7207..3b3c6a81ef 100644 --- a/test/parallel/test-crypto-from-binary.js +++ b/test/parallel/test-crypto-from-binary.js @@ -36,7 +36,7 @@ const EXTERN_APEX = 0xFBEE9; // Manually controlled string for checking binary output let ucs2_control = 'a\u0000'; -// grow the strings to proper length +// Grow the strings to proper length while (ucs2_control.length <= EXTERN_APEX) { ucs2_control = ucs2_control.repeat(2); } diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js index e0efe761e3..8aae0d5e12 100644 --- a/test/parallel/test-crypto-keygen.js +++ b/test/parallel/test-crypto-keygen.js @@ -639,7 +639,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher); message: 'Unknown cipher' }); - // cipher, but no valid passphrase. + // Cipher, but no valid passphrase. for (const passphrase of [undefined, null, 5, false, true]) { common.expectsError(() => generateKeyPairSync('rsa', { modulusLength: 4096, diff --git a/test/parallel/test-domain-multi.js b/test/parallel/test-domain-multi.js index 45d94b35a1..63701150f8 100644 --- a/test/parallel/test-domain-multi.js +++ b/test/parallel/test-domain-multi.js @@ -27,7 +27,7 @@ const domain = require('domain'); const http = require('http'); const a = domain.create(); -a.enter(); // this will be our "root" domain +a.enter(); // This will be our "root" domain a.on('error', common.mustNotCall()); @@ -62,11 +62,11 @@ const server = http.createServer((req, res) => { const c = domain.create(); const req = http.get({ host: 'localhost', port: server.address().port }); - // add the request to the C domain + // Add the request to the C domain c.add(req); req.on('response', (res) => { - // add the response object to the C domain + // Add the response object to the C domain c.add(res); res.pipe(process.stdout); }); diff --git a/test/parallel/test-event-emitter-add-listeners.js b/test/parallel/test-event-emitter-add-listeners.js index 6ef3952218..7812de670f 100644 --- a/test/parallel/test-event-emitter-add-listeners.js +++ b/test/parallel/test-event-emitter-add-listeners.js @@ -60,7 +60,7 @@ const EventEmitter = require('events'); ee.emit('hello', 'a', 'b'); } -// just make sure that this doesn't throw: +// Just make sure that this doesn't throw: { const f = new EventEmitter(); diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js index e29bd80ebf..5e18ad44ae 100644 --- a/test/parallel/test-file-write-stream2.js +++ b/test/parallel/test-file-write-stream2.js @@ -62,7 +62,7 @@ function removeTestFile() { tmpdir.refresh(); -// drain at 0, return false at 10. +// Drain at 0, return false at 10. const file = fs.createWriteStream(filepath, { highWaterMark: 11 }); diff --git a/test/parallel/test-fs-append-file-sync.js b/test/parallel/test-fs-append-file-sync.js index e053d06161..190381234a 100644 --- a/test/parallel/test-fs-append-file-sync.js +++ b/test/parallel/test-fs-append-file-sync.js @@ -39,7 +39,7 @@ const data = '南越国是前203年至前111年存在于岭南地区的一个国 const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); -// Test that empty file will be created and have content added +// Test that empty file will be created and have content added. const filename = join(tmpdir.path, 'append-sync.txt'); fs.appendFileSync(filename, data); @@ -48,7 +48,7 @@ const fileData = fs.readFileSync(filename); assert.strictEqual(Buffer.byteLength(data), fileData.length); -// Test that appends data to a non empty file +// Test that appends data to a non empty file. const filename2 = join(tmpdir.path, 'append-sync2.txt'); fs.writeFileSync(filename2, currentFileData); @@ -59,7 +59,7 @@ const fileData2 = fs.readFileSync(filename2); assert.strictEqual(Buffer.byteLength(data) + currentFileData.length, fileData2.length); -// Test that appendFileSync accepts buffers +// Test that appendFileSync accepts buffers. const filename3 = join(tmpdir.path, 'append-sync3.txt'); fs.writeFileSync(filename3, currentFileData); @@ -70,13 +70,13 @@ const fileData3 = fs.readFileSync(filename3); assert.strictEqual(buf.length + currentFileData.length, fileData3.length); -// test that appendFile accepts numbers. +// Test that appendFile accepts numbers. const filename4 = join(tmpdir.path, 'append-sync4.txt'); fs.writeFileSync(filename4, currentFileData, { mode: m }); fs.appendFileSync(filename4, num, { mode: m }); -// windows permissions aren't unix +// Windows permissions aren't Unix. if (!common.isWindows) { const st = fs.statSync(filename4); assert.strictEqual(st.mode & 0o700, m); @@ -87,7 +87,7 @@ const fileData4 = fs.readFileSync(filename4); assert.strictEqual(Buffer.byteLength(String(num)) + currentFileData.length, fileData4.length); -// Test that appendFile accepts file descriptors +// Test that appendFile accepts file descriptors. const filename5 = join(tmpdir.path, 'append-sync5.txt'); fs.writeFileSync(filename5, currentFileData); @@ -100,7 +100,7 @@ const fileData5 = fs.readFileSync(filename5); assert.strictEqual(Buffer.byteLength(data) + currentFileData.length, fileData5.length); -// Exit logic for cleanup +// Exit logic for cleanup. process.on('exit', function() { fs.unlinkSync(filename); diff --git a/test/parallel/test-fs-append-file.js b/test/parallel/test-fs-append-file.js index 3122982e2a..90fe8d9277 100644 --- a/test/parallel/test-fs-append-file.js +++ b/test/parallel/test-fs-append-file.js @@ -42,7 +42,7 @@ tmpdir.refresh(); const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; -// Test that empty file will be created and have content added (callback API) +// Test that empty file will be created and have content added (callback API). { const filename = join(tmpdir.path, 'append.txt'); @@ -56,7 +56,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; })); } -// Test that empty file will be created and have content added (promise API) +// Test that empty file will be created and have content added (promise API). { const filename = join(tmpdir.path, 'append-promise.txt'); @@ -68,7 +68,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; .catch(throwNextTick); } -// Test that appends data to a non-empty file (callback API) +// Test that appends data to a non-empty file (callback API). { const filename = join(tmpdir.path, 'append-non-empty.txt'); fs.writeFileSync(filename, currentFileData); @@ -84,7 +84,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; })); } -// Test that appends data to a non-empty file (promise API) +// Test that appends data to a non-empty file (promise API). { const filename = join(tmpdir.path, 'append-non-empty-promise.txt'); fs.writeFileSync(filename, currentFileData); @@ -98,7 +98,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; .catch(throwNextTick); } -// Test that appendFile accepts buffers (callback API) +// Test that appendFile accepts buffers (callback API). { const filename = join(tmpdir.path, 'append-buffer.txt'); fs.writeFileSync(filename, currentFileData); @@ -115,7 +115,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; })); } -// Test that appendFile accepts buffers (promises API) +// Test that appendFile accepts buffers (promises API). { const filename = join(tmpdir.path, 'append-buffer-promises.txt'); fs.writeFileSync(filename, currentFileData); @@ -130,7 +130,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; .catch(throwNextTick); } -// Test that appendFile accepts numbers (callback API) +// Test that appendFile accepts numbers (callback API). { const filename = join(tmpdir.path, 'append-numbers.txt'); fs.writeFileSync(filename, currentFileData); @@ -139,7 +139,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; fs.appendFile(filename, n, { mode: m }, common.mustCall((e) => { assert.ifError(e); - // windows permissions aren't unix + // Windows permissions aren't Unix. if (!common.isWindows) { const st = fs.statSync(filename); assert.strictEqual(st.mode & 0o700, m); @@ -153,7 +153,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; })); } -// Test that appendFile accepts numbers (promises API) +// Test that appendFile accepts numbers (promises API). { const filename = join(tmpdir.path, 'append-numbers-promises.txt'); fs.writeFileSync(filename, currentFileData); @@ -161,7 +161,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; const m = 0o600; fs.promises.appendFile(filename, n, { mode: m }) .then(common.mustCall(() => { - // windows permissions aren't unix + // Windows permissions aren't Unix. if (!common.isWindows) { const st = fs.statSync(filename); assert.strictEqual(st.mode & 0o700, m); @@ -176,7 +176,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; .catch(throwNextTick); } -// Test that appendFile accepts file descriptors (callback API) +// Test that appendFile accepts file descriptors (callback API). { const filename = join(tmpdir.path, 'append-descriptors.txt'); fs.writeFileSync(filename, currentFileData); @@ -200,7 +200,7 @@ const throwNextTick = (e) => { process.nextTick(() => { throw e; }); }; })); } -// Test that appendFile accepts file descriptors (promises API) +// Test that appendFile accepts file descriptors (promises API). { const filename = join(tmpdir.path, 'append-descriptors-promises.txt'); fs.writeFileSync(filename, currentFileData); diff --git a/test/parallel/test-fs-error-messages.js b/test/parallel/test-fs-error-messages.js index dd5438c44b..370b4f4697 100644 --- a/test/parallel/test-fs-error-messages.js +++ b/test/parallel/test-fs-error-messages.js @@ -321,7 +321,7 @@ function re(literals, ...values) { `ENOTEMPTY: directory not empty, rename '${existingDir}' -> ` + `'${existingDir2}'`); assert.strictEqual(err.errno, UV_ENOTEMPTY); - } else if (err.code === 'EXDEV') { // not on the same mounted filesystem + } else if (err.code === 'EXDEV') { // Not on the same mounted filesystem assert.strictEqual( err.message, `EXDEV: cross-device link not permitted, rename '${existingDir}' -> ` + diff --git a/test/parallel/test-fs-link.js b/test/parallel/test-fs-link.js index 9b95fc3e02..f4f3f787d7 100644 --- a/test/parallel/test-fs-link.js +++ b/test/parallel/test-fs-link.js @@ -7,7 +7,7 @@ const fs = require('fs'); const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); -// test creating and reading hard link +// Test creating and reading hard link const srcPath = path.join(tmpdir.path, 'hardlink-target.txt'); const dstPath = path.join(tmpdir.path, 'link1.js'); fs.writeFileSync(srcPath, 'hello world'); diff --git a/test/parallel/test-fs-mkdir.js b/test/parallel/test-fs-mkdir.js index f2ed9b9f68..2a15627a0f 100644 --- a/test/parallel/test-fs-mkdir.js +++ b/test/parallel/test-fs-mkdir.js @@ -132,7 +132,7 @@ function nextdir() { } } -// mkdirp when folder does not yet exist. +// `mkdirp` when folder does not yet exist. { const pathname = path.join(tmpdir.path, nextdir(), nextdir()); diff --git a/test/parallel/test-fs-open.js b/test/parallel/test-fs-open.js index 7881248252..9a1ae623fe 100644 --- a/test/parallel/test-fs-open.js +++ b/test/parallel/test-fs-open.js @@ -27,7 +27,7 @@ const fs = require('fs'); let caughtException = false; try { - // should throw ENOENT, not EBADF + // Should throw ENOENT, not EBADF // see https://github.com/joyent/node/pull/1228 fs.openSync('/path/to/file/that/does/not/exist', 'r'); } catch (e) { diff --git a/test/parallel/test-fs-promises-file-handle-chmod.js b/test/parallel/test-fs-promises-file-handle-chmod.js index cb7a1c6317..2a05218969 100644 --- a/test/parallel/test-fs-promises-file-handle-chmod.js +++ b/test/parallel/test-fs-promises-file-handle-chmod.js @@ -17,7 +17,7 @@ tmpdir.refresh(); async function validateFilePermission() { const filePath = path.resolve(tmpDir, 'tmp-chmod.txt'); const fileHandle = await open(filePath, 'w+', 0o444); - // file created with r--r--r-- 444 + // File created with r--r--r-- 444 const statsBeforeMod = fs.statSync(filePath); assert.deepStrictEqual(statsBeforeMod.mode & 0o444, 0o444); @@ -34,7 +34,7 @@ async function validateFilePermission() { expectedAccess = newPermissions; } - // change the permissions to rwxr--r-x + // Change the permissions to rwxr--r-x await fileHandle.chmod(newPermissions); const statsAfterMod = fs.statSync(filePath); assert.deepStrictEqual(statsAfterMod.mode & expectedAccess, expectedAccess); diff --git a/test/parallel/test-fs-promises.js b/test/parallel/test-fs-promises.js index 749e0a6f08..97b5f8326e 100644 --- a/test/parallel/test-fs-promises.js +++ b/test/parallel/test-fs-promises.js @@ -119,7 +119,7 @@ async function getHandle(dest) { await unlink(dest); } - // bytes written to file match buffer + // Bytes written to file match buffer { const handle = await getHandle(dest); const buf = Buffer.from('hello fsPromises'); @@ -130,7 +130,7 @@ async function getHandle(dest) { assert.deepStrictEqual(ret.buffer, buf); } - // truncate file to specified length + // Truncate file to specified length { const handle = await getHandle(dest); const buf = Buffer.from('hello FileHandle'); @@ -224,7 +224,7 @@ async function getHandle(dest) { const newMode = 0o666; if (common.isOSX) { - // lchmod is only available on macOS + // `lchmod` is only available on macOS. await lchmod(newLink, newMode); stats = await lstat(newLink); assert.strictEqual(stats.mode & 0o777, newMode); @@ -287,7 +287,7 @@ async function getHandle(dest) { assert(stats.isDirectory()); } - // mkdirp when folder does not yet exist. + // `mkdirp` when folder does not yet exist. { const dir = path.join(tmpDir, nextdir(), nextdir()); await mkdir(dir, { recursive: true }); @@ -344,7 +344,7 @@ async function getHandle(dest) { }); } - // mkdtemp with invalid numeric prefix + // `mkdtemp` with invalid numeric prefix { await mkdtemp(path.resolve(tmpDir, 'FOO')); assert.rejects( diff --git a/test/parallel/test-fs-read-stream-err.js b/test/parallel/test-fs-read-stream-err.js index a9b4838cf1..1d280f6487 100644 --- a/test/parallel/test-fs-read-stream-err.js +++ b/test/parallel/test-fs-read-stream-err.js @@ -43,15 +43,15 @@ fs.close = common.mustCall((fd_, cb) => { const read = fs.read; fs.read = function() { - // first time is ok. + // First time is ok. read.apply(fs, arguments); - // then it breaks + // Then it breaks. fs.read = common.mustCall(function() { const cb = arguments[arguments.length - 1]; process.nextTick(() => { cb(err); }); - // and should not be called again! + // It should not be called again! fs.read = () => { throw new Error('BOOM!'); }; diff --git a/test/parallel/test-fs-read-stream-inherit.js b/test/parallel/test-fs-read-stream-inherit.js index a081302cc5..69f3b9c3f7 100644 --- a/test/parallel/test-fs-read-stream-inherit.js +++ b/test/parallel/test-fs-read-stream-inherit.js @@ -140,7 +140,7 @@ const rangeFile = fixtures.path('x.txt'); })); } -// pause and then resume immediately. +// Pause and then resume immediately. { const pauseRes = fs.createReadStream(rangeFile); pauseRes.pause(); diff --git a/test/parallel/test-fs-read-stream.js b/test/parallel/test-fs-read-stream.js index 2a07a09c97..b1559ed9ea 100644 --- a/test/parallel/test-fs-read-stream.js +++ b/test/parallel/test-fs-read-stream.js @@ -206,7 +206,7 @@ if (!common.isWindows) { } { - // pause and then resume immediately. + // Pause and then resume immediately. const pauseRes = fs.createReadStream(rangeFile); pauseRes.pause(); pauseRes.resume(); diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js index 1eaf1681d7..48294d4a62 100644 --- a/test/parallel/test-fs-realpath.js +++ b/test/parallel/test-fs-realpath.js @@ -365,7 +365,7 @@ function test_upone_actual(realpath, realpathSync, cb) { cb(); } -// going up with .. multiple times +// Going up with .. multiple times // . // `-- a/ // |-- b/ @@ -407,7 +407,7 @@ function test_up_multiple(realpath, realpathSync, cb) { } -// absolute symlinks with children. +// Absolute symlinks with children. // . // `-- a/ // |-- b/ diff --git a/test/parallel/test-fs-symlink-dir-junction.js b/test/parallel/test-fs-symlink-dir-junction.js index 5bd7a8dcc4..fc89ad3684 100644 --- a/test/parallel/test-fs-symlink-dir-junction.js +++ b/test/parallel/test-fs-symlink-dir-junction.js @@ -28,7 +28,7 @@ const fs = require('fs'); const tmpdir = require('../common/tmpdir'); -// test creating and reading symbolic link +// Test creating and reading symbolic link const linkData = fixtures.path('cycles/'); const linkPath = path.join(tmpdir.path, 'cycles_link'); diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index 93932e27d7..e34953423b 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -33,7 +33,7 @@ function stat_resource(resource) { return fs.statSync(resource); } else { const stats = fs.fstatSync(resource); - // ensure mtime has been written to disk + // Ensure mtime has been written to disk // except for directories on AIX where it cannot be synced if (common.isAIX && stats.isDirectory()) return stats; @@ -59,8 +59,8 @@ function expect_errno(syscall, resource, err, errno) { function expect_ok(syscall, resource, err, atime, mtime) { const mtime_diff = check_mtime(resource, mtime); assert( - // check up to single-second precision - // sub-second precision is OS and fs dependant + // Check up to single-second precision. + // Sub-second precision is OS and fs dependant. !err && (mtime_diff < 2) || err && err.code === 'ENOSYS', `FAILED: expect_ok ${util.inspect(arguments)} check_mtime: ${mtime_diff}` @@ -82,7 +82,7 @@ runTests(cases.values()); function runTests(iter) { const { value, done } = iter.next(); if (done) return; - // Support easy setting same or different atime / mtime values + // Support easy setting same or different atime / mtime values. const [atime, mtime] = Array.isArray(value) ? value : [value, value]; let fd; @@ -119,7 +119,7 @@ function runTests(iter) { fs.utimesSync(tmpdir.path, atime, mtime); expect_ok('utimesSync', tmpdir.path, undefined, atime, mtime); - // some systems don't have futimes + // Some systems don't have futimes // if there's an error, it should be ENOSYS try { fs.futimesSync(fd, atime, mtime); diff --git a/test/parallel/test-fs-write-file.js b/test/parallel/test-fs-write-file.js index 7f0ec116f1..b9536bea4c 100644 --- a/test/parallel/test-fs-write-file.js +++ b/test/parallel/test-fs-write-file.js @@ -48,7 +48,7 @@ fs.writeFile(filename, s, common.mustCall(function(e) { })); })); -// test that writeFile accepts buffers +// Test that writeFile accepts buffers. const filename2 = join(tmpdir.path, 'test2.txt'); const buf = Buffer.from(s, 'utf8'); @@ -62,14 +62,14 @@ fs.writeFile(filename2, buf, common.mustCall(function(e) { })); })); -// test that writeFile accepts numbers. +// Test that writeFile accepts numbers. const filename3 = join(tmpdir.path, 'test3.txt'); const m = 0o600; fs.writeFile(filename3, n, { mode: m }, common.mustCall(function(e) { assert.ifError(e); - // windows permissions aren't unix + // Windows permissions aren't Unix. if (!common.isWindows) { const st = fs.statSync(filename3); assert.strictEqual(st.mode & 0o700, m); @@ -82,7 +82,7 @@ fs.writeFile(filename3, n, { mode: m }, common.mustCall(function(e) { })); })); -// Test that writeFile accepts file descriptors +// Test that writeFile accepts file descriptors. const filename4 = join(tmpdir.path, 'test4.txt'); fs.open(filename4, 'w+', common.mustCall(function(e, fd) { diff --git a/test/parallel/test-fs-write-stream-err.js b/test/parallel/test-fs-write-stream-err.js index 36bf9dbcfb..0db517da2a 100644 --- a/test/parallel/test-fs-write-stream-err.js +++ b/test/parallel/test-fs-write-stream-err.js @@ -38,17 +38,17 @@ fs.write = function() { switch (writeCalls++) { case 0: console.error('first write'); - // first time is ok. + // First time is ok. return write.apply(fs, arguments); case 1: - // then it breaks + // Then it breaks. console.error('second write'); const cb = arguments[arguments.length - 1]; return process.nextTick(function() { cb(err); }); default: - // and should not be called again! + // It should not be called again! throw new Error('BOOM!'); } }; diff --git a/test/parallel/test-http-agent-destroyed-socket.js b/test/parallel/test-http-agent-destroyed-socket.js index 145dc48424..5b58ef0f52 100644 --- a/test/parallel/test-http-agent-destroyed-socket.js +++ b/test/parallel/test-http-agent-destroyed-socket.js @@ -41,7 +41,7 @@ const server = http.createServer(common.mustCall((req, res) => { }; const request1 = http.get(requestOptions, common.mustCall((response) => { - // assert request2 is queued in the agent + // Assert request2 is queued in the agent const key = agent.getName(requestOptions); assert.strictEqual(agent.requests[key].length, 1); response.resume(); diff --git a/test/parallel/test-http-agent-keepalive.js b/test/parallel/test-http-agent-keepalive.js index 4d682a89ab..7e2cef4e3e 100644 --- a/test/parallel/test-http-agent-keepalive.js +++ b/test/parallel/test-http-agent-keepalive.js @@ -62,7 +62,7 @@ function checkDataAndSockets(body) { } function second() { - // request second, use the same socket + // Request second, use the same socket get('/second', common.mustCall((res) => { assert.strictEqual(res.statusCode, 200); res.on('data', checkDataAndSockets); @@ -79,7 +79,7 @@ function second() { } function remoteClose() { - // mock remote server close the socket + // Mock remote server close the socket get('/remote_close', common.mustCall((res) => { assert.deepStrictEqual(res.statusCode, 200); res.on('data', checkDataAndSockets); @@ -89,7 +89,7 @@ function remoteClose() { process.nextTick(common.mustCall(() => { assert.strictEqual(agent.sockets[name], undefined); assert.strictEqual(agent.freeSockets[name].length, 1); - // waiting remote server close the socket + // Waiting remote server close the socket setTimeout(common.mustCall(() => { assert.strictEqual(agent.sockets[name], undefined); assert.strictEqual(agent.freeSockets[name], undefined); @@ -101,7 +101,7 @@ function remoteClose() { } function remoteError() { - // remote server will destroy the socket + // Remote server will destroy the socket const req = get('/error', common.mustNotCall()); req.on('error', common.mustCall((err) => { assert(err); diff --git a/test/parallel/test-http-client-response-domain.js b/test/parallel/test-http-client-response-domain.js index 617dc729ac..ace9efc752 100644 --- a/test/parallel/test-http-client-response-domain.js +++ b/test/parallel/test-http-client-response-domain.js @@ -30,7 +30,7 @@ let d; const tmpdir = require('../common/tmpdir'); tmpdir.refresh(); -// first fire up a simple HTTP server +// First fire up a simple HTTP server const server = http.createServer(function(req, res) { res.writeHead(200); res.end(); diff --git a/test/parallel/test-http-client-spurious-aborted.js b/test/parallel/test-http-client-spurious-aborted.js index 8f05f0cb36..296b4bd256 100644 --- a/test/parallel/test-http-client-spurious-aborted.js +++ b/test/parallel/test-http-client-spurious-aborted.js @@ -67,7 +67,7 @@ function download() { assert.strictEqual(aborted, abortRequest); finishCountdown.dec(); if (finishCountdown.remaining === 0) return; - abortRequest = false; // next one should be a good response + abortRequest = false; // Next one should be a good response download(); }); }); diff --git a/test/parallel/test-http-client-timeout-event.js b/test/parallel/test-http-client-timeout-event.js index c76d56ef25..71767bef8f 100644 --- a/test/parallel/test-http-client-timeout-event.js +++ b/test/parallel/test-http-client-timeout-event.js @@ -36,7 +36,7 @@ server.listen(0, options.host, function() { options.port = this.address().port; const req = http.request(options); req.on('error', function() { - // this space is intentionally left blank + // This space is intentionally left blank }); req.on('close', common.mustCall(() => server.close())); diff --git a/test/parallel/test-http-client-timeout-option.js b/test/parallel/test-http-client-timeout-option.js index 6351a2ca4a..c21ec88e85 100644 --- a/test/parallel/test-http-client-timeout-option.js +++ b/test/parallel/test-http-client-timeout-option.js @@ -21,7 +21,7 @@ server.listen(0, options.host, function() { options.port = this.address().port; const req = http.request(options); req.on('error', function() { - // this space is intentionally left blank + // This space is intentionally left blank }); req.on('close', common.mustCall(() => server.close())); diff --git a/test/parallel/test-http-client-timeout-with-data.js b/test/parallel/test-http-client-timeout-with-data.js index bc5670b693..a3f7fdd929 100644 --- a/test/parallel/test-http-client-timeout-with-data.js +++ b/test/parallel/test-http-client-timeout-with-data.js @@ -46,7 +46,7 @@ server.listen(0, options.host, function() { function onresponse(res) { req.setTimeout(50, common.mustCall(function() { - assert.strictEqual(nchunks, 1); // should have received the first chunk + assert.strictEqual(nchunks, 1); // Should have received the first chunk server.emit('timeout'); })); diff --git a/test/parallel/test-http-client-timeout.js b/test/parallel/test-http-client-timeout.js index bf0a3fbe54..90a3bebebc 100644 --- a/test/parallel/test-http-client-timeout.js +++ b/test/parallel/test-http-client-timeout.js @@ -32,13 +32,13 @@ const options = { }; const server = http.createServer(function(req, res) { - // this space intentionally left blank + // This space intentionally left blank }); server.listen(0, options.host, function() { options.port = this.address().port; const req = http.request(options, function(res) { - // this space intentionally left blank + // This space intentionally left blank }); req.on('close', function() { server.close(); diff --git a/test/parallel/test-http-conn-reset.js b/test/parallel/test-http-conn-reset.js index fef75b7289..e218bbfdce 100644 --- a/test/parallel/test-http-conn-reset.js +++ b/test/parallel/test-http-conn-reset.js @@ -38,7 +38,7 @@ const server = net.createServer(function(client) { }); server.listen(0, options.host, common.mustCall(onListen)); -// do a GET request, expect it to fail +// Do a GET request, expect it to fail function onListen() { options.port = this.address().port; const req = http.request(options, common.mustNotCall()); diff --git a/test/parallel/test-http-header-overflow.js b/test/parallel/test-http-header-overflow.js index 167dada928..a539a69c03 100644 --- a/test/parallel/test-http-header-overflow.js +++ b/test/parallel/test-http-header-overflow.js @@ -7,7 +7,7 @@ const { expectsError, mustCall } = require('../common'); const CRLF = '\r\n'; const DUMMY_HEADER_NAME = 'Cookie: '; const DUMMY_HEADER_VALUE = 'a'.repeat( - // plus one is to make it 1 byte too big + // Plus one is to make it 1 byte too big maxHeaderSize - DUMMY_HEADER_NAME.length - (2 * CRLF.length) + 1 ); const PAYLOAD_GET = 'GET /blah HTTP/1.1'; diff --git a/test/parallel/test-http-outgoing-finish-writable.js b/test/parallel/test-http-outgoing-finish-writable.js index 033e9b6bc1..e03901fb6d 100644 --- a/test/parallel/test-http-outgoing-finish-writable.js +++ b/test/parallel/test-http-outgoing-finish-writable.js @@ -31,7 +31,7 @@ server.on('listening', common.mustCall(function() { assert.strictEqual(clientRequest.writable, true); clientRequest.end(); - // writable is still true when close + // Writable is still true when close // THIS IS LEGACY, we cannot change it // unless we break error detection assert.strictEqual(clientRequest.writable, true); diff --git a/test/parallel/test-http-outgoing-internal-headernames-getter.js b/test/parallel/test-http-outgoing-internal-headernames-getter.js index c8bd1f13d5..c3caffff1f 100644 --- a/test/parallel/test-http-outgoing-internal-headernames-getter.js +++ b/test/parallel/test-http-outgoing-internal-headernames-getter.js @@ -7,7 +7,7 @@ const warn = 'OutgoingMessage.prototype._headerNames is deprecated'; common.expectWarning('DeprecationWarning', warn, 'DEP0066'); { - // tests for _headerNames get method + // Tests for _headerNames get method const outgoingMessage = new OutgoingMessage(); outgoingMessage._headerNames; } diff --git a/test/parallel/test-http-outgoing-internal-headernames-setter.js b/test/parallel/test-http-outgoing-internal-headernames-setter.js index 7329076698..5f943596df 100644 --- a/test/parallel/test-http-outgoing-internal-headernames-setter.js +++ b/test/parallel/test-http-outgoing-internal-headernames-setter.js @@ -7,7 +7,7 @@ const warn = 'OutgoingMessage.prototype._headerNames is deprecated'; common.expectWarning('DeprecationWarning', warn, 'DEP0066'); { - // tests for _headerNames set method + // Tests for _headerNames set method const outgoingMessage = new OutgoingMessage(); outgoingMessage._headerNames = { 'x-flow-id': '61bba6c5-28a3-4eab-9241-2ecaa6b6a1fd' diff --git a/test/parallel/test-http-outgoing-settimeout.js b/test/parallel/test-http-outgoing-settimeout.js index 6e46973bc1..3065c53f11 100644 --- a/test/parallel/test-http-outgoing-settimeout.js +++ b/test/parallel/test-http-outgoing-settimeout.js @@ -5,7 +5,7 @@ const assert = require('assert'); const { OutgoingMessage } = require('http'); { - // tests for settimeout method with socket + // Tests for settimeout method with socket const expectedMsecs = 42; const outgoingMessage = new OutgoingMessage(); outgoingMessage.socket = { diff --git a/test/parallel/test-http-parser.js b/test/parallel/test-http-parser.js index 5503b2284b..6d664cfc0a 100644 --- a/test/parallel/test-http-parser.js +++ b/test/parallel/test-http-parser.js @@ -179,7 +179,7 @@ function expectBody(expected) { let seen_body = false; const onHeaders = (headers) => { - assert.ok(seen_body); // trailers should come after the body + assert.ok(seen_body); // Trailers should come after the body assert.deepStrictEqual(headers, ['Vary', '*', 'Content-Type', 'text/plain']); }; @@ -190,7 +190,7 @@ function expectBody(expected) { assert.strictEqual(url || parser.url, '/it'); assert.strictEqual(versionMajor, 1); assert.strictEqual(versionMinor, 1); - // expect to see trailing headers now + // Expect to see trailing headers now parser[kOnHeaders] = mustCall(onHeaders); }; diff --git a/test/parallel/test-http-res-write-after-end.js b/test/parallel/test-http-res-write-after-end.js index 75cb25f0a6..bf6b7a3842 100644 --- a/test/parallel/test-http-res-write-after-end.js +++ b/test/parallel/test-http-res-write-after-end.js @@ -34,7 +34,7 @@ const server = http.Server(common.mustCall(function(req, res) { res.end(); const r = res.write('This should raise an error.'); - // write after end should return true + // Write after end should return true assert.strictEqual(r, true); })); 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 39ac800d0d..f801da246e 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 @@ -40,7 +40,7 @@ server.once('request', common.mustCall((req, res) => { name: 'TypeError [ERR_INVALID_ARG_TYPE]', }; - // write should not accept an Array + // 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 + // End should not accept an Array assert.throws( () => { res.end(['moo']); @@ -64,7 +64,7 @@ server.listen(0, function() { // Just make a request, other tests handle responses http.get({ port: this.address().port }, (res) => { res.resume(); - // do it again to test .end(Buffer); + // Do it again to test .end(Buffer); http.get({ port: server.address().port }, (res) => { res.resume(); server.close(); diff --git a/test/parallel/test-http-server-multiheaders2.js b/test/parallel/test-http-server-multiheaders2.js index a8878d2951..95ee5b61fa 100644 --- a/test/parallel/test-http-server-multiheaders2.js +++ b/test/parallel/test-http-server-multiheaders2.js @@ -65,7 +65,7 @@ const multipleForbidden = [ 'Location', 'Max-Forwards', - // special case, tested differently + // Special case, tested differently // 'Content-Length', ]; diff --git a/test/parallel/test-http-set-trailers.js b/test/parallel/test-http-set-trailers.js index 3252ac7fc0..9068ef8f76 100644 --- a/test/parallel/test-http-set-trailers.js +++ b/test/parallel/test-http-set-trailers.js @@ -36,7 +36,7 @@ const server = http.createServer(function(req, res) { server.listen(0); -// first, we test an HTTP/1.0 request. +// First, we test an HTTP/1.0 request. server.on('listening', function() { const c = net.createConnection(this.address().port); let res_buffer = ''; @@ -66,7 +66,7 @@ server.on('listening', function() { }); }); -// now, we test an HTTP/1.1 request. +// Now, we test an HTTP/1.1 request. server.on('listening', function() { const c = net.createConnection(this.address().port); let res_buffer = ''; diff --git a/test/parallel/test-http-url.parse-basic.js b/test/parallel/test-http-url.parse-basic.js index e68df80e91..e03f39aa90 100644 --- a/test/parallel/test-http-url.parse-basic.js +++ b/test/parallel/test-http-url.parse-basic.js @@ -29,7 +29,7 @@ let testURL; // make sure the basics work function check(request) { - // default method should still be get + // Default method should still be 'GET' assert.strictEqual(request.method, 'GET'); // There are no URL params, so you should not see any assert.strictEqual(request.url, '/'); diff --git a/test/parallel/test-http-url.parse-search.js b/test/parallel/test-http-url.parse-search.js index 111cf97874..d10713f5f1 100644 --- a/test/parallel/test-http-url.parse-search.js +++ b/test/parallel/test-http-url.parse-search.js @@ -26,7 +26,7 @@ const http = require('http'); const url = require('url'); function check(request) { - // a path should come over with params + // A path should come over with params assert.strictEqual(request.url, '/asdf?qwer=zxcv'); } diff --git a/test/parallel/test-http-writable-true-after-close.js b/test/parallel/test-http-writable-true-after-close.js index a1915dd69c..c0db7c3449 100644 --- a/test/parallel/test-http-writable-true-after-close.js +++ b/test/parallel/test-http-writable-true-after-close.js @@ -18,7 +18,7 @@ const server = createServer(common.mustCall((req, res) => { // on CentOS 5, 'finish' is emitted res.on('finish', listener); - // everywhere else, 'close' is emitted + // Everywhere else, 'close' is emitted res.on('close', listener); get(`http://127.0.0.1:${internal.address().port}`, common.mustCall((inner) => { diff --git a/test/parallel/test-http2-client-destroy.js b/test/parallel/test-http2-client-destroy.js index 6c4adfe5b4..e7ea37e152 100644 --- a/test/parallel/test-http2-client-destroy.js +++ b/test/parallel/test-http2-client-destroy.js @@ -49,7 +49,7 @@ const Countdown = require('../common/countdown'); })); } -// test destroy before client operations +// Test destroy before client operations { const server = h2.createServer(); server.listen(0, common.mustCall(() => { @@ -81,7 +81,7 @@ const Countdown = require('../common/countdown'); common.expectsError(() => client.settings({}), sessionError); common.expectsError(() => client.goaway(), sessionError); common.expectsError(() => client.request(), sessionError); - client.close(); // should be a non-op at this point + client.close(); // Should be a non-op at this point // Wait for setImmediate call from destroy() to complete // so that state.destroyed is set to true @@ -91,7 +91,7 @@ const Countdown = require('../common/countdown'); common.expectsError(() => client.settings({}), sessionError); common.expectsError(() => client.goaway(), sessionError); common.expectsError(() => client.request(), sessionError); - client.close(); // should be a non-op at this point + client.close(); // Should be a non-op at this point }); req.resume(); diff --git a/test/parallel/test-http2-client-priority-before-connect.js b/test/parallel/test-http2-client-priority-before-connect.js index a9615d2cd6..7aa13a5e45 100644 --- a/test/parallel/test-http2-client-priority-before-connect.js +++ b/test/parallel/test-http2-client-priority-before-connect.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream) => { stream.respond(); stream.end('ok'); diff --git a/test/parallel/test-http2-client-settings-before-connect.js b/test/parallel/test-http2-client-settings-before-connect.js index ceea1bc39a..ce888bb441 100644 --- a/test/parallel/test-http2-client-settings-before-connect.js +++ b/test/parallel/test-http2-client-settings-before-connect.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream, headers, flags) => { stream.respond(); stream.end('ok'); diff --git a/test/parallel/test-http2-client-shutdown-before-connect.js b/test/parallel/test-http2-client-shutdown-before-connect.js index bd971ebf7d..7e6a1a55c1 100644 --- a/test/parallel/test-http2-client-shutdown-before-connect.js +++ b/test/parallel/test-http2-client-shutdown-before-connect.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustNotCall()); server.listen(0, common.mustCall(() => { diff --git a/test/parallel/test-http2-client-socket-destroy.js b/test/parallel/test-http2-client-socket-destroy.js index 3eb7e898ed..a91c6da28d 100644 --- a/test/parallel/test-http2-client-socket-destroy.js +++ b/test/parallel/test-http2-client-socket-destroy.js @@ -13,7 +13,7 @@ const body = const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream) => { stream.on('aborted', common.mustCall()); stream.on('close', common.mustCall()); diff --git a/test/parallel/test-http2-client-write-before-connect.js b/test/parallel/test-http2-client-write-before-connect.js index 6588d7dccd..6efefc5870 100644 --- a/test/parallel/test-http2-client-write-before-connect.js +++ b/test/parallel/test-http2-client-write-before-connect.js @@ -8,7 +8,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream, headers, flags) => { let data = ''; stream.setEncoding('utf8'); diff --git a/test/parallel/test-http2-cookies.js b/test/parallel/test-http2-cookies.js index 275fbf05e7..fcd6b84758 100644 --- a/test/parallel/test-http2-cookies.js +++ b/test/parallel/test-http2-cookies.js @@ -14,7 +14,7 @@ const setCookie = [ 'e=f' ]; -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-create-client-session.js b/test/parallel/test-http2-create-client-session.js index 35de927ea7..b2d6ddbe7a 100644 --- a/test/parallel/test-http2-create-client-session.js +++ b/test/parallel/test-http2-create-client-session.js @@ -13,7 +13,7 @@ const body = const server = h2.createServer(); const count = 100; -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream, count)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-createwritereq.js b/test/parallel/test-http2-createwritereq.js index 1575424d16..3015ad6c64 100644 --- a/test/parallel/test-http2-createwritereq.js +++ b/test/parallel/test-http2-createwritereq.js @@ -24,7 +24,7 @@ const encodings = { 'ucs-2': 'ucs2', 'utf16le': 'ucs2', 'utf-16le': 'ucs2', - 'UTF8': 'utf8' // should fall through to Buffer.from + 'UTF8': 'utf8' // Should fall through to Buffer.from }; const testsToRun = Object.keys(encodings).length; diff --git a/test/parallel/test-http2-info-headers.js b/test/parallel/test-http2-info-headers.js index 132818c409..ec95a9d3d9 100644 --- a/test/parallel/test-http2-info-headers.js +++ b/test/parallel/test-http2-info-headers.js @@ -8,7 +8,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); const status101regex = diff --git a/test/parallel/test-http2-methods.js b/test/parallel/test-http2-methods.js index a291bdf008..143b50b66b 100644 --- a/test/parallel/test-http2-methods.js +++ b/test/parallel/test-http2-methods.js @@ -11,7 +11,7 @@ const server = h2.createServer(); const methods = [undefined, 'GET', 'POST', 'PATCH', 'FOO', 'A B C']; let expected = methods.length; -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream, expected)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-no-wanttrailers-listener.js b/test/parallel/test-http2-no-wanttrailers-listener.js index 87bc21df48..09293f2584 100644 --- a/test/parallel/test-http2-no-wanttrailers-listener.js +++ b/test/parallel/test-http2-no-wanttrailers-listener.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-options-max-headers-block-length.js b/test/parallel/test-http2-options-max-headers-block-length.js index 0706e6a83e..18f72bf1de 100644 --- a/test/parallel/test-http2-options-max-headers-block-length.js +++ b/test/parallel/test-http2-options-max-headers-block-length.js @@ -8,7 +8,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustNotCall()); server.listen(0, common.mustCall(() => { diff --git a/test/parallel/test-http2-options-max-reserved-streams.js b/test/parallel/test-http2-options-max-reserved-streams.js index 6dbf54bf31..44c495b833 100644 --- a/test/parallel/test-http2-options-max-reserved-streams.js +++ b/test/parallel/test-http2-options-max-reserved-streams.js @@ -15,7 +15,7 @@ const countdown = new Countdown(3, () => { client.close(); }); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream) => { // The first pushStream will complete as normal stream.pushStream({ diff --git a/test/parallel/test-http2-perf_hooks.js b/test/parallel/test-http2-perf_hooks.js index 4264915294..0fcbc323e0 100644 --- a/test/parallel/test-http2-perf_hooks.js +++ b/test/parallel/test-http2-perf_hooks.js @@ -62,7 +62,7 @@ const body = const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-priority-event.js b/test/parallel/test-http2-priority-event.js index fe04ffb342..41ec6534b2 100644 --- a/test/parallel/test-http2-priority-event.js +++ b/test/parallel/test-http2-priority-event.js @@ -8,7 +8,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onPriority(stream, parent, weight, exclusive) { diff --git a/test/parallel/test-http2-respond-file-fd-errors.js b/test/parallel/test-http2-respond-file-fd-errors.js index 078d0eb11e..9508cfae97 100644 --- a/test/parallel/test-http2-respond-file-fd-errors.js +++ b/test/parallel/test-http2-respond-file-fd-errors.js @@ -29,7 +29,7 @@ const fd = fs.openSync(fname, 'r'); const server = http2.createServer(); server.on('stream', common.mustCall((stream) => { - // should throw if fd isn't a number + // Should throw if fd isn't a number Object.keys(types).forEach((type) => { if (type === 'number') { return; diff --git a/test/parallel/test-http2-respond-file-fd-invalid.js b/test/parallel/test-http2-respond-file-fd-invalid.js index 7630b93bc6..64c8ba541f 100644 --- a/test/parallel/test-http2-respond-file-fd-invalid.js +++ b/test/parallel/test-http2-respond-file-fd-invalid.js @@ -26,7 +26,7 @@ server.on('stream', (stream) => { try { while (fs.fstatSync(++fd)); } catch { - // do nothing; we now have an invalid fd + // Do nothing; we now have an invalid fd } stream.respondWithFD(fd); diff --git a/test/parallel/test-http2-respond-nghttperrors.js b/test/parallel/test-http2-respond-nghttperrors.js index d720ec1fa4..3bdfbffeec 100644 --- a/test/parallel/test-http2-respond-nghttperrors.js +++ b/test/parallel/test-http2-respond-nghttperrors.js @@ -13,7 +13,7 @@ const { } = internalBinding('http2'); const { NghttpError } = require('internal/http2/util'); -// tests error handling within respond +// Tests error handling within respond // - every other NGHTTP2 error from binding (should emit stream error) const specificTestKeys = []; diff --git a/test/parallel/test-http2-server-errors.js b/test/parallel/test-http2-server-errors.js index eeb9e79682..fec6cc84be 100644 --- a/test/parallel/test-http2-server-errors.js +++ b/test/parallel/test-http2-server-errors.js @@ -41,7 +41,7 @@ const h2 = require('http2'); }; const request = client.request(headers); request.on('data', common.mustCall(function(chunk) { - // cause an error on the server side + // Cause an error on the server side client.destroy(); })); request.end(); @@ -81,7 +81,7 @@ const h2 = require('http2'); }; const request = client.request(headers); request.on('data', common.mustCall(function(chunk) { - // cause an error on the server side + // Cause an error on the server side client.destroy(); })); request.end(); diff --git a/test/parallel/test-http2-server-push-stream-errors.js b/test/parallel/test-http2-server-push-stream-errors.js index fb6fc11b63..35d8b796e4 100644 --- a/test/parallel/test-http2-server-push-stream-errors.js +++ b/test/parallel/test-http2-server-push-stream-errors.js @@ -13,7 +13,7 @@ const { } = internalBinding('http2'); const { NghttpError } = require('internal/http2/util'); -// tests error handling within pushStream +// Tests error handling within pushStream // - NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE (should emit session error) // - NGHTTP2_ERR_STREAM_CLOSED (should emit stream error) // - every other NGHTTP2 error from binding (should emit stream error) diff --git a/test/parallel/test-http2-server-push-stream-head.js b/test/parallel/test-http2-server-push-stream-head.js index 35e22c0ce3..c1db3ce81e 100644 --- a/test/parallel/test-http2-server-push-stream-head.js +++ b/test/parallel/test-http2-server-push-stream-head.js @@ -21,7 +21,7 @@ server.on('stream', common.mustCall((stream, headers) => { }, common.mustCall((err, push, headers) => { assert.strictEqual(push._writableState.ended, true); push.respond(); - // cannot write to push() anymore + // Cannot write to push() anymore push.on('error', common.expectsError({ type: Error, code: 'ERR_STREAM_WRITE_AFTER_END', diff --git a/test/parallel/test-http2-server-rst-before-respond.js b/test/parallel/test-http2-server-rst-before-respond.js index e7218aaeea..78fca25a82 100644 --- a/test/parallel/test-http2-server-rst-before-respond.js +++ b/test/parallel/test-http2-server-rst-before-respond.js @@ -8,7 +8,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-server-shutdown-before-respond.js b/test/parallel/test-http2-server-shutdown-before-respond.js index 33f224fc69..65dd853f83 100644 --- a/test/parallel/test-http2-server-shutdown-before-respond.js +++ b/test/parallel/test-http2-server-shutdown-before-respond.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-http2-server-socket-destroy.js b/test/parallel/test-http2-server-socket-destroy.js index 99595aeb63..e7fbc2ceb7 100644 --- a/test/parallel/test-http2-server-socket-destroy.js +++ b/test/parallel/test-http2-server-socket-destroy.js @@ -11,7 +11,7 @@ const { kSocket } = require('internal/http2/util'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream) { diff --git a/test/parallel/test-http2-timeouts.js b/test/parallel/test-http2-timeouts.js index de8311a149..3a75d63580 100644 --- a/test/parallel/test-http2-timeouts.js +++ b/test/parallel/test-http2-timeouts.js @@ -7,7 +7,7 @@ const h2 = require('http2'); const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall((stream) => { stream.setTimeout(1, common.mustCall(() => { stream.respond({ ':status': 200 }); diff --git a/test/parallel/test-http2-trailers.js b/test/parallel/test-http2-trailers.js index bdc0931157..98b9b5d4a0 100644 --- a/test/parallel/test-http2-trailers.js +++ b/test/parallel/test-http2-trailers.js @@ -12,7 +12,7 @@ const trailerValue = 'testing'; const server = h2.createServer(); -// we use the lower-level API here +// We use the lower-level API here server.on('stream', common.mustCall(onStream)); function onStream(stream, headers, flags) { diff --git a/test/parallel/test-https-agent-create-connection.js b/test/parallel/test-https-agent-create-connection.js index c174f90d7d..c0b50cef01 100644 --- a/test/parallel/test-https-agent-create-connection.js +++ b/test/parallel/test-https-agent-create-connection.js @@ -74,7 +74,7 @@ function createServer() { })); } -// use port and host and option connect +// Use port and host and option connect { const server = createServer(); server.listen(0, common.mustCall(() => { diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index c55f554b00..255bf066aa 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -23,7 +23,7 @@ const common = require('../common'); const assert = require('assert'); -// does node think that i18n was enabled? +// Does node think that i18n was enabled? let enablei18n = process.config.variables.v8_enable_i18n_support; if (enablei18n === undefined) { enablei18n = 0; diff --git a/test/parallel/test-listen-fd-ebadf.js b/test/parallel/test-listen-fd-ebadf.js index 3ec40b5c23..351500be28 100644 --- a/test/parallel/test-listen-fd-ebadf.js +++ b/test/parallel/test-listen-fd-ebadf.js @@ -35,7 +35,7 @@ let invalidFd = 2; try { while (fs.fstatSync(++invalidFd)); } catch { - // do nothing; we now have an invalid fd + // Do nothing; we now have an invalid fd } net.createServer(common.mustNotCall()).listen({ fd: invalidFd }) diff --git a/test/parallel/test-microtask-queue-run-immediate.js b/test/parallel/test-microtask-queue-run-immediate.js index 4d998cf0b8..2d4e21f83a 100644 --- a/test/parallel/test-microtask-queue-run-immediate.js +++ b/test/parallel/test-microtask-queue-run-immediate.js @@ -41,7 +41,7 @@ setImmediate(function() { }); -// no nextTick, microtask with nextTick +// No nextTick, microtask with nextTick setImmediate(function() { let called = false; diff --git a/test/parallel/test-microtask-queue-run.js b/test/parallel/test-microtask-queue-run.js index 85eb770da1..7a1667819f 100644 --- a/test/parallel/test-microtask-queue-run.js +++ b/test/parallel/test-microtask-queue-run.js @@ -41,7 +41,7 @@ setTimeout(function() { }, 0); -// no nextTick, microtask with nextTick +// No nextTick, microtask with nextTick setTimeout(function() { let called = false; diff --git a/test/parallel/test-module-relative-lookup.js b/test/parallel/test-module-relative-lookup.js index c5350e11fa..e9d6112da7 100644 --- a/test/parallel/test-module-relative-lookup.js +++ b/test/parallel/test-module-relative-lookup.js @@ -2,7 +2,7 @@ const common = require('../common'); const assert = require('assert'); -const _module = require('module'); // avoid collision with global.module +const _module = require('module'); // Avoid collision with global.module // Current directory gets highest priority for local modules function testFirstInPath(moduleName, isLocalModule) { diff --git a/test/parallel/test-net-keepalive.js b/test/parallel/test-net-keepalive.js index 9cc08af8fe..d91ec625f8 100644 --- a/test/parallel/test-net-keepalive.js +++ b/test/parallel/test-net-keepalive.js @@ -38,7 +38,7 @@ const echoServer = net.createServer(function(connection) { }, 1), common.platformTimeout(100)); connection.setTimeout(0); assert.notStrictEqual(connection.setKeepAlive, undefined); - // send a keepalive packet after 50 ms + // Send a keepalive packet after 50 ms connection.setKeepAlive(true, common.platformTimeout(50)); connection.on('end', function() { connection.end(); diff --git a/test/parallel/test-net-persistent-keepalive.js b/test/parallel/test-net-persistent-keepalive.js index 85a2950273..b25162996e 100644 --- a/test/parallel/test-net-persistent-keepalive.js +++ b/test/parallel/test-net-persistent-keepalive.js @@ -25,7 +25,7 @@ echoServer.listen(0); echoServer.on('listening', function() { clientConnection = new net.Socket(); - // send a keepalive packet after 1000 ms + // Send a keepalive packet after 1000 ms // and make sure it persists const s = clientConnection.setKeepAlive(true, 400); assert.ok(s instanceof net.Socket); diff --git a/test/parallel/test-net-server-connections-child-null.js b/test/parallel/test-net-server-connections-child-null.js index 46084404c8..bf75826fdd 100644 --- a/test/parallel/test-net-server-connections-child-null.js +++ b/test/parallel/test-net-server-connections-child-null.js @@ -33,7 +33,7 @@ if (process.argv[2] === 'child') { const connect = net.connect(server.address().port); connect.on('close', common.mustCall(() => { - // now server.connections should be null + // `server.connections` should now be null. assert.strictEqual(server.connections, null); server.close(); })); diff --git a/test/parallel/test-path-join.js b/test/parallel/test-path-join.js index a9fb5b1e92..6243d97ce8 100644 --- a/test/parallel/test-path-join.js +++ b/test/parallel/test-path-join.js @@ -8,7 +8,7 @@ const backslashRE = /\\/g; const joinTests = [ [ [path.posix.join, path.win32.join], - // arguments result + // Arguments result [[['.', 'x/b', '..', '/b/c.js'], 'x/b/c.js'], [[], '.'], [['/.', 'x/b', '..', '/b/c.js'], '/x/b/c.js'], @@ -64,7 +64,7 @@ const joinTests = [ joinTests.push([ path.win32.join, joinTests[0][1].slice(0).concat( - [// arguments result + [// Arguments result // UNC path expected [['//foo/bar'], '\\\\foo\\bar\\'], [['\\/foo/bar'], '\\\\foo\\bar\\'], diff --git a/test/parallel/test-path-relative.js b/test/parallel/test-path-relative.js index 26521bc088..5d5d118cc6 100644 --- a/test/parallel/test-path-relative.js +++ b/test/parallel/test-path-relative.js @@ -7,7 +7,7 @@ const failures = []; const relativeTests = [ [ path.win32.relative, - // arguments result + // Arguments result [['c:/blah\\blah', 'd:/games', 'd:\\games'], ['c:/aaaa/bbbb', 'c:/aaaa', '..'], ['c:/aaaa/bbbb', 'c:/cccc', '..\\..\\cccc'], diff --git a/test/parallel/test-path-resolve.js b/test/parallel/test-path-resolve.js index 79c2d67920..e9e6d83ff5 100644 --- a/test/parallel/test-path-resolve.js +++ b/test/parallel/test-path-resolve.js @@ -28,7 +28,7 @@ const resolveTests = [ ] ], [ path.posix.resolve, - // arguments result + // Arguments result [[['/var/lib', '../', 'file/'], '/var/file'], [['/var/lib', '/../', 'file/'], '/file'], [['a/b/c/', '../../..'], process.cwd()], diff --git a/test/parallel/test-preload.js b/test/parallel/test-preload.js index 3d754accae..326eed030c 100644 --- a/test/parallel/test-preload.js +++ b/test/parallel/test-preload.js @@ -25,14 +25,14 @@ const fixtureC = fixtures.path('printC.js'); const fixtureD = fixtures.path('define-global.js'); const fixtureThrows = fixtures.path('throws_error4.js'); -// test preloading a single module works +// Test preloading a single module works childProcess.exec(`"${nodeBinary}" ${preloadOption([fixtureA])} "${fixtureB}"`, function(err, stdout, stderr) { assert.ifError(err); assert.strictEqual(stdout, 'A\nB\n'); }); -// test preloading multiple modules works +// Test preloading multiple modules works childProcess.exec( `"${nodeBinary}" ${preloadOption([fixtureA, fixtureB])} "${fixtureC}"`, function(err, stdout, stderr) { @@ -78,7 +78,7 @@ stdinProc.on('close', function(code) { assert.strictEqual(stdinStdout, 'A\nhello\n'); }); -// test that preload can be used with repl +// Test that preload can be used with repl const replProc = childProcess.spawn( nodeBinary, ['-i', '--require', fixtureA], @@ -109,7 +109,7 @@ childProcess.exec( } ); -// test that preload works with -i +// Test that preload works with -i const interactive = childProcess.exec( `"${nodeBinary}" ${preloadOption([fixtureD])}-i`, common.mustCall(function(err, stdout, stderr) { diff --git a/test/parallel/test-process-env.js b/test/parallel/test-process-env.js index e1be9c6e1b..0e06306634 100644 --- a/test/parallel/test-process-env.js +++ b/test/parallel/test-process-env.js @@ -59,7 +59,7 @@ if (process.argv[2] === 'you-are-the-child') { child.stderr.on('data', function(data) { console.log(data.toString()); }); child.on('exit', function(statusCode) { if (statusCode !== 0) { - process.exit(statusCode); // failed assertion in child process + process.exit(statusCode); // Failed assertion in child process } }); } diff --git a/test/parallel/test-process-kill-pid.js b/test/parallel/test-process-kill-pid.js index e69be183fb..c299ceabaa 100644 --- a/test/parallel/test-process-kill-pid.js +++ b/test/parallel/test-process-kill-pid.js @@ -97,7 +97,7 @@ kill('0', undefined, 0, 15); kill(0, 1, 0, 1); kill(0, 15, 0, 15); -// negative numbers are meaningful on unix +// Negative numbers are meaningful on unix kill(-1, 'SIGHUP', -1, 1); kill(-1, undefined, -1, 15); kill('-1', 'SIGHUP', -1, 1); diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js index 175098aed7..b26f41a466 100644 --- a/test/parallel/test-querystring.js +++ b/test/parallel/test-querystring.js @@ -269,7 +269,7 @@ qsWeirdObjects.forEach((testCase) => { assert.strictEqual(qs.stringify(testCase[0]), testCase[1]); }); -// invalid surrogate pair throws URIError +// Invalid surrogate pair throws URIError common.expectsError( () => qs.stringify({ foo: '\udc00' }), { diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index 90cb8f1584..fba215e225 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -61,7 +61,7 @@ function isWarned(emitter) { } { - // set crlfDelay to float 100.5ms + // Set crlfDelay to float 100.5ms const fi = new FakeInput(); const rli = new readline.Interface({ input: fi, @@ -172,7 +172,7 @@ function isWarned(emitter) { rli.close(); } - // sending multiple newlines at once + // Sending multiple newlines at once { const fi = new FakeInput(); const rli = new readline.Interface( @@ -288,7 +288,7 @@ function isWarned(emitter) { }), delay * 2); } - // set crlfDelay to `Infinity` is allowed + // Set crlfDelay to `Infinity` is allowed { const fi = new FakeInput(); const delay = 200; @@ -515,7 +515,7 @@ function isWarned(emitter) { rli.close(); } - // calling readline without `new` + // Calling readline without `new` { const fi = new FakeInput(); const rli = readline.Interface( @@ -661,13 +661,13 @@ function isWarned(emitter) { }); fi.emit('data', '💻'); - // move left one character/code point + // Move left one character/code point fi.emit('keypress', '.', { name: 'left' }); let cursorPos = rli._getCursorPos(); assert.strictEqual(cursorPos.rows, 0); assert.strictEqual(cursorPos.cols, 0); - // move right one character/code point + // Move right one character/code point fi.emit('keypress', '.', { name: 'right' }); cursorPos = rli._getCursorPos(); assert.strictEqual(cursorPos.rows, 0); @@ -695,7 +695,7 @@ function isWarned(emitter) { }); fi.emit('data', '💻'); - // move left one character/code point + // Move left one character/code point fi.emit('keypress', '.', { name: 'left' }); let cursorPos = rli._getCursorPos(); assert.strictEqual(cursorPos.rows, 0); @@ -731,7 +731,7 @@ function isWarned(emitter) { }); fi.emit('data', '💻'); - // move left one character/code point + // Move left one character/code point fi.emit('keypress', '.', { name: 'right' }); let cursorPos = rli._getCursorPos(); assert.strictEqual(cursorPos.rows, 0); @@ -1104,7 +1104,7 @@ function isWarned(emitter) { assert.strictEqual(internalReadline.getStringWidth('안녕하세요'), 10); assert.strictEqual(internalReadline.getStringWidth('A\ud83c\ude00BC'), 5); - // check if vt control chars are stripped + // Check if vt control chars are stripped assert.strictEqual( internalReadline.stripVTControlCharacters('\u001b[31m> \u001b[39m'), '> ' diff --git a/test/parallel/test-repl-autolibs.js b/test/parallel/test-repl-autolibs.js index f069d8bf40..976cad8436 100644 --- a/test/parallel/test-repl-autolibs.js +++ b/test/parallel/test-repl-autolibs.js @@ -37,10 +37,10 @@ function test1() { gotWrite = true; if (data.length) { - // inspect output matches repl output + // Inspect output matches repl output assert.strictEqual(data, `${util.inspect(require('fs'), null, 2, false)}\n`); - // globally added lib matches required lib + // Globally added lib matches required lib assert.strictEqual(global.fs, require('fs')); test2(); } @@ -57,7 +57,7 @@ function test2() { if (data.length) { // repl response error message assert.strictEqual(data, '{}\n'); - // original value wasn't overwritten + // 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 378af1c144..001e2ffd4e 100644 --- a/test/parallel/test-repl-context.js +++ b/test/parallel/test-repl-context.js @@ -41,14 +41,14 @@ const stream = new ArrayStream(); assert.ok(!server.underscoreAssigned); assert.strictEqual(server.lines.length, 0); - // an assignment to '_' in the repl server + // An assignment to '_' in the repl server server.write('_ = 500;\n'); assert.ok(server.underscoreAssigned); assert.strictEqual(server.lines.length, 1); assert.strictEqual(server.lines[0], '_ = 500;'); assert.strictEqual(server.last, 500); - // use the server to create a new context + // Use the server to create a new context const context = server.createContext(); // Ensure that creating a new context does not diff --git a/test/parallel/test-repl-history-navigation.js b/test/parallel/test-repl-history-navigation.js index 562b79dae8..b00f932aa9 100644 --- a/test/parallel/test-repl-history-navigation.js +++ b/test/parallel/test-repl-history-navigation.js @@ -50,7 +50,7 @@ const DOWN = { name: 'down' }; const prompt = '> '; const tests = [ - { // creates few history to navigate for + { // Creates few history to navigate for env: { NODE_REPL_HISTORY: defaultHistoryPath }, test: [ 'let ab = 45', ENTER, '555 + 909', ENTER, diff --git a/test/parallel/test-repl-save-load.js b/test/parallel/test-repl-save-load.js index 2c42788be6..74841d86ff 100644 --- a/test/parallel/test-repl-save-load.js +++ b/test/parallel/test-repl-save-load.js @@ -49,7 +49,7 @@ putIn.run(testFile); // save it to a file putIn.run([`.save ${saveFileName}`]); -// the file should have what I wrote +// The file should have what I wrote assert.strictEqual(fs.readFileSync(saveFileName, 'utf8'), `${testFile.join('\n')}\n`); @@ -104,7 +104,7 @@ putIn.write = function(data) { }; putIn.run([`.load ${loadFile}`]); -// throw error on loading directory +// Throw error on loading directory loadFile = tmpdir.path; putIn.write = function(data) { assert.strictEqual(data, `Failed to load:${loadFile} is not a valid file\n`); diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index b28923a49b..558b6cab47 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -384,7 +384,7 @@ testMe.complete('var log = console.lo', common.mustCall((error, data) => { assert.deepStrictEqual(data, [['console.log'], 'console.lo']); })); -// tab completion for defined commands +// Tab completion for defined commands putIn.run(['.clear']); testMe.complete('.b', common.mustCall((error, data) => { diff --git a/test/parallel/test-repl-underscore.js b/test/parallel/test-repl-underscore.js index cbf62c3b6e..30f679bcb1 100644 --- a/test/parallel/test-repl-underscore.js +++ b/test/parallel/test-repl-underscore.js @@ -15,7 +15,7 @@ testError(); function testSloppyMode() { const r = initRepl(repl.REPL_MODE_SLOPPY); - // cannot use `let` in sloppy mode + // Cannot use `let` in sloppy mode r.write(`_; // initial value undefined var x = 10; // evaluates to undefined _; // still undefined diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 2337e32280..1426330e20 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -32,7 +32,7 @@ const message = 'Read, Eval, Print Loop'; const prompt_unix = 'node via Unix socket> '; const prompt_tcp = 'node via TCP socket> '; -// absolute path to test/fixtures/a.js +// Absolute path to test/fixtures/a.js const moduleFilename = fixtures.path('a'); // function for REPL to run diff --git a/test/parallel/test-setproctitle.js b/test/parallel/test-setproctitle.js index 2ed0730eec..05bdfa578d 100644 --- a/test/parallel/test-setproctitle.js +++ b/test/parallel/test-setproctitle.js @@ -39,6 +39,6 @@ exec(cmd, common.mustCall((error, stdout, stderr) => { if (common.isFreeBSD || common.isOpenBSD) title += ` (${path.basename(process.execPath)})`; - // omitting trailing whitespace and \n + // Omitting trailing whitespace and \n assert.strictEqual(stdout.replace(/\s+$/, '').endsWith(title), true); })); diff --git a/test/parallel/test-stdout-stderr-reading.js b/test/parallel/test-stdout-stderr-reading.js index 6466366a4f..57bfffa272 100644 --- a/test/parallel/test-stdout-stderr-reading.js +++ b/test/parallel/test-stdout-stderr-reading.js @@ -2,7 +2,7 @@ const common = require('../common'); const assert = require('assert'); -// verify that stdout is never read from. +// Verify that stdout is never read from. const net = require('net'); const read = net.Socket.prototype.read; @@ -59,7 +59,7 @@ function parent() { } function child() { - // should not be reading *ever* in here. + // Should not be reading *ever* in here. net.Socket.prototype.read = function() { throw new Error('no reading allowed in child'); }; diff --git a/test/parallel/test-stream-ispaused.js b/test/parallel/test-stream-ispaused.js index 366d34e326..a57928f934 100644 --- a/test/parallel/test-stream-ispaused.js +++ b/test/parallel/test-stream-ispaused.js @@ -32,7 +32,7 @@ readable._read = Function(); // Default state of a stream is not "paused" assert.ok(!readable.isPaused()); -// make the stream start flowing... +// Make the stream start flowing... readable.on('data', Function()); // still not paused. diff --git a/test/parallel/test-stream-readable-emittedReadable.js b/test/parallel/test-stream-readable-emittedReadable.js index 167904e592..6580c36303 100644 --- a/test/parallel/test-stream-readable-emittedReadable.js +++ b/test/parallel/test-stream-readable-emittedReadable.js @@ -31,7 +31,7 @@ process.nextTick(common.mustCall(() => { readable.push('bar'); })); -// these triggers two readable events +// These triggers two readable events setImmediate(common.mustCall(() => { readable.push('quo'); process.nextTick(common.mustCall(() => { diff --git a/test/parallel/test-stream-readable-event.js b/test/parallel/test-stream-readable-event.js index 8276e7ce4d..e248bed4b5 100644 --- a/test/parallel/test-stream-readable-event.js +++ b/test/parallel/test-stream-readable-event.js @@ -38,7 +38,7 @@ const Readable = require('stream').Readable; r.push(Buffer.from('blerg')); setTimeout(function() { - // we're testing what we think we are + // We're testing what we think we are assert(!r._readableState.reading); r.on('readable', common.mustCall()); }, 1); diff --git a/test/parallel/test-stream-readable-flow-recursion.js b/test/parallel/test-stream-readable-flow-recursion.js index fed4287445..bac6427fb0 100644 --- a/test/parallel/test-stream-readable-flow-recursion.js +++ b/test/parallel/test-stream-readable-flow-recursion.js @@ -67,7 +67,7 @@ flow(stream, 5000, function() { process.on('exit', function(code) { assert.strictEqual(reads, 2); - // we pushed up the high water mark + // We pushed up the high water mark assert.strictEqual(stream.readableHighWaterMark, 8192); // Length is 0 right now, because we pulled it all out. assert.strictEqual(stream.readableLength, 0); diff --git a/test/parallel/test-stream-readable-no-unneeded-readable.js b/test/parallel/test-stream-readable-no-unneeded-readable.js index 13ee2b498c..20092b57d9 100644 --- a/test/parallel/test-stream-readable-no-unneeded-readable.js +++ b/test/parallel/test-stream-readable-no-unneeded-readable.js @@ -17,7 +17,7 @@ function test(r) { if (data) { wrapper.push(data); } - // else the end event should fire + // else: the end event should fire }); }, }); diff --git a/test/parallel/test-stream-readable-reading-readingMore.js b/test/parallel/test-stream-readable-reading-readingMore.js index a2a0665808..e72159d1c9 100644 --- a/test/parallel/test-stream-readable-reading-readingMore.js +++ b/test/parallel/test-stream-readable-reading-readingMore.js @@ -20,7 +20,7 @@ const Readable = require('stream').Readable; if (readable.readableFlowing) assert.strictEqual(state.readingMore, true); - // reading as long as we've not ended + // Reading as long as we've not ended assert.strictEqual(state.reading, !state.ended); }, 2)); @@ -80,7 +80,7 @@ const Readable = require('stream').Readable; if (readable.readableFlowing) assert.strictEqual(state.readingMore, true); - // reading as long as we've not ended + // Reading as long as we've not ended assert.strictEqual(state.reading, !state.ended); }, 2)); @@ -129,7 +129,7 @@ const Readable = require('stream').Readable; readable.on('readable', onReadable); readable.on('data', common.mustCall((data) => { - // reading as long as we've not ended + // Reading as long as we've not ended assert.strictEqual(state.reading, !state.ended); }, 2)); diff --git a/test/parallel/test-stream-transform-split-highwatermark.js b/test/parallel/test-stream-transform-split-highwatermark.js index 301d81bc90..7837b009cd 100644 --- a/test/parallel/test-stream-transform-split-highwatermark.js +++ b/test/parallel/test-stream-transform-split-highwatermark.js @@ -39,7 +39,7 @@ testTransform(555, 555, { writableHighWaterMark: 777, }); -// test highWaterMark = 0 overriding +// Test highWaterMark = 0 overriding testTransform(0, 0, { highWaterMark: 0, readableHighWaterMark: 666, diff --git a/test/parallel/test-stream-writableState-ending.js b/test/parallel/test-stream-writableState-ending.js index ae2121f456..69afd1af53 100644 --- a/test/parallel/test-stream-writableState-ending.js +++ b/test/parallel/test-stream-writableState-ending.js @@ -14,22 +14,22 @@ function testStates(ending, finished, ended) { } writable._write = (chunk, encoding, cb) => { - // ending, finished, ended start in false. + // Ending, finished, ended start in false. testStates(false, false, false); cb(); }; writable.on('finish', () => { - // ending, finished, ended = true. + // Ending, finished, ended = true. testStates(true, true, true); }); const result = writable.end('testing function end()', () => { - // ending, finished, ended = true. + // Ending, finished, ended = true. testStates(true, true, true); }); -// end returns the writable instance +// End returns the writable instance assert.strictEqual(result, writable); // ending, ended = true. diff --git a/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js b/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js index ca5d3dfb0f..0cf9179ac4 100644 --- a/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js +++ b/test/parallel/test-stream-writableState-uncorked-bufferedRequestCount.js @@ -41,17 +41,17 @@ assert.strictEqual(writable._writableState.corked, 1); assert.strictEqual(writable._writableState.bufferedRequestCount, 2); function uncork() { - // second uncork flushes the buffer + // Second uncork flushes the buffer writable.uncork(); assert.strictEqual(writable._writableState.corked, 0); assert.strictEqual(writable._writableState.bufferedRequestCount, 0); - // verify that end() uncorks correctly + // Verify that end() uncorks correctly writable.cork(); writable.write('third chunk'); writable.end(); - // end causes an uncork() as well + // End causes an uncork() as well assert.strictEqual(writable._writableState.corked, 0); assert.strictEqual(writable._writableState.bufferedRequestCount, 0); } diff --git a/test/parallel/test-stream2-readable-from-list.js b/test/parallel/test-stream2-readable-from-list.js index 00024b9120..0210a1848d 100644 --- a/test/parallel/test-stream2-readable-from-list.js +++ b/test/parallel/test-stream2-readable-from-list.js @@ -52,15 +52,15 @@ function bufferListFromArray(arr) { } ]`); - // read more than the first element. + // Read more than the first element. let ret = fromList(6, { buffer: list, length: 16 }); assert.strictEqual(ret.toString(), 'foogba'); - // read exactly the first element. + // Read exactly the first element. ret = fromList(2, { buffer: list, length: 10 }); assert.strictEqual(ret.toString(), 'rk'); - // read less than the first element. + // Read less than the first element. ret = fromList(2, { buffer: list, length: 8 }); assert.strictEqual(ret.toString(), 'ba'); @@ -80,15 +80,15 @@ function bufferListFromArray(arr) { 'kuel' ]; list = bufferListFromArray(list); - // read more than the first element. + // Read more than the first element. let ret = fromList(6, { buffer: list, length: 16, decoder: true }); assert.strictEqual(ret, 'foogba'); - // read exactly the first element. + // Read exactly the first element. ret = fromList(2, { buffer: list, length: 10, decoder: true }); assert.strictEqual(ret, 'rk'); - // read less than the first element. + // Read less than the first element. ret = fromList(2, { buffer: list, length: 8, decoder: true }); assert.strictEqual(ret, 'ba'); diff --git a/test/parallel/test-stream2-set-encoding.js b/test/parallel/test-stream2-set-encoding.js index f60e8df9e1..0095fa544d 100644 --- a/test/parallel/test-stream2-set-encoding.js +++ b/test/parallel/test-stream2-set-encoding.js @@ -34,14 +34,14 @@ class TestReader extends R { _read(n) { setTimeout(() => { if (this.pos >= this.len) { - // double push(null) to test eos handling + // Double push(null) to test eos handling this.push(null); return this.push(null); } n = Math.min(n, this.len - this.pos); if (n <= 0) { - // double push(null) to test eos handling + // Double push(null) to test eos handling this.push(null); return this.push(null); } diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index d7611bb2c4..2590d5192f 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -407,7 +407,7 @@ const Transform = require('_stream_transform'); } }; - // anything except null/undefined is fine. + // Anything except null/undefined is fine. // those are "magic" in the stream API, because they signal EOF. const objects = [ { foo: 'bar' }, @@ -448,7 +448,7 @@ const Transform = require('_stream_transform'); } }; - // anything except null/undefined is fine. + // Anything except null/undefined is fine. // those are "magic" in the stream API, because they signal EOF. const objects = [ { foo: 'bar' }, diff --git a/test/parallel/test-stream2-writable.js b/test/parallel/test-stream2-writable.js index ec8e088221..af38df7e68 100644 --- a/test/parallel/test-stream2-writable.js +++ b/test/parallel/test-stream2-writable.js @@ -34,7 +34,7 @@ class TestWriter extends W { } _write(chunk, encoding, cb) { - // simulate a small unpredictable latency + // Simulate a small unpredictable latency setTimeout(() => { this.buffer.push(chunk.toString()); this.written += chunk.length; @@ -73,7 +73,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); })); diff --git a/test/parallel/test-stream3-cork-end.js b/test/parallel/test-stream3-cork-end.js index 8403e20fb1..0cbc033a2e 100644 --- a/test/parallel/test-stream3-cork-end.js +++ b/test/parallel/test-stream3-cork-end.js @@ -17,17 +17,17 @@ let seenChunks = []; let seenEnd = false; const w = new Writable(); -// lets arrange to store the chunks +// Let's arrange to store the chunks. w._write = function(chunk, encoding, cb) { - // Stream end event is not seen before the last write + // Stream end event is not seen before the last write. assert.ok(!seenEnd); - // Default encoding given none was specified + // Default encoding given none was specified. assert.strictEqual(encoding, 'buffer'); seenChunks.push(chunk); cb(); }; -// lets record the stream end event +// Let's record the stream end event. w.on('finish', () => { seenEnd = true; }); @@ -39,7 +39,7 @@ function writeChunks(remainingChunks, callback) { if (writeChunk) { setImmediate(() => { writeState = w.write(writeChunk); - // we were not told to stop writing + // We were not told to stop writing. assert.ok(writeState); writeChunks(remainingChunks, callback); @@ -49,43 +49,43 @@ function writeChunks(remainingChunks, callback) { } } -// do an initial write +// Do an initial write. w.write('stuff'); -// the write was immediate +// The write was immediate. assert.strictEqual(seenChunks.length, 1); -// reset the seen chunks +// Reset the seen chunks. seenChunks = []; -// trigger stream buffering +// Trigger stream buffering. w.cork(); -// write the bufferedChunks +// Write the bufferedChunks. writeChunks(inputChunks, () => { - // should not have seen anything yet + // Should not have seen anything yet. assert.strictEqual(seenChunks.length, 0); - // trigger flush and ending the stream + // Trigger flush and ending the stream. w.end(); - // stream should not ended in current tick + // Stream should not ended in current tick. assert.ok(!seenEnd); - // Buffered bytes should be seen in current tick + // Buffered bytes should be seen in current tick. assert.strictEqual(seenChunks.length, 4); - // did the chunks match + // Did the chunks match. for (let i = 0, l = expectedChunks.length; i < l; i++) { const seen = seenChunks[i]; - // there was a chunk + // There was a chunk. assert.ok(seen); const expected = Buffer.from(expectedChunks[i]); - // it was what we expected + // It was what we expected. assert.ok(seen.equals(expected)); } setImmediate(() => { - // stream should have ended in next tick + // Stream should have ended in next tick. assert.ok(seenEnd); }); }); diff --git a/test/parallel/test-stream3-cork-uncork.js b/test/parallel/test-stream3-cork-uncork.js index 5b52ec0019..dfb901af41 100644 --- a/test/parallel/test-stream3-cork-uncork.js +++ b/test/parallel/test-stream3-cork-uncork.js @@ -17,15 +17,15 @@ let seenChunks = []; let seenEnd = false; const w = new Writable(); -// lets arrange to store the chunks +// Let's arrange to store the chunks. w._write = function(chunk, encoding, cb) { - // Default encoding given none was specified + // Default encoding given none was specified. assert.strictEqual(encoding, 'buffer'); seenChunks.push(chunk); cb(); }; -// lets record the stream end event +// Let's record the stream end event. w.on('finish', () => { seenEnd = true; }); @@ -37,7 +37,7 @@ function writeChunks(remainingChunks, callback) { if (writeChunk) { setImmediate(() => { writeState = w.write(writeChunk); - // we were not told to stop writing + // We were not told to stop writing. assert.ok(writeState); writeChunks(remainingChunks, callback); @@ -47,40 +47,40 @@ function writeChunks(remainingChunks, callback) { } } -// do an initial write +// Do an initial write. w.write('stuff'); -// the write was immediate +// The write was immediate. assert.strictEqual(seenChunks.length, 1); -// reset the chunks seen so far +// Reset the chunks seen so far. seenChunks = []; -// trigger stream buffering +// Trigger stream buffering. w.cork(); -// write the bufferedChunks +// Write the bufferedChunks. writeChunks(inputChunks, () => { - // should not have seen anything yet + // Should not have seen anything yet. assert.strictEqual(seenChunks.length, 0); - // trigger writing out the buffer + // Trigger writing out the buffer. w.uncork(); - // Buffered bytes should be seen in current tick + // Buffered bytes should be seen in current tick. assert.strictEqual(seenChunks.length, 4); - // did the chunks match + // Did the chunks match. for (let i = 0, l = expectedChunks.length; i < l; i++) { const seen = seenChunks[i]; - // there was a chunk + // There was a chunk. assert.ok(seen); const expected = Buffer.from(expectedChunks[i]); - // it was what we expected + // It was what we expected. assert.ok(seen.equals(expected)); } setImmediate(() => { - // the stream should not have been ended + // The stream should not have been ended. assert.ok(!seenEnd); }); }); diff --git a/test/parallel/test-stream3-pause-then-read.js b/test/parallel/test-stream3-pause-then-read.js index d514c89e01..b86c015706 100644 --- a/test/parallel/test-stream3-pause-then-read.js +++ b/test/parallel/test-stream3-pause-then-read.js @@ -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'); diff --git a/test/parallel/test-string-decoder-end.js b/test/parallel/test-string-decoder-end.js index b10756a463..0c0c072eb9 100644 --- a/test/parallel/test-string-decoder-end.js +++ b/test/parallel/test-string-decoder-end.js @@ -94,7 +94,7 @@ function testBuf(encoding, buf) { } res1 += s.end(); - // write the whole buffer at once. + // Write the whole buffer at once. let res2 = ''; s = new SD(encoding); res2 += s.write(buf); diff --git a/test/parallel/test-stringbytes-external.js b/test/parallel/test-stringbytes-external.js index 9d8aa45f67..b66fb0960a 100644 --- a/test/parallel/test-stringbytes-external.js +++ b/test/parallel/test-stringbytes-external.js @@ -67,10 +67,10 @@ assert.strictEqual(ucs2_control, l_bin); const b_bin = b.toString('binary'); assert.strictEqual(ucs2_control, b_bin); -// create buffer copy from external +// Create buffer copy from external const c_bin = Buffer.from(l_bin, 'latin1'); const c_ucs = Buffer.from(b_ucs, 'ucs2'); -// make sure they're the same length +// Make sure they're the same length assert.strictEqual(c_bin.length, c_ucs.length); // Make sure Buffers from externals are the same for (let i = 0; i < c_bin.length; i++) { @@ -101,7 +101,7 @@ const PRE_3OF4_APEX = Math.ceil((EXTERN_APEX / 4) * 3) - RADIOS; assert.strictEqual(pumped_string[k], pumped_string2[k]); } - // the recoded buffer is the same? + // The recoded buffer is the same? for (let i = 0; i < decoded.length; ++i) { assert.strictEqual(datum[i], decoded[i]); } @@ -122,7 +122,7 @@ const PRE_3OF4_APEX = Math.ceil((EXTERN_APEX / 4) * 3) - RADIOS; assert.strictEqual(pumped_string[k], pumped_string2[k]); } - // the recoded buffer is the same? + // The recoded buffer is the same? for (let i = 0; i < decoded.length; ++i) { assert.strictEqual(datum[i], decoded[i]); } diff --git a/test/parallel/test-timers-refresh.js b/test/parallel/test-timers-refresh.js index dd4332ab32..597d5c9241 100644 --- a/test/parallel/test-timers-refresh.js +++ b/test/parallel/test-timers-refresh.js @@ -30,7 +30,7 @@ const { setUnrefTimeout } = require('internal/timers'); strictEqual(timer.refresh(), timer); } -// should throw with non-functions +// Should throw with non-functions { const expectedError = { code: 'ERR_INVALID_CALLBACK', diff --git a/test/parallel/test-timers-unrefed-in-callback.js b/test/parallel/test-timers-unrefed-in-callback.js index 50e6881bd3..afeb3706df 100644 --- a/test/parallel/test-timers-unrefed-in-callback.js +++ b/test/parallel/test-timers-unrefed-in-callback.js @@ -24,7 +24,7 @@ let counter2 = 0; // it would have fired 11 more times, and the assertion in the // process'exit event handler would fail. function Test1() { - // server only for maintaining event loop + // Server only for maintaining event loop const server = net.createServer().listen(0); const timer1 = setInterval(common.mustCall(() => { @@ -43,7 +43,7 @@ function Test1() { // timer callback. counter2 continues to be incremented more than 11 // until server close completed. function Test2() { - // server only for maintaining event loop + // Server only for maintaining event loop const server = net.createServer().listen(0); const timer2 = setInterval(() => { diff --git a/test/parallel/test-timers.js b/test/parallel/test-timers.js index e29d756cfe..b8733f79f5 100644 --- a/test/parallel/test-timers.js +++ b/test/parallel/test-timers.js @@ -60,7 +60,7 @@ inputs.forEach((value, index) => { }, value); const handle = setInterval(() => { - clearInterval(handle); // disarm timer or we'll never finish + clearInterval(handle); // Disarm timer or we'll never finish intervals[index] = true; }, value); }); @@ -69,7 +69,7 @@ inputs.forEach((value, index) => { // before a timer set here for 2 ms. setTimeout(common.mustCall(() => { - // assert that all other timers have run + // Assert that all other timers have run inputs.forEach((value, index) => { assert(timeouts[index]); assert(intervals[index]); diff --git a/test/parallel/test-tls-cipher-list.js b/test/parallel/test-tls-cipher-list.js index 4a39ee9391..ddbe6a33f6 100644 --- a/test/parallel/test-tls-cipher-list.js +++ b/test/parallel/test-tls-cipher-list.js @@ -23,8 +23,8 @@ function doCheck(arg, check) { }).on('error', common.mustNotCall()); } -// test the default unmodified version +// Test the default unmodified version doCheck([], defaultCoreList); -// test the command line switch by itself +// Test the command line switch by itself doCheck(['--tls-cipher-list=ABC'], 'ABC'); diff --git a/test/parallel/test-tls-env-extra-ca-file-load.js b/test/parallel/test-tls-env-extra-ca-file-load.js index fa97d7c0c6..85ee22b570 100644 --- a/test/parallel/test-tls-env-extra-ca-file-load.js +++ b/test/parallel/test-tls-env-extra-ca-file-load.js @@ -33,7 +33,7 @@ if (process.argv[2] !== 'child') { ].forEach((processEnv) => { fork(__filename, ['child'], { env: processEnv }) .on('exit', common.mustCall((status) => { - // client did not succeed in connecting + // Client did not succeed in connecting assert.strictEqual(status, 0); })); }); diff --git a/test/parallel/test-tls-env-extra-ca-no-crypto.js b/test/parallel/test-tls-env-extra-ca-no-crypto.js index 06399c5d23..53b5ed03ea 100644 --- a/test/parallel/test-tls-env-extra-ca-no-crypto.js +++ b/test/parallel/test-tls-env-extra-ca-no-crypto.js @@ -16,7 +16,7 @@ if (process.argv[2] === 'child') { ['child'], { env: Object.assign({}, process.env, { NODE_EXTRA_CA_CERTS }) }, ).on('exit', common.mustCall(function(status) { - // client did not succeed in connecting + // Client did not succeed in connecting assert.strictEqual(status, 0); })); } diff --git a/test/parallel/test-tls-env-extra-ca.js b/test/parallel/test-tls-env-extra-ca.js index b8ff1d3be2..c6587ae414 100644 --- a/test/parallel/test-tls-env-extra-ca.js +++ b/test/parallel/test-tls-env-extra-ca.js @@ -39,7 +39,7 @@ const server = tls.createServer(options, common.mustCall(function(s) { }); fork(__filename, { env }).on('exit', common.mustCall(function(status) { - // client did not succeed in connecting + // Client did not succeed in connecting assert.strictEqual(status, 0); })); })); diff --git a/test/parallel/test-tls-fast-writing.js b/test/parallel/test-tls-fast-writing.js index 937694228a..398beb0d09 100644 --- a/test/parallel/test-tls-fast-writing.js +++ b/test/parallel/test-tls-fast-writing.js @@ -43,7 +43,7 @@ function onconnection(conn) { console.log('ok - got chunk'); } - // just some basic sanity checks. + // Just some basic sanity checks. assert(c.length); assert(Buffer.isBuffer(c)); @@ -69,7 +69,7 @@ server.listen(0, function() { write(); } function write() { - // this needs to return false eventually + // This needs to return false eventually while (false !== conn.write(chunk)); } }); diff --git a/test/parallel/test-url-fileurltopath.js b/test/parallel/test-url-fileurltopath.js index 9a9b751201..f6a1fb4fda 100644 --- a/test/parallel/test-url-fileurltopath.js +++ b/test/parallel/test-url-fileurltopath.js @@ -93,7 +93,7 @@ assert.throws(() => url.fileURLToPath('https://a/b/c'), { { path: 'C:\\fóóbàr', fileURL: 'file:///C:/f%C3%B3%C3%B3b%C3%A0r' }, // euro sign (BMP code point) { path: 'C:\\€', fileURL: 'file:///C:/%E2%82%AC' }, - // rocket emoji (non-BMP code point) + // Rocket emoji (non-BMP code point) { path: 'C:\\🚀', fileURL: 'file:///C:/%F0%9F%9A%80' } ]; } else { @@ -138,7 +138,7 @@ assert.throws(() => url.fileURLToPath('https://a/b/c'), { { path: '/fóóbàr', fileURL: 'file:///f%C3%B3%C3%B3b%C3%A0r' }, // euro sign (BMP code point) { path: '/€', fileURL: 'file:///%E2%82%AC' }, - // rocket emoji (non-BMP code point) + // Rocket emoji (non-BMP code point) { path: '/🚀', fileURL: 'file:///%F0%9F%9A%80' }, ]; } diff --git a/test/parallel/test-url-pathtofileurl.js b/test/parallel/test-url-pathtofileurl.js index 6cdfa5dcd3..1beb69b7f3 100644 --- a/test/parallel/test-url-pathtofileurl.js +++ b/test/parallel/test-url-pathtofileurl.js @@ -67,7 +67,7 @@ const url = require('url'); { path: 'C:\\fóóbàr', expected: 'file:///C:/f%C3%B3%C3%B3b%C3%A0r' }, // euro sign (BMP code point) { path: 'C:\\€', expected: 'file:///C:/%E2%82%AC' }, - // rocket emoji (non-BMP code point) + // Rocket emoji (non-BMP code point) { path: 'C:\\🚀', expected: 'file:///C:/%F0%9F%9A%80' } ]; } else { @@ -112,7 +112,7 @@ const url = require('url'); { path: '/fóóbàr', expected: 'file:///f%C3%B3%C3%B3b%C3%A0r' }, // euro sign (BMP code point) { path: '/€', expected: 'file:///%E2%82%AC' }, - // rocket emoji (non-BMP code point) + // 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 6bead6a30d..dc0362df1a 100644 --- a/test/parallel/test-url-relative.js +++ b/test/parallel/test-url-relative.js @@ -152,7 +152,7 @@ const relativeTests2 = [ ['g#s/../x', bases[0], 'http://a/b/c/g#s/../x'], ['http:g', bases[0], ('http:g', 'http://a/b/c/g')], ['http:', bases[0], ('http:', bases[0])], - // not sure where this one originated + // Not sure where this one originated ['/a/b/c/./../../g', bases[0], 'http://a/a/g'], // http://gbiv.com/protocols/uri/test/rel_examples2.html @@ -211,7 +211,7 @@ const relativeTests2 = [ ['../../', bases[3], 'fred:///s//'], ['../../g', bases[3], 'fred:///s//g'], ['../../../g', bases[3], 'fred:///s/g'], - // may change to fred:///s//a/../../../g + // May change to fred:///s//a/../../../g ['../../../../g', bases[3], 'fred:///g'], // http://gbiv.com/protocols/uri/test/rel_examples5.html @@ -229,9 +229,9 @@ const relativeTests2 = [ ['../g', bases[4], 'http:///s//a/g'], ['../../', bases[4], 'http:///s//'], ['../../g', bases[4], 'http:///s//g'], - // may change to http:///s//a/../../g + // May change to http:///s//a/../../g ['../../../g', bases[4], 'http:///s/g'], - // may change to http:///s//a/../../../g + // May change to http:///s//a/../../../g ['../../../../g', bases[4], 'http:///g'], // From Dan Connelly's tests in http://www.w3.org/2000/10/swap/uripath.py diff --git a/test/parallel/test-util-isDeepStrictEqual.js b/test/parallel/test-util-isDeepStrictEqual.js index 08a30a28db..071e612565 100644 --- a/test/parallel/test-util-isDeepStrictEqual.js +++ b/test/parallel/test-util-isDeepStrictEqual.js @@ -350,7 +350,7 @@ notUtilIsDeepStrict( m2.set(2, 'hi'); // different order m2.set(1, obj); - m2.set(3, [1, 2, 3]); // deep equal, but not reference equal. + m2.set(3, [1, 2, 3]); // Deep equal, but not reference equal. utilIsDeepStrict(m1, m2); } diff --git a/test/parallel/test-v8-coverage.js b/test/parallel/test-v8-coverage.js index 926d28f14e..5c3db7af2c 100644 --- a/test/parallel/test-v8-coverage.js +++ b/test/parallel/test-v8-coverage.js @@ -28,7 +28,7 @@ function nextdir() { assert.ok(fixtureCoverage); // first branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); } @@ -44,7 +44,7 @@ function nextdir() { assert.ok(fixtureCoverage, 'coverage not found for file'); // first branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); } @@ -62,11 +62,11 @@ function nextdir() { assert.ok(fixtureCoverage); // first branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[0].ranges[1].count, 0); } -// outputs coverage from subprocess. +// Outputs coverage from subprocess. { const coverageDirectory = path.join(tmpdir.path, nextdir()); const output = spawnSync(process.execPath, [ @@ -79,7 +79,7 @@ function nextdir() { assert.ok(fixtureCoverage); // first branch executed. assert.strictEqual(fixtureCoverage.functions[1].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[1].ranges[1].count, 0); } @@ -96,7 +96,7 @@ function nextdir() { assert.ok(fixtureCoverage); // first branch executed. assert.strictEqual(fixtureCoverage.functions[1].ranges[0].count, 1); - // second branch did not execute. + // Second branch did not execute. assert.strictEqual(fixtureCoverage.functions[1].ranges[1].count, 0); } @@ -145,7 +145,7 @@ function nextdir() { assert.ok(fixtureCoverage); // first branch executed. assert.strictEqual(fixtureCoverage.functions[0].ranges[0].count, 1); - // second branch did not execute. + // 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 8fe5f8f3da..23c56018b6 100644 --- a/test/parallel/test-vm-global-property-interceptors.js +++ b/test/parallel/test-vm-global-property-interceptors.js @@ -117,7 +117,7 @@ Object.defineProperty(this, 'encodeURI', { value: 42 }); assert.strictEqual(vm.runInContext('encodeURI;', ctx), 42); assert.strictEqual(ctx.encodeURI, 42); -// redefine properties on the sandbox +// Redefine properties on the sandbox vm.runInContext(` Object.defineProperty(this, 'e', { value: 'newE' }); `, ctx); diff --git a/test/parallel/test-zlib-from-concatenated-gzip.js b/test/parallel/test-zlib-from-concatenated-gzip.js index 45f8281387..7bb31c0f9d 100644 --- a/test/parallel/test-zlib-from-concatenated-gzip.js +++ b/test/parallel/test-zlib-from-concatenated-gzip.js @@ -81,6 +81,6 @@ fs.createReadStream(pmmFileGz) abcEncoded, defEncoded.slice(0, offset) ])); - // write remaining bytes of "def" + // Write remaining bytes of "def" unzip.end(defEncoded.slice(offset)); }); diff --git a/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js b/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js index f7b09f7ec0..7db3a8a27a 100644 --- a/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js +++ b/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js @@ -5,7 +5,7 @@ const common = require('../common'); const assert = require('assert'); const zlib = require('zlib'); -// should ignore trailing null-bytes +// Should ignore trailing null-bytes let data = Buffer.concat([ zlib.gzipSync('abc'), zlib.gzipSync('def'), diff --git a/test/parallel/test-zlib-invalid-input.js b/test/parallel/test-zlib-invalid-input.js index dbfb5235b8..9b22df4778 100644 --- a/test/parallel/test-zlib-invalid-input.js +++ b/test/parallel/test-zlib-invalid-input.js @@ -20,7 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -// test uncompressing invalid input +// Test uncompressing invalid input const common = require('../common'); const assert = require('assert'); diff --git a/test/parallel/test-zlib-random-byte-pipes.js b/test/parallel/test-zlib-random-byte-pipes.js index c7026163e7..0816e047bb 100644 --- a/test/parallel/test-zlib-random-byte-pipes.js +++ b/test/parallel/test-zlib-random-byte-pipes.js @@ -31,7 +31,7 @@ const zlib = require('zlib'); const Stream = stream.Stream; -// emit random bytes, and keep a shasum +// Emit random bytes, and keep a shasum class RandomReadStream extends Stream { constructor(opt) { super(); @@ -50,7 +50,7 @@ class RandomReadStream extends Stream { opt.total = opt.total || 256 * 1024 * 1024; this._remaining = opt.total; - // how variable to make the block sizes + // How variable to make the block sizes opt.jitter = opt.jitter || 1024; this._opt = opt; @@ -86,7 +86,7 @@ class RandomReadStream extends Stream { return; } - // figure out how many bytes to output + // Figure out how many bytes to output // if finished, then just emit end. let block = this._opt.block; const jitter = this._opt.jitter; @@ -110,7 +110,7 @@ class RandomReadStream extends Stream { } } -// a filter that just verifies a shasum +// A filter that just verifies a shasum class HashStream extends Stream { constructor() { super(); diff --git a/test/parallel/test-zlib.js b/test/parallel/test-zlib.js index d5ef9fe9d1..1852ae3393 100644 --- a/test/parallel/test-zlib.js +++ b/test/parallel/test-zlib.js @@ -39,7 +39,7 @@ let zlibPairs = [ // How fast to trickle through the slowstream let trickle = [128, 1024, 1024 * 1024]; -// tunable options for zlib classes. +// Tunable options for zlib classes. // several different chunk sizes let chunkSize = [128, 1024, 1024 * 16, 1024 * 1024]; @@ -144,7 +144,7 @@ class SlowStream extends stream.Stream { } end(chunk) { - // walk over the chunk in blocks. + // Walk over the chunk in blocks. this.chunk = chunk; this.length = chunk.length; this.resume(); diff --git a/test/pummel/test-net-timeout.js b/test/pummel/test-net-timeout.js index 524322440a..59a8d50f79 100644 --- a/test/pummel/test-net-timeout.js +++ b/test/pummel/test-net-timeout.js @@ -59,7 +59,7 @@ echo_server.listen(common.PORT, () => { const client = net.createConnection(common.PORT); client.setEncoding('UTF8'); - client.setTimeout(0); // disable the timeout for client + client.setTimeout(0); // Disable the timeout for client client.on('connect', () => { console.log('client connected.'); client.write('hello\r\n'); diff --git a/test/pummel/test-stream-pipe-multi.js b/test/pummel/test-stream-pipe-multi.js index 2767028c4b..f8fb7c9cc8 100644 --- a/test/pummel/test-stream-pipe-multi.js +++ b/test/pummel/test-stream-pipe-multi.js @@ -64,7 +64,7 @@ FakeStream.prototype.close = function() { }; -// expect all streams to close properly. +// Expect all streams to close properly. process.on('exit', function() { assert.strictEqual(wclosed, cnt); assert.strictEqual(rclosed, cnt); @@ -93,8 +93,8 @@ for (let i = 0; i < cnt; i++) { r.pipe(w); } -// now start passing through data -// simulate a relatively fast async stream. +// Now start passing through data. +// Simulate a relatively fast async stream. rr.forEach(function(r) { let cnt = chunks; let paused = false; diff --git a/test/pummel/test-timers.js b/test/pummel/test-timers.js index 6b761f455d..8a8646b323 100644 --- a/test/pummel/test-timers.js +++ b/test/pummel/test-timers.js @@ -23,11 +23,11 @@ const common = require('../common'); const assert = require('assert'); -const WINDOW = 200; // why is does this need to be so big? +const WINDOW = 200; // Why is does this need to be so big? let interval_count = 0; -// check that these don't blow up. +// Check that these don't blow up. clearTimeout(null); clearInterval(null); diff --git a/test/sequential/test-deprecation-flags.js b/test/sequential/test-deprecation-flags.js index dd41614f7f..61a3d84ece 100644 --- a/test/sequential/test-deprecation-flags.js +++ b/test/sequential/test-deprecation-flags.js @@ -61,7 +61,7 @@ execFile(node, traceDep, function(er, stdout, stderr) { assert.strictEqual(er, null); assert.strictEqual(stdout, ''); const stack = stderr.trim().split('\n'); - // just check the top and bottom. + // Just check the top and bottom. assert(/this function is deprecated/.test(stack[1])); assert(/This is deprecated/.test(stack[0])); console.log('trace ok'); diff --git a/test/sequential/test-http-max-http-headers.js b/test/sequential/test-http-max-http-headers.js index b91135a61a..16704fd912 100644 --- a/test/sequential/test-http-max-http-headers.js +++ b/test/sequential/test-http-max-http-headers.js @@ -59,7 +59,7 @@ function writeHeaders(socket, headers) { last = current; } - // safety check we are chunking correctly + // Safety check we are chunking correctly assert.strictEqual(array.join(''), headers); next(); diff --git a/test/sequential/test-inspector.js b/test/sequential/test-inspector.js index 9aaabdc6c9..0438191858 100644 --- a/test/sequential/test-inspector.js +++ b/test/sequential/test-inspector.js @@ -225,7 +225,7 @@ async function testCommandLineAPI(session) { checkException(result); assert.deepStrictEqual(JSON.parse(result.result.value), { old: 'yes' }); - // remove module from require.cache + // Remove module from require.cache result = await session.send( { 'method': 'Runtime.evaluate', 'params': { diff --git a/test/sequential/test-module-loading.js b/test/sequential/test-module-loading.js index 9db97a2769..0269445c76 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -45,7 +45,7 @@ require('../fixtures/not-main-module.js'); } { - // require a file without any extensions + // Require a file without any extensions const foo_no_ext = require('../fixtures/foo'); assert.strictEqual(foo_no_ext.foo, 'ok'); } @@ -154,7 +154,7 @@ require.extensions['.test'] = function(module, filename) { }; assert.strictEqual(require('../fixtures/registerExt').test, 'passed'); -// unknown extension, load as .js +// Unknown extension, load as .js assert.strictEqual(require('../fixtures/registerExt.hello.world').test, 'passed'); diff --git a/test/sequential/test-net-listen-shared-ports.js b/test/sequential/test-net-listen-shared-ports.js index 78d94b4ae1..41345f37e6 100644 --- a/test/sequential/test-net-listen-shared-ports.js +++ b/test/sequential/test-net-listen-shared-ports.js @@ -59,7 +59,7 @@ if (cluster.isMaster) { }, common.mustCall(function() { server2.listen({ port: common.PORT + 1, exclusive: true }, common.mustCall(function() { - // the first worker should succeed + // The first worker should succeed process.send('success'); }) ); diff --git a/test/sequential/test-repl-timeout-throw.js b/test/sequential/test-repl-timeout-throw.js index 3636b93ddf..eecd7b3986 100644 --- a/test/sequential/test-repl-timeout-throw.js +++ b/test/sequential/test-repl-timeout-throw.js @@ -53,7 +53,7 @@ child.stdout.once('data', function() { child.on('close', function(c) { assert.strictEqual(c, 0); - // make sure we got 3 throws, in the end. + // Make sure we got 3 throws, in the end. const lastLine = stdout.trim().split(/\r?\n/).pop(); assert.strictEqual(lastLine, '> 3'); }); |