-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] #98
Comments
在无法确定真实执行文件的目录情况下 |
编译过的文件,如果有sourcemap会自动剔除 ,除非设置了logging=debug就会保留 |
最好是有些特征用来过滤,比如特定的文件夹或文件名 |
或许可以通过文件内容过滤,比如 entryFilter: (entry) => {
// skip files without sourcemap
if (entry.source?.includes("sourceMappingURL") === false) {
return false;
}
...
} |
我看了一下,nodejs v8 注入环境变量NODE_V8_COVERAGE 生成的覆盖率文件中包含source-map-cache, Profiler.takePreciseCoverage() 生成的覆盖率文件经过monocart-coverage-reports 分析之后展示的是相对路径, 所以上面看到有/opt/nodeapp/src 和src 两个目录 |
Nodejs确实会提供source-map-cache,这样可以从source-map-cache里读取对应文件的sourcemap 所以提供的路径可能就不一致,如果要统一路径,可以试试参数sourcePath const coverageOptions = {
sourcePath: (filePath) => {
// Remove the virtual prefix
const list = ['my-dist-file1/', 'my-dist-file2/'];
for (const str of list) {
if (filePath.startsWith(str)) {
return filePath.slice(str.length);
}
}
return filePath;
}
}; 我其实并没有看懂你具体是个啥问题,但只能尽可能的解释或者帮你找下你提到的一些信息 |
又帮到了我,谢谢 |
想问下,在sourceMap 映射源文件之后,可以通过配置使覆盖率报告中剔除编译后(运行时)的文件吗
The text was updated successfully, but these errors were encountered: