feat: platform filters#134
Merged
Merged
Conversation
Add platform-aware harness test filtering and skipped test result handling. Version plan: harness tests can now declare a platform suffix and run only on matching runners, while shared harness tests continue to run everywhere. Skipped platform-mismatched files still emit structured results, so downstream reporting and run-state tracking remain accurate.
Document the Nx release impact of platform-specific harness test filtering and skipped-file reporting.
Add a Jest testPathIgnorePatterns argument for platform-specific harness files so files for other runners are excluded during Jest discovery. Keep the runner-level skipped result shape valid as a fallback and add playground fixtures for Android-only and iOS-only harness tests.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Explain the platform suffix naming convention and note that mismatched platform harness files are filtered before Jest schedules them.
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.
Harness users can keep platform-specific harness tests side by side without files for the wrong runner being scheduled by Jest. This is needed so files like
only-ios.ios.harness.tsandonly-android.android.harness.tscan coexist in one suite while each runner only sees the files that make sense for its platform.How
*.ios.harness.tsand*.android.harness.ts.--testPathIgnorePatternsargument from the Harness CLI based on the selected runner, so mismatched platform files are excluded during Jest discovery.Platform.OSfor the expected runner.Potential issues / pitfalls
.harnessmatches a configured runnerplatformId; unknown suffixes continue to behave like shared tests.--testPathIgnorePatterns, so projects with custom ignore patterns should still compose with this, but unusual Jest CLI wrappers may need to preserve repeated array flags.Checks
pnpm vitest run src/__tests__/jest-platform-ignore-pattern.test.ts --root packages/clipnpm vitest run packages/jest/src/__tests__/test-file-platform-filter.test.ts packages/jest/src/__tests__/execute-run.test.tspnpm nx run-many -t lint typecheck build --projects=@react-native-harness/cli,@react-native-harness/jest,@react-native-harness/playground@react-native-harness/jest:testand builds for affected packages