1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 04:52:26 -05:00

[ci] Ensure correct tests

This commit is contained in:
Leo Lamprecht 2024-10-11 15:17:53 +02:00
parent 21e4cbc4cd
commit 630d5e63fe

View file

@ -894,11 +894,13 @@ async fn test_watch_basic() {
bar_test.write("import bar from './bar.js'; Deno.test('bar', bar);");
assert_eq!(next_line(&mut stdout_lines).await.unwrap(), "");
next_line(&mut stdout_lines).await;
assert_contains!(
next_line(&mut stdout_lines).await.unwrap(),
"running 1 test"
);
assert_contains!(next_line(&mut stdout_lines).await.unwrap(), "foo", "bar");
next_line(&mut stdout_lines).await;
assert_contains!(
next_line(&mut stdout_lines).await.unwrap(),
"running 1 test"
@ -913,6 +915,7 @@ async fn test_watch_basic() {
foo_test.write("import foo from './foo.js'; Deno.test('foobar', foo);");
assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "Restarting");
next_line(&mut stdout_lines).await;
assert_contains!(
next_line(&mut stdout_lines).await.unwrap(),
"running 1 test"
@ -927,6 +930,7 @@ async fn test_watch_basic() {
let another_test = t.path().join("new_test.js");
another_test.write("Deno.test('another one', () => 3 + 3)");
assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "Restarting");
next_line(&mut stdout_lines).await;
assert_contains!(
next_line(&mut stdout_lines).await.unwrap(),
"running 1 test"
@ -972,6 +976,7 @@ async fn test_watch_basic() {
// Then restore the file
another_test.write("Deno.test('another one', () => 3 + 3)");
assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "Restarting");
next_line(&mut stdout_lines).await;
assert_contains!(
next_line(&mut stdout_lines).await.unwrap(),
"running 1 test"
@ -987,6 +992,7 @@ async fn test_watch_basic() {
foo_file
.write("export default function foo() { throw new Error('Whoops!'); }");
assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "Restarting");
next_line(&mut stdout_lines).await;
assert_contains!(
next_line(&mut stdout_lines).await.unwrap(),
"running 1 test"
@ -999,6 +1005,7 @@ async fn test_watch_basic() {
// Then restore the file
foo_file.write("export default function foo() { 1 + 1 }");
assert_contains!(next_line(&mut stderr_lines).await.unwrap(), "Restarting");
next_line(&mut stdout_lines).await;
assert_contains!(
next_line(&mut stdout_lines).await.unwrap(),
"running 1 test"