Skip to content

Commit 5bac052

Browse files
committed
Meta tweaks
1 parent c6e791a commit 5bac052

File tree

10 files changed

+28
-19
lines changed

10 files changed

+28
-19
lines changed

package.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,22 @@
4646
"human-signals": "^3.0.1",
4747
"is-stream": "^3.0.0",
4848
"merge-stream": "^2.0.0",
49-
"npm-run-path": "^5.0.1",
49+
"npm-run-path": "^5.1.0",
5050
"onetime": "^6.0.0",
51-
"signal-exit": "^3.0.5",
51+
"signal-exit": "^3.0.7",
5252
"strip-final-newline": "^3.0.0"
5353
},
5454
"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",
5858
"get-node": "^12.0.0",
5959
"is-running": "^2.1.0",
6060
"p-event": "^5.0.1",
6161
"semver": "^7.3.5",
6262
"tempfile": "^4.0.0",
63-
"tsd": "^0.18.0",
64-
"xo": "^0.46.4"
63+
"tsd": "^0.19.1",
64+
"xo": "^0.48.0"
6565
},
6666
"c8": {
6767
"reporter": [
@@ -73,5 +73,11 @@
7373
"**/test.js",
7474
"**/test/**"
7575
]
76+
},
77+
"xo": {
78+
"rules": {
79+
"unicorn/no-empty-file": "off",
80+
"@typescript-eslint/ban-types": "off"
81+
}
7682
}
7783
}

test/command.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {fileURLToPath} from 'node:url';
44
import test from 'ava';
55
import {execa, execaSync, execaCommand, execaCommandSync} from '../index.js';
66

7-
process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
7+
process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
88

99
const command = async (t, expected, ...args) => {
1010
const {command: failCommand} = await t.throwsAsync(execa('fail.js', args));

test/error.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {execa, execaSync} from '../index.js';
88

99
const pExec = promisify(childProcess.exec);
1010

11-
process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
11+
process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
1212

1313
const TIMEOUT_REGEXP = /timed out after/;
1414

test/helpers/override-promise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Can't use `test.before`, because `ava` needs `Promise`.
22
const nativePromise = Promise;
33
global.Promise = class BrokenPromise {
4-
then() {
4+
then() { // eslint-disable-line unicorn/no-thenable
55
throw new Error('error');
66
}
77
};

test/kill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {pEvent} from 'p-event';
66
import isRunning from 'is-running';
77
import {execa, execaSync} from '../index.js';
88

9-
process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
9+
process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
1010

1111
const TIMEOUT_REGEXP = /timed out after/;
1212

test/node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import test from 'ava';
55
import {pEvent} from 'p-event';
66
import {execaNode} from '../index.js';
77

8-
process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
8+
process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
99

1010
async function inspectMacro(t, input) {
1111
const originalArgv = process.execArgv;

test/override-promise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {execa} from '../index.js';
1010

1111
restorePromise();
1212

13-
process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
13+
process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
1414

1515
test('should work with third-party Promise', async t => {
1616
const {stdout} = await execa('noop.js', ['foo']);

test/promise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {fileURLToPath} from 'node:url';
44
import test from 'ava';
55
import {execa} from '../index.js';
66

7-
process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
7+
process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
88

99
test('promise methods are not enumerable', t => {
1010
const descriptors = Object.getOwnPropertyDescriptors(execa('noop.js'));

test/stream.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import getStream from 'get-stream';
99
import tempfile from 'tempfile';
1010
import {execa, execaSync} from '../index.js';
1111

12-
process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
12+
process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
1313

1414
test('buffer', async t => {
1515
const {stdout} = await execa('noop.js', ['foo'], {encoding: null});
@@ -74,7 +74,8 @@ test('input can be a Stream', async t => {
7474
test('you can write to child.stdin', async t => {
7575
const subprocess = execa('stdin.js');
7676
subprocess.stdin.end('unicorns');
77-
t.is((await subprocess).stdout, 'unicorns');
77+
const {stdout} = await subprocess;
78+
t.is(stdout, 'unicorns');
7879
});
7980

8081
test('input option can be a String - sync', t => {

test/test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import getNode from 'get-node';
77
import semver from 'semver';
88
import {execa, execaSync} from '../index.js';
99

10-
process.env.PATH = fileURLToPath(new URL('./fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
10+
process.env.PATH = fileURLToPath(new URL('fixtures', import.meta.url)) + path.delimiter + process.env.PATH;
1111
process.env.FOO = 'foo';
1212

1313
const ENOENT_REGEXP = process.platform === 'win32' ? /failed with exit code 1/ : /spawn.* ENOENT/;
@@ -148,8 +148,10 @@ test('child_process.spawnSync() errors are propagated with a correct shape', t =
148148

149149
test('do not try to consume streams twice', async t => {
150150
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');
153155
});
154156

155157
test('use relative path with \'..\' chars', async t => {

0 commit comments

Comments
 (0)