Closed HeroicKatora closed 2 years ago
Making sure not to use any file-API:
Set timeout to 20 seconds...
running 1 test
test lib::included_file ... ok
test result: ok. 1 passed; 0 failed; 0 ignored
:tada:
PR coming soon.
wasm testing:
As per wasm-bindgen,
cargo test --target wasm32-unknown-unknown
tries to execute the.wasm
file which it can't. We need a runner, something that spins up the host platform which runs the sandbox. They suggestwasm-bindgen-test
/wasm-bindgen-test-runner
which usesnode
under the hood, and providesweb-sys
host bindings for things such as actual output. (There's certainly a possible to provide output in some ring-buffer without host requirements but web-sys works and is established, so who's to blame for doing it that way. Except people that want perfect reproducibility of course).cargo install --git https://github.com/rustwasm/wasm-bindgen wasm-bindgen-cli --bin wasm-bindgen-test-runner
(1.1)
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner cargo +stable test --target wasm32-unknown-unknown
:Running tests/rayon-0.rs (target/wasm32-unknown-unknown/debug/deps/rayon_0-39b62c7e345d87d8.wasm) Set timeout to 20 seconds... Error: failed to execute
node
Install node, ugh
Yay, tests are being ran
panicked at 'called
Result::unwrap()
on anErr
value: ThreadPoolBuildError { kind: IOError(Error { kind: Unsupported, message: "operation not supported on this platform" }) }', tests/rayon-0.rs:13:10as expected, until #240 or further is resolved