I have implemented an API for WASM modules for a game engine. I want to create tests for it to make sure that the API that the WASM scripts use are correctly implemented.

How could I build a test suite for this? Since I would have to compile the modules as well, I doubt just "cargo test" would be enough. Is there another testing tool that could be better for this?

#wasm #rust #softwaredevelopment

@hipsterelectron thanks! I hope to make a blog post with a demo or something soon. Currently it's a lot of unsafe code 😂. I need to do some cleanup to make sure I don't have any unnecessary unsafe code. Its FFI, so unsafe is the nature of this unfortunately.

The past weekend, I exposed the asset API to WASM so you can load images now. Exposing the GLTF asset api should be easy, but it was easier to implement the image one first. You can spawn ECS entities in the world and with positions. After I expose GLTF, it should be possible to spawn a visible and renderable entity!!

The past month I had to rewrite the entire WASM API since I finally accepted that WIT and the component model just isnt as portable as raw WASM. I also have a lua scripting engine that is farther along, but tbh, its not as cool and since this is a hobby project cool makes things more fun lmfao.