Skip to content
Myr

Emit `end` event on streams when process fails (#518)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by GitHub · parent 1f7677c · Browse files · 2 files+8 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+8 added−1 removed

  • tests:+6 added−0 removed
  • other:+2 added−1 removed

2 files+8 added−1 removed

modified:lib/stream.js+2 added-1 removed
modified:test/stream.js+6 added
2 unmodified lines
3import fs from 'node:fs';4import Stream from 'node:stream';5import test from 'ava';6import getStream from 'get-stream';7import {pEvent} from 'p-event';8import tempfile from 'tempfile';9import {execa, execaSync} from '../index.js';10import {setFixtureDir} from './helpers/fixtures-dir.js';11
161 unmodified lines
173 const {exitCode} = await t.throwsAsync(subprocess);174 t.is(exitCode, 2);175});176177test('buffer: false > emits end event when promise is rejected', async t => {178 const subprocess = execa('wrong command', {buffer: false, reject: false});179 await t.notThrowsAsync(Promise.all([subprocess, pEvent(subprocess.stdout, 'end')]));180});181182test('can use all: true with stdout: ignore', async t => {183 await t.notThrowsAsync(execa('max-buffer.js', {buffer: false, stdout: 'ignore', all: true}));184});185
21 unmodified lines