Closed agconti closed 6 years ago
Thanks for the suggestion. However I will not be merging this in because in my opinion it is better for devs to pass in their own custom implementation of the AWS stub, since the one for the tests in s3-upload-stream
is setup to trigger different behavior when certain filenames are used, specific to internal unit tests for the module itself.
If your goal is to unit test uploads in your own app then you may choose to copy the stub from the s3-upload-stream
and use it as a template to implement your own stub in your unit test suite. By doing this you would have more control to trigger certain error conditions as needed.
But exposing the stub from the unit tests as a first class citizen of the module is a little too hacky in my opinion.
👍
Since other devs will probably need to mock AWS so they can test the uploads in their application, it makes sense to expose
AWSstub
as a connivence utility.