From 99e332e5b2f3ff6f338d5538d94b3d71dc11847a Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 11 Jul 2023 11:42:43 -0700 Subject: [PATCH] Introduce jest-e2e test for TurboModule Interop (#38206) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38206 This test will ensure that the TurboModule interop layer works in Catalyst. It will navigate to the sample legacy module screen, and ensure that all methods work. Steps: 1. Open up Catalyst 2. Navigate to the Legacy Native Module example 3. Click "Run all tests" 4. Validate that all tests match expectations. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D46917689 fbshipit-source-id: 071f9324fa3719648c1a390bde4ba00a4e687e44 --- .../js/examples/TurboModule/SampleLegacyModuleExample.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js b/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js index 8d08c79e88e..1be5e965ec6 100644 --- a/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js +++ b/packages/rn-tester/js/examples/TurboModule/SampleLegacyModuleExample.js @@ -129,7 +129,9 @@ class SampleLegacyModuleExample extends React.Component<{||}, State> { const result = this.state.testResults[name] || {}; return ( - {JSON.stringify(result.value)} + + {(JSON.stringify(result.value) || '').replaceAll('"', "'")} + {result.type} ); @@ -145,6 +147,7 @@ class SampleLegacyModuleExample extends React.Component<{||}, State> { Object.keys(this._tests).forEach(item => { try {