1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

test: re-enable test watch tests and mark as flaky (#11669)

This commit is contained in:
Casper Beyer 2021-08-18 21:35:24 +08:00 committed by GitHub
parent a66218d457
commit 71e558c71c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use flaky_test::flaky_test;
use std::io::BufRead; use std::io::BufRead;
use tempfile::TempDir; use tempfile::TempDir;
use test_util as util; use test_util as util;
@ -427,9 +428,7 @@ fn run_watch_with_import_map_and_relative_paths() {
temp_directory.close().unwrap(); temp_directory.close().unwrap();
} }
// TODO(bartlomieju): flaky (https://github.com/denoland/deno/issues/10552) #[flaky_test]
#[ignore]
#[test]
fn test_watch() { fn test_watch() {
macro_rules! assert_contains { macro_rules! assert_contains {
($string:expr, $($test:expr),+) => { ($string:expr, $($test:expr),+) => {
@ -462,9 +461,10 @@ fn test_watch() {
let mut stderr_lines = let mut stderr_lines =
std::io::BufReader::new(stderr).lines().map(|r| r.unwrap()); std::io::BufReader::new(stderr).lines().map(|r| r.unwrap());
assert_eq!(stdout_lines.next().unwrap(), "");
assert_contains!( assert_contains!(
stdout_lines.next().unwrap(), stdout_lines.next().unwrap(),
"No matching test modules found" "0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out"
); );
wait_for_process_finished("Test", &mut stderr_lines); wait_for_process_finished("Test", &mut stderr_lines);
@ -487,6 +487,7 @@ fn test_watch() {
) )
.expect("error writing file"); .expect("error writing file");
assert_eq!(stdout_lines.next().unwrap(), "");
assert_contains!(stdout_lines.next().unwrap(), "running 1 test"); assert_contains!(stdout_lines.next().unwrap(), "running 1 test");
assert_contains!(stdout_lines.next().unwrap(), "foo", "bar"); assert_contains!(stdout_lines.next().unwrap(), "foo", "bar");
assert_contains!(stdout_lines.next().unwrap(), "running 1 test"); assert_contains!(stdout_lines.next().unwrap(), "running 1 test");
@ -596,9 +597,7 @@ fn test_watch() {
drop(t); drop(t);
} }
// TODO(bartlomieju): flaky (https://github.com/denoland/deno/issues/10552) #[flaky_test]
#[ignore]
#[test]
fn test_watch_doc() { fn test_watch_doc() {
macro_rules! assert_contains { macro_rules! assert_contains {
($string:expr, $($test:expr),+) => { ($string:expr, $($test:expr),+) => {
@ -631,11 +630,11 @@ fn test_watch_doc() {
let mut stderr_lines = let mut stderr_lines =
std::io::BufReader::new(stderr).lines().map(|r| r.unwrap()); std::io::BufReader::new(stderr).lines().map(|r| r.unwrap());
assert_eq!(stdout_lines.next().unwrap(), "");
assert_contains!( assert_contains!(
stdout_lines.next().unwrap(), stdout_lines.next().unwrap(),
"No matching test modules found" "0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out"
); );
wait_for_process_finished("Test", &mut stderr_lines); wait_for_process_finished("Test", &mut stderr_lines);
let foo_file = t.path().join("foo.ts"); let foo_file = t.path().join("foo.ts");