Expand globals test coverage in setUpDefaultReactNativeEnvironment-Globals-itest.js#56661
Closed
rubennorte wants to merge 1 commit into
Closed
Expand globals test coverage in setUpDefaultReactNativeEnvironment-Globals-itest.js#56661rubennorte wants to merge 1 commit into
rubennorte wants to merge 1 commit into
Conversation
…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
|
@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D103224423. |
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? |
|
This pull request has been merged in a3906b6. |
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.
Summary:
Expand the Fantom integration test for
setUpDefaultReactNativeEnvironmentglobals 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
describeblocks (global object,environment,JavaScript language features,Web APIs) and added coverage for:Node,Document,CharacterData,Text,Element,HTMLElement,HTMLCollection,NodeList.DOMRect,DOMRectReadOnly,DOMRectList.Event,EventTarget,CustomEvent.performance,Performance,PerformanceEntry,PerformanceMark,PerformanceMeasure,PerformanceObserver,PerformanceObserverEntryList,PerformanceEventTiming,PerformanceLongTaskTiming,PerformanceResourceTiming,EventCounts,TaskAttributionTiming.setTimeout/clearTimeout,setInterval/clearInterval,setImmediate/clearImmediate,requestAnimationFrame/cancelAnimationFrame,requestIdleCallback/cancelIdleCallback,queueMicrotask.XMLHttpRequest,FormData,fetch,Headers,Request,Response,WebSocket,AbortController,AbortSignal,URL,URLSearchParams.Blob,File, and a presence-only check forFileReader(accessing the lazy getter triggers a native module that isn't available in the Fantom environment, so we assert the property is registered onglobalThiswithout reading it).Promise.alert,navigator.PerformanceObserverEntryListandEventCountsaren't recognized as globals by Flow in this file, so they're declared viadeclare var ... : unknownat the top of the file and the assertion checkstypeof.Changelog: [Internal]
Differential Revision: D103224423