Skip to content

Commit

Permalink
fix all new testing flow errors up to v11
Browse files Browse the repository at this point in the history
  • Loading branch information
Brianzchen committed May 14, 2023
1 parent b8a6372 commit 2e04f77
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('act', () => {
});

it('should fail on incorrect usage of result', () => {
// $FlowExpectedError[incompatible-type]
// $FlowExpectedError[unsafe-addition]
act(() => {}) + 1;
// $FlowExpectedError[prop-missing]
act(() => {}).doesNotExist();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ describe('act', () => {
act(() => {});
act(() => Promise.resolve());
act(() => ({
then: (resolve) => {},
then: (resolve: () => mixed) => {},
}));
});

it('should fail on incorrect usage of result', () => {
// $FlowExpectedError[incompatible-type]
// $FlowExpectedError[unsafe-addition]
act(() => {}) + 1;
// $FlowExpectedError[prop-missing]
act(() => {}).doesNotExist();
Expand Down Expand Up @@ -78,8 +78,8 @@ describe('waitForDomChange', () => {
});

it('should pass on correct inputs', () => {
waitForDomChange({ container: document.createElement('div') });
waitForDomChange({ timeout: 1 });
waitForDomChange<any>({ container: document.createElement('div') });
waitForDomChange<any>({ timeout: 1 });
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('act', () => {
});

it('should fail on incorrect usage of result', () => {
// $FlowExpectedError[incompatible-type]
// $FlowExpectedError[unsafe-addition]
act(() => {}) + 1;
// $FlowExpectedError[prop-missing]
act(() => {}).doesNotExist();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ describe('act', () => {
act(() => {});
act(() => Promise.resolve());
act(() => ({
then: (resolve) => {},
then: (resolve: () => mixed) => {},
}));
});

it('should fail on incorrect usage of result', () => {
// $FlowExpectedError[incompatible-type]
// $FlowExpectedError[unsafe-addition]
act(() => {}) + 1;
// $FlowExpectedError[prop-missing]
act(() => {}).doesNotExist();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('act', () => {
});

it('should fail on incorrect usage of result', () => {
// $FlowExpectedError[incompatible-type]
// $FlowExpectedError[unsafe-addition]
act(() => {}) + 1;
// $FlowExpectedError[prop-missing]
act(() => {}).doesNotExist();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ describe('act', () => {
act(() => {});
act(() => Promise.resolve());
act(() => ({
then: (resolve) => {},
then: (resolve: () => mixed) => {},
}));
});

it('should fail on incorrect usage of result', () => {
// $FlowExpectedError[incompatible-type]
// $FlowExpectedError[unsafe-addition]
act(() => {}) + 1;
// $FlowExpectedError[prop-missing]
act(() => {}).doesNotExist();
Expand Down

0 comments on commit 2e04f77

Please sign in to comment.