Skip to content

feat: platform filters#134

Merged
V3RON merged 4 commits into
mainfrom
feat/platform-filters
May 29, 2026
Merged

feat: platform filters#134
V3RON merged 4 commits into
mainfrom
feat/platform-filters

Conversation

@V3RON
Copy link
Copy Markdown
Contributor

@V3RON V3RON commented May 29, 2026

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.ts and only-android.android.harness.ts can coexist in one suite while each runner only sees the files that make sense for its platform.

How

  • Added platform suffix detection for harness test files such as *.ios.harness.ts and *.android.harness.ts.
  • Injected a Jest --testPathIgnorePatterns argument from the Harness CLI based on the selected runner, so mismatched platform files are excluded during Jest discovery.
  • Kept a runner-level skip result as a defensive fallback if tests are supplied directly to the runner.
  • Added Android-only and iOS-only playground harness fixtures that assert Platform.OS for the expected runner.
  • Added an Nx version plan describing the user-facing release impact.

Potential issues / pitfalls

  • The discovery-level filtering is applied by the Harness CLI. Direct Jest runner usage that bypasses the CLI will rely on the runner fallback instead of pre-scheduling exclusion.
  • Platform suffixes are only recognized when the segment before .harness matches a configured runner platformId; unknown suffixes continue to behave like shared tests.
  • Harness appends --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/cli
  • pnpm vitest run packages/jest/src/__tests__/test-file-platform-filter.test.ts packages/jest/src/__tests__/execute-run.test.ts
  • pnpm nx run-many -t lint typecheck build --projects=@react-native-harness/cli,@react-native-harness/jest,@react-native-harness/playground
  • pre-push hook: @react-native-harness/jest:test and builds for affected packages

V3RON added 3 commits May 29, 2026 12:11
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.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-native-harness Ready Ready Preview, Comment May 29, 2026 10:38am

Request Review

Explain the platform suffix naming convention and note that mismatched platform harness files are filtered before Jest schedules them.
@V3RON V3RON merged commit 1db36ed into main May 29, 2026
6 checks passed
@V3RON V3RON deleted the feat/platform-filters branch May 29, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant