From 6bbfe1a6b49f1f2ee37c8ac91883ddf7380638cc Mon Sep 17 00:00:00 2001 From: Namekuji Date: Sat, 27 May 2023 06:28:27 -0400 Subject: [PATCH] add tests --- packages/backend/native-utils/crates/database/src/lib.rs | 9 +-------- packages/backend/native-utils/package.json | 4 +++- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/backend/native-utils/crates/database/src/lib.rs b/packages/backend/native-utils/crates/database/src/lib.rs index 36d4a532aa..28c0a6ed45 100644 --- a/packages/backend/native-utils/crates/database/src/lib.rs +++ b/packages/backend/native-utils/crates/database/src/lib.rs @@ -19,17 +19,10 @@ pub fn get_database() -> Result<&'static DatabaseConnection, Error> { #[cfg(test)] mod tests { use super::get_database; - use crate::{error::Error, init_database}; + use crate::error::Error; #[test] fn unit_lib_error_uninitialized() { assert_eq!(get_database().unwrap_err(), Error::Uninitialized); } - - #[tokio::test] - async fn unit_lib_connect_in_memory_sqlite() -> Result<(), Error> { - init_database("sqlite::memory:").await?; - get_database()?; - Ok(()) - } } diff --git a/packages/backend/native-utils/package.json b/packages/backend/native-utils/package.json index 787d1bd89f..c82826d69b 100644 --- a/packages/backend/native-utils/package.json +++ b/packages/backend/native-utils/package.json @@ -39,6 +39,8 @@ "prepublishOnly": "napi prepublish -t npm", "test": "ava", "universal": "napi universal", - "version": "napi version" + "version": "napi version", + "cargo:unit": "cargo test --workspace unit", + "cargo:integration": "cargo test --workspace inte -- --test-threads=1" } }