mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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:
parent
ca5f322d32
commit
aa8a2441cb
@ -83,7 +83,6 @@ overrides:
|
||||
- node-api/*/*.js
|
||||
- parallel/*.js
|
||||
- parallel/*.mjs
|
||||
- pseudo-tty/*.js
|
||||
- pummel/*.js
|
||||
- sequential/*.js
|
||||
- sequential/*.mjs
|
||||
|
@ -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 {
|
||||
|
@ -7,7 +7,7 @@ const readline = require('readline');
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
rl.write('text');
|
||||
|
@ -17,7 +17,7 @@ repl.start('> ');
|
||||
terminal: true,
|
||||
input: stream,
|
||||
output: process.stdout,
|
||||
useColors: false
|
||||
useColors: false,
|
||||
});
|
||||
|
||||
replServer.on('close', common.mustCall());
|
||||
|
@ -15,5 +15,5 @@ assert.throws(
|
||||
'+ {}\n' +
|
||||
'- {\n' +
|
||||
'- foo: \'bar\'\n' +
|
||||
'- }'
|
||||
'- }',
|
||||
});
|
||||
|
@ -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('^'),
|
||||
);
|
||||
|
@ -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/)) {
|
||||
|
@ -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/)) {
|
||||
|
@ -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/)) {
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
|
@ -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');
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user