MCPcopy Create free account
hub / github.com/endbasic/endbasic / test_sleep_ok

Function test_sleep_ok

web/src/datetime.rs:110–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108
109 #[wasm_bindgen_test]
110 async fn test_sleep_ok() {
111 let datetime = WebDateTime::new(WebYielder::new());
112 let before = Date::now();
113 datetime.sleep(Duration::from_millis(10)).await.unwrap();
114 let elapsed = Date::now() - before;
115 assert!(10.0 <= elapsed);
116 }
117
118 #[wasm_bindgen_test]
119 async fn test_sleep_too_big() {

Callers

nothing calls this directly

Calls 1

sleepMethod · 0.45

Tested by

no test coverage detected