-
Notifications
You must be signed in to change notification settings - Fork 459
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 testEnumerables on ObjectWrap #736
Conversation
Also since the key length assertion was broken, no one noticed that the key length actually changed because addition instance properties were added. (in e8935bd) |
assert(keys.includes("testGetSet")); | ||
assert(keys.includes("testGetter")); | ||
assert(keys.includes("testValue")); | ||
assert(keys.includes("testMethod")); |
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.
Since there are now 6, there should likely be an assert for the 2 additional methods right?
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.
From what I see, tests for those were added in the same commit the properties were added. See e8935bd#diff-ec20a47eb5374e448ec0794a5fb6ac6eR100
Though maybe I'm missing something...
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 just though that if it validates that the number is 6, then it would be followed by 6 asserts as to what those are. It's not clear to without taking more time to check that that the earlier
assert(Object.keys(obj).length === 2);
assert(Object.keys(obj).includes('ownProperty'));
assert(Object.keys(obj).indexOf('ownPropertyT') >= 0);
covers that and if it it does it may may sense to still have the additional checks so that if the length is 6 we follow it with 6 checks.
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 added the check in 2405844
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
PR-URL: #736 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: nodejs/node-addon-api#736 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: nodejs/node-addon-api#736 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: nodejs/node-addon-api#736 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: nodejs/node-addon-api#736 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
The assertion on key length is broken. It's an assignment instead of a bool expression.
Also changes the tests for properties to the same style as the tests for "own properties."