istanbuljs / nyc

the Istanbul command line interface
https://istanbul.js.org/
ISC License
5.62k stars 360 forks source link

Markdown reporter #1549

Open ianchanning opened 9 months ago

ianchanning commented 9 months ago

Is there an explicit markdown reporter? The text reporter is close, but has an intial row that doesn't get included in the table and it is missing the outside | and so doesn't quite work if you output the text in a Github PR comment.

Link to bug demonstration repository

N/A

Expected Behavior

| File                      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s              |
| ------------------------- | ------- | -------- | ------- | ------- | ------------------------------ |
| All files                 |    62.6 |    29.06 |      66 |   61.91 |                                |

GitHub output:

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 62.6 29.06 66 61.91

Observed Behavior

--------------------------|---------|----------|---------|---------|--------------------------------
File                      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s              
--------------------------|---------|----------|---------|---------|--------------------------------
All files                 |    62.6 |    29.06 |      66 |   61.91 |                                

GitHub output:

-------------------------- --------- ---------- --------- --------- -------------------------------- File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 62.6 29.06 66 61.91

Troubleshooting steps

The main proble is the initinal row. Even though the rest of the table isn't a strictly formatted table, it does get formatted.

Environment Information

N/A
BboyAkers commented 6 months ago

Hmmm I'll take a crack at this! 🙂