Skip to content
Myr

Attach pid and kill() to returned promise (#11)

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

* Attach pid and kill() to returned promise * Drop usage of "test.only"

authored by Luke Horvat · committed by Sindre Sorhus · parent d6f0a42 · Browse files · 3 files+17 added−5 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+17 added−5 removed

  • other:+17 added−5 removed

3 files+17 added−5 removed

modified:index.js+8 added-2 removed
modified:readme.md+2 added-2 removed
modified:test.js+7 added-1 removed
19 unmodified lines
20 t.is(typeof err.stdout, 'string');21 }22});2324test.only('include stdout in errors for improved debugging', async t => {24test('include stdout in errors for improved debugging', async t => {25 try {26 await m('./fixtures/error-message.js');27 } catch (err) {28 t.true(err.message.indexOf('stdout') !== -1);
22 unmodified lines
51 process.env.PATH = '';52 await t.throws(m('cat-names', {preferLocal: false}), /spawn cat-names ENOENT/);53 process.env.PATH = _path;54});5556test('execa() returns a promise with kill() and pid', t => {57 const promise = m('echo', ['foo']);58 t.is(typeof promise.kill, 'function');59 t.is(typeof promise.pid, 'number');60});