diff --git a/cli/fmt.rs b/cli/fmt.rs index 96ca285c1c..025adc83f2 100644 --- a/cli/fmt.rs +++ b/cli/fmt.rs @@ -324,11 +324,3 @@ fn test_is_supported() { assert!(is_supported(Path::new("foo.mjs"))); assert!(!is_supported(Path::new("foo.mjsx"))); } - -#[tokio::test] -async fn check_tests_dir() { - // Because of cli/tests/error_syntax.js the following should fail but not - // crash. - let r = format(vec!["./tests".to_string()], true).await; - assert!(r.is_err()); -} diff --git a/cli/tests/fmt_check_tests_dir.out b/cli/tests/fmt_check_tests_dir.out new file mode 100644 index 0000000000..9ae4117f0e --- /dev/null +++ b/cli/tests/fmt_check_tests_dir.out @@ -0,0 +1,2 @@ +[WILDCARD] +error: Found [WILDCARD] not formatted files diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 36e2bc90b4..db2773150c 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1539,6 +1539,12 @@ itest!(bundle { output: "bundle.test.out", }); +itest!(fmt_check_tests_dir { + args: "fmt --check ./", + output: "fmt_check_tests_dir.out", + exit_code: 1, +}); + itest!(fmt_stdin { args: "fmt -", input: Some("const a = 1\n"),