[RNMobile] Add support for platform test files#33628
Closed
Conversation
|
Size Change: 0 B Total Size: 1.07 MB ℹ️ View Unchanged
|
Contributor
|
👋 Once this is ready to review, if you need a reviewer, please feel free to add me! |
Contributor
|
This looks like a stale PR that hasn't seen any activity for some time. Should we close it? |
Contributor
Author
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
testfolders 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.jsonfile: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.jsfiles for terms that need renaming or removal).