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
fix(NODE-3442): AsyncIterator has incorrect return type #2916
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,8 @@ describe('executeLegacyOperation', function () { | |
expect(caughtError).to.equal(expectedError); | ||
}); | ||
|
||
it('should reject promise with errors on throw errors, and rethrow error', function (done) { | ||
it('should reject promise with errors on throw errors, and rethrow error', function () { | ||
const expectedError = new Error('THIS IS AN ERROR'); | ||
let callbackError; | ||
|
||
const topology = { | ||
logicalSessionTimeoutMinutes: null | ||
|
@@ -39,18 +38,10 @@ describe('executeLegacyOperation', function () { | |
throw expectedError; | ||
}; | ||
|
||
const callback = err => (callbackError = err); | ||
const options = { skipSessions: true }; | ||
|
||
executeLegacyOperation(topology, operation, [{}, null], options).then(null, callback); | ||
|
||
setTimeout(() => { | ||
try { | ||
expect(callbackError).to.equal(expectedError); | ||
done(); | ||
} catch (e) { | ||
done(e); | ||
} | ||
return executeLegacyOperation(topology, operation, [{}, null], options).then(null, err => { | ||
expect(err).to.equal(expectedError); | ||
Comment on lines
+43
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was failing on the first commit I pushed, might have been flaky and I coulda tried a rerun but changing this to not rely on a setTimeout seems like a quick cleanup win. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cleaning up flaky tests is always good in my book! 👍 |
||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I brought in bluebird because our current test just did
class P extends Promise
and I needed something that wouldn't extend the native promise.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM, I think it's a good idea to test bluebird anyway, since it's the most likely alternative promise library people would use.