-
Notifications
You must be signed in to change notification settings - Fork 731
Add test for updateIntervalMs=0 disabling updater #11586
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Co-authored-by: Byron <[email protected]>
22490d1 to
ac99db3
Compare
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.
Pull request overview
This PR adds test coverage for the updater service's behavior when updateIntervalMs is set to 0, which disables automatic update checks. This validates existing logic in the start() method that conditionally skips setting up the interval timer.
- Adds a new test case that verifies the updater doesn't perform any automatic checks when disabled
- Confirms that both initial checks and periodic interval checks are skipped
- Uses the existing test patterns with fake timers to validate timer-based behavior
| await vi.advanceTimersByTimeAsync(3600 * 1000); | ||
| expect(mock).not.toHaveBeenCalled(); | ||
|
|
Copilot
AI
Dec 19, 2025
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.
These two time advances with identical assertions are redundant. Since the test is verifying that no timer was set when updateIntervalMs is 0, a single time advance is sufficient to demonstrate this behavior. Consider removing one of these duplicate checks.
| await vi.advanceTimersByTimeAsync(3600 * 1000); | |
| expect(mock).not.toHaveBeenCalled(); |
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.
Fair enough - I also saw it, but thought it wanted to make extra-sure.
The updater service has logic to disable automatic update checks when
updateIntervalMsis set to 0, but this behavior lacked test coverage.Changes
should disable updater when updateIntervalMs is 0to verify:start()that skips setInterval whenupdateIntervalMs !== 0Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.