chore(dump): add tests

This commit is contained in:
Tamo 2022-04-28 10:48:57 +02:00 committed by Irevoire
parent ae4e419db4
commit 5f0e9b63d2
No known key found for this signature in database
GPG key ID: 7A6A970C96104F1B
23 changed files with 853 additions and 142 deletions

View file

@ -79,9 +79,9 @@ impl Server {
}
}
pub async fn new_with_options(options: Opt) -> Self {
let meilisearch = setup_meilisearch(&options).unwrap();
let auth = AuthController::new(&options.db_path, &options.master_key).unwrap();
pub async fn new_with_options(options: Opt) -> Result<Self, anyhow::Error> {
let meilisearch = setup_meilisearch(&options)?;
let auth = AuthController::new(&options.db_path, &options.master_key)?;
let service = Service {
meilisearch,
auth,
@ -89,10 +89,10 @@ impl Server {
api_key: None,
};
Server {
Ok(Server {
service,
_dir: None,
}
})
}
/// Returns a view to an index. There is no guarantee that the index exists.