From f71829f9d7211a71d29af66b7f53369e2fd234c8 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Fri, 11 Oct 2024 14:47:36 +0200 Subject: [PATCH 1/5] Added empty line between test modules --- cli/tools/test/reporters/pretty.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/tools/test/reporters/pretty.rs b/cli/tools/test/reporters/pretty.rs index 4120bbfb54..b03945e405 100644 --- a/cli/tools/test/reporters/pretty.rs +++ b/cli/tools/test/reporters/pretty.rs @@ -181,7 +181,7 @@ impl TestReporter for PrettyTestReporter { let inflection = if plan.total == 1 { "test" } else { "tests" }; writeln!( &mut self.writer, - "{}", + "\n{}", colors::gray(format!( "running {} {} from {}", plan.total, From 21e4cbc4cd94b61a2203f62daf1bc952e1f0f3b5 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Fri, 11 Oct 2024 15:02:14 +0200 Subject: [PATCH 2/5] [ci] Run CI From 630d5e63fee273ad793fc7d9e9966e61fa417176 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Fri, 11 Oct 2024 15:17:53 +0200 Subject: [PATCH 3/5] [ci] Ensure correct tests --- tests/integration/watcher_tests.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index 122353bba9..5f236d7bda 100644 --- a/tests/integration/watcher_tests.rs +++ b/tests/integration/watcher_tests.rs @@ -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" From 8dc211d47cf04d88c4bf85856492427a2aa0cd5a Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Fri, 11 Oct 2024 15:32:26 +0200 Subject: [PATCH 4/5] Fixed test --- tests/integration/watcher_tests.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index 5f236d7bda..eccd0c4468 100644 --- a/tests/integration/watcher_tests.rs +++ b/tests/integration/watcher_tests.rs @@ -944,6 +944,7 @@ async fn test_watch_basic() { // Confirm that restarting occurs when a new file is updated another_test.write("Deno.test('another one', () => 3 + 3); Deno.test('another another one', () => 4 + 4)"); 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 2 tests" From 2668bdc380138e62bb404dd0bec173ccc88f1036 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Fri, 11 Oct 2024 15:35:23 +0200 Subject: [PATCH 5/5] [ci] Run CI