Skip to content

Generate coverage without deno test #23961

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

Closed
szmarczak opened this issue May 23, 2024 · 5 comments
Closed

Generate coverage without deno test #23961

szmarczak opened this issue May 23, 2024 · 5 comments
Labels
duplicate a duplicate of another issue 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
@kt3k
Copy link
Member

kt3k commented Apr 14, 2025

This issue seems the same as #16440. Let's track in there.

@kt3k kt3k closed this as completed Apr 14, 2025
@kt3k kt3k added the duplicate a duplicate of another issue label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate a duplicate of another issue 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