Tests: align reactive/marshes/reactive-runtime island names with live site
Update test-examples.sx to reference the real path-derived names (~geography/<domain>/<stem>) instead of short aliases, drop the alias chains in run_tests.ml, and add marshes/_islands loading so the migrated one-per-file islands resolve. Fix the try-rerender-page stub in boot-helpers.sx to accept the 3 args its callers pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2479,17 +2479,20 @@ let run_spec_tests env test_files =
|
||||
(* Island definitions *)
|
||||
load_module "index.sx" sx_islands_dir;
|
||||
load_module "demo.sx" sx_islands_dir;
|
||||
load_module "marshes.sx" sx_islands_dir;
|
||||
load_module "cek.sx" sx_geo_dir;
|
||||
(* Load one-per-file islands from _islands/ directories.
|
||||
The inject_path_name derives ~geography/cek/demo-counter from the file path. *)
|
||||
Using sx_sx_dir as base matches the live server's naming:
|
||||
sx/sx/geography/<domain>/_islands/<stem>.sx -> ~geography/<domain>/<stem>. *)
|
||||
load_dir_recursive (Filename.concat sx_geo_dir "cek/_islands") sx_sx_dir;
|
||||
let sx_reactive_dir = Filename.concat sx_geo_dir "reactive" in
|
||||
if Sys.file_exists (Filename.concat sx_reactive_dir "_islands") then
|
||||
load_dir_recursive (Filename.concat sx_reactive_dir "_islands") sx_sx_dir;
|
||||
let sx_reactive_runtime_dir = Filename.concat sx_geo_dir "reactive-runtime" in
|
||||
if Sys.file_exists (Filename.concat sx_reactive_runtime_dir "_islands") then
|
||||
load_dir_recursive (Filename.concat sx_reactive_runtime_dir "_islands") sx_geo_dir;
|
||||
load_dir_recursive (Filename.concat sx_reactive_runtime_dir "_islands") sx_sx_dir;
|
||||
let sx_marshes_dir = Filename.concat sx_geo_dir "marshes" in
|
||||
if Sys.file_exists (Filename.concat sx_marshes_dir "_islands") then
|
||||
load_dir_recursive (Filename.concat sx_marshes_dir "_islands") sx_sx_dir;
|
||||
load_module "reactive-runtime.sx" sx_sx_dir;
|
||||
|
||||
(* Create short-name aliases for reactive-islands tests *)
|
||||
@@ -2497,17 +2500,7 @@ let run_spec_tests env test_files =
|
||||
try let v = Sx_types.env_get env full in
|
||||
ignore (Sx_types.env_bind env short v)
|
||||
with _ -> () in
|
||||
alias "~reactive-islands/counter" "~reactive-islands/index/demo-counter";
|
||||
alias "~reactive-islands/temperature" "~reactive-islands/index/demo-temperature";
|
||||
alias "~reactive-islands/stopwatch" "~reactive-islands/index/demo-stopwatch";
|
||||
alias "~reactive-islands/reactive-list" "~reactive-islands/index/demo-reactive-list";
|
||||
alias "~reactive-islands/input-binding" "~reactive-islands/index/demo-input-binding";
|
||||
alias "~reactive-islands/error-boundary" "~reactive-islands/index/demo-error-boundary";
|
||||
alias "~reactive-islands/dynamic-class" "~reactive-islands/index/demo-dynamic-class";
|
||||
alias "~reactive-islands/store-writer" "~reactive-islands/index/demo-store-writer";
|
||||
alias "~reactive-islands/store-reader" "~reactive-islands/index/demo-store-reader";
|
||||
alias "~marshes/demo-marsh-product" "~reactive-islands/marshes/demo-marsh-product";
|
||||
alias "~marshes/demo-marsh-settle" "~reactive-islands/marshes/demo-marsh-settle";
|
||||
let _ = alias in
|
||||
|
||||
(* Determine test files — scan spec/tests/, lib/tests/, web/tests/ *)
|
||||
let lib_tests_dir = Filename.concat project_dir "lib/tests" in
|
||||
|
||||
Reference in New Issue
Block a user