Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feat: Added childComponentOverrides property to override nested child providers #332

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

Merged
timdeschryver merged 1 commit into testing-library:main from JJosephttg:override-specific-nested-component-providers
Nov 28, 2022
Merged

Feat: Added childComponentOverrides property to override nested child providers #332

timdeschryver merged 1 commit into testing-library:main from JJosephttg:override-specific-nested-component-providers
Nov 28, 2022

Conversation

Copy link
Contributor

@JJosephttg JJosephttg commented Nov 26, 2022

This PR is to allow for specific child components to be overridden with providers as the introduction of standalone components and scoping services to specific components make it difficult to mock out services that might talk to external dependencies, especially when the component you are testing is higher up. Currently there is no way to mock component level providers for nested children which this tries to address.

Feel free to leave suggestions for improvements. I am hoping to at least get something out the door so that it is at least possible to override child providers.

I also added a test and an example in the description to show how this works

...oviders and fixed linting errors from existing tests
@JJosephttg JJosephttg changed the title (削除) Added childComponentOverrides property to override nested child providers (削除ここまで) (追記) Feat: Added childComponentOverrides property to override nested child providers (追記ここまで) Nov 27, 2022
@timdeschryver timdeschryver changed the base branch from main to beta November 28, 2022 14:52
@timdeschryver timdeschryver changed the base branch from beta to main November 28, 2022 14:52
Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

Copy link
Member

@all-contributors please add @JJosephttg for code, tests

Copy link
Contributor

@timdeschryver

I've put up a pull request to add @JJosephttg! 🎉

@timdeschryver timdeschryver merged commit 6e951ad into testing-library:main Nov 28, 2022
Copy link

🎉 This PR is included in version 12.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@timdeschryver timdeschryver timdeschryver approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /