summaryrefslogtreecommitdiff
path: root/cli/tools/test_runner.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/test_runner.rs')
-rw-r--r--cli/tools/test_runner.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/cli/tools/test_runner.rs b/cli/tools/test_runner.rs
index 432935aef..733a3edd5 100644
--- a/cli/tools/test_runner.rs
+++ b/cli/tools/test_runner.rs
@@ -340,7 +340,7 @@ pub async fn run_tests(
doc_modules: Vec<ModuleSpecifier>,
test_modules: Vec<ModuleSpecifier>,
no_run: bool,
- fail_fast: bool,
+ fail_fast: Option<usize>,
quiet: bool,
allow_none: bool,
filter: Option<String>,
@@ -515,6 +515,7 @@ pub async fn run_tests(
let mut has_error = false;
let mut planned = 0;
let mut reported = 0;
+ let mut failed = 0;
for event in receiver.iter() {
match event.message.clone() {
@@ -538,6 +539,7 @@ pub async fn run_tests(
if let TestResult::Failed(_) = result {
has_error = true;
+ failed += 1;
}
}
_ => {}
@@ -545,8 +547,10 @@ pub async fn run_tests(
reporter.visit_event(event);
- if has_error && fail_fast {
- break;
+ if let Some(x) = fail_fast {
+ if failed >= x {
+ break;
+ }
}
}