Skip to content

Conversation

@vmoroz
Copy link
Member

@vmoroz vmoroz commented Jan 14, 2021

This PR simplifies writing integration tests for Microsoft.ReactNative.dll in the Microsoft.ReactNative.IntegrationTests project. To accomplish it we are adding two new helper classes: TestReactNativeHostHolder and TestEventService:

  • The TestReactNativeHostHolder helps creation of ReactNativeHost in the unit tests. It takes care about creation pseudo-UI thread, initializing all settings, and then waiting until the ReactNativeHost unloads the React instance.
  • The TestEventService helps logging and observing test events. The test events can be logged from different threads. The TestEventService::Observe method blocks the unit test thread until all test events are observed. Each incoming test event is checked for its name and associated JSValue data.

All existing tests in Microsoft.ReactNative.IntegrationTests are changed to use the new helper classes. The TestEventService replaces the pattern based on the std::promise. In addition to that we have the following:

  • Fixed DynamicReader to correctly output Int64 value type.
  • Extracted ExecuteJsi related tests into their own test file ExecuteJsiTests.cpp.
  • Renamed AddValues.js to ReactNativeHostTests.js to match the test file name ReactNativeHostTests.cpp.
  • Put all helper files into the Utilities filter folder.
Microsoft Reviewers: Open in CodeFlow

@vmoroz vmoroz requested a review from a team as a code owner January 14, 2021 17:48
Copy link

@NikoAri NikoAri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@vmoroz vmoroz merged commit ec3f492 into microsoft:master Jan 14, 2021
vmoroz added a commit that referenced this pull request Jan 15, 2021
* Fix unused parameter warning in AbiCallInvoker (#6860)

* Move CallInvoker.h to TurboModule filter folder (#6861)

* Simplify Microsoft.ReactNative.IntegrationTests (#6868)

* Update clang-format version to 1.5.0 (#6870)

* Add JSValue constructor for std::optional<T> (#6873)

* Updated doc comments in IReactNotificationService.idl (#6875)

* Fix ReactNotificationService for notifications between app and modules (#6877)
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.

2 participants