Skip to content

Commit 8aa03d9

Browse files
committed
Code improvements
1 parent 29890bd commit 8aa03d9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/type-definitions/runner.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ function getEnvPath(env) {
4949
async function runTestsOnEnv({ typeScriptVersion, target, type, env, lib }) {
5050
$.verbose = false;
5151
const envLibName = env ? env.substring(0, env.lastIndexOf('@')) : '';
52-
const command = `npx -p typescript@${ typeScriptVersion }${ env ? ` -p ${ env }` : '' } `
53-
+ `tsc -p ${ type }/tsconfig.json --target ${ target } --lib ${ target }${ lib ? `,${ lib }` : '' }${ env ? ` --types @core-js/types${ type === 'pure' ? '/pure' : '' },${ envLibName }` : '' }`;
52+
const command = `npx -p typescript@${ typeScriptVersion }${
53+
env ? ` -p ${ env }` : '' } tsc -p ${ type }/tsconfig.json --target ${ target } --lib ${ target }${ lib ? `,${ lib }` : '' }${
54+
env ? ` --types @core-js/types${ type === 'pure' ? '/pure' : '' },${ envLibName }` : '' }`;
5455
echo(`$ ${ command }`);
5556
try {
57+
tested++;
5658
if (env && lib) {
5759
await $({ cwd: getEnvPath(env) })`npx -p typescript@${ typeScriptVersion } tsc -p ./tsconfig.${ type }.json --target ${ target } --lib ${ target },${ lib } --types @core-js/types${ type === 'pure' ? '/pure' : '' },${ envLibName }`.quiet();
5860
} else if (env) {
@@ -63,9 +65,7 @@ async function runTestsOnEnv({ typeScriptVersion, target, type, env, lib }) {
6365
await $`npx -p typescript@${ typeScriptVersion } tsc -p ${ type }/tsconfig.json --target ${ target } --lib ${ target }`.quiet();
6466
}
6567
echo(chalk.green(`$ ${ command }`));
66-
tested++;
6768
} catch (error) {
68-
tested++;
6969
failed++;
7070
echo(`$ ${ chalk.red(command) }\n ${ error }`);
7171
}

0 commit comments

Comments
 (0)