#![cfg(target_arch = "wasm32")] use subxt::{config::PolkadotConfig}; use wasm_bindgen_test::*; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); // Run the tests by calling: // // ```text // wasm-pack test --firefox --headless` // ``` // // You'll need to have a substrate/polkadot node running: // // ```bash // ./polkadot --dev // ``` // // Use the following to enable logs: // ``` // console_error_panic_hook::set_once(); // tracing_wasm::set_as_global_default(); // ``` #[wasm_bindgen_test] async fn wasm_ws_transport_works() { let client = subxt::client::OnlineClient::::from_url("ws://127.0.0.1:9944") .await .unwrap(); let mut stream = client.backend().stream_best_block_headers().await.unwrap(); stream.next().await; }