Skip to content

Commit

Permalink
[config_util] Set the custom panic hook for tests with debug mode
Browse files Browse the repository at this point in the history
This is necessary to debug errors from panics since the tests might trigger "unwrap_or_quit()".
  • Loading branch information
m4heshd committed Apr 20, 2024
1 parent c9bc3c4 commit 04945fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/src/config_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,13 @@ pub async fn inc_file_number() {

#[cfg(test)]
mod tests {
use crate::rt_util::set_custom_panic;

use super::{get_config, is_debug, load_config, UFCRConfig};

#[tokio::test]
async fn unit_load_config() {
set_custom_panic(true);
load_config().await;
}

Expand Down

0 comments on commit 04945fe

Please sign in to comment.