Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support no-capture behavior in wasm-bindgen-test #3800

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs
Expand Up @@ -145,10 +145,15 @@ pub fn run(server: &SocketAddr, shell: &Shell, timeout: u64) -> Result<(), Error
shell.status("Waiting for test to finish...");
let start = Instant::now();
let max = Duration::new(timeout, 0);
let mut last_logs = String::new();
while start.elapsed() < max {
if client.text(&id, &output)?.contains("test result: ") {
break;
}
let all_logs = client.text(&id, &logs)?;
let new_logs = all_logs.strip_prefix(&last_logs).expect("console.log div reduced in size");
print!("{new_logs}");
last_logs = all_logs;
thread::sleep(Duration::from_millis(100));
}
shell.clear();
Expand Down