- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add minimal wasm-bindgen test crate #696
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @stevebob!
Instead, tests are conducted by running a small js script which requires the wasm module built from the test library. I removed wasm-bindgen-test because it failed to link the test module when OsRand or StdRng::from_entropy were used, despite the library working when required by js script.
I ran into a problem adding OsRng and StdRng::from_entropy tests where the I've removed the wasm-bindgen-test tests, and instead just test with the javascript file. Running the js file when the crate is built without the "wasm-bindgen" feature results in the nodejs program crashing (which is expected). I've made an issue in the wasm-bindgen repo about the test failing when OsRng is used: rustwasm/wasm-bindgen#1189 |
Good work on tracking that down. Does it mean that using |
It should work now. I'll add the test back. Is it worth leaving the current test that runs a little js program as well? |
I don't know, whatever you think is most useful! |
I added the wasm-bindgen-test tests back, and kept the existing nodejs script test as well. There's currently a CI test failing, but it doesn't look related to this change. Is there a way to re-run the failed job in case it's a transient problem? |
Yes, I just restarted that job. |
My guess is that there's some other reason that test is failing now. |
Yes, it is some other reason... merging this. |
This adds a simple test of wasm-bindgen support. It uses wasm-pack to compile the test to wasm, and run it in nodejs.