Update API to align with vitest-browser ecosystem#18
Merged
Conversation
commit: |
7 tasks
sheremet-va
reviewed
Jan 15, 2026
sheremet-va
requested changes
Jan 15, 2026
Member
sheremet-va
left a comment
There was a problem hiding this comment.
Looks good, just a small note
fa36a66 to
9ac828a
Compare
sheremet-va
reviewed
Jan 15, 2026
Member
sheremet-va
left a comment
There was a problem hiding this comment.
Looks perfect, thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enhances the testing API with updated naming conventions and new features for querying elements.
✨ New Features
Render Result with Locator Methods: The render result now includes built-in locator methods (
getByText,getByRole,getByLabelText, etc.) that query frombaseElement(defaults todocument.body)Container Element: New
containerproperty provides direct access to the component's host element (shortcut forfixture.nativeElement)Base Element Configuration: New
baseElementoption allows customizing the root element for queries, essential for testing components with portals/overlays🔄 Breaking Changes (with deprecation period)
locatorreplacescomponent- Aligns with vitest-browser-vue and other libraries in the ecosystemconst { component } = await render(...)const { locator } = await render(...)componentis deprecated but still works for backward compatibilityComponentRenderOptionsreplacesRenderConfigtype - More descriptive namingRenderConfigis deprecated but still works for backward compatibility📚 Documentation
locatorvsscreenquery patternsMigration: All deprecated properties continue to work. Update at your convenience - simply rename
component→locatorandRenderConfig→ComponentRenderOptions.