Skip to content

chore: add support node 16 #292

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

Merged
merged 6 commits into from
Oct 28, 2021

Conversation

RafaelGSS
Copy link
Contributor

Along with Node 16 support, this PR upgrades the node-tap version to solve: tapjs/tapjs#624 required in v16+.

Is worth mentioning the deprecation of async_wrap in v16+

test/cli-bubbleprof-visualize-only.test.js 2> (node:872069) [DEP0111] DeprecationWarning: Access to process.binding('async_wrap') is deprecated.

@simoneb
Copy link
Contributor

simoneb commented Oct 25, 2021

I'll get to this tomorrow. It's worth making sure (apart from seeing a green build) that this keeps working fine when trying to profile an app using Node < 16

Copy link
Contributor

@ShogunPanda ShogunPanda left a comment

Choose a reason for hiding this comment

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

Code LGTM to me.

Just one thing: instead of decreasing the code threshold, can you try to check coverage via c8 and see if it is a nyc/istanbul problem?

You can find an example of use of tap and c8 here: https://github.com/ShogunPanda/cronometro/blob/master/package.json

@RafaelGSS
Copy link
Contributor Author

Code LGTM to me.

Just one thing: instead of decreasing the code threshold, can you try to check coverage via c8 and see if it is a nyc/istanbul problem?

You can find an example of use of tap and c8 here: https://github.com/ShogunPanda/cronometro/blob/master/package.json

Actually, looks like it was never covered before:

Suites:   33 passed, 33 of 33 completed
Asserts:  244 passed, of 244
Time:     3m
--------------------|---------|----------|---------|---------|---------------------------------
File                | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--------------------|---------|----------|---------|---------|---------------------------------
All files           |   93.59 |     90.9 |   94.87 |   93.84 |
 node-clinic        |   93.08 |    90.72 |   93.93 |   93.37 |
  bin.js            |   93.08 |    90.72 |   93.93 |   93.37 | 343-345,354-363,376-377,397-398
 node-clinic/lib    |     100 |      100 |     100 |     100 |
  clean.js          |     100 |      100 |     100 |     100 |
  help-formatter.js |     100 |      100 |     100 |     100 |
--------------------|---------|----------|---------|---------|---------------------------------

The difference is because node-tap@15 enforces 100% code coverage by default. I'll try to cover those lines but looks like those statements are related to the spinner (provided by ora package) start/stop which is disabled in tests.

@ShogunPanda
Copy link
Contributor

I see. It makes sense.
Alternatively you can introduce an additional option (this is a technique to avoid stuff like proxyquire) to use a custom spinner and this way we can achieve 100%.

Copy link
Contributor

@simoneb simoneb left a comment

Choose a reason for hiding this comment

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

Oh well, this was almost too easy. LGTM 🚀

@simoneb
Copy link
Contributor

simoneb commented Oct 25, 2021

Please just tune the coverage as on Windows (possibly due to some platform conditional tests) coverage is below the thresholds

@RafaelGSS
Copy link
Contributor Author

Please just tune the coverage as on Windows (possibly due to some platform conditional tests) coverage is below the thresholds

Ok.

I'm trying to achieve the 100% of code coverage, otherwise, I'll adjust it based on the platform.

@RafaelGSS
Copy link
Contributor Author

Alternatively you can introduce an additional option (this is a technique to avoid stuff like proxyquire) to use a custom spinner and this way we can achieve 100%.

I ran some tests trying to achieve the 100% and it was a bit tricky and mainly not confident since we are mocking visual feedback that's not covered at all in the tests. So, I've updated some statements to ignore in Istanbul that makes more sense to me.

@RafaelGSS RafaelGSS requested a review from ShogunPanda October 26, 2021 14:00
Copy link
Contributor

@ShogunPanda ShogunPanda left a comment

Choose a reason for hiding this comment

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

LGTM!

@RafaelGSS RafaelGSS merged commit 87e8a21 into clinicjs:main Oct 28, 2021
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.

None yet

3 participants