2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-07-26 20:16:12 -04:00
|
|
|
|
|
|
|
use super::*;
|
|
|
|
|
2023-08-02 12:38:10 -04:00
|
|
|
mod common;
|
2023-07-26 20:16:12 -04:00
|
|
|
mod compound;
|
2023-08-02 12:38:10 -04:00
|
|
|
mod dot;
|
2023-07-26 20:16:12 -04:00
|
|
|
mod junit;
|
|
|
|
mod pretty;
|
2023-08-25 19:19:23 -04:00
|
|
|
mod tap;
|
2023-07-26 20:16:12 -04:00
|
|
|
|
|
|
|
pub use compound::CompoundTestReporter;
|
2023-08-02 12:38:10 -04:00
|
|
|
pub use dot::DotTestReporter;
|
2023-07-26 20:16:12 -04:00
|
|
|
pub use junit::JunitTestReporter;
|
|
|
|
pub use pretty::PrettyTestReporter;
|
2023-08-25 19:19:23 -04:00
|
|
|
pub use tap::TapTestReporter;
|
2023-07-26 20:16:12 -04:00
|
|
|
|
|
|
|
pub trait TestReporter {
|
|
|
|
fn report_register(&mut self, description: &TestDescription);
|
|
|
|
fn report_plan(&mut self, plan: &TestPlan);
|
|
|
|
fn report_wait(&mut self, description: &TestDescription);
|
2024-05-22 10:08:27 -04:00
|
|
|
fn report_slow(&mut self, description: &TestDescription, elapsed: u64);
|
2023-07-26 20:16:12 -04:00
|
|
|
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>,
|
|
|
|
);
|
2024-02-28 17:12:21 -05:00
|
|
|
fn report_completed(&mut self);
|
2023-07-26 20:16:12 -04:00
|
|
|
fn flush_report(
|
|
|
|
&mut self,
|
|
|
|
elapsed: &Duration,
|
|
|
|
tests: &IndexMap<usize, TestDescription>,
|
|
|
|
test_steps: &IndexMap<usize, TestStepDescription>,
|
|
|
|
) -> anyhow::Result<()>;
|
|
|
|
}
|