mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
We have been stalled on ESLint 3.8.0 for some time. Current ESLint is 3.13.0. We have been unable to upgrade because of more aggressive reporting on some rules, including indentation. ESLint configuration options and bugfixes are now such that we can reasonably upgrade. PR-URL: https://github.com/nodejs/node/pull/10561 Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
48 lines
1.5 KiB
JavaScript
48 lines
1.5 KiB
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const cp = require('child_process');
|
|
|
|
if (process.argv[2] === 'child') {
|
|
setTimeout(() => {
|
|
// The following console statements are part of the test.
|
|
console.log('child stdout');
|
|
console.error('child stderr');
|
|
}, common.platformTimeout(1000));
|
|
return;
|
|
}
|
|
|
|
const cmd = `${process.execPath} ${__filename} child`;
|
|
|
|
// Test the case where a timeout is set, and it expires.
|
|
cp.exec(cmd, { timeout: 1 }, common.mustCall((err, stdout, stderr) => {
|
|
assert.strictEqual(err.killed, true);
|
|
assert.strictEqual(err.code, null);
|
|
assert.strictEqual(err.signal, 'SIGTERM');
|
|
assert.strictEqual(err.cmd, cmd);
|
|
assert.strictEqual(stdout.trim(), '');
|
|
assert.strictEqual(stderr.trim(), '');
|
|
}));
|
|
|
|
// Test with a different kill signal.
|
|
cp.exec(cmd, {
|
|
timeout: 1,
|
|
killSignal: 'SIGKILL'
|
|
}, common.mustCall((err, stdout, stderr) => {
|
|
assert.strictEqual(err.killed, true);
|
|
assert.strictEqual(err.code, null);
|
|
assert.strictEqual(err.signal, 'SIGKILL');
|
|
assert.strictEqual(err.cmd, cmd);
|
|
assert.strictEqual(stdout.trim(), '');
|
|
assert.strictEqual(stderr.trim(), '');
|
|
}));
|
|
|
|
// Test the case where a timeout is set, but not expired.
|
|
cp.exec(cmd, { timeout: Math.pow(2, 30) },
|
|
common.mustCall((err, stdout, stderr) => {
|
|
assert.ifError(err);
|
|
assert.strictEqual(stdout.trim(), 'child stdout');
|
|
assert.strictEqual(stderr.trim(), 'child stderr');
|
|
})
|
|
);
|