From 5826ccd9232ca4f2bf15136a1dda2f036694d776 Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Sun, 19 Nov 2023 22:49:41 +0100 Subject: [PATCH] add wasm-bindgen-test --- Cargo.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 6 +++--- tests/wasm.rs | 0 3 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 tests/wasm.rs diff --git a/Cargo.lock b/Cargo.lock index f7379c1..ad4ce35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -223,6 +223,7 @@ dependencies = [ "tokio", "tokio-tungstenite", "url", + "wasm-bindgen-test", "ws_stream_wasm", ] @@ -252,6 +253,16 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + [[package]] name = "const-oid" version = "0.9.5" @@ -1674,6 +1685,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -2627,6 +2644,31 @@ version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +[[package]] +name = "wasm-bindgen-test" +version = "0.3.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6433b7c56db97397842c46b67e11873eda263170afeb3a2dc74a7cb370fee0d" +dependencies = [ + "console_error_panic_hook", + "js-sys", + "scoped-tls", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "493fcbab756bb764fa37e6bee8cec2dd709eb4273d06d0c282a5e74275ded735" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "web-sys" version = "0.3.65" diff --git a/Cargo.toml b/Cargo.toml index 72028c6..31de1b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,9 +54,10 @@ sqlx = { version = "0.7.1", features = [ ], optional = true } safina-timer = "0.1.11" rand = "0.8.5" -# TODO: Remove the below 2 imports for production! +# TODO: Remove the below 3 imports for production! ws_stream_wasm = "0.7.4" pharos = "0.5.3" +wasm-bindgen-test = "0.3.38" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] rustls = "0.21.8" @@ -70,9 +71,8 @@ hostname = "0.3.1" [target.'cfg(target_arch = "wasm32")'.dependencies] getrandom = { version = "0.2.11", features = ["js"] } -tokio-tungstenite = { version = "0.20.1", default-features = false } ws_stream_wasm = "0.7.4" -pharos = "0.5.3" +wasm-bindgen-test = "0.3.38" [dev-dependencies] diff --git a/tests/wasm.rs b/tests/wasm.rs new file mode 100644 index 0000000..e69de29