Skip to content
Myr

Meta tweaks

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

authored by Sindre Sorhus · committed by Sindre Sorhus · parent c6e791a · Browse files · 10 files+28 added−19 removed
This commit

State

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

Diff stats

10 files+28 added−19 removed

  • tests:+15 added−12 removed
  • other:+13 added−7 removed

10 files+28 added−19 removed

modified:test/helpers/override-promise.js+1 added-1 removed
modified:test/command.js+1 added-1 removed
modified:test/error.js+1 added-1 removed
6 unmodified lines
7import {execa, execaSync} from '../index.js';89const pExec = promisify(childProcess.exec);1011process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;11process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;1213const TIMEOUT_REGEXP = /timed out after/;1415const getExitRegExp = exitMessage => new RegExp(`failed with exit code ${exitMessage}`);
203 unmodified lines
modified:test/kill.js+1 added-1 removed
4 unmodified lines
5import {pEvent} from 'p-event';6import isRunning from 'is-running';7import {execa, execaSync} from '../index.js';89process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;9process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;1011const TIMEOUT_REGEXP = /timed out after/;1213test('kill("SIGKILL") should terminate cleanly', async t => {
298 unmodified lines
modified:test/node.js+1 added-1 removed
3 unmodified lines
4import test from 'ava';5import {pEvent} from 'p-event';6import {execaNode} from '../index.js';78process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;8process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;910async function inspectMacro(t, input) {11 const originalArgv = process.execArgv;12 process.execArgv = [input, '-e'];
92 unmodified lines
modified:test/override-promise.js+1 added-1 removed
modified:test/promise.js+1 added-1 removed
modified:test/stream.js+3 added-2 removed
7 unmodified lines
8import getStream from 'get-stream';9import tempfile from 'tempfile';10import {execa, execaSync} from '../index.js';1112process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;12process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;1314test('buffer', async t => {15 const {stdout} = await execa('noop.js', ['foo'], {encoding: null});16 t.true(Buffer.isBuffer(stdout));
56 unmodified lines
7374test('you can write to child.stdin', async t => {75 const subprocess = execa('stdin.js');76 subprocess.stdin.end('unicorns');77 const {stdout} = await subprocess;77 t.is((await subprocess).stdout, 'unicorns');78 t.is(stdout, 'unicorns');79});8081test('input option can be a String - sync', t => {82 const {stdout} = execaSync('stdin.js', {input: 'foobar'});
119 unmodified lines
modified:test/test.js+5 added-3 removed
5 unmodified lines
6import getNode from 'get-node';7import semver from 'semver';8import {execa, execaSync} from '../index.js';910process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;10process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;11process.env.FOO = 'foo';1213const ENOENT_REGEXP = process.platform === 'win32' ? /failed with exit code 1/ : /spawn.* ENOENT/;14
132 unmodified lines
147});148149test('do not try to consume streams twice', async t => {150 const subprocess = execa('noop.js', ['foo']);151 t.is((await subprocess).stdout, 'foo');152 t.is((await subprocess).stdout, 'foo');151 const {stdout} = await subprocess;152 const {stdout: stdout2} = await subprocess;153 t.is(stdout, 'foo');154 t.is(stdout2, 'foo');155});156157test('use relative path with \'..\' chars', async t => {158 const pathViaParentDir = path.join('..', path.basename(fileURLToPath(new URL('..', import.meta.url))), 'test', 'fixtures', 'noop.js');
94 unmodified lines
modified:package.json+13 added-7 removed
44 unmodified lines
45 "get-stream": "^6.0.1",46 "human-signals": "^3.0.1",47 "is-stream": "^3.0.0",48 "merge-stream": "^2.0.0",49 "npm-run-path": "^5.0.1",49 "npm-run-path": "^5.1.0",50 "onetime": "^6.0.0",51 "signal-exit": "^3.0.5",51 "signal-exit": "^3.0.7",52 "strip-final-newline": "^3.0.0"53 },54 "devDependencies": {55 "@types/node": "^16.11.7",56 "ava": "^3.15.0",57 "c8": "^7.10.0",55 "@types/node": "^17.0.17",56 "ava": "^4.0.1",57 "c8": "^7.11.0",58 "get-node": "^12.0.0",59 "is-running": "^2.1.0",60 "p-event": "^5.0.1",61 "semver": "^7.3.5",62 "tempfile": "^4.0.0",63 "tsd": "^0.18.0",64 "xo": "^0.46.4"63 "tsd": "^0.19.1",64 "xo": "^0.48.0"65 },66 "c8": {67 "reporter": [68 "text",
3 unmodified lines
72 "**/fixtures/**",73 "**/test.js",74 "**/test/**"75 ]76 },77 "xo": {78 "rules": {79 "unicorn/no-empty-file": "off",80 "@typescript-eslint/ban-types": "off"81 }82 }83}