Skip to content
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

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

Merged
merged 1 commit into from
Nov 28, 2022
Merged

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

merged 1 commit into from
Nov 28, 2022

Conversation

JJosephttg
Copy link
Contributor

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!

@timdeschryver
Copy link
Member

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

@allcontributors
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
@github-actions
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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants