Skip to content

Commit 0309095

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Remove uses of $FlowExpectedError as a type across fbsource
Reviewed By: marcoww6 Differential Revision: D80579770 fbshipit-source-id: 9911e0f25e0dcef259f6d4980994be4a68c46e47
1 parent 14324a6 commit 0309095

7 files changed

Lines changed: 12 additions & 27 deletions

.flowconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ munge_underscores=true
1717

1818
experimental.error_code_migration=new
1919
suppress_type=$FlowFixMe
20-
suppress_type=$FlowExpectedError
2120

2221
format.bracket_spacing=false
2322

packages/react-relay/__tests__/RelayResolverNullableModelClientEdge-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ test('Errors thrown when reading the model a client edge points to are caught as
503503
handled: false,
504504
},
505505
]);
506-
const data: $FlowExpectedError = snapshot.data;
506+
const data: $FlowFixMe = snapshot.data;
507507
expect(data.edge_to_model_that_throws).toBe(null);
508508
});
509509

@@ -537,7 +537,7 @@ test('Errors thrown when reading plural client edge are caught as resolver error
537537
handled: false,
538538
},
539539
]);
540-
const data: $FlowExpectedError = snapshot.data;
540+
const data: $FlowFixMe = snapshot.data;
541541
expect(data.edge_to_plural_models_that_throw).toStrictEqual([null, null]);
542542
});
543543

@@ -564,7 +564,7 @@ test('Errors thrown when reading plural client edge are caught as resolver error
564564
handled: false,
565565
},
566566
]);
567-
const data: $FlowExpectedError = snapshot.data;
567+
const data: $FlowFixMe = snapshot.data;
568568
expect(data.edge_to_plural_models_some_throw).toStrictEqual([
569569
null,
570570
{id: 'a valid id!'},

packages/react-relay/relay-hooks/__tests__/useIsParentQueryActive-test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ beforeEach(() => {
4646
const source = new RecordSource();
4747
const store = new Store(source);
4848
fetch = jest.fn(
49-
(
50-
_query: $FlowExpectedError,
51-
_variables: $FlowExpectedError,
52-
_cacheConfig: $FlowExpectedError,
53-
) =>
49+
(_query: $FlowFixMe, _variables: $FlowFixMe, _cacheConfig: $FlowFixMe) =>
5450
Observable.create(
5551
(
5652
sink: Sink<

packages/relay-runtime/store/OperationExecutor.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,7 @@ class Executor<TMutation: MutationParameters> {
570570
const payloadFollowups = [];
571571
for (let i = 0; i < normalizedResponses.length; i++) {
572572
const response = normalizedResponses[i];
573-
const source = new RelayRecordSource(
574-
response.data as $FlowExpectedError,
575-
);
573+
const source = new RelayRecordSource(response.data as $FlowFixMe);
576574
const isFinal = response.extensions?.is_final === true;
577575
const payload: RelayResponsePayload = {
578576
errors: [],

packages/relay-runtime/store/__tests__/RelayModernEnvironment-ExecuteWithProvidedVariable-test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ function getEnvironment(
3434
): RelayModernEnvironment {
3535
let subject;
3636
const fetch = jest.fn(
37-
(
38-
_query: $FlowExpectedError,
39-
_variables: $FlowExpectedError,
40-
_cacheConfig: $FlowExpectedError,
41-
) =>
37+
(_query: $FlowFixMe, _variables: $FlowFixMe, _cacheConfig: $FlowFixMe) =>
4238
RelayObservable.create(
4339
(
4440
sink: Sink<{

packages/relay-runtime/store/__tests__/RelayModernEnvironment-ExecuteWithUndeclaredUnusedArgument-test.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,7 @@ describe('query with undeclared, unused fragment argument', () => {
7878
`;
7979
operation = createOperationDescriptor(query, {id: '4'});
8080
fetch = jest.fn(
81-
(
82-
_query: $FlowExpectedError,
83-
_variables: $FlowExpectedError,
84-
_cacheConfig: $FlowExpectedError,
85-
) =>
81+
(_query: $FlowFixMe, _variables: $FlowFixMe, _cacheConfig: $FlowFixMe) =>
8682
RelayObservable.create(
8783
(
8884
sink: Sink<{

packages/relay-runtime/store/__tests__/resolvers/LiveResolvers-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ test('unsubscribe happens when record is updated due to missing data', () => {
8686

8787
const snapshot = environment.lookup(operation.fragment);
8888
// lookup() doesn't have the nice types of reading a fragment through the actual APIs
89-
let data: $FlowExpectedError = snapshot.data;
89+
let data: $FlowFixMe = snapshot.data;
9090
const environmentUpdateHandler = jest.fn(() => {
9191
data = environment.lookup(operation.fragment).data;
9292
});
@@ -266,7 +266,7 @@ test('Errors thrown during _initial_ read() are caught as resolver errors', () =
266266
handled: false,
267267
},
268268
]);
269-
const data: $FlowExpectedError = snapshot.data;
269+
const data: $FlowFixMe = snapshot.data;
270270
expect(data.counter_throws_when_odd).toBe(null);
271271
});
272272

@@ -300,7 +300,7 @@ test('Errors thrown during read() _after update_ are caught as resolver errors',
300300

301301
// Confirm there are no initial errors
302302
expect(snapshot.fieldErrors).toEqual(null);
303-
const data: $FlowExpectedError = snapshot.data;
303+
const data: $FlowFixMe = snapshot.data;
304304
expect(data.counter_throws_when_odd).toBe(0);
305305

306306
// This should trigger a read that throws
@@ -320,7 +320,7 @@ test('Errors thrown during read() _after update_ are caught as resolver errors',
320320
handled: false,
321321
},
322322
]);
323-
const nextData: $FlowExpectedError = nextSnapshot.data;
323+
const nextData: $FlowFixMe = nextSnapshot.data;
324324
expect(nextData.counter_throws_when_odd).toBe(null);
325325

326326
handler.mockReset();
@@ -332,7 +332,7 @@ test('Errors thrown during read() _after update_ are caught as resolver errors',
332332

333333
// Confirm there are no initial errors
334334
expect(finalSnapshot.fieldErrors).toEqual(null);
335-
const finalData: $FlowExpectedError = finalSnapshot.data;
335+
const finalData: $FlowFixMe = finalSnapshot.data;
336336
expect(finalData.counter_throws_when_odd).toBe(2);
337337
});
338338

0 commit comments

Comments
 (0)