TS issues related with TestHelper#42256
Conversation
|
@c3024 |
| let mockFetch: MockFetch; | ||
| beforeEach(() => { | ||
| // @ts-expect-error TODO: Remove this once TestHelper (https://github.com/Expensify/App/issues/25318) is migrated to TypeScript. | ||
| global.fetch = TestHelper.getGlobalFetchMock(); |
There was a problem hiding this comment.
Do we still need this line?
There was a problem hiding this comment.
We just need to remove the comment, this global.fetch = TestHelper.getGlobalFetchMock(); is necessary for the test.
Julesssss
left a comment
There was a problem hiding this comment.
Is there any discussion about global.fetch and mockFetch you know about? I haven't heard about it
|
Just curious, why are you getting rid of |
These changes are from PR where we removed @ts-expect-error in unnecessary places |
This is me experimenting |
Beamanator
left a comment
There was a problem hiding this comment.
Ok then sorry but I'd appreciate if you revert removing ?. b/c it makes the diff a lot longer, and IMO since we already use ?. everywhere in the code it's better to keep it here. Thoughts @Julesssss ?
|
@ZhenjaHorbach can you be a bit quicker with this PR? This is causing a LOT of PRs to have a type error and cannot be merged |
Sorry And It's me added And the problems with the tests were not related to this |
|
Problems were related with this I tried to remove and use only
But using the first method we mutate the original fetch and then add type which we use for tests but save original methods inside global.fetch Is the second method we have methods only from getGlobalFetchMock what was causing problems with the tests |
|
@Beamanator |
Deleting |
Okay |
Beamanator
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks for the fixes @ZhenjaHorbach 👍
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
| let mockFetch: MockFetch; | ||
| beforeEach(() => { | ||
| // @ts-expect-error TODO: Remove this once TestHelper (https://github.com/Expensify/App/issues/25318) is migrated to TypeScript. | ||
| global.fetch = TestHelper.getGlobalFetchMock(); |
There was a problem hiding this comment.
We just need to remove the comment, this global.fetch = TestHelper.getGlobalFetchMock(); is necessary for the test.
|
Thanks @fabioh8010 for the review! |
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 1.4.75-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.75-1 🚀
|
Details
Fixed Issues
$ #39130
PROPOSAL: #39130 (comment)
Tests
Nothing to test. All changes are related to TS only
Offline tests
Nothing to test. All changes are related to TS only
QA Steps
Nothing to test. All changes are related to TS only
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
NA
Android: mWeb Chrome
NA
iOS: Native
NA
iOS: mWeb Safari
NA
MacOS: Chrome / Safari
NA
MacOS: Desktop
NA