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
fix(cli/test): fix clear screen behavior when run deno test --watch
#19888
fix(cli/test): fix clear screen behavior when run deno test --watch
#19888
Conversation
Thanks for the PR @liruifengv, could you update some of unit tests in |
I'd be happy to update the unit tests, but could you give a little more hints, I've just changed an incorrect bool value being passed, and I'm not quite sure how to update the unit tests. |
There's |
I don't think this test needs updating, it's correct |
If that test was correct then why the behavior reported in the issue wasn't? |
This incorrect behavior is that the screen is not cleared when the This is because we passed the opposite value to the file_watcher::watch_func(
flags,
file_watcher::PrintConfig {
job_name: "Test".to_string(),
clear_screen: !test_flags
.watch
.as_ref()
.map(|w| !w.no_clear_screen)
.unwrap_or(true),
},
...
)
.await?; So much so that The value of |
Oh, got it, sorry for the confusion. In such case - maybe we could adjust the integration tests in |
I think so. But I found this pr #17129 which does not clear screen in non-TTY environments. see also |
I can also write the test code: let line = next_line(&mut stderr_lines).await.unwrap();
assert_not_contains!(&line, CLEAR_SCREEN);
assert_contains!(&line, "Restarting"); But I don't think it's meaningful because it always not_contains in non-TTY environments. |
Okay, let's land it as is. |
fix #19725