-
Sorry, I'm a little confused. I've gotten through the game of life tutorial and read the wasm-bindgen book and even integrated a project into a usable wasm js-callable library. However, my mental models of what wasm-bindgen are doing and where to do what came up against this question today as I was trying to write tests. Question 1. Question 2. In my naive approach I thought:
However, based on my first question it looks like I'm just writing more Rust code against the Rust wrapper in W for 2 and the wasm-artifact itself is never getting tested. What am I missing and how do other professionals do it? Any clarification would be helpful. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I don't completely understand your question, also never heard of Generally speaking you can use the regular Cargo test infrastructure in combination with |
Beta Was this translation helpful? Give feedback.
wasm-bindgen-cli
is just a Wasm post-processor. The Rust compiler is the one converting Rust to Wasm.wasm-bindgen-test
+wasm-bindgen-test-runner
executes your tests when targetingwasm32-unknown-unknown
on a platform that supports Wasm (e.g. a browser), so it does indeed test how your code runs as Wasm.