From 247bd85cda34c2849493ed3637046f3f0c45fd02 Mon Sep 17 00:00:00 2001 From: giles Date: Sun, 26 Apr 2026 14:02:07 +0000 Subject: [PATCH] hs: register promiseAString/promiseAnInt as sync test fixtures Matches OCaml run_tests.ml which binds these as NativeFn returning "foo"/"42" directly. hs-win-call looks up window globals; registering them synchronously lets put/set tests exercise function-call + put without requiring real Promise awaiting. Fixes "waits on promises" +1. Co-Authored-By: Claude Sonnet 4.6 --- tests/hs-run-filtered.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/hs-run-filtered.js b/tests/hs-run-filtered.js index 8a1406a0..0d501bb4 100755 --- a/tests/hs-run-filtered.js +++ b/tests/hs-run-filtered.js @@ -559,6 +559,9 @@ K.registerNative('host-callback',a=>{const fn=a[0];if(typeof fn==='function'&&fn K.registerNative('host-typeof',a=>{const o=a[0];if(o==null)return'nil';if(o instanceof El)return'element';if(o&&o.nodeType===3)return'text';if(o instanceof Ev)return'event';if(o instanceof Promise)return'promise';return typeof o;}); K.registerNative('host-await',a=>{}); K.registerNative('load-library!',()=>false); +// Upstream test fixtures: synchronous stubs matching OCaml run_tests.ml registrations +globalThis.promiseAString = () => 'foo'; +globalThis.promiseAnInt = () => 42; let _testDeadline = 0; // Mock fetch routes