Tape: Collect test coverage for reports

Created on 25 Apr 2020  路  8Comments  路  Source: substack/tape

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.

Most helpful comment

@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: https://github.com/istanbuljs/nyc/issues/1281#issuecomment-630333743

All 8 comments

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?

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

@ljharb Alright.
It seems is a regressen in nyc.
https://github.com/istanbuljs/nyc/issues/1281

I will check.

@AndyOGo try tape with v4, compared to v5?

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:

https://github.com/istanbuljs/nyc/issues/1281#issuecomment-630273102

Per https://github.com/istanbuljs/nyc/issues/1281#issuecomment-630333743, seems like it was an issue with your machine and nyc, and not tape?

@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: https://github.com/istanbuljs/nyc/issues/1281#issuecomment-630333743

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timbuckley picture timbuckley  路  5Comments

kl0tl picture kl0tl  路  7Comments

mustafamamun picture mustafamamun  路  3Comments

callumlocke picture callumlocke  路  4Comments

frankandrobot picture frankandrobot  路  4Comments