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

Coverage docs #2382

Closed
Toxicable opened this issue Jan 5, 2021 · 4 comments
Closed

Coverage docs #2382

Toxicable opened this issue Jan 5, 2021 · 4 comments
Labels
Can Close? We will close this in 30 days if there is no further activity enhancement

Comments

@Toxicable
Copy link

So we need some docs for coverage.
For now I'll update this issue as the docs, once I've finalized it I'll add a MR to into the docs site.

Config

.bazelrc

# When running `bazel coverage` --instrument_test_targets needs to be set in order to
# collect coverage information from test targets
coverage --instrument_test_targets

WORKSPACE
If you use included_files then ensure that .wasm is added
If you don't use included_files then this isn't needed

yarn_install(
  ...
  included_files = [ ".wasm" ] 

Targets
Any target that you'd like to enable coverage for needs to add "@npm//c8" as a dep.

jasmine_node_test(
  ...
  deps = [ "@npm//c8" ]

Tracking issues

Development

Basic run
Run yarn bazel coverage --combined_report=lcov --experimental_convenience_symlinks=normal :target
The combined lcov report will be in bazel-out/_coverage/_coverage_report.dat

Tracking issues

CI

@herman-rogers
Copy link

Does this rule work with karma_web_test_suite? As in can I run bazelisk coverage for karma rules and have it output correct coverage?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

@github-actions github-actions bot added the Can Close? We will close this in 30 days if there is no further activity label Apr 23, 2021
@github-actions
Copy link

github-actions bot commented May 7, 2021

This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?"

@github-actions github-actions bot closed this as completed May 7, 2021
@farcaller
Copy link

It doesn't seem to work with e.g. jest (based on the jest example) – there's no coverage data generated after the run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can Close? We will close this in 30 days if there is no further activity enhancement
Projects
None yet
Development

No branches or pull requests

4 participants