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

Use fake timers in proposals.utils.spec.ts #6387

Merged
merged 1 commit into from
Feb 10, 2025
Merged

Use fake timers in proposals.utils.spec.ts #6387

merged 1 commit into from
Feb 10, 2025

Conversation

dskloetd
Copy link
Contributor

Motivation

I noticed flakiness in frontend/src/tests/lib/utils/proposals.utils.spec.ts which seemed to result from the test especting nowInSeconds to always return the same value during the test.

Changes

  1. Call vi.useFakeTimers() in beforeEach in frontend/src/tests/lib/utils/proposals.utils.spec.ts.

Tests

  1. I changed Date.now to always increase by 1 second on every call to see if any other tests had similar problems but this was the only test that failed.

Todos

  • Add entry to changelog (if necessary).
    not necessary

@dskloetd dskloetd marked this pull request as ready for review February 10, 2025 14:06
@dskloetd dskloetd requested a review from a team as a code owner February 10, 2025 14:06
@dskloetd dskloetd enabled auto-merge February 10, 2025 14:06
Copy link
Contributor

@yhabib yhabib left a comment

Choose a reason for hiding this comment

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

Thanks

@dskloetd dskloetd added this pull request to the merge queue Feb 10, 2025
Merged via the queue into main with commit ba957ce Feb 10, 2025
32 checks passed
@dskloetd dskloetd deleted the kloet/now-offset branch February 10, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants