gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit6995424969954249Align all plugin sources with Hybriel day38bmre69954249/plugins/fetch/tests/refused-catch.mjs

1.3 KB

  1. // refused-catch.mjs — mission 517 (hybriel#240). A fetch to a closed port, an unknown host
  2. // and a closed https port must each give an error `on Error` can catch, with the host:port and
  3. // the reason in the message, and the program must run on to its end.
  4. import { spawnSync } from 'node:child_process';
  5. import net from 'node:net';
  6. import path from 'node:path';
  7. import { fileURLToPath } from 'node:url';
  8. const HERE = path.dirname(fileURLToPath(import.meta.url));
  9. const ROOT = path.resolve(HERE, '../../..');
  10. const BIN = process.env.HL_BIN || path.resolve(ROOT, 'native/zig-out/bin/hybriel');
  11. // Find a port nothing listens on: bind one, note it, close it.
  12. const probe = net.createServer();
  13. await new Promise((r) => probe.listen(0, '127.0.0.1', r));
  14. const port = probe.address().port;
  15. await new Promise((r) => probe.close(r));
  16. const r = spawnSync(BIN, [path.join(HERE, 'refused_catch.hl')], {
  17. env: { ...process.env, HL_TEST_PORT: String(port) }, encoding: 'utf8', timeout: 60000,
  18. });
  19. const log = (r.stdout || '') + (r.stderr || '');
  20. const ok = r.status === 0
  21. && log.includes(`127.0.0.1:${port}/x: connection refused`)
  22. && log.includes('could not resolve host')
  23. && log.includes('done 3 true true true');
  24. if (ok) { console.log('PASS refused, https refused and unknown host are caught'); process.exit(0); }
  25. console.log(`FAIL exit ${r.status}\n` + log.slice(-1500));
  26. process.exit(1);

Branches

Latest commits

  • 69954249Align all plugin sources with Hybriel day38bmre
  • f740f666Re-vendor components to Hybriel set day38bmre
  • 8176eb14Record CS23b deployment and live verificationmre
  • 84e3ddaaRemove blank line before pagination Style closing bracemre
  • a92298ddRecord exact CSS and same-date proof after specificity reviewmre
  • c71a0abePreserve consumer theme specificity with nested tag rulesmre
  • 64a2bc27Document CS23b style formatting proof and review statusmre
  • a72b57cficons: nest Style rules in the language's formmre
  • 927616e2pagination: nest Style rules in the language's formmre
  • aab8ad29code-editor: nest Style rules in the language's formmre
  • ba30727afile-upload: nest Style rules in the language's formmre
  • 42fefa4emodal: nest Style rules in the language's formmre
  • 6fd953e3range-picker: nest Style rules in the language's formmre
  • f661951ddate-picker: nest Style rules in the language's formmre
  • 363577e6media-player: nest Style rules in the language's formmre
  • 0b3fd8c9comments: nest Style rules in the language's formmre
  • 67e043c8plugins/web/README.md from hybriel cb9e480dmre
  • 519b56e9styles.hl: Style in the language's form (nested like the View, one declaration per line, bare @media)mre
  • 29f63d01md-editor: Style in the language's form (nested like the View, one declaration per line, bare @media)mre
  • 869f49c7files-upload: Style in the language's form (nested like the View, one declaration per line, bare @media)mre