Skip to content

Commit

Permalink
Refine LINE_WITH_TIME_RE
Browse files Browse the repository at this point in the history
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:

- NomicFoundation/hardhat#4307
- NomicFoundation/hardhat#4314
  • Loading branch information
smoelius committed Nov 30, 2024
1 parent 6bbfc08 commit dfd89b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backends/src/ts/mocha/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Default for ItMessageState {
static LINE_WITH_TIME_RE: Lazy<Regex> = 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<Regex> = Lazy::new(|| {
Expand Down

0 comments on commit dfd89b9

Please # to comment.