test: rebuildable bundles, npm test entry point

- esbuild alias fixed in the session/sysinfo/sftp test commands (they
  could not build at all), .sftp-svc.mjs build documented, real
  connection-stability assertions
- tests/build-bundles.cjs builds every bundle fresh; npm test runs the
  seven offline suites; esbuild pinned in devDependencies
- remove the assertion-less .exact-inline.mjs; ignore/clean test temp dirs
This commit is contained in:
Bill committed 2026-09-20 20:27:06 +08:00
1 parent 24f7e7c52a
commit cca4ba029a
12 files changed
+108 -92

No files matched your search

+4 -2
View File
@@ -1,6 +1,7 @@
// Real-server SFTP verification (M4). Credentials from env (never hardcoded):
// JD_HOST / JD_USER / JD_PASS
// Prereq bundles: tests/.session-e2e.cjs (pty session layer), tests/.sftp-svc.cjs (sftp service)
// Prereq bundles: `node tests/build-bundles.cjs` builds both of them —
// tests/.session-e2e.cjs (pty session layer), tests/.sftp-svc.mjs (sftp service)
import { createRequire } from 'module'
import { randomUUID } from 'crypto'
import { promises as fsp } from 'fs'
@@ -100,7 +101,8 @@ try {
console.log('[sftp] recursive delete ok')
const exits = events.filter((e) => e.channel === 'pty:exit')
console.log('[sftp] unexpected exits:', exits.length)
if (exits.length) fail(`session exited unexpectedly during the transfer (${exits.length}x) — see the debug log above`)
console.log('[sftp] no unexpected session exits')
await fsp.rm(localFile, { force: true })
await fsp.rm(dlDir, { recursive: true, force: true })