Skip to content

Invalid coverage with --experimental-monocart when using ts-node #561

@AriPerkkio

Description

@AriPerkkio

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 |                   
------------|---------|----------|---------|---------|-------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions