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

Collect test coverage for reports #504

Closed
AndyOGo opened this issue Apr 25, 2020 · 8 comments
Closed

Collect test coverage for reports #504

AndyOGo opened this issue Apr 25, 2020 · 8 comments

Comments

@AndyOGo
Copy link

AndyOGo commented Apr 25, 2020

Hi,

I use this tool by using stylelint-test-rule-tape.

It works like a charm.
But now I want to create coverage reports with instanbul/nyc.
Unfortunately it won't detect all testet files 🤔

tap-nyc does not make a difference.

@ljharb
Copy link
Collaborator

ljharb commented Apr 25, 2020

I'm not sure what you're asking, but it seems like this is an nyc question (solveable with your .nycrc) and not a tape question?

@AndyOGo
Copy link
Author

AndyOGo commented Apr 25, 2020

Thank you for your quick response @ljharb

Okay, maybe I'm asking this in the wrong channel.

Anyway I used instanbul/nyc without any problems with mocha, jest, ava.
But with tape, it just does not detect covered code paths 😕
And I don't get why.

I have read that node-tap has build-in coverage support, here:
https://istanbul.js.org/docs/tutorials/tap/

But I wonder how tape is supposed to be used with nyc.
I also tried this, but it just does not see all covered paths...
https://github.com/MegaArman/tap-nyc#example-usage-with-tapejs-and-nyc

@AndyOGo
Copy link
Author

AndyOGo commented Apr 25, 2020

@ljharb Alright.
It seems is a regressen in nyc.
istanbuljs/nyc#1281

I will check.

@ljharb
Copy link
Collaborator

ljharb commented Apr 25, 2020

@AndyOGo try tape with v4, compared to v5?

@ljharb
Copy link
Collaborator

ljharb commented Apr 25, 2020

Closing, per istanbuljs/nyc#1281 (comment)

@ljharb ljharb closed this as completed Apr 25, 2020
@aral
Copy link

aral commented May 18, 2020

Just a quick update: I have a tiny reproducible test for this now. Quite possibly the issue is on the nyc side of things but basically nyc no longer works with either Tape 4.11.0 or 5.0.0:

istanbuljs/nyc#1281 (comment)

@ljharb
Copy link
Collaborator

ljharb commented May 18, 2020

Per istanbuljs/nyc#1281 (comment), seems like it was an issue with your machine and nyc, and not tape?

@aral
Copy link

aral commented May 18, 2020

@ljharb It was apparently even more niche than that :) It fails if the Node.js binary is granted permissions to bind to ports < 1024 on Linux via setcap. I documented it here: istanbuljs/nyc#1281 (comment)

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

3 participants