Skip to content

Commit db4f6dc

Browse files
committed
Type tests runner refactoring
1 parent 01db7f5 commit db4f6dc

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/type-definitions/runner.mjs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ async function runLimited(tasks, limit) {
6666

6767
async function runTask(config) {
6868
$.verbose = false;
69-
const command = `$ ${ config.cmd } ${ config.args.join(' ') }`;
69+
const command = `$ npx ${ config.args.join(' ') }`;
7070
try {
7171
tested++;
7272
echo(command);
7373
if (config.cwd) {
74-
await $({ cwd: config.cwd })`${ config.cmd } ${ config.args }`.quiet();
74+
await $({ cwd: config.cwd })`npx ${ config.args }`.quiet();
7575
} else {
76-
await $`${ config.cmd } ${ config.args }`.quiet();
76+
await $`npx ${ config.args }`.quiet();
7777
}
7878
echo(chalk.green(command));
7979
} catch (error) {
@@ -94,7 +94,6 @@ function buildTasks(types, targets, typeScriptVersions, envs, libs) {
9494
const libsStr = lib ? `${ target },${ lib }` : target;
9595
const tsConfigPath = env ? `./tsconfig.${ type }${ tsConfigPostfix }.json` : `${ type }/tsconfig${ tsConfigPostfix }.json`;
9696
const taskConfig = {
97-
cmd: 'npx',
9897
cwd: getEnvPath(env),
9998
args: [
10099
'-p', `typescript@${ typeScriptVersion }`,
@@ -157,9 +156,9 @@ async function prepareEnvironment(environments, coreJsTypes) {
157156

158157
let tasks = [];
159158
tasks.push(
160-
{ cmd: 'npx', args: ['-p', 'typescript@5.9', 'tsc'] },
161-
{ cmd: 'npx', args: ['-p', 'typescript@5.9', 'tsc', '-p', 'templates/tsconfig.json'] },
162-
{ cmd: 'npx', args: ['-p', 'typescript@5.9', '-p', '@types/node@24', 'tsc', '-p', 'templates/tsconfig.require.json'] },
159+
{ args: ['-p', 'typescript@5.9', 'tsc'] },
160+
{ args: ['-p', 'typescript@5.9', 'tsc', '-p', 'templates/tsconfig.json'] },
161+
{ args: ['-p', 'typescript@5.9', '-p', '@types/node@24', 'tsc', '-p', 'templates/tsconfig.require.json'] },
163162
);
164163

165164
let envs;

0 commit comments

Comments
 (0)