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

Generate coverage without deno test #23961

Open
szmarczak opened this issue May 23, 2024 · 4 comments
Open

Generate coverage without deno test #23961

szmarczak opened this issue May 23, 2024 · 4 comments
Labels
suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage

Comments

@szmarczak
Copy link

Is it possible to generate coverage without deno test but with deno run? This would enable generating coverages for custom test runners.

@szmarczak szmarczak changed the title Generate coverage without running tests Generate coverage without deno test May 23, 2024
@szmarczak
Copy link
Author

@bartlomieju
Copy link
Member

DENO_UNSTABLE_COVERAGE_DIR is the way to go here, though as the name suggests it's not stabilized, but we haven't changed the behavior of this env var in a couple years.

@szmarczak
Copy link
Author

Doesn't it require to be ran via deno test?

deno/cli/args/mod.rs

Lines 1463 to 1472 in 0a30897

pub fn coverage_dir(&self) -> Option<String> {
match &self.flags.subcommand {
DenoSubcommand::Test(test) => test
.coverage_dir
.as_ref()
.map(ToOwned::to_owned)
.or_else(|| env::var("DENO_UNSTABLE_COVERAGE_DIR").ok()),
_ => None,
}
}

@bartlomieju
Copy link
Member

Ah good point, I missed that. Then appears it's not possible at the moment, but seems like a reasonable feature. PRs are welcome.

@dsherret dsherret added suggestion suggestions for new features (yet to be agreed) testing related to deno test and coverage labels May 24, 2024
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

3 participants