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

Make DENO_COVERAGE_DIR public #11560

Open
Tracked by #12826
caspervonb opened this issue Jul 31, 2021 · 3 comments
Open
Tracked by #12826

Make DENO_COVERAGE_DIR public #11560

caspervonb opened this issue Jul 31, 2021 · 3 comments
Labels
suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage

Comments

@caspervonb
Copy link
Contributor

caspervonb commented Jul 31, 2021

The DENO_UNSTABLE_COVERAGE_DIR is the environment variable that actually controls if coverage collection takes place or not. It has a terrible name and is not documented anywhere as it is not considered public at the moment.

Using an environment variable is the most common way to determine if coverage should be collected and where it should be collected too.

This implies that we remove deno test --coverage which was kept for backwards compatibility in 1.x.
The removal of the coverage flag would probably have to be a 2.0 change.

Usage would be:

export DENO_COVERAGE_DIR="some/path"
deno run ...
deno test ...
deno test ...
deno coverage --lcov > cov.lcov
@bartlomieju
Copy link
Member

What are use cases for making this env var public?

@kitsonk kitsonk added suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage labels Aug 7, 2021
@lowlighter
Copy link
Contributor

It could be useful for apps that spawns external v8 instances to know whether coverage should be collected or not.

I'm mostly thinking about astral (lino-levan/astral#13) where some functions may be evaluated in a browser context.

Not sure if duplicated references are properly now handled (it uses to only treat first occurrence), but if it is, it'd may allow unified coverage which would be really nice

@bartlomieju
Copy link
Member

I'm fine making this env var public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage
Projects
None yet
Development

No branches or pull requests

4 participants