Skip to content

Migrate StyleSheet pure-logic Jest tests to Fantom#57260

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

Migrate StyleSheet pure-logic Jest tests to Fantom#57260
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D108759084

Conversation

@rubennorte

Copy link
Copy Markdown
Contributor

Summary:
Migrates the pure-logic StyleSheet unit tests from regular Jest (-test.js) to Fantom (-itest.js), so they run on Hermes inside the real React Native runtime, the same engine that runs this code in production.

Migrated files (all style-processing utilities that run on the client at runtime): flattenStyle, processAspectRatio, processBackgroundPosition, processBackgroundRepeat, processBackgroundSize, processFilter, processFontVariant, processTransform, processTransformOrigin, setNormalizedColorAlpha, splitLayoutProps.

Notable adaptations:

  • toThrowErrorMatchingSnapshot() and toThrowErrorMatchingInlineSnapshot() are not available in Fantom, so they were replaced with toThrow('<exact message>'), preserving the exact error messages that were previously captured in snapshots.
  • Removed the now-obsolete file snapshots for processAspectRatio, processTransform, and processTransformOrigin.
  • toMatchInlineSnapshot (used by splitLayoutProps) is supported by Fantom and was kept unchanged.

Changelog: [Internal]

Differential Revision: D108759084

Summary:
Migrates the pure-logic StyleSheet unit tests from regular Jest (`-test.js`) to Fantom (`-itest.js`), so they run on Hermes inside the real React Native runtime, the same engine that runs this code in production.

Migrated files (all style-processing utilities that run on the client at runtime): `flattenStyle`, `processAspectRatio`, `processBackgroundPosition`, `processBackgroundRepeat`, `processBackgroundSize`, `processFilter`, `processFontVariant`, `processTransform`, `processTransformOrigin`, `setNormalizedColorAlpha`, `splitLayoutProps`.

Notable adaptations:
- `toThrowErrorMatchingSnapshot()` and `toThrowErrorMatchingInlineSnapshot()` are not available in Fantom, so they were replaced with `toThrow('<exact message>')`, preserving the exact error messages that were previously captured in snapshots.
- Removed the now-obsolete file snapshots for `processAspectRatio`, `processTransform`, and `processTransformOrigin`.
- `toMatchInlineSnapshot` (used by `splitLayoutProps`) is supported by Fantom and was kept unchanged.

Changelog: [Internal]

Differential Revision: D108759084
@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 Jun 18, 2026
@meta-codesync

meta-codesync Bot commented Jun 18, 2026

Copy link
Copy Markdown

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

@meta-codesync meta-codesync Bot closed this in b57f65e Jun 18, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jun 18, 2026
@meta-codesync

meta-codesync Bot commented Jun 18, 2026

Copy link
Copy Markdown

This pull request has been merged in b57f65e.

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. 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.

1 participant