Skip to content

Commit 4cf571d

Browse files
committed
fix test
1 parent eddd17d commit 4cf571d

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ http.workspace = true
4646
http-body-util.workspace = true
4747
hyper.workspace = true
4848
hyper-util.workspace = true
49+
lazy-regex.workspace = true
4950
ntest_timeout.workspace = true
5051
once_cell.workspace = true
5152
os_pipe.workspace = true

tests/integration/watcher_tests.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,10 +1144,8 @@ async fn test_watch_doc() {
11441144
"#,
11451145
);
11461146

1147-
assert_eq!(
1148-
skip_restarting_line(&mut stderr_lines).await,
1149-
format!("Check {foo_file_url}$3-6.ts")
1150-
);
1147+
let file_regex = lazy_regex::lazy_regex!(r"Check [^\n]*foo\.ts\$3-6\.ts");
1148+
assert!(file_regex.is_match(&skip_restarting_line(&mut stderr_lines).await),);
11511149
assert_eq!(
11521150
next_line(&mut stderr_lines).await.unwrap(),
11531151
"TS2322 [ERROR]: Type 'number' is not assignable to type 'string'."
@@ -1214,10 +1212,9 @@ async fn test_watch_doc() {
12141212
);
12151213

12161214
wait_contains("running 1 test from", &mut stdout_lines).await;
1217-
assert_contains!(
1218-
next_line(&mut stdout_lines).await.unwrap(),
1219-
&format!("{foo_file_url}$3-8.ts ... ok")
1220-
);
1215+
1216+
let file_regex = lazy_regex::lazy_regex!(r"[^\n]*foo\.ts\$3-8\.ts");
1217+
assert!(file_regex.is_match(&next_line(&mut stdout_lines).await.unwrap()));
12211218
wait_contains("ok | 1 passed | 0 failed", &mut stdout_lines).await;
12221219

12231220
wait_contains("Test finished", &mut stderr_lines).await;

0 commit comments

Comments
 (0)