I'm new to this wasm ecosystem so apologies if this is a silly issue/question.
I'm trying to test my wasm module inside the Rust project, the same way I would do with a normal Rust crate. I'm running into an issue where I can't pass errors outside of the wasm functions that are compatible with my local architecture. For example:
If this method returns an error, it will panic my tests with:
thread 'server::auth_test::test_activate_user_v2' panicked at 'function not implemented on non-wasm32 targets', /Users/kristian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasm-bindgen-0.2.87/src/lib.rs:996:1
After tracing through the code, I discovered this is originating in the JsError::new() call. You cannot instantiate a JSError outside of a wasm architecture.
Is there a way to get around this so I can pass helpful errors back in my test code?
One solution is to dynamically compile in a different error. For example:
I'm new to this wasm ecosystem so apologies if this is a silly issue/question.
I'm trying to test my wasm module inside the Rust project, the same way I would do with a normal Rust crate. I'm running into an issue where I can't pass errors outside of the wasm functions that are compatible with my local architecture. For example:
If this method returns an error, it will panic my tests with:
After tracing through the code, I discovered this is originating in the
JsError::new()
call. You cannot instantiate aJSError
outside of a wasm architecture.Is there a way to get around this so I can pass helpful errors back in my test code?
One solution is to dynamically compile in a different error. For example:
But this seems like a lot of headache for what I have to think is a very common problem? Thanks for your help!