1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-01 16:51:13 -05:00
denoland-deno/cli/tools/test/reporters/mod.rs
Bartek Iwańczuk 806137bb96
refactor(cli/test): move reporters to a separate directory (#19957)
Just a small cleanup that will make #19804 easier.
2023-07-27 02:16:12 +02:00

53 lines
1.5 KiB
Rust

// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
use super::*;
mod compound;
mod junit;
mod pretty;
pub use compound::CompoundTestReporter;
pub use junit::JunitTestReporter;
pub use pretty::PrettyTestReporter;
pub trait TestReporter {
fn report_register(&mut self, description: &TestDescription);
fn report_plan(&mut self, plan: &TestPlan);
fn report_wait(&mut self, description: &TestDescription);
fn report_output(&mut self, output: &[u8]);
fn report_result(
&mut self,
description: &TestDescription,
result: &TestResult,
elapsed: u64,
);
fn report_uncaught_error(&mut self, origin: &str, error: Box<JsError>);
fn report_step_register(&mut self, description: &TestStepDescription);
fn report_step_wait(&mut self, description: &TestStepDescription);
fn report_step_result(
&mut self,
desc: &TestStepDescription,
result: &TestStepResult,
elapsed: u64,
tests: &IndexMap<usize, TestDescription>,
test_steps: &IndexMap<usize, TestStepDescription>,
);
fn report_summary(
&mut self,
elapsed: &Duration,
tests: &IndexMap<usize, TestDescription>,
test_steps: &IndexMap<usize, TestStepDescription>,
);
fn report_sigint(
&mut self,
tests_pending: &HashSet<usize>,
tests: &IndexMap<usize, TestDescription>,
test_steps: &IndexMap<usize, TestStepDescription>,
);
fn flush_report(
&mut self,
elapsed: &Duration,
tests: &IndexMap<usize, TestDescription>,
test_steps: &IndexMap<usize, TestStepDescription>,
) -> anyhow::Result<()>;
}