Fix Network serialization

Summary:
Changelog: [Network] Fix import / export of binary data

Introduced proper serialization of binary data when creating a Flipper export.
Implements / solves https://github.com/facebook/flipper/issues/2308

Reviewed By: nikoant

Differential Revision: D28441021

fbshipit-source-id: 90b524bf2a5d85e373073b50a3ccf2bb29628ee0
This commit is contained in:
Michel Weststrate
2021-05-17 03:15:46 -07:00
committed by Facebook GitHub Bot
parent 5242a81e94
commit b947a65c51
4 changed files with 201 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ import {TestUtils} from 'flipper-plugin';
import * as NetworkPlugin from '../index';
test('Can handle custom headers', async () => {
const {instance, sendEvent, act, renderer, exportState} =
const {instance, sendEvent, act, renderer, exportStateAsync} =
TestUtils.renderPlugin(NetworkPlugin);
act(() => {
@@ -122,7 +122,7 @@ test('Can handle custom headers', async () => {
// after import, columns should be visible and restored
{
const snapshot = exportState();
const snapshot = await exportStateAsync();
// Note: snapshot is set in the previous test
const {instance: instance2, renderer: renderer2} = TestUtils.renderPlugin(
NetworkPlugin,