Skip to content

Don't npm install the parent project with no args #35359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/testRunner/externalCompileRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ namespace Harness {
if (types) {
args.push("--types", types.join(","));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not correct; args needs to include --types even if the list is empty. npm install is OK to skip though.

I think this will make the diffs in the baselines go away, unfortunately. The real fix for those projects is to add types entries to their tsconfigs.

// Also actually install those types (for, eg, the js projects which need node)
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
if (types.length) {
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
}
}
args.push("--noEmit");
Baseline.runBaseline(`${cls.kind()}/${directoryName}.log`, cls.report(cp.spawnSync(`node`, args, { cwd, timeout, shell: true }), cwd));
Expand Down
9 changes: 0 additions & 9 deletions tests/baselines/reference/user/TypeScript-Vue-Starter.log

This file was deleted.

2 changes: 1 addition & 1 deletion tests/cases/user/TypeScript-React-Starter/test.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter",
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter.git",
"types": ["jest", "node"]
}
2 changes: 1 addition & 1 deletion tests/cases/user/TypeScript-Vue-Starter/test.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"cloneUrl": "https://github.com/Microsoft/TypeScript-Vue-Starter.git",
"types": []
"types": ["jest"]
}
2 changes: 1 addition & 1 deletion tests/cases/user/TypeScript-WeChat-Starter/test.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter",
"cloneUrl": "https://github.com/Microsoft/TypeScript-WeChat-Starter.git",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha ha oh no

"types": []
}