microsoft / microsoft/TypeScript

tsgo producing source maps that cause functions to appear uncovered in tests

Ouverte
#63,185 2 commentaires 1 réaction 1 personne assignée Voir sur GitHub

@weswigham y travaille déjà.

Depuis le 24/2/2026.

Bug Domain: Source Maps Needs Human Review Needs More Info
Langage dominant
Go
Étoiles
111k
Forks
14.3k
Merge moyen
2 j 4 h
PR mergées (30 j)
132

Description

### 🔎 Search Terms

tsgo
sourcemaps
code coverage

### 🕗 Version & Regression Information

- This changed between versions 5.9.3 and tsgo 7.0.0-dev.20260219.1

### ⏯ Playground Link

_No response_

### 💻 Code

I'm not sure how best to describe what's going on, as I haven't been able to pin down exactly what causes it.

Way too much stuff to put in a text box. [This tarball file](https://izs.me/tsgo-sourcemap-coverage-oddity.tgz) contains the following folders:

- `coverage-report` An HTML report of the test run with a build done by `tsgo`. Note that some functions are claiming to have not been called, but this is impossible, since the function body lines are all covered. 🤔
- `dist-tsc` The dist folder as built by `tsc` (Version 5.9.3)
- `dist-tsgo` The dist folder as built by `tsgo` (Version 7.0.0-dev.20260219.1)
- `tsconfig.json`, `.tshy` the tsconfig files in use
- And some other stuff as well relating to the test run, `test-results`, `processinfo`, `coverage-json`, etc.

The only thing that jumps out at me in diffing the dist folders is that it appears that tsgo sometimes includes the inline sources in the source maps, which is unexpected, since I didn't specify that in the config, and it seems inconsistent.

Let me know if there's anything else I can provide to help uncover what's going on here :)

### 🙁 Actual behavior

Source maps produced by tsgo do not result in accurately reporting code coverage.

### 🙂 Expected behavior

Code coverage should be accurate.

### Additional information about the issue

https://izs.me/tsgo-sourcemap-coverage-oddity.tgz has all the extra information I could think to provide.

This was on the [node-glob](https://github.com/isaacs/node-glob) project, if you want to run it yourself. Just add `"compiler": "tsgo",` in the `tshy` config in `package.json` to generate it with tsgo.

Feel free to ping me on the TypeScript discord with any questions or comments. Happy to help however I can, the faster builds are great, very exciting to see!

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.