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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions test/objectwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,15 @@ const test = (binding) => {
keys.push(key);
}

assert(keys.length = 4);
assert(obj.testGetSet);
assert(obj.testGetter);
assert(obj.testValue);
assert(obj.testMethod);
assert(keys.length == 6);
// on prototype
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

// on object only
assert(keys.includes("ownProperty"));
assert(keys.includes("ownPropertyT"));
}
};

Expand Down