Files
react-native/ReactCommon/react
Micha Reiser 28ed660c2d Use EXPECT_NEAR to improve test failure messages
Summary:
The current test failures don't include the values passed to `EXPECT` which makes it difficult to understand if the test ended earlier or later then expected.

```
Failure: Value of: (commitDuration >= 1000 - threshold) && (commitDuration <= 1000 + threshold)
  Actual: false
Expected: true
```

This diff uses the gtest `EXPECT_NEAR` to get exception messages including the delta:

```
Failure: The difference between telemetryDurationToMilliseconds(telemetry.getTextMeasureTime()) and 600 is 153, which exceeds threshold, where
telemetryDurationToMilliseconds(telemetry.getTextMeasureTime()) evaluates to 753,
600 evaluates to 600, and
threshold evaluates to 70.
```

This doesn't change the test's flakiness because of how sleep is implemented.

Changelog: [Internal] Test only change

Reviewed By: sammy-SC

Differential Revision: D27595206

fbshipit-source-id: f31bdd92ecc7271c9491dda18639ea08820f5730
2021-04-07 01:31:47 -07:00
..
2021-04-01 04:50:59 -07:00
2021-04-01 04:50:59 -07:00
2021-04-01 04:50:59 -07:00