diff options
Diffstat (limited to 'cli/tests/integration/watcher_tests.rs')
-rw-r--r-- | cli/tests/integration/watcher_tests.rs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/cli/tests/integration/watcher_tests.rs b/cli/tests/integration/watcher_tests.rs index 4e597cf1b..2f2bc9851 100644 --- a/cli/tests/integration/watcher_tests.rs +++ b/cli/tests/integration/watcher_tests.rs @@ -3,8 +3,8 @@ use flaky_test::flaky_test; use std::fs::write; use std::io::BufRead; -use tempfile::TempDir; use test_util as util; +use test_util::TempDir; const CLEAR_SCREEN: &str = r#"[2J"#; @@ -88,7 +88,7 @@ fn child_lines( #[test] fn lint_watch_test() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let badly_linted_original = util::testdata_path().join("lint/watch/badly_linted.js"); let badly_linted_output = @@ -147,7 +147,7 @@ fn lint_watch_test() { #[test] fn lint_watch_without_args_test() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let badly_linted_original = util::testdata_path().join("lint/watch/badly_linted.js"); let badly_linted_output = @@ -206,7 +206,7 @@ fn lint_watch_without_args_test() { #[test] fn lint_all_files_on_each_change_test() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let badly_linted_fixed0 = util::testdata_path().join("lint/watch/badly_linted.js"); let badly_linted_fixed1 = @@ -245,7 +245,7 @@ fn lint_all_files_on_each_change_test() { #[test] fn fmt_watch_test() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let fixed = util::testdata_path().join("badly_formatted_fixed.js"); let badly_formatted_original = util::testdata_path().join("badly_formatted.mjs"); @@ -295,7 +295,7 @@ fn fmt_watch_test() { #[test] fn fmt_watch_without_args_test() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let fixed = util::testdata_path().join("badly_formatted_fixed.js"); let badly_formatted_original = util::testdata_path().join("badly_formatted.mjs"); @@ -343,7 +343,7 @@ fn fmt_watch_without_args_test() { #[test] fn fmt_check_all_files_on_each_change_test() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let badly_formatted_original = util::testdata_path().join("badly_formatted.mjs"); let badly_formatted_1 = t.path().join("badly_formatted_1.js"); @@ -384,11 +384,11 @@ fn fmt_check_all_files_on_each_change_test() { fn bundle_js_watch() { use std::path::PathBuf; // Test strategy extends this of test bundle_js by adding watcher - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.ts"); write(&file_to_watch, "console.log('Hello world');").unwrap(); assert!(file_to_watch.is_file()); - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let bundle = t.path().join("mod6.bundle.js"); let mut deno = util::deno_cmd() .current_dir(util::testdata_path()) @@ -439,7 +439,7 @@ fn bundle_js_watch() { /// Confirm that the watcher continues to work even if module resolution fails at the *first* attempt #[test] fn bundle_watch_not_exit() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.ts"); write(&file_to_watch, "syntax error ^^").unwrap(); let target_file = t.path().join("target.js"); @@ -485,7 +485,7 @@ fn bundle_watch_not_exit() { #[flaky_test::flaky_test] fn run_watch() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); write(&file_to_watch, "console.log('Hello world');").unwrap(); @@ -568,7 +568,7 @@ fn run_watch() { #[test] fn run_watch_external_watch_files() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); write(&file_to_watch, "console.log('Hello world');").unwrap(); @@ -609,7 +609,7 @@ fn run_watch_external_watch_files() { #[test] fn run_watch_load_unload_events() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); write( &file_to_watch, @@ -677,7 +677,7 @@ fn run_watch_load_unload_events() { /// Confirm that the watcher continues to work even if module resolution fails at the *first* attempt #[test] fn run_watch_not_exit() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); write(&file_to_watch, "syntax error ^^").unwrap(); @@ -727,7 +727,7 @@ fn run_watch_with_import_map_and_relative_paths() { assert!(relative_path.is_relative()); relative_path } - let temp_directory = TempDir::new_in(util::testdata_path()).unwrap(); + let temp_directory = TempDir::new_in(&util::testdata_path()); let file_to_watch = create_relative_tmp_file( &temp_directory, "file_to_watch.js", @@ -764,7 +764,7 @@ fn run_watch_with_import_map_and_relative_paths() { #[flaky_test] fn test_watch() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let mut child = util::deno_cmd() .current_dir(util::testdata_path()) @@ -908,7 +908,7 @@ fn test_watch() { #[flaky_test] fn test_watch_doc() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let mut child = util::deno_cmd() .current_dir(util::testdata_path()) @@ -961,7 +961,7 @@ fn test_watch_doc() { #[test] fn test_watch_module_graph_error_referrer() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); write(&file_to_watch, "import './nonexistent.js';").unwrap(); let mut child = util::deno_cmd() @@ -991,7 +991,7 @@ fn test_watch_module_graph_error_referrer() { #[test] fn watch_with_no_clear_screen_flag() { - let t = TempDir::new().unwrap(); + let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); write(&file_to_watch, "export const foo = 0;").unwrap(); |