-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add test coverage reporting #3834
Add test coverage reporting #3834
Conversation
tasks/test/mocha-chrome.js
Outdated
} else { | ||
if (coverage) { | ||
await fs.mkdir('./.nyc_output/', { recursive: true }); | ||
await fs.writeFile( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any errors in these will not be caught properly and might be problematic - I would probably consider doing something like
const { stats, coverage } = await new Promise(resolve => eventHandler1.on('mocha:end', resolve));
if (stats.failures) {
throw new Error(stats);
}
if (coverage) {
await fs.mkdir('./.nyc_output/', { recursive: true });
await fs.writeFile(
'./.nyc_output/out.json',
JSON.stringify(coverage)
);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this look now? i tried the above but had some issues so i tried to find something between that and the current structure.
closes #3385
coverage/index.html