fix headless tests on desktop

This commit is contained in:
Evan Almloff 2024-02-27 12:19:34 -06:00
parent 271b53e866
commit acbc1f6a47

View file

@ -51,11 +51,11 @@ fn handle_edits_code() -> String {
.then(bytes => {{
// In headless mode, the requestAnimationFrame callback is never called, so we need to run the bytes directly
if (headless) {{
interpreter.run_from_bytes(bytes);
window.interpreter.run_from_bytes(bytes);
}}
else {{
requestAnimationFrame(() => {{
interpreter.run_from_bytes(bytes);
window.interpreter.run_from_bytes(bytes);
}});
}}
window.interpreter.wait_for_request(headless);