Skip to content

Fix result.rowCount being a string instead of a number via native bindings. #734

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

Merged
merged 2 commits into from
Feb 22, 2015
Merged

Conversation

nstepien
Copy link
Contributor

Btw, once you drop support for node 0.8 you can drop the parseInt radix, as it should default to 10.

@@ -8,6 +8,7 @@ test('fires callback with results', function() {
client.query('SELECT 1 as num', assert.calls(function(err, result) {
assert.isNull(err);
assert.equal(result.rows[0].num, 1);
assert.equal(result.rowCount, 1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might want to use assert.strictEqual here - doing an assert.equals basically does "1" == 1 which is true. What do you think?

@brianc
Copy link
Owner

brianc commented Feb 22, 2015

Other than that one little thing, this looks great!

@nstepien
Copy link
Contributor Author

You're right, I missed strictEqual and thought equal was using the strict equality operator.

@brianc
Copy link
Owner

brianc commented Feb 22, 2015

No worries! This is fabulous now! Thank you so much!! 🙆‍♀️ 🙇

brianc added a commit that referenced this pull request Feb 22, 2015
Fix result.rowCount being a string instead of a number via native bindings.
@brianc brianc merged commit f8d5db9 into brianc:master Feb 22, 2015
@nstepien nstepien deleted the patch branch February 22, 2015 20:33
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

Successfully merging this pull request may close these issues.

2 participants