mirror of
https://github.com/YusufB5/ASCILINE.git
synced 2026-07-14 23:32:10 +02:00
fix: add verification and playback safeguards
This commit is contained in:
parent
312d5d6df0
commit
50a954c585
16 changed files with 1556 additions and 43 deletions
18
tests/test_frontend_static.py
Normal file
18
tests/test_frontend_static.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
APP_JS = Path(__file__).resolve().parents[1] / "app.js"
|
||||
|
||||
|
||||
def test_app_js_has_idempotent_render_loop_guard():
|
||||
source = APP_JS.read_text(encoding="utf-8")
|
||||
|
||||
assert "let renderLoopId = null;" in source
|
||||
assert "if (renderLoopId !== null) return;" in source
|
||||
assert "renderLoopId = requestAnimationFrame(renderFrame);" in source
|
||||
assert "cancelAnimationFrame(renderLoopId);" in source
|
||||
|
||||
|
||||
def test_app_js_syntax_is_valid():
|
||||
subprocess.run(["node", "--check", str(APP_JS)], check=True)
|
||||
Loading…
Add table
Add a link
Reference in a new issue