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: add provideMockWithValues #238

Conversation

michaelwestphal
Copy link
Contributor

@michaelwestphal michaelwestphal commented Jul 15, 2021

Thank you for this wonderful library!

I would love to add a function to create a Mock provider where you can also pass in values to assign as properties or functions on the mock as desired. As createMockWithValues compliments createMock, this new function is intended to compliment provideMock.

Ironically to me the hardest part of this addition was trying to figure out a reasonable unit test 😄

michaelwestphal and others added 3 commits July 14, 2021 21:12
Add a function to create a Mock provider where you can also pass in
values to assign as properties or functions on the mock.
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.

Oh great addition, thanks @michaelwestphal !
I also added a commit to this PR to fix some dependencies.

@timdeschryver
Copy link
Member

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

@allcontributors
Copy link
Contributor

@timdeschryver

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

@timdeschryver timdeschryver merged commit fa34bdd into testing-library:main Jul 15, 2021
@github-actions
Copy link

🎉 This PR is included in version 10.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@michaelwestphal michaelwestphal deleted the add-provide-mock-with-values branch July 15, 2021 14:08
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