Skip to content
Myr

Fix linting (#77)

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

authored by Sam Verschueren · committed by Sindre Sorhus · parent f2d80c6 · Browse files · 3 files+11 added−11 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+11 added−11 removed

  • tests:+2 added−2 removed
  • other:+9 added−9 removed

3 files+11 added−11 removed

modified:lib/errname.js+2 added-2 removed
modified:test/errname.js+2 added-2 removed
modified:test.js+7 added-7 removed
77 unmodified lines
78 // TODO: figure out how to make the below not hang on Windows79 return;80 }8182 // account for npm adding local binaries to the PATH82 // Account for npm adding local binaries to the PATH83 const _path = process.env.PATH;84 process.env.PATH = '';85 await t.throws(m('cat-names', {preferLocal: false}), /spawn .* ENOENT/);86 process.env.PATH = _path;
22 unmodified lines
109 child.stdin.end('unicorns');110 t.is((await child).stdout, 'unicorns');111});112113test('input option can be a String - sync', async t => {113test('input option can be a String - sync', t => {114 const {stdout} = m.sync('stdin', {input: 'foobar'});115 t.is(stdout, 'foobar');116});117118test('input option can be a Buffer - sync', async t => {119 const {stdout} = m.sync('stdin', {input: new Buffer('testing12', 'utf8')});118test('input option can be a Buffer - sync', t => {119 const {stdout} = m.sync('stdin', {input: Buffer.from('testing12', 'utf8')});120 t.is(stdout, 'testing12');121});122123test('opts.stdout:ignore - stdout will not collect data', async t => {
224 unmodified lines
348 test('cleanup false - SIGINT', spawnAndKill, 'SIGTERM', false);349 test('cleanup false - SIGKILL', spawnAndKill, 'SIGKILL', false);350}351352// see: https://github.com/sindresorhus/execa/issues/56352// See: https://github.com/sindresorhus/execa/issues/56353const onlyWinFailing = test[process.platform === 'win32' ? 'failing' : 'serial'];354onlyWinFailing('execa.shell() supports the `shell` option', async t => {355 const {stdout} = await m.shell('noop foo', {356 shell: process.platform === 'win32' ? 'cmd.exe' : '/bin/bash'
2 unmodified lines
359});360361if (process.platform !== 'win32') {362 test('write to fast-exit process', async t => {363 // try-catch here is necessary, because this test is not 100% accurate364 // sometimes process can manage to accept input before exiting363 // Try-catch here is necessary, because this test is not 100% accurate364 // Sometimes process can manage to accept input before exiting365 try {366 await m(`fast-exit-${process.platform}`, [], {input: 'data'});367 } catch (err) {368 t.is(err.code, 'EPIPE');
3 unmodified lines