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

Request.send chokes when not provided a callback #248

Open
tmonoceros opened this issue Oct 7, 2021 · 0 comments
Open

Request.send chokes when not provided a callback #248

tmonoceros opened this issue Oct 7, 2021 · 0 comments

Comments

@tmonoceros
Copy link

The fix for this issue breaks some previously-functioning tests.

The callback provided to request.send() is optional in the AWS SDK. Starting with 5.3, invoking send() on a mocked request without a callback causes a crash and thus test failures.

This can be worked around but can be annoying and does make 5.3 a breaking release.

Example:

const awsMock = require('aws-sdk-mock')
const aws = require('aws-sdk')

awsMock.mock('EventBridge', 'putEvents')
const eb = new aws.EventBridge()

const request = eb.putEvents('stuff')
request.send() //crash in 5.3+, fine in 5.2
awsMock.restore()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant