Skip to content
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

[TM] Add spec for SourceCode #24901

Closed
wants to merge 2 commits into from

Conversation

jeanregisser
Copy link
Contributor

Summary

Part of #24875

Changelog

[General] [Added] - Add TurboModule spec for SourceCode

Test Plan

Run yarn flow-check-ios and yarn flow-check-android at the root level

@jeanregisser jeanregisser requested a review from shergin as a code owner May 16, 2019 15:33
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 16, 2019
@react-native-bot react-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label May 16, 2019
@jeanregisser
Copy link
Contributor Author

jeanregisser commented May 16, 2019

I'm not too sure how to update tests that are directly writing to NativeModules.

For instance:

NativeModules.SourceCode.scriptURL = 'http://10.0.0.1:8081/main.bundle';

or

react-native/jest/setup.js

Lines 261 to 263 in 0815f81

SourceCode: {
scriptURL: null,
},

Let me know your thoughts on this.

@ericlewis
Copy link
Contributor

I'm not too sure how to update tests that are directly writing to NativeModules.

For instance:

NativeModules.SourceCode.scriptURL = 'http://10.0.0.1:8081/main.bundle';

or

react-native/jest/setup.js

Lines 261 to 263 in 0815f81

SourceCode: {
scriptURL: null,
},

Let me know your thoughts on this.

Change them to getConstants() calls:

SourceCode: {
  getConstants: function() {
   return { 
     scriptURL: null, 
    }
  }
}

and

NativeSourceCode.getConstants().scriptURL = 'http://10.0.0.1:8081/main.bundle';

@jeanregisser
Copy link
Contributor Author

jeanregisser commented May 16, 2019

Thanks @ericlewis you put me on the right track 👍

This is what I did to fix the tests: 7eeb16b

@ericlewis ericlewis added the Flow label May 16, 2019
Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

Amazing, thanks!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@rickhanlonii has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @jeanregisser in 163fb08.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 22, 2019
M-i-k-e-l pushed a commit to M-i-k-e-l/react-native that referenced this pull request Mar 10, 2020
Summary:
Part of facebook#24875

## Changelog

[General] [Added] - Add TurboModule spec for SourceCode
Pull Request resolved: facebook#24901

Reviewed By: fkgozali

Differential Revision: D15391727

Pulled By: rickhanlonii

fbshipit-source-id: 9d4622d809efdc3955d435c5a51b72c38cedccc5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Flow Merged This PR has been merged. Native Module Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants