Expose test utils to Labrinth dependents (#4703)

* Expose test utils to Labrinth dependents

* Feature gate `labrinth::test`

* Unify db migrators

* Expose `NotificationBuilder::insert_many_deliveries`

* Add logging utils to common crate

* Remove unused console-subscriber layer

* fix CI
This commit is contained in:
aecsocket
2025-11-08 12:26:24 -08:00
committed by GitHub
parent 1efdceacfd
commit f8a5a77daa
45 changed files with 378 additions and 567 deletions

View File

@@ -0,0 +1,32 @@
//! Re-exports all [`labrinth::test`] items for compatibility.
//!
//! Previously, tests used `mod common` and `common::item` imports for testing.
//! This has been moved into [`labrinth::test`] under a feature flag, and this
//! module remains for backwards compatibility with tests which expect the
//! `common` module.
pub use labrinth::test::*;
#[macro_export]
macro_rules! assert_status {
($response:expr, $status:expr) => {
assert_eq!(
$response.status(),
$status,
"{:#?}",
$response.response().body()
);
};
}
#[macro_export]
macro_rules! assert_any_status_except {
($response:expr, $status:expr) => {
assert_ne!(
$response.status(),
$status,
"{:#?}",
$response.response().body()
);
};
}