antonosmond / mock-aws

Mock aws-sdk API methods to enable easier testing of apps which use the AWS SDK for JavaScript
ISC License
14 stars 10 forks source link

Add support for functions when calling mocks #1

Closed deitch closed 8 years ago

deitch commented 8 years ago

Instead of just fixed data as the third argument to mock(), it can be fixed or functions. This gives the ability to look at parameters, provide variable data, send data or call an error.

deitch commented 8 years ago

Added one test for the function. All tests that passed before, pass now.

hairyhenderson commented 8 years ago

@deitch - nice. Was just wondering if there was a way I could inject errors, and this looks like the right way!

@antonosmond - any chance of this getting merged soon?

antonosmond commented 8 years ago

Done - only just saw your pull request otherwise I would've merged it sooner. Tbh I've not used this repo for a while but if people are using it I'll keep it alive and merge any sensible changes. Thanks for your contribution @deitch - have a great Xmas!

hairyhenderson commented 8 years ago

:tada: @antonosmond - are you going to publish the new version to npmjs?

antonosmond commented 8 years ago

@hairyhenderson - Done.

hairyhenderson commented 8 years ago

@antonosmond - awesome, thank you! :)

deitch commented 8 years ago

Great! I am glad it was helpful to people.