-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
test(ui): Add types to test mocks #79255
Conversation
They are currently implicit any which we'd like to turn off. didn't really focus on any area in particular just did a bunch of easy ones. part of getsentry/frontend-tsc#79
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 🙏 thanks for doing all these!
let shortIdMock; | ||
let eventIdMock; | ||
let configState; | ||
let orgsMock: jest.Mock; |
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.
Ideally we provide the type of what it’s mocking I think?
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.
MockApiClient.addMockResponse return type is jest.Mock<any, any, any>
🤷
@@ -632,7 +632,7 @@ describe('Discover -> ColumnEditModal', function () { | |||
}); | |||
|
|||
describe('equation automatic update', function () { | |||
let onApply; | |||
let onApply!: jest.Mock; |
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 other way that allows us to not use !
? 🤔
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'll need to use it even more if we keep making the types more strict since typescript doesn't know how beforeEach works
They are currently implicit any which we'd like to turn off.
didn't really focus on any area in particular just did a bunch of easy ones.
part of getsentry/frontend-tsc#79