Skip to content

Commit

Permalink
Avoid calling fail in tests
Browse files Browse the repository at this point in the history
Summary:
Looks like we call fail() here which has special meaning in Jest tests but newer versions of Jest don't implement it, and our OSS test run in that newer version.
jestjs/jest#11698

Trying to see if it's possible to remove that call to fail() so that OSS and internal tests have consistent behavior.

Reviewed By: itamark

Differential Revision: D68867479

fbshipit-source-id: 896ffff042849dfff6fe7ff88d61084e20d369dd
  • Loading branch information
captbaritone authored and facebook-github-bot committed Jan 30, 2025
1 parent 59ae292 commit 7201930
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/relay-runtime/network/RelayObservable.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,7 @@ if (__DEV__) {
// Default implementation of HostReportErrors() in development builds.
// Can be replaced by the host application environment.
RelayObservable.onUnhandledError((error, isUncaughtThrownError) => {
declare function fail(string): void;
if (typeof fail === 'function') {
// In test environments (Jest), fail() immediately fails the current test.
fail(String(error));
} else if (isUncaughtThrownError) {
if (isUncaughtThrownError) {
// Rethrow uncaught thrown errors on the next frame to avoid breaking
// current logic.
setTimeout(() => {
Expand Down

0 comments on commit 7201930

Please sign in to comment.