privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
https://tsx.is
MIT License
9.42k stars 144 forks source link

All first lines uncovered when using `c8` with `tsx --test` #564

Open rozzilla opened 4 months ago

rozzilla commented 4 months ago

Acknowledgements

Minimal reproduction URL

https://github.com/rozzilla/c8-tsx-coverage-issue

Problem & expected behavior (under 200 words)

As you can see from the repro, even though I have a test covering the whole file, the coverage result return the 1st line as uncovered

Bugs are expected to be fixed by those affected by it

Compensating engineering work financially will speed up resolution

privatenumber commented 3 months ago

tsx is just using the Node APIs so I'm not sure if this is a bug in tsx or if there's even anything we can do on our end.

This may be related: https://github.com/nodejs/node/pull/53315

rozzilla commented 3 months ago

To better explain the issue, this doesn't happen with nyc

Il Gio 6 Giu 2024, 08:49 Hiroki Osame @.***> ha scritto:

tsx is just using the Node APIs so I'm not sure if this is a bug in tsx or if there's even anything we can do on our end.

This may be fixed by: nodejs/node#53315 https://github.com/nodejs/node/pull/53315

— Reply to this email directly, view it on GitHub https://github.com/privatenumber/tsx/issues/564#issuecomment-2151531823, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6PVA775WISR2WJHCGOYP3ZGAA7VAVCNFSM6AAAAABIQOEAMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJRGUZTCOBSGM . You are receiving this because you authored the thread.Message ID: @.***>

privatenumber commented 3 months ago

Not sure if I understand how that better explains the issue...

If you want to get to the bottom of this, I recommend inlining the sourcemap as a minimal reproduction and filing an issue with Node.

rozzilla commented 3 months ago

I also found another issue. If I run the coverage with nyc on the latest tsx version (so 4.15.6) I get no coverage. If I downgrade tsx to 4.7.2 I get the coverage. 🤔 Do you know @privatenumber what changed meanwhile that is causing this regression?


From @privatenumber: This is a bug tracker. Please file unrelated bugs its in own issue. I'm going to hide this because it's not relevant to what you're reporting above.

privatenumber commented 3 months ago

Locking as this seems blocked by Node. Feel free to open an issue there if it doesn't exist yet.