Skip to content

Add Fantom.getHostPlatform() to expose test runner host OS (#56990)#56990

Closed
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D106669673
Closed

Add Fantom.getHostPlatform() to expose test runner host OS (#56990)#56990
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D106669673

Conversation

@rubennorte

@rubennorte rubennorte commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary:

Adds a new Fantom.getHostPlatform() API that returns the host
operating system where the Fantom test runner is running (e.g. 'linux',
'macos', 'windows', 'android'). This is different from React Native's
Platform.OS, which always reflects the React Native target platform
being tested.

The value is determined by the Node.js Jest runner (via
process.platform) and baked into the JS bundle through the existing
setConstants(...) pipeline, so no native changes are needed.

  • Add HostPlatform type and hostPlatform field to
    FantomRuntimeConstants.
  • Populate hostPlatform from the host platform in the entrypoint
    template (maps darwin -> macos, win32 -> windows, etc.).
  • Expose getHostPlatform() from the public Fantom API.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D106669673

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 28, 2026
@meta-codesync

meta-codesync Bot commented May 28, 2026

Copy link
Copy Markdown

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106669673.

@meta-codesync meta-codesync Bot changed the title Add Fantom.getRealPlatformOS() to expose test runner host OS Add Fantom.getHostPlatform() to expose test runner host OS May 29, 2026
@rubennorte rubennorte force-pushed the export-D106669673 branch from ea53118 to 1f994b3 Compare May 29, 2026 11:49
@meta-codesync meta-codesync Bot changed the title Add Fantom.getHostPlatform() to expose test runner host OS Add Fantom.getHostPlatform() to expose test runner host OS (#56990) May 29, 2026
rubennorte added a commit to rubennorte/react-native that referenced this pull request May 29, 2026
Summary:

Adds a new `Fantom.getHostPlatform()` API that returns the host
operating system where the Fantom test runner is running (e.g. 'linux',
'macos', 'windows', 'android'). This is different from React Native's
`Platform.OS`, which always reflects the React Native target platform
being tested.

The value is determined by the Node.js Jest runner (via
`process.platform`) and baked into the JS bundle through the existing
`setConstants(...)` pipeline, so no native changes are needed.

- Add `HostPlatform` type and `hostPlatform` field to
  `FantomRuntimeConstants`.
- Populate `hostPlatform` from the host platform in the entrypoint
  template (maps darwin -> macos, win32 -> windows, etc.).
- Expose `getHostPlatform()` from the public Fantom API.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D106669673
@rubennorte rubennorte force-pushed the export-D106669673 branch from 1f994b3 to a4809a2 Compare May 29, 2026 14:09
rubennorte added a commit to rubennorte/react-native that referenced this pull request May 29, 2026
Summary:

Adds a new `Fantom.getHostPlatform()` API that returns the host
operating system where the Fantom test runner is running (e.g. 'linux',
'macos', 'windows', 'android'). This is different from React Native's
`Platform.OS`, which always reflects the React Native target platform
being tested.

The value is determined by the Node.js Jest runner (via
`process.platform`) and baked into the JS bundle through the existing
`setConstants(...)` pipeline, so no native changes are needed.

- Add `HostPlatform` type and `hostPlatform` field to
  `FantomRuntimeConstants`.
- Populate `hostPlatform` from the host platform in the entrypoint
  template (maps darwin -> macos, win32 -> windows, etc.).
- Expose `getHostPlatform()` from the public Fantom API.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D106669673
Summary:

Adds a new `Fantom.getHostPlatform()` API that returns the host
operating system where the Fantom test runner is running (e.g. 'linux',
'macos', 'windows', 'android'). This is different from React Native's
`Platform.OS`, which always reflects the React Native target platform
being tested.

The value is determined by the Node.js Jest runner (via
`process.platform`) and baked into the JS bundle through the existing
`setConstants(...)` pipeline, so no native changes are needed.

- Add `HostPlatform` type and `hostPlatform` field to
  `FantomRuntimeConstants`.
- Populate `hostPlatform` from the host platform in the entrypoint
  template (maps darwin -> macos, win32 -> windows, etc.).
- Expose `getHostPlatform()` from the public Fantom API.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D106669673
@rubennorte rubennorte force-pushed the export-D106669673 branch from a4809a2 to 0335fec Compare May 29, 2026 14:10
@meta-codesync meta-codesync Bot closed this in 9199b39 May 29, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label May 29, 2026
@meta-codesync

meta-codesync Bot commented May 29, 2026

Copy link
Copy Markdown

This pull request has been merged in 9199b39.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @rubennorte in 9199b39

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants