-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[RNMobile] Add support for platform test files #33628
Conversation
Size Change: 0 B Total Size: 1.07 MB ℹ️ View Unchanged
|
👋 Once this is ready to review, if you need a reviewer, please feel free to add me! |
This looks like a stale PR that hasn't seen any activity for some time. Should we close it? |
Yeah, we can close it. I worked on this PR as an enhancement but after all this time we haven't needed it. In the future, we could resume it if necessary. |
Description
This PR introduces support for platform test files for both unit and integration tests. Depending on the platform, now we can create test files in
test
folders with extensionandroid.js
(Android platform) orios.js
(iOS platform), they will allow us to have test code specific to a platform which will be useful for those cases when we want to test a specific logic of a platform.Additionally, I added and updated the following commands:
Test commands:
npm run native test
: Runs the default test files (as we had previously) and uses Android as the default platform.npm run native test:android
: Runs the Android-specific test files, as Android is the default platform when running the default tests, we should reserve these ones for only Android-specific logic.npm run native test:ios
: Runs the iOS-specific test files, in this case when importing files, it will always take the iOS variant. As with Android-specific tests, we should reserve these ones for only iOS-specific logic.npm run native test:all
: Runs all tests.Debug commands:
npm run native test:debug
: Runs the default test files via the Chrome devtools.npm run native test:debug:android
: Runs the Android-specific test files via the Chrome devtools.npm run native test:debug:ios
: Runs the iOS-specific test files via the Chrome devtools.On the other hand, I updated a couple of commands from the root's
package.json
file:Test commands:
npm run test-unit:native
: Same command asnpm run native test
.npm run test-unit:native:android
: Same command asnpm run native test:android
.npm run test-unit:native:ios
: Same command asnpm run native test:ios
.Debug commands:
npm run test-unit:native:debug
: Same command asnpm run native test:debug
.npm run test-unit:native:debug:android
: Same command asnpm run native test:debug:android
.npm run test-unit:native:debug:ios
: Same command asnpm run native test:debug:ios
.How has this been tested?
[To be added...]
Screenshots
N/A
Types of changes
New feature
Checklist:
*.native.js
files for terms that need renaming or removal).