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

This commit is contained in:
Jack Bates 2020-02-12 15:19:46 -07:00 committed by GitHub
parent 2b64731a97
commit bf370659b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 13 deletions

View File

@ -81,7 +81,9 @@ namespace Harness {
if (types) {
args.push("--types", types.join(","));
// 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));

View File

@ -1,9 +0,0 @@
Exit Code: 1
Standard output:
src/components/Hello.spec.ts(4,1): error TS2593: Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.
src/components/Hello.spec.ts(5,3): error TS2593: Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or `npm i @types/mocha` and then add `jest` or `mocha` to the types field in your tsconfig.
src/components/Hello.spec.ts(14,5): error TS2304: Cannot find name 'expect'.
Standard error:

View File

@ -1,4 +1,4 @@
{
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter",
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter.git",
"types": ["jest", "node"]
}

View File

@ -1,4 +1,4 @@
{
"cloneUrl": "https://github.com/Microsoft/TypeScript-Vue-Starter.git",
"types": []
"types": ["jest"]
}

View File

@ -1,4 +1,4 @@
{
"cloneUrl": "https://github.com/Microsoft/TypeScript-React-Starter",
"cloneUrl": "https://github.com/Microsoft/TypeScript-WeChat-Starter.git",
"types": []
}