istanbuljs / nyc

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

Markdown reporter #1549

Open ianchanning opened 7 months ago

ianchanning commented 7 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 4 months ago

Hmmm I'll take a crack at this! 🙂