You've already forked AstralRinth
forked from didirus/AstralRinth
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:
32
apps/labrinth/tests/common.rs
Normal file
32
apps/labrinth/tests/common.rs
Normal 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()
|
||||
);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user