Skip to content

Commit

Permalink
[WIP] Enable timers in Node.js environment
Browse files Browse the repository at this point in the history
  • Loading branch information
teohhanhui committed May 11, 2022
1 parent 81bfbd8 commit 8e55bc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,6 @@ required-features = ["skip"]
[[test]]
name = "take"
required-features = ["take"]

[patch.crates-io]
gloo-timers = { version = "0.2.4", git = "https://github.com/ctm/gloo", branch = "js_sys-experiment" }
17 changes: 5 additions & 12 deletions tests/interval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ use {
tracing_futures::Instrument,
};

#[cfg(all(
all(target_arch = "wasm32", not(target_os = "wasi")),
feature = "browser",
))]
#[cfg(
all(target_arch = "wasm32", not(target_os = "wasi"))
)]
use wasm_bindgen_test::wasm_bindgen_test;
#[cfg(all(
all(target_arch = "wasm32", not(target_os = "wasi")),
Expand All @@ -42,10 +41,7 @@ wasm_bindgen_test_configure!(run_in_browser);
#[tracing::instrument]
#[test_log::test(async_std::test)]
#[cfg_attr(
all(
all(target_arch = "wasm32", not(target_os = "wasi")),
feature = "browser",
),
all(target_arch = "wasm32", not(target_os = "wasi")),
wasm_bindgen_test
)]
async fn interval_50_sends_5_times_then_we_dispose_it() {
Expand Down Expand Up @@ -90,10 +86,7 @@ async fn interval_50_sends_5_times_then_we_dispose_it() {
#[tracing::instrument]
#[test_log::test(async_std::test)]
#[cfg_attr(
all(
all(target_arch = "wasm32", not(target_os = "wasi")),
feature = "browser",
),
all(target_arch = "wasm32", not(target_os = "wasi")),
wasm_bindgen_test
)]
async fn interval_1000_can_be_disposed_before_anything_is_sent() {
Expand Down

0 comments on commit 8e55bc2

Please sign in to comment.