Skip to content

Commit 762a557

Browse files
committed
Update TypeScript-React-Native-Starter
Add a 'path' field to test.json.
1 parent 586ecbf commit 762a557

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/testRunner/externalCompileRunner.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface ExecResult {
1010

1111
interface UserConfig {
1212
types: string[];
13+
path?: string;
1314
}
1415

1516
abstract class ExternalCompileRunnerBase extends RunnerBase {
@@ -57,7 +58,7 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
5758
ts.Debug.assert(!!config.types, "Bad format from test.json: Types field must be present.");
5859
types = config.types;
5960

60-
cwd = submoduleDir;
61+
cwd = config.path ? path.join(cwd, config.path) : submoduleDir;
6162
}
6263
if (fs.existsSync(path.join(cwd, "package.json"))) {
6364
if (fs.existsSync(path.join(cwd, "package-lock.json"))) {

tests/baselines/reference/user/TypeScript-React-Native-Starter.log

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Exit Code: 1
22
Standard output:
3-
node_modules/@types/node/globals.d.ts(163,13): error TS2451: Cannot redeclare block-scoped variable 'global'.
4-
node_modules/@types/node/globals.d.ts(217,13): error TS2300: Duplicate identifier 'require'.
5-
node_modules/@types/react-native/index.d.ts(8958,11): error TS2451: Cannot redeclare block-scoped variable 'global'.
6-
node_modules/@types/react-native/index.d.ts(8959,14): error TS2300: Duplicate identifier 'require'.
3+
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.
4+
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.
5+
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'.
6+
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.
77

88

99

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"types": ["jest"]
2+
"types": ["jest"],
3+
"path": "TypeScript-React-Native-Starter/ExampleProject"
34
}

0 commit comments

Comments
 (0)