Files
flipper/desktop/plugins/network
bizzguy 5320015776 Fix mock export file format (#1872)
Summary:
Provide a more robust technique for exporting the mocks to a file.

The current technique for exporting mocks to a file seems to fail under some scenarios.  The correct format is an array of objects:

```
[
  {
    "requestUrl": "https://api.github.com/repos/facebook/yoga",
    "requestMethod": "GET",
```
However, the following format is sometimes exported instead:

```
{
  "10": {
    "requestUrl": "https://demo9512366.mockable.io/SonarPost",
```

Using `Object.values` provides a more robust technique that has been successful during subsequent testing.

## Changelog

Network Plugin - new technique for exporting mocks

Pull Request resolved: https://github.com/facebook/flipper/pull/1872

Test Plan:
Create mocks in the network plugin
Export mocks
Manually examine file for correct format
Import mocks and verify that the file has been imported correctly

Reviewed By: nikoant

Differential Revision: D26172954

Pulled By: mweststrate

fbshipit-source-id: bdfa3ba7dfe656f30ef17df001fc83dd8ea18ece
2021-02-01 10:23:45 -08:00
..
2020-10-14 06:23:27 -07:00
2020-08-10 08:47:32 -07:00
2021-02-01 10:23:45 -08:00
2021-02-01 03:58:34 -08:00