Skip to content

Commit

Permalink
init logging for module loader test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrieshiemstra committed Feb 7, 2024
1 parent 983e6e7 commit bd52b0b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ pub mod tests {

#[test]
fn test_module_loader() {
crate::facades::tests::init_logging();

struct MyModuleLoader {}
impl ScriptModuleLoader for MyModuleLoader {
fn normalize_path(
Expand Down
6 changes: 5 additions & 1 deletion src/facades.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ pub mod tests {
}
}

pub fn init_test_rt() -> QuickJsRuntimeFacade {
pub fn init_logging() {
{
let i_lock = &mut *crate::facades::INITTED.lock().unwrap();
if !*i_lock {
Expand All @@ -1082,6 +1082,10 @@ pub mod tests {
*i_lock = true;
}
}
}

pub fn init_test_rt() -> QuickJsRuntimeFacade {
init_logging();

QuickJsRuntimeFacade::builder()
.gc_interval(Duration::from_secs(1))
Expand Down

0 comments on commit bd52b0b

Please sign in to comment.