From dfd89b981d9607833d6cca9e2b789044c5ff848e Mon Sep 17 00:00:00 2001 From: Samuel Moelius Date: Sat, 30 Nov 2024 14:27:16 -0500 Subject: [PATCH] Refine `LINE_WITH_TIME_RE` To allow Necessist to work with Mocha tests ending in `(`...`)`. This is a bandaid. A better approach would be to disable printing of times altogether. However, this appears to be an open issue for Hardhat: - https://github.com/NomicFoundation/hardhat/issues/4307 - https://github.com/NomicFoundation/hardhat/issues/4314 --- backends/src/ts/mocha/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/src/ts/mocha/mod.rs b/backends/src/ts/mocha/mod.rs index a067b98c..aac3906c 100644 --- a/backends/src/ts/mocha/mod.rs +++ b/backends/src/ts/mocha/mod.rs @@ -62,7 +62,7 @@ impl Default for ItMessageState { static LINE_WITH_TIME_RE: Lazy = Lazy::new(|| { // smoelius: The initial `.` is the check mark. #[allow(clippy::unwrap_used)] - Regex::new(r"^\s*. (.*) \(.*\)$").unwrap() + Regex::new(r"^\s*. (.*) \([0-9]+ms\)$").unwrap() }); static LINE_WITHOUT_TIME_RE: Lazy = Lazy::new(|| {