diff --git a/src/testRunner/externalCompileRunner.ts b/src/testRunner/externalCompileRunner.ts index a8a240a5161..c3b2ef3e6ec 100644 --- a/src/testRunner/externalCompileRunner.ts +++ b/src/testRunner/externalCompileRunner.ts @@ -10,6 +10,7 @@ interface ExecResult { interface UserConfig { types: string[]; + path?: string; } abstract class ExternalCompileRunnerBase extends RunnerBase { @@ -57,7 +58,7 @@ abstract class ExternalCompileRunnerBase extends RunnerBase { ts.Debug.assert(!!config.types, "Bad format from test.json: Types field must be present."); types = config.types; - cwd = submoduleDir; + cwd = config.path ? path.join(cwd, config.path) : submoduleDir; } if (fs.existsSync(path.join(cwd, "package.json"))) { if (fs.existsSync(path.join(cwd, "package-lock.json"))) { diff --git a/tests/baselines/reference/user/TypeScript-React-Native-Starter.log b/tests/baselines/reference/user/TypeScript-React-Native-Starter.log index 91ac9569693..a678ef73eb7 100644 --- a/tests/baselines/reference/user/TypeScript-React-Native-Starter.log +++ b/tests/baselines/reference/user/TypeScript-React-Native-Starter.log @@ -1,9 +1,9 @@ Exit Code: 1 Standard output: -node_modules/@types/node/globals.d.ts(163,13): error TS2451: Cannot redeclare block-scoped variable 'global'. -node_modules/@types/node/globals.d.ts(217,13): error TS2300: Duplicate identifier 'require'. -node_modules/@types/react-native/index.d.ts(8958,11): error TS2451: Cannot redeclare block-scoped variable 'global'. -node_modules/@types/react-native/index.d.ts(8959,14): error TS2300: Duplicate identifier 'require'. +node_modules/@types/react-native/index.d.ts(3425,42): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +node_modules/@types/react-native/index.d.ts(3438,42): error TS2583: Cannot find name 'Map'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. +node_modules/@types/react-native/index.d.ts(8745,18): error TS2717: Subsequent property declarations must have the same type. Property 'geolocation' must be of type 'Geolocation', but here has type 'GeolocationStatic'. +node_modules/@types/react/index.d.ts(379,23): error TS2583: Cannot find name 'Set'. Do you need to change your target library? Try changing the `lib` compiler option to es2015 or later. diff --git a/tests/cases/user/TypeScript-React-Native-Starter/test.json b/tests/cases/user/TypeScript-React-Native-Starter/test.json index 8b177c575aa..cbe38c569ee 100644 --- a/tests/cases/user/TypeScript-React-Native-Starter/test.json +++ b/tests/cases/user/TypeScript-React-Native-Starter/test.json @@ -1,3 +1,4 @@ { - "types": ["jest"] + "types": ["jest"], + "path": "TypeScript-React-Native-Starter/ExampleProject" }