Skip to content

fix(lint): address @sentry/require-fake-timer-cleanup violations#114902

Open
natemoo-re wants to merge 5 commits into
nm/lint/jest-timersfrom
nm/lint/jest-timers-fix
Open

fix(lint): address @sentry/require-fake-timer-cleanup violations#114902
natemoo-re wants to merge 5 commits into
nm/lint/jest-timersfrom
nm/lint/jest-timers-fix

Conversation

@natemoo-re
Copy link
Copy Markdown
Member

This addresses 13 violations from enabling @sentry/require-fake-timer-cleanup.

Stacked PR on top of #114758

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 5, 2026
@natemoo-re natemoo-re force-pushed the nm/lint/jest-timers-fix branch from 32e78c1 to ae6eedc Compare May 5, 2026 19:15
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 5, 2026
@natemoo-re natemoo-re force-pushed the nm/lint/jest-timers branch from be347b2 to 5fb5e03 Compare May 5, 2026 19:16
@natemoo-re natemoo-re force-pushed the nm/lint/jest-timers-fix branch from ae6eedc to 531c41c Compare May 5, 2026 19:16
@getsentry getsentry deleted a comment from github-actions Bot May 5, 2026
@natemoo-re natemoo-re removed the Scope: Backend Automatically applied to PRs that change backend components label May 5, 2026
@natemoo-re natemoo-re marked this pull request as ready for review May 5, 2026 19:17
@natemoo-re natemoo-re requested review from a team as code owners May 5, 2026 19:17
@natemoo-re natemoo-re requested a review from JoshuaKGoldberg May 5, 2026 19:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.40%

});

afterEach(() => {
act(() => jest.runOnlyPendingTimers());
Copy link
Copy Markdown
Member

@ryan953 ryan953 May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

act?

The first file in the changeset doesn't have act

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tests need to wrap this in act() if they render a component that subscribes to a timer, because runOnlyPendingTimers() will trigger a React state update.

Comment thread static/app/components/replays/canvasReplayerPlugin.spec.ts Outdated
Comment on lines +475 to +477
expect(
await screen.findByText('https://cdn.example.com/runner.min.js.map')
).toBeInTheDocument();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably can use getByText here.

Comment on lines +259 to +261
await waitFor(() => {
expect(screen.getByTestId('logs-table')).toBeInTheDocument();
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use await findByTestId

expect(screen.getByTestId('logs-table')).toBeInTheDocument();
});

const allTreeRows = await screen.findAllByTestId('log-table-row');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here probably screen.getAllByTestId

Comment on lines +621 to +623
await waitFor(() => {
expect(within(projectSummary[0]!).getByText('Errors: 3')).toBeInTheDocument();
});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we use findBy here?

@getsantry
Copy link
Copy Markdown
Contributor

getsantry Bot commented May 28, 2026

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label May 28, 2026
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 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants