-
Notifications
You must be signed in to change notification settings - Fork 91
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
Cannot get coverage report if c8 is running in a sub-directory & src is one level up. #527
Comments
I have the same issue: #498 |
For |
Yes. Actually, c8 doesn't consider the location of the configuration file as the base path to resolve the sources to cover. This makes declaring the sources there useless except when executing c8 from the same directory as the one where the configuration file is located. There are some other issues too that prevent c8 from working properly outside of the "root" directory: include and exclude are also not relative to the configuration file location, and they basically contradict the |
@ericmorand You can try mcr CLI // mcr.config.js
export default {
name: 'My Coverage Report',
reports: [
'v8',
'console-details'
],
outputDir: './coverage-reports',
entryFilter: {
'**/node_modules/**': false,
'**/src/**': true
},
sourceFilter: {
'**/src/**': true
}
};
|
@timganter Can you try with --allowExternal on the cmd. It would work. |
@cenfun thank you..I think you got it right by having both a source and an entry filter approach. Can you elaborate a bit on Typically:
Since we have to execute a command (i.e. interpreting an entry point with node like doing |
@ericmorand Both can generate coverage reports from raw v8 coverage data. |
I opened an issue in your repository to move the conversation there: cenfun/monocart-coverage-reports#22 |
@skullpsg sorry, no 🎲 . You can try it out on my repo here: https://github.com/timganter/c8-sub-directory?tab=readme-ov-file#steps-to-reproduce |
Hello! When I have c8 running from a sub-directory, I can't seem to get it to report coverage for src code that is one level up from where c8 is running.
video.mov
The text was updated successfully, but these errors were encountered: