Skip to content

Commit ba88bcb

Browse files
committed
Don't npm install the parent project with no args
1 parent 7726464 commit ba88bcb

File tree

8 files changed

+54
-84
lines changed

8 files changed

+54
-84
lines changed

src/testRunner/externalCompileRunner.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ namespace Harness {
7979
if (types) {
8080
args.push("--types", types.join(","));
8181
// Also actually install those types (for, eg, the js projects which need node)
82-
exec("npm", ["i", ...types.map(t => `@types/${t}`), "--no-save", "--ignore-scripts"], { cwd: originalCwd, timeout: timeout / 2 }); // NPM shouldn't take the entire timeout - if it takes a long time, it should be terminated and we should log the failure
82+
if (types.length) {
83+
exec("npm", ["i", ...types.map(t => `@types/${t}`), "--no-save", "--ignore-scripts"], { cwd: originalCwd, timeout: timeout / 2 }); // NPM shouldn't take the entire timeout - if it takes a long time, it should be terminated and we should log the failure
84+
}
8385
}
8486
args.push("--noEmit");
8587
Baseline.runBaseline(`${cls.kind()}/${directoryName}.log`, cls.report(cp.spawnSync(`node`, args, { cwd, timeout, shell: true }), cwd));
@@ -337,4 +339,4 @@ ${stderr.replace(/\r\n/g, "\n")}`;
337339
}
338340
return result;
339341
}
340-
}
342+
}

tests/baselines/reference/user/TypeScript-Vue-Starter.log

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/baselines/reference/user/TypeScript-WeChat-Starter.log

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/baselines/reference/user/npm.log

Lines changed: 47 additions & 0 deletions
Large diffs are not rendered by default.

tests/baselines/reference/user/sift.log

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter",
2+
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter.git",
33
"types": ["jest", "node"]
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"cloneUrl": "https://github.com/Microsoft/TypeScript-Vue-Starter.git",
3-
"types": []
3+
"types": ["jest"]
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter",
2+
"cloneUrl": "https://github.com/Microsoft/TypeScript-WeChat-Starter.git",
33
"types": []
44
}

0 commit comments

Comments
 (0)