2021-11-22 11:28:30 -05:00
|
|
|
//! Test suite for the Web and headless browsers.
|
|
|
|
#![cfg(target_arch = "wasm32")]
|
|
|
|
|
|
|
|
use veilid_core::tests::common::*;
|
|
|
|
use veilid_core::xx::*;
|
|
|
|
use wasm_bindgen_test::*;
|
|
|
|
|
|
|
|
wasm_bindgen_test_configure!(run_in_browser);
|
|
|
|
|
2022-03-15 09:33:34 -04:00
|
|
|
extern crate wee_alloc;
|
|
|
|
#[global_allocator]
|
|
|
|
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
|
|
|
|
|
2021-11-22 11:28:30 -05:00
|
|
|
static SETUP_ONCE: Once = Once::new();
|
|
|
|
pub fn setup() -> () {
|
|
|
|
SETUP_ONCE.call_once(|| {
|
|
|
|
console_error_panic_hook::set_once();
|
2022-06-08 20:07:26 -04:00
|
|
|
let mut builder = tracing_wasm::WASMLayerConfigBuilder::new();
|
|
|
|
builder.set_report_logs_in_timings(false);
|
|
|
|
builder.set_max_level(Level::TRACE);
|
|
|
|
builder.set_console_config(tracing_wasm::ConsoleConfig::ReportWithConsoleColor);
|
|
|
|
tracing_wasm::set_as_global_default_with_config(builder.build());
|
2021-11-22 11:28:30 -05:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
#[wasm_bindgen_test]
|
|
|
|
async fn run_test_host_interface() {
|
|
|
|
setup();
|
|
|
|
|
|
|
|
test_host_interface::test_all().await;
|
|
|
|
}
|
|
|
|
|
2022-10-02 18:47:36 -04:00
|
|
|
#[wasm_bindgen_test]
|
|
|
|
async fn run_test_async_tag_lock() {
|
|
|
|
setup();
|
|
|
|
|
|
|
|
test_async_tag_lock::test_all().await;
|
|
|
|
}
|