init
This commit is contained in:
20
tests/workers/scan_library_worker.rs
Normal file
20
tests/workers/scan_library_worker.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
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::<App>().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
|
||||
}
|
Reference in New Issue
Block a user