Skip to content
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

Merged
merged 3 commits into from
Oct 17, 2024
Merged

Conversation

scttcper
Copy link
Member

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

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
@scttcper scttcper requested review from a team as code owners October 17, 2024 00:15
@scttcper scttcper requested a review from a team October 17, 2024 00:15
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 17, 2024
Copy link
Contributor

@saponifi3d saponifi3d left a 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;
Copy link
Member

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?

Copy link
Member Author

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;
Copy link
Member

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 !? 🤔

Copy link
Member Author

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

@scttcper scttcper merged commit 17c7471 into master Oct 17, 2024
43 of 44 checks passed
@scttcper scttcper deleted the scttcper/various-test-mock-types branch October 17, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants