Skip to content

Commit

Permalink
Update TypeScript-React-Native-Starter
Browse files Browse the repository at this point in the history
Add a 'path' field to test.json.
  • Loading branch information
sandersn committed Apr 4, 2019
1 parent 586ecbf commit 762a557
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/testRunner/externalCompileRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface ExecResult {

interface UserConfig {
types: string[];
path?: string;
}

abstract class ExternalCompileRunnerBase extends RunnerBase {
Expand Down Expand Up @@ -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"))) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.



Expand Down
3 changes: 2 additions & 1 deletion tests/cases/user/TypeScript-React-Native-Starter/test.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"types": ["jest"]
"types": ["jest"],
"path": "TypeScript-React-Native-Starter/ExampleProject"
}

0 comments on commit 762a557

Please sign in to comment.