Skip to content

Commit

Permalink
test: add trailing commas in test/pseudo-tty
Browse files Browse the repository at this point in the history
PR-URL: #46371
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
aduh95 authored and juanarbol committed Mar 5, 2023
1 parent 6f91c8e commit ed564a9
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion test/.eslintrc.yaml
Expand Up @@ -81,7 +81,6 @@ overrides:
- node-api/*/*.js
- parallel/*.js
- parallel/*.mjs
- pseudo-tty/*.js
- pummel/*.js
- sequential/*.js
- sequential/*.mjs
Expand Down
2 changes: 1 addition & 1 deletion test/pseudo-tty/console_colors.js
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion test/pseudo-tty/readline-dumb-tty.js
Expand Up @@ -7,7 +7,7 @@ const readline = require('readline');

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
output: process.stdout,
});

rl.write('text');
Expand Down
2 changes: 1 addition & 1 deletion test/pseudo-tty/repl-dumb-tty.js
Expand Up @@ -17,7 +17,7 @@ repl.start('> ');
terminal: true,
input: stream,
output: process.stdout,
useColors: false
useColors: false,
});

replServer.on('close', common.mustCall());
Expand Down
2 changes: 1 addition & 1 deletion test/pseudo-tty/test-assert-no-color.js
Expand Up @@ -15,5 +15,5 @@ assert.throws(
'+ {}\n' +
'- {\n' +
'- foo: \'bar\'\n' +
'- }'
'- }',
});
4 changes: 2 additions & 2 deletions test/pseudo-tty/test-assert-position-indicator.js
Expand Up @@ -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('^'),
);
2 changes: 1 addition & 1 deletion test/pseudo-tty/test-set-raw-mode-reset-process-exit.js
Expand Up @@ -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/)) {
Expand Down
2 changes: 1 addition & 1 deletion test/pseudo-tty/test-set-raw-mode-reset-signal.js
Expand Up @@ -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/)) {
Expand Down
2 changes: 1 addition & 1 deletion test/pseudo-tty/test-set-raw-mode-reset.js
Expand Up @@ -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/)) {
Expand Down
2 changes: 1 addition & 1 deletion test/pseudo-tty/test-trace-sigint-disabled.js
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/pseudo-tty/test-trace-sigint-on-idle.js
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion test/pseudo-tty/test-trace-sigint.js
Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions test/pseudo-tty/test-tty-color-support.js
Expand Up @@ -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' },
);
});

Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit ed564a9

Please sign in to comment.