Skip to content

improvement(test-version-utils): Share TestObjectProvider creation hooks #24662

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Abe27342
Copy link
Contributor

Description

Follow-up to #24647 which gives us the same benefits for tests that use the describeE2eDocs helper by sharing code between describeCompat, describeWithVersions, and describeE2eDocs.

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 17:01
@github-actions github-actions bot added area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch labels May 20, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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 refactors test setup code to share TestObjectProvider lifecycle hooks across different test suites, unifying the creation, reset, and cleanup logic.

  • Replaces duplicated provider creation and teardown logic in describeWithVersions.ts and describeE2eDocs.ts with a shared lifecycle hook factory.
  • Refactors describeCompat.ts to use createTestObjectProviderLifecycleHooks and streamlines the provider access pattern.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/test/test-version-utils/src/describeWithVersions.ts Removes inlined provider state management and cleanup hooks in favor of the shared lifecycle hook.
packages/test/test-version-utils/src/describeE2eDocs.ts Similar refactoring to use lifecycle hooks, removing redundant cleanup and error verification in afterEach hooks.
packages/test/test-version-utils/src/describeCompat.ts Refactors provider creation and cleanup by introducing a currentProvider state and consolidating setup/teardown logic via the new lifecycle hook.

@Abe27342 Abe27342 enabled auto-merge (squash) May 20, 2025 21:30
@Abe27342 Abe27342 disabled auto-merge May 20, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant