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

Documentation example for __mocks__ implementation #229

Open
mdpratt opened this issue Jun 26, 2024 · 2 comments
Open

Documentation example for __mocks__ implementation #229

mdpratt opened this issue Jun 26, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@mdpratt
Copy link

mdpratt commented Jun 26, 2024

This package makes mocking on a spec by spec significantly easier. However sometimes I would like to mock a client with a default behavior across many packages; for example, mocking STS' GetCallerIdentityCommand. Some documentation on how to put this into a toplevel __mocks__ would be appreciated.

If I figure it out, I'll open a pull request, but automocks is something that trips me up almost every time getting it just right.

@mdpratt mdpratt added the enhancement New feature or request label Jun 26, 2024
@m-radzikowski
Copy link
Owner

I'm unsure if using (Jest) __mocks__ dir is a solution here because it replaces local modules with mocks. What you can try is maybe setting mock behavior in setupFilesAfterEnv script? If you make it work, please share.

@crs1138
Copy link

crs1138 commented Nov 8, 2024

@mdpratt if you do work it out, could you mention it here please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants