use loco_rs::{bgworker::BackgroundWorker, testing::prelude::*}; use music_metadata_manager::{ app::App, workers::scan_library_worker::{Worker, WorkerArgs}, }; use serial_test::serial; #[tokio::test] #[serial] async fn test_run_scan_library_worker_worker() { let boot = boot_test::().await.unwrap(); // Execute the worker ensuring that it operates in 'ForegroundBlocking' mode, which prevents the addition of your worker to the background assert!( Worker::perform_later(&boot.app_context, WorkerArgs { library_id: 1 }) .await .is_ok() ); // Include additional assert validations after the execution of the worker }