mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 18:20:51 +00:00
Merge pull request #1230 from fitzgen/multiple-futures-same-promise
futures: Add a test for creating multiple futures from the same promise
This commit is contained in:
commit
a0c8514e66
7
crates/futures/tests/tests.rs
Normal file → Executable file
7
crates/futures/tests/tests.rs
Normal file → Executable file
@ -108,3 +108,10 @@ fn spawn_local_err_no_exception() -> impl Future<Item = (), Error = JsValue> {
|
||||
})
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test(async)]
|
||||
fn can_create_multiple_futures_from_same_promise() -> impl Future<Item = (), Error = JsValue> {
|
||||
let promise = js_sys::Promise::resolve(&JsValue::null());
|
||||
let a = JsFuture::from(promise.clone());
|
||||
let b = JsFuture::from(promise);
|
||||
futures::future::join_all(vec![a, b]).map(|_| ())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user