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

Add Object missing tests #923

Closed
wants to merge 10 commits into from
Closed

Conversation

JoseExposito
Copy link
Contributor

@JoseExposito JoseExposito commented Mar 6, 2021

Hi!

I submitted part of this changes to my mentee application. I don't think it was accepted (:sob:) but it doesn't matter, I think we can still merge them :wink:

This PR adds tests that were missing for the Napi::Object class. I splitted the changes in commits to make life easier for the code reviewer:

At this point, the only method in this table that is not being tested is Object(napi_env env, napi_value value). I didn't implement it because it basically calls Value(env, value) so I think it makes sense to implement it in basic_types/value, but let me know what you think.

Copy link
Member

@NickNaso NickNaso left a comment

Choose a reason for hiding this comment

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

@JoseExposito thanks for wirking on this. Just some comments for now.

test/object/object.cc Outdated Show resolved Hide resolved
test/object/subscript_operator.js Show resolved Hide resolved
@NickNaso
Copy link
Member

At this point, the only method in this table that is not being tested is Object(napi_env env, napi_value value). I didn't implement it because it basically calls Value(env, value) so I think it makes sense to implement it in basic_types/value, but let me know what you think.

In my opinion you should create a test for Napi::Object::Object(napi_env env, napi_value value) here and check if you are able to create a JavaScript object from another JavaScript object.

@JoseExposito
Copy link
Contributor Author

JoseExposito commented Mar 13, 2021

Hi @NickNaso

Thanks for you code review

In my opinion you should create a test for Napi::Object::Object(napi_env env, napi_value value) here and check if you are able to create a JavaScript object from another JavaScript object.

Added in 61a0c76

EDIT:

I'm seeing the same crash that was present in #928 here now:

All tests passed!
Tests aborted with SIGSEGV
Error: Process completed with exit code 1.

It looks like this problem is affecting other PRs, like #927 or #909. Maybe something is going on with the CI system?

Copy link
Member

@NickNaso NickNaso left a comment

Choose a reason for hiding this comment

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

LGTM.

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

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
Copy link
Member

mhdawson commented Mar 15, 2021

In terms of:

At this point, the only method in this table that is not being tested is Object(napi_env env, napi_value value). I didn't implement it because it basically calls Value(env, value) so I think it makes sense to implement it in basic_types/value, but let me know what you think.

I'd be ok with testing it in both as its a simple/quick test and it would mean that it would be clear we have full Object coverage.

mhdawson pushed a commit that referenced this pull request Mar 15, 2021
Test that Object::GetPropertyNames does not
return properties whose key is a Symbol

PR-URL: #923
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: NickNaso <nicoladelgobbo@gmail.com>
@mhdawson
Copy link
Member

Landed in 298ff8d. @JoseExposito thanks for the PR!

@mhdawson mhdawson closed this Mar 15, 2021
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request Aug 24, 2022
Test that Object::GetPropertyNames does not
return properties whose key is a Symbol

PR-URL: nodejs/node-addon-api#923
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: NickNaso <nicoladelgobbo@gmail.com>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this pull request Aug 26, 2022
Test that Object::GetPropertyNames does not
return properties whose key is a Symbol

PR-URL: nodejs/node-addon-api#923
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: NickNaso <nicoladelgobbo@gmail.com>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this pull request Sep 19, 2022
Test that Object::GetPropertyNames does not
return properties whose key is a Symbol

PR-URL: nodejs/node-addon-api#923
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: NickNaso <nicoladelgobbo@gmail.com>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request Aug 11, 2023
Test that Object::GetPropertyNames does not
return properties whose key is a Symbol

PR-URL: nodejs/node-addon-api#923
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: NickNaso <nicoladelgobbo@gmail.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.

3 participants