aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_search_connect_deadline.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-25 10:23:05 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-25 10:23:05 +0200
commitf1ed3e6be452f6211cee8db1afef8b56473a04db (patch)
tree27a3f0060e968784f13be54ba074835dcc516eb7 /packages/meshbay-hub/tests/test_search_connect_deadline.py
parent762233772162a05be67432aa551a430b939250de (diff)
downloadmeshbay-f1ed3e6be452f6211cee8db1afef8b56473a04db.tar.gz
test(hub): read the search code wherever it is split
The Node harnesses take one file or several, and the tests that lift connectToGroup and the pool out of search-page.js as text take them from spa_source, which also reads connection-pool.js once it exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/tests/test_search_connect_deadline.py')
-rw-r--r--packages/meshbay-hub/tests/test_search_connect_deadline.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/meshbay-hub/tests/test_search_connect_deadline.py b/packages/meshbay-hub/tests/test_search_connect_deadline.py
index d41cbb5..2d3db06 100644
--- a/packages/meshbay-hub/tests/test_search_connect_deadline.py
+++ b/packages/meshbay-hub/tests/test_search_connect_deadline.py
@@ -32,6 +32,7 @@ import subprocess
from pathlib import Path
import pytest
+from spa_source import search_argv, search_source
STATIC = Path(__file__).resolve().parents[1] / "src" / "meshbay_hub" / "static"
SEARCH_PAGE = STATIC / "search-page.js"
@@ -47,7 +48,7 @@ CAP_MS = 30000
def _attempt(**cfg) -> dict:
proc = subprocess.run(
- ["node", str(HARNESS), str(SEARCH_PAGE), json.dumps(cfg)],
+ ["node", str(HARNESS), search_argv(), json.dumps(cfg)],
capture_output=True, text=True)
assert proc.returncode == 0, proc.stderr
return json.loads(proc.stdout)
@@ -59,7 +60,7 @@ def test_the_constants_are_what_these_scenarios_assume():
a change to either without a change here would leave the scenarios asserting
about a deadline the code no longer has.
"""
- code = SEARCH_PAGE.read_text(encoding="utf-8")
+ code = search_source()
assert f"const SEARCH_STALL_MS = {STALL_MS};" in code
assert f"const SEARCH_MAX_MS = {CAP_MS};" in code