-
Notifications
You must be signed in to change notification settings - Fork 549
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
base: main
Are you sure you want to change the base?
Conversation
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 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. |
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.
Looks good!
Description
Follow-up to #24647 which gives us the same benefits for tests that use the
describeE2eDocs
helper by sharing code betweendescribeCompat
,describeWithVersions
, anddescribeE2eDocs
.