m-radzikowski / aws-sdk-client-mock

AWS JavaScript SDK v3 mocks for easy unit testing. 🖋️ Typed 🔬 Tested 📄 Documented 🛠️ Maintained
https://m-radzikowski.github.io/aws-sdk-client-mock/
MIT License
749 stars 37 forks source link

Ability pass a Sinon Sandbox #192

Closed EdgarOrtegaRamirez closed 6 months ago

EdgarOrtegaRamirez commented 7 months ago

My project has a Sinon sandbox used to restore all stub/spies/mocks on a afterEach global hook. I would like to configure mockClient to use it like mockClient(Client, { sandbox: mySandbox }) or any other configuration method

m-radzikowski commented 6 months ago

I like the idea of having a single point of resetting all mocks.

I've added the ability in v3.1.0-beta.0. You can test it if you have a moment.

The API is exactly as you suggested: mockClient(client, { sandbox: mySandbox })