diff options
Diffstat (limited to 'cli/tools/test.rs')
-rw-r--r-- | cli/tools/test.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs index e680d5718..08000c765 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -44,7 +44,6 @@ use rand::seq::SliceRandom; use rand::SeedableRng; use regex::Regex; use serde::Deserialize; -use std::cell::RefCell; use std::collections::BTreeMap; use std::collections::HashSet; use std::fmt::Write as _; @@ -956,6 +955,7 @@ pub async fn check_specifiers( lib, PermissionsContainer::new(Permissions::allow_all()), PermissionsContainer::new(permissions.clone()), + false, ) .await?; } @@ -977,6 +977,7 @@ pub async fn check_specifiers( lib, PermissionsContainer::allow_all(), PermissionsContainer::new(permissions), + true, ) .await?; @@ -1352,14 +1353,12 @@ pub async fn run_tests_with_watch( Permissions::from_options(&ps.options.permissions_options())?; let no_check = ps.options.type_check_mode() == TypeCheckMode::None; - let ps = RefCell::new(ps); - let resolver = |changed: Option<Vec<PathBuf>>| { let paths_to_watch = test_options.files.include.clone(); let paths_to_watch_clone = paths_to_watch.clone(); let files_changed = changed.is_some(); let test_options = &test_options; - let ps = ps.borrow().clone(); + let ps = ps.clone(); async move { let test_modules = if test_options.doc { @@ -1467,8 +1466,7 @@ pub async fn run_tests_with_watch( let operation = |modules_to_reload: Vec<ModuleSpecifier>| { let permissions = &permissions; let test_options = &test_options; - ps.borrow_mut().reset_for_file_watcher(); - let ps = ps.borrow().clone(); + let ps = ps.clone(); async move { let specifiers_with_mode = fetch_specifiers_with_test_mode( @@ -1504,13 +1502,12 @@ pub async fn run_tests_with_watch( } }; - let clear_screen = !ps.borrow().options.no_clear_screen(); file_watcher::watch_func( resolver, operation, file_watcher::PrintConfig { job_name: "Test".to_string(), - clear_screen, + clear_screen: !ps.options.no_clear_screen(), }, ) .await?; |