Skip to content

Commit bf37065

Browse files
authored
Don't npm install the parent project with no args (#35359)
1 parent 2b64731 commit bf37065

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed

src/testRunner/externalCompileRunner.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ namespace Harness {
8181
if (types) {
8282
args.push("--types", types.join(","));
8383
// Also actually install those types (for, eg, the js projects which need node)
84-
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+
if (types.length) {
85+
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
86+
}
8587
}
8688
args.push("--noEmit");
8789
Baseline.runBaseline(`${cls.kind()}/${directoryName}.log`, cls.report(cp.spawnSync(`node`, args, { cwd, timeout, shell: true }), cwd));

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

Lines changed: 0 additions & 9 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)