diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2020-07-30 21:39:08 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 12:09:08 -0400 |
commit | 0da4779b178a0c97925c1ef5589d0f24a37f4501 (patch) | |
tree | 0be0e95c53ec8f2f83b05a8c60a5fbbf56fd3689 /cli/tests/integration_tests.rs | |
parent | 95597fc6e2ed9975c26eae77ba68ae42ca2c331a (diff) |
feat(unstable): add "--ignore" flag to deno fmt (#6890)
Diffstat (limited to 'cli/tests/integration_tests.rs')
-rw-r--r-- | cli/tests/integration_tests.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index ea76fe23b..89b5cc21e 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -352,6 +352,20 @@ fn fmt_test() { let badly_formatted_str = badly_formatted.to_str().unwrap(); std::fs::copy(&badly_formatted_original, &badly_formatted) .expect("Failed to copy file"); + // First, check formatting by ignoring the badly formatted file. + let status = util::deno_cmd() + .current_dir(util::root_path()) + .arg("fmt") + .arg(format!("--ignore={}", badly_formatted_str)) + .arg("--unstable") + .arg("--check") + .arg(badly_formatted_str) + .spawn() + .expect("Failed to spawn script") + .wait() + .expect("Failed to wait for child process"); + assert!(status.success()); + // Check without ignore. let status = util::deno_cmd() .current_dir(util::root_path()) .arg("fmt") @@ -362,6 +376,7 @@ fn fmt_test() { .wait() .expect("Failed to wait for child process"); assert!(!status.success()); + // Format the source file. let status = util::deno_cmd() .current_dir(util::root_path()) .arg("fmt") |