test: add trailing commas in test/pseudo-tty

PR-URL: https://github.com/nodejs/node/pull/46371
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Antoine du Hamel 2023-01-29 20:14:30 +02:00 committed by GitHub
parent ca5f322d32
commit aa8a2441cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 15 additions and 16 deletions

View File

@ -83,7 +83,6 @@ overrides:
- node-api/*/*.js
- parallel/*.js
- parallel/*.mjs
- pseudo-tty/*.js
- pummel/*.js
- sequential/*.js
- sequential/*.mjs

View File

@ -10,7 +10,7 @@ console.log('%s q', 'string');
console.log('%o with object format param', { foo: 'bar' });
console.log(
new Error('test\n at abc (../fixtures/node_modules/bar.js:4:4)\nfoobar')
new Error('test\n at abc (../fixtures/node_modules/bar.js:4:4)\nfoobar'),
);
try {

View File

@ -7,7 +7,7 @@ const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
output: process.stdout,
});
rl.write('text');

View File

@ -17,7 +17,7 @@ repl.start('> ');
terminal: true,
input: stream,
output: process.stdout,
useColors: false
useColors: false,
});
replServer.on('close', common.mustCall());

View File

@ -15,5 +15,5 @@ assert.throws(
'+ {}\n' +
'- {\n' +
'- foo: \'bar\'\n' +
'- }'
'- }',
});

View File

@ -8,11 +8,11 @@ process.stderr.columns = 20;
// Confirm that there is no position indicator.
assert.throws(
() => { assert.strictEqual('a'.repeat(30), 'a'.repeat(31)); },
(err) => !err.message.includes('^')
(err) => !err.message.includes('^'),
);
// Confirm that there is a position indicator.
assert.throws(
() => { assert.strictEqual('aaaa', 'aaaaa'); },
(err) => err.message.includes('^')
(err) => err.message.includes('^'),
);

View File

@ -10,7 +10,7 @@ child_process.spawnSync(process.execPath, [
const { stdout } = child_process.spawnSync('stty', {
stdio: ['inherit', 'pipe', 'inherit'],
encoding: 'utf8'
encoding: 'utf8',
});
if (stdout.match(/-echo\b/)) {

View File

@ -15,7 +15,7 @@ proc.stdout.on('data', common.mustCall(() => {
proc.on('exit', common.mustCall(() => {
const { stdout } = child_process.spawnSync('stty', {
stdio: ['inherit', 'pipe', 'inherit'],
encoding: 'utf8'
encoding: 'utf8',
});
if (stdout.match(/-echo\b/)) {

View File

@ -11,7 +11,7 @@ child_process.spawnSync(process.execPath, [
const { stdout } = child_process.spawnSync('stty', {
stdio: ['inherit', 'pipe', 'inherit'],
encoding: 'utf8'
encoding: 'utf8',
});
if (stdout.match(/-echo\b/)) {

View File

@ -14,7 +14,7 @@ if (process.env.CHILD === 'true') {
['--trace-sigint', __filename],
{
env: { ...process.env, CHILD: 'true' },
stdio: 'inherit'
stdio: 'inherit',
});
cp.on('exit', mustCall((code, signal) => {
assert.strictEqual(signal, null);

View File

@ -13,7 +13,7 @@ if (process.env.CHILD === 'true') {
['--trace-sigint', __filename],
{
env: { ...process.env, CHILD: 'true' },
stdio: ['inherit', 'inherit', 'inherit', 'ipc']
stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
});
cp.on('message', mustCall(() => {
setTimeout(() => cp.kill('SIGINT'), platformTimeout(100));

View File

@ -14,7 +14,7 @@ if (process.env.CHILD === 'true') {
['--trace-sigint', __filename],
{
env: { ...process.env, CHILD: 'true' },
stdio: 'inherit'
stdio: 'inherit',
});
cp.on('exit', mustCall((code, signal) => {
assert.strictEqual(signal, 'SIGINT');

View File

@ -21,14 +21,14 @@ const writeStream = new WriteStream(fd);
[true, null, () => {}, Symbol(), 5n].forEach((input) => {
assert.throws(
() => writeStream.hasColors(input),
{ code: 'ERR_INVALID_ARG_TYPE' }
{ code: 'ERR_INVALID_ARG_TYPE' },
);
});
[-1, 1].forEach((input) => {
assert.throws(
() => writeStream.hasColors(input),
{ code: 'ERR_OUT_OF_RANGE' }
{ code: 'ERR_OUT_OF_RANGE' },
);
});
@ -78,7 +78,7 @@ const writeStream = new WriteStream(fd);
actual,
depth,
`i: ${i}, expected: ${depth}, ` +
`actual: ${actual}, env: ${inspect(env)}`
`actual: ${actual}, env: ${inspect(env)}`,
);
const colors = 2 ** actual;
assert(writeStream.hasColors(colors, env));