diff --git a/artifacts/api-server/src/routes/testkit.ts b/artifacts/api-server/src/routes/testkit.ts index 029c27d..0ec19e6 100644 --- a/artifacts/api-server/src/routes/testkit.ts +++ b/artifacts/api-server/src/routes/testkit.ts @@ -975,10 +975,10 @@ const https = require('https'); const http = require('http'); const BASE = process.argv[2]; -// Try the absolute CJS bundle path first (dev/Replit), then bare module name. +// Prefer bare module name (portable), fall back to absolute CJS bundle for Replit. let nt; const NOSTR_CJS = '/home/runner/workspace/artifacts/api-server/node_modules/nostr-tools/lib/cjs/index.js'; -try { nt = require(NOSTR_CJS); } catch { try { nt = require('nostr-tools'); } catch { process.stderr.write('nostr-tools not importable\n'); process.exit(1); } } +try { nt = require('nostr-tools'); } catch { try { nt = require(NOSTR_CJS); } catch { process.stderr.write('nostr-tools not importable\n'); process.exit(1); } } const { generateSecretKey, getPublicKey, finalizeEvent } = nt; function request(url, opts, body) { @@ -1087,8 +1087,9 @@ fi # Summary # --------------------------------------------------------------------------- echo +TOTAL=\$((PASS+FAIL+SKIP)) echo "=======================================" -echo " RESULTS: PASS=\$PASS FAIL=\$FAIL SKIP=\$SKIP" +echo " RESULTS: PASS=\$PASS/\$TOTAL FAIL=\$FAIL SKIP=\$SKIP" echo "=======================================" if [[ "\$FAIL" -gt 0 ]]; then exit 1; fi `;