JS test harness: 375/469 spec tests pass with full build
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 9s

- Add --full flag for full-spec build (includes continuations + types)
- Add types module to JS SPEC_MODULES
- 375 tests pass on JavaScript, 94 remaining failures are:
  29 type platform stubs, 14 render format, 6 continuation aliases,
  5 type system platform, 4 string primitive aliases
- Full test build: hosts/javascript/cli.py --extensions continuations
  --spec-modules types --output sx-full-test.js

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 10:46:50 +00:00
parent 1ea80a2b71
commit 4b21efc43c
3 changed files with 23 additions and 3 deletions

View File

@@ -36,7 +36,15 @@ global.clearTimeout = clearTimeout;
global.console = console;
// Load the bootstrapped evaluator
const jsPath = path.join(__dirname, "..", "..", "shared", "static", "scripts", "sx-browser.js");
// Use --full flag to load a full-spec build (if available)
const fullBuild = process.argv.includes("--full");
const jsPath = fullBuild
? path.join(__dirname, "..", "..", "shared", "static", "scripts", "sx-full-test.js")
: path.join(__dirname, "..", "..", "shared", "static", "scripts", "sx-browser.js");
if (fullBuild && !fs.existsSync(jsPath)) {
console.error("Full test build not found. Run: python3 hosts/javascript/cli.py --extensions continuations --spec-modules types --output shared/static/scripts/sx-full-test.js");
process.exit(1);
}
const Sx = require(jsPath);
if (!Sx || !Sx.parse) {
console.error("Failed to load Sx evaluator");
@@ -95,6 +103,16 @@ env["make-continuation"] = function(fn) {
env["continuation?"] = function(x) { return x != null && x._continuation === true; };
env["continuation-fn"] = function(c) { return c.fn; };
// Render helpers
if (Sx.renderToHtml) {
env["render-html"] = function(expr, e) { return Sx.renderToHtml(expr, e || env); };
}
// Type system helpers — available when types module is included
env["test-prim-param-types"] = function(name, types) { return null; };
env["component-param-types"] = function(c) { return c && c._paramTypes ? c._paramTypes : null; };
env["component-set-param-types!"] = function(c, t) { if (c) c._paramTypes = t; return null; };
// Platform test functions
env["try-call"] = function(thunk) {
try {
@@ -142,7 +160,7 @@ for (const expr of frameworkExprs) {
}
// Determine which tests to run
const args = process.argv.slice(2);
const args = process.argv.slice(2).filter(a => !a.startsWith("--"));
let testFiles = [];
if (args.length > 0) {