Extract the content of the case 'Int32' (Flow, TypeScript) into a single emitInt32 function in the parsers-primitives.js file.#34906
Conversation
Base commit: 7227bde |
Base commit: 7227bde |
|
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
cipolleschi
left a comment
There was a problem hiding this comment.
Thanks for taking this. 👏 That's amazing! :D
We can improve the quality even further by adding a unit test.
The steps should be:
- add the
__tests__subfolder in thepackages/react-native-codegen/src/parsers. - add a
parser-primitives-test.jswhere we unit test this fuction:- we test the output when the
nullableparameter isfalse - we test the output when the
nullableparameter istrue
- we test the output when the
An example of unit test can be found here.
Thank you so much! 🙏
|
@cipolleschi |
|
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
| @@ -0,0 +1,40 @@ | |||
| /** | |||
There was a problem hiding this comment.
Thanks for adding the test!
Could you please name this parsers-primitives-test.js, for consistency?
There was a problem hiding this comment.
@rshest thanks for the review!
I realized that the original file was called parsers-primitives.js, both word containing s
So I renamed the test to also follow the same parsers-primitives-test.js
|
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
This pull request was successfully merged by @Naturalclar in db8c11d. When will my fix make it into a release? | Upcoming Releases |
Summary
Part of #34872
Refactors emitInt32 in codegen parser module into a common parsers-primitive.js
Changelog
[Internal] [Changed] - Extract the content of the case 'Int32' (Flow, TypeScript) into a single emitInt32 function
Test Plan
Ran
yarn jest react-native-codegen