Skip to content

Expand globals test coverage in setUpDefaultReactNativeEnvironment-Globals-itest.js#56661

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

Expand globals test coverage in setUpDefaultReactNativeEnvironment-Globals-itest.js#56661
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D103224423

Conversation

@rubennorte

Copy link
Copy Markdown
Contributor

Summary:
Expand the Fantom integration test for setUpDefaultReactNativeEnvironment globals so it covers the full set of globals that React Native's default environment is expected to install, not just the global-object aliases and __DEV__/NODE_ENV.

Reorganized the existing tests into nested describe blocks (global object, environment, JavaScript language features, Web APIs) and added coverage for:

  • DOM: Node, Document, CharacterData, Text, Element, HTMLElement, HTMLCollection, NodeList.
  • Geometry: DOMRect, DOMRectReadOnly, DOMRectList.
  • Events: Event, EventTarget, CustomEvent.
  • Performance: performance, Performance, PerformanceEntry, PerformanceMark, PerformanceMeasure, PerformanceObserver, PerformanceObserverEntryList, PerformanceEventTiming, PerformanceLongTaskTiming, PerformanceResourceTiming, EventCounts, TaskAttributionTiming.
  • Timers and microtasks: setTimeout/clearTimeout, setInterval/clearInterval, setImmediate/clearImmediate, requestAnimationFrame/cancelAnimationFrame, requestIdleCallback/cancelIdleCallback, queueMicrotask.
  • Networking: XMLHttpRequest, FormData, fetch, Headers, Request, Response, WebSocket, AbortController, AbortSignal, URL, URLSearchParams.
  • File: Blob, File, and a presence-only check for FileReader (accessing the lazy getter triggers a native module that isn't available in the Fantom environment, so we assert the property is registered on globalThis without reading it).
  • JavaScript language features: Promise.
  • Other: alert, navigator.

PerformanceObserverEntryList and EventCounts aren't recognized as globals by Flow in this file, so they're declared via declare var ... : unknown at the top of the file and the assertion checks typeof.

Changelog: [Internal]

Differential Revision: D103224423

…obals-itest.js

Summary:
Expand the Fantom integration test for `setUpDefaultReactNativeEnvironment` globals so it covers the full set of globals that React Native's default environment is expected to install, not just the global-object aliases and `__DEV__`/`NODE_ENV`.

Reorganized the existing tests into nested `describe` blocks (`global object`, `environment`, `JavaScript language features`, `Web APIs`) and added coverage for:
- DOM: `Node`, `Document`, `CharacterData`, `Text`, `Element`, `HTMLElement`, `HTMLCollection`, `NodeList`.
- Geometry: `DOMRect`, `DOMRectReadOnly`, `DOMRectList`.
- Events: `Event`, `EventTarget`, `CustomEvent`.
- Performance: `performance`, `Performance`, `PerformanceEntry`, `PerformanceMark`, `PerformanceMeasure`, `PerformanceObserver`, `PerformanceObserverEntryList`, `PerformanceEventTiming`, `PerformanceLongTaskTiming`, `PerformanceResourceTiming`, `EventCounts`, `TaskAttributionTiming`.
- Timers and microtasks: `setTimeout`/`clearTimeout`, `setInterval`/`clearInterval`, `setImmediate`/`clearImmediate`, `requestAnimationFrame`/`cancelAnimationFrame`, `requestIdleCallback`/`cancelIdleCallback`, `queueMicrotask`.
- Networking: `XMLHttpRequest`, `FormData`, `fetch`, `Headers`, `Request`, `Response`, `WebSocket`, `AbortController`, `AbortSignal`, `URL`, `URLSearchParams`.
- File: `Blob`, `File`, and a presence-only check for `FileReader` (accessing the lazy getter triggers a native module that isn't available in the Fantom environment, so we assert the property is registered on `globalThis` without reading it).
- JavaScript language features: `Promise`.
- Other: `alert`, `navigator`.

`PerformanceObserverEntryList` and `EventCounts` aren't recognized as globals by Flow in this file, so they're declared via `declare var ... : unknown` at the top of the file and the assertion checks `typeof`.

Changelog: [Internal]

Differential Revision: D103224423
@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 Apr 30, 2026
@meta-codesync

meta-codesync Bot commented Apr 30, 2026

Copy link
Copy Markdown

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

@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @rubennorte in a3906b6

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

@react-native-bot react-native-bot added the Merged This PR has been merged. label Apr 30, 2026
@meta-codesync

meta-codesync Bot commented Apr 30, 2026

Copy link
Copy Markdown

This pull request has been merged in a3906b6.

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