I am generating coverage reports using nyc in Node 16.
However, for some reason, the coverage report (both lcov and html) is messed up, because the paths to the source files are wrong. They follow the pattern:
<relative path>file:<absolute path><file name>
e.g. SF:src/rest/file:/home/<user>/code/<project>/src/rest/auth.ts in lcov.info
Consequently, my html coverage reports show errors like
Unable to lookup source: /home/<user>/code/<project>/src/rest/file:/home/<user>/code/<project>/src/rest/auth.ts (ENOENT: no such file or directory, open ...
for all files.
I found out, that the sourcemaps have paths starting with "file:///".
Also, in the "coverage" folder, there are obscure folders named "file:", which seem to resemble the absolute path with folders inside.
I can't figure out why this is, but I want the reports to use relative paths to my project directory.