Fix linting errors (#462)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by ehmicky · committed by GitHub · parent 2f61456 · Browse files · 3 files·+14 added−14 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+14 added−14 removed
- tests:+10 added−10 removed
- other:+4 added−4 removed
Provenance
- Commit
8e4f901- Tree
38766f5- Author
ehmicky <ehmicky@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
2f61456
3 files changed+14 added−14 removed
modified:lib/stream.js+1 added-1 removed
4 unmodified lines5678991011121384 unmodified lines4 unmodified lines
// `input` optionconst handleInput = (spawned, input) => { // Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852 // TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 // @todo remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0 if (input === undefined || spawned.stdin === undefined) { return; }
84 unmodified linesmodified:test/kill.js+10 added-10 removed
136 unmodified lines137 test('spawnAndExit detached', spawnAndExit, false, true);138 test('spawnAndExit cleanup detached', spawnAndExit, true, true);139 140 // When parent process exits before child process141-const spawnAndKill = async (t, signal, cleanup, detached, isKilled) => {141+const spawnAndKill = async (t, [signal, cleanup, detached, isKilled]) => {142 const subprocess = execa('sub-process', [cleanup, detached], {stdio: ['ignore', 'ignore', 'ignore', 'ipc']});143 144 const pid = await pEvent(subprocess, 'message');145 t.true(Number.isInteger(pid));17 unmodified lines163 // - on Linux subprocesses are never killed regardless of `options.detached`164 // With `options.cleanup`, subprocesses are always killed165 // - `options.cleanup` with SIGKILL is a noop, since it cannot be handled166 const exitIfWindows = process.platform === 'win32';167-test('spawnAndKill SIGTERM', spawnAndKill, 'SIGTERM', false, false, exitIfWindows);168-test('spawnAndKill SIGKILL', spawnAndKill, 'SIGKILL', false, false, exitIfWindows);169-test('spawnAndKill cleanup SIGTERM', spawnAndKill, 'SIGTERM', true, false, true);170-test('spawnAndKill cleanup SIGKILL', spawnAndKill, 'SIGKILL', true, false, exitIfWindows);171-test('spawnAndKill detached SIGTERM', spawnAndKill, 'SIGTERM', false, true, false);172-test('spawnAndKill detached SIGKILL', spawnAndKill, 'SIGKILL', false, true, false);173-test('spawnAndKill cleanup detached SIGTERM', spawnAndKill, 'SIGTERM', true, true, false);174-test('spawnAndKill cleanup detached SIGKILL', spawnAndKill, 'SIGKILL', true, true, false);167+test('spawnAndKill SIGTERM', spawnAndKill, ['SIGTERM', false, false, exitIfWindows]);168+test('spawnAndKill SIGKILL', spawnAndKill, ['SIGKILL', false, false, exitIfWindows]);169+test('spawnAndKill cleanup SIGTERM', spawnAndKill, ['SIGTERM', true, false, true]);170+test('spawnAndKill cleanup SIGKILL', spawnAndKill, ['SIGKILL', true, false, exitIfWindows]);171+test('spawnAndKill detached SIGTERM', spawnAndKill, ['SIGTERM', false, true, false]);172+test('spawnAndKill detached SIGKILL', spawnAndKill, ['SIGKILL', false, true, false]);173+test('spawnAndKill cleanup detached SIGTERM', spawnAndKill, ['SIGTERM', true, true, false]);174+test('spawnAndKill cleanup detached SIGKILL', spawnAndKill, ['SIGKILL', true, true, false]);175 176 // See #128177 test('removes exit handler on exit', async t => {178- // FIXME: This relies on `signal-exit` internals178+ // @todo this relies on `signal-exit` internals179 const emitter = process.__signal_exit_emitter__;180 181 const subprocess = execa('noop');182 const listener = emitter.listeners('exit').pop();80 unmodified linesmodified:index.js+3 added-3 removed
6 unmodified lines7 const onetime = require('onetime');8 const makeError = require('./lib/error');9 const normalizeStdio = require('./lib/stdio');10 const {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = require('./lib/kill');11-const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = require('./lib/stream.js');12-const {mergePromise, getSpawnedPromise} = require('./lib/promise.js');13-const {joinCommand, parseCommand} = require('./lib/command.js');11+const {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = require('./lib/stream');12+const {mergePromise, getSpawnedPromise} = require('./lib/promise');13+const {joinCommand, parseCommand} = require('./lib/command');14 15 const DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;16 17 const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => {241 unmodified lines