mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
fix: running subcommand with coverage collection (#10802)
This commit is contained in:
parent
76d343002e
commit
ea2c7ac556
1 changed files with 6 additions and 4 deletions
10
cli/main.rs
10
cli/main.rs
|
@ -896,8 +896,9 @@ async fn run_command(flags: Flags, script: String) -> Result<(), AnyError> {
|
||||||
let coverage_dir = PathBuf::from(coverage_dir);
|
let coverage_dir = PathBuf::from(coverage_dir);
|
||||||
let mut coverage_collector =
|
let mut coverage_collector =
|
||||||
tools::coverage::CoverageCollector::new(coverage_dir, session);
|
tools::coverage::CoverageCollector::new(coverage_dir, session);
|
||||||
coverage_collector.start_collecting().await?;
|
worker
|
||||||
|
.with_event_loop(coverage_collector.start_collecting().boxed_local())
|
||||||
|
.await?;
|
||||||
Some(coverage_collector)
|
Some(coverage_collector)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
@ -912,9 +913,10 @@ async fn run_command(flags: Flags, script: String) -> Result<(), AnyError> {
|
||||||
worker.execute("window.dispatchEvent(new Event('unload'))")?;
|
worker.execute("window.dispatchEvent(new Event('unload'))")?;
|
||||||
|
|
||||||
if let Some(coverage_collector) = maybe_coverage_collector.as_mut() {
|
if let Some(coverage_collector) = maybe_coverage_collector.as_mut() {
|
||||||
coverage_collector.stop_collecting().await?;
|
worker
|
||||||
|
.with_event_loop(coverage_collector.stop_collecting().boxed_local())
|
||||||
|
.await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue