c8 icon indicating copy to clipboard operation
c8 copied to clipboard

Invalid coverage with `--experimental-monocart` when using `ts-node`

Open AriPerkkio opened this issue 8 months ago • 6 comments

All metrics of coverage report are incorrectly set to 100% when using --experimental-monocart with ts-node.

Repro, make sure you download the project locally as WebContainers do not support V8 coverage/CDP: https://stackblitz.com/~/edit/c8-ts-node-invalid-monocart

$ pnpm test

------------|---------|----------|---------|---------|-------------------
File        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
------------|---------|----------|---------|---------|-------------------
All files   |   76.47 |       25 |     100 |   76.47 |                   
 example.ts |   76.47 |       25 |     100 |   76.47 | 3-4,13-14         
------------|---------|----------|---------|---------|-------------------

$ pnpm test:monocart

------------|---------|----------|---------|---------|-------------------
File        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
------------|---------|----------|---------|---------|-------------------
All files   |     100 |      100 |     100 |     100 |                   
 example.ts |     100 |      100 |     100 |     100 |                   
------------|---------|----------|---------|---------|-------------------

AriPerkkio avatar May 21 '25 08:05 AriPerkkio