-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS issues related with TestHelper #42256
TS issues related with TestHelper #42256
Conversation
@c3024 |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just need to remove the comment, this global.fetch = TestHelper.getGlobalFetchMock();
is necessary for the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks for the fixes @ZhenjaHorbach 👍
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
NA
Android: mWeb Chrome
NA
iOS: Native
NA
iOS: mWeb Safari
NA
MacOS: Chrome / Safari
NA
MacOS: Desktop
NA