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

Unit test coverage #102

Closed
jasongin opened this issue Feb 13, 2017 · 3 comments
Closed

Unit test coverage #102

jasongin opened this issue Feb 13, 2017 · 3 comments

Comments

@jasongin
Copy link
Member

We need better unit test coverage of NAPI APIs.

Currently our test coverage consists of the test cases under test/addons-abi, which while better than nothing are far from exhaustive. They don't test error conditions at all, and several APIs are completely uncovered. We need to either expand these test cases or build some new test infrastructure. A problem with the way the current tests work is there isn't any way to assert in the C code -- all assertions are in the JavaScript code.

And then, it would be really nice to get code coverage to measure how much of the NAPI implementation code is being covered by the tests.

@mhdawson
Copy link
Member

Unless we can do something easy, I'd be voting that we expand test/addons-abi. Its already run by #103 which we should be running from now on.

@mhdawson
Copy link
Member

You can now look at the code coverage here: https://coverage.nodejs.org, just drill down to the specific files for n-api.

@mhdawson
Copy link
Member

The coverage in https://coverage.nodejs.org shows as

97% for js_native_api_v8.cc and js_native_api_v8.h.

We also have efforts with lots of open test issues in node-addon-api as well as this issue to puruse fuller cover there: #431

I think we can close this. Closing please let us know if you think that was not the right thing to do.

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

No branches or pull requests

2 participants