-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
test(NODE-2856): Check that defaultTransactionOptions get used from session #2845
test(NODE-2856): Check that defaultTransactionOptions get used from session #2845
Conversation
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.
A few small requests, but overall LGTM! 👍
5d445e3
to
89dda16
Compare
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.
LGTM! 👍
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.
just a small suggested improvement on the assertion
session.startTransaction(); | ||
const result = ReadPreference.resolve(client, { session: session }); | ||
expect(result).to.exist; | ||
expect(result.mode).to.deep.equal('secondary'); |
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.
by the way, you can use the property
assertion to check the property and the value, instead of the combination of the exist and the equal checks, it usually gives a nicer message on failure, like so: expect(result).to.have.property('mode', 'secondary');
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.
LGTM :)
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.
LGTM!
Description
Test verifying that transactions get their
readPreference
fromSessionOptions
passed at session instantiationWhat changed?