Skip to content

test(base-data-service): Use fake timers - #9496

Merged
FrederikBolding merged 1 commit into
mainfrom
fb/base-data-service-fake-timers
Jul 14, 2026
Merged

test(base-data-service): Use fake timers#9496
FrederikBolding merged 1 commit into
mainfrom
fb/base-data-service-fake-timers

Conversation

@FrederikBolding

@FrederikBolding FrederikBolding commented Jul 14, 2026

Copy link
Copy Markdown
Member

Explanation

Separated out for review from #9445, since it is needed for multiple PRs. Makes it easier to write tests for BaseDataService going forward.

References

N/A

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@FrederikBolding
FrederikBolding marked this pull request as ready for review July 14, 2026 08:12
@FrederikBolding
FrederikBolding requested a review from a team as a code owner July 14, 2026 08:12
*/
destroy(): void {
this.#queryCacheUnsubscribe();
this.#queryClient.clear();

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.

Is this related to the tests or does this fix another bug? 🤔

@FrederikBolding FrederikBolding Jul 14, 2026

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.

The tests would hang waiting for a GC timer without this

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.

Though it makes sense to clear it out when destroying regardless!

@FrederikBolding
FrederikBolding added this pull request to the merge queue Jul 14, 2026
Merged via the queue into main with commit 621fbe4 Jul 14, 2026
431 checks passed
@FrederikBolding
FrederikBolding deleted the fb/base-data-service-fake-timers branch July 14, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants