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

fix testEnumerables on ObjectWrap #736

Closed

Conversation

fholzer
Copy link
Contributor

@fholzer fholzer commented May 24, 2020

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."

@fholzer
Copy link
Contributor Author

fholzer commented May 25, 2020

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"));
Copy link
Member

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?

Copy link
Contributor Author

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...

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

mhdawson pushed a commit that referenced this pull request Jun 9, 2020
PR-URL: #736
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@mhdawson
Copy link
Member

mhdawson commented Jun 9, 2020

@fholzer thanks!. Landed as d463f02

@mhdawson mhdawson closed this Jun 9, 2020
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request Aug 24, 2022
PR-URL: nodejs/node-addon-api#736
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this pull request Aug 26, 2022
PR-URL: nodejs/node-addon-api#736
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this pull request Sep 19, 2022
PR-URL: nodejs/node-addon-api#736
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request Aug 11, 2023
PR-URL: nodejs/node-addon-api#736
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
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