Skip to content
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

allow ejecting from coverage reporting in jest_config_template.mjs #294

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Aghassi
Copy link

@Aghassi Aghassi commented Sep 25, 2024

This addresses the ability to let users define their own coverage reporting logic in unique cases. For us, we use monocart-coverage-reporter. In doing so, we needed to write our own globalTeardown for jest that uses the split coverage logic, but also manipulates the dat files before they are passed to bazel

This addresses the ability to let users define their own coverage reporting logic in unique cases. For us, we use monocart-coverage-reporter. In doing so, we needed to write our own `globalTeardown` for jest that uses the split coverage logic, but also manipulates the dat files before they are passed to bazel
* also manipulating/massaging the `.dat` file before it gets
* passed to Bazel
*/
if (process.env.SKIP_SETTING_COVERAGE_DIR != "1") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SKIP_SETTING_COVERAGE_DIR is a custom env var that you set on your jest_test targets?

Perhaps we expose this as a config attribute such as automatic_coverage_reporting which default to True but can be opted out of if you roll your own in a globalTeardown?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because we source our jest_test from a macro that embeds that in env and then give everyone the same baseline jest.config that we provide which has globalTeardown set. I'm fine with a config attribute, but maybe scope it to be rules_jest_automatic_coverage_reporting so it's not so generic it could have other implications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants