feat: add bundle-host-test.cjs + smoke integration

- bundle-host-test.cjs: JS smoke-test for PluginBundleHost contract
  - 4 error boundary scenarios (missing frontend, JS throw, missing component, mount throw)
  - 5 real mount scenarios (bundle exec, DiagnosticsPanel mount, Settings mount, unmount, mount-throw catch)
  - Runs real platform-test bundle in vm.Sandbox with mock window/document
- smoke-platform.sh: add bundle-host-test step
- Fix: platform-test badgeRow div call (3rd arg was ignored)
This commit is contained in:
2026-06-17 18:51:14 +08:00
parent 05ef1449bc
commit c2e14cae69
5 changed files with 317 additions and 3 deletions
+14 -3
View File
@@ -73,9 +73,6 @@ if [ "$SMOKE_ED_EXIT" -ne 0 ]; then
exit 1
fi
echo ""
echo "✅ smoke-platform done"
# ── test workspace via Go smoke ──
echo ""
echo "[go smoke: workspace]"
@@ -96,5 +93,19 @@ if [ "$SMOKE_CONT_EXIT" -ne 0 ]; then
exit 1
fi
# ── bundle host test (JS smoke for error boundary + real mount proof) ──
echo ""
echo "[bundle host test]"
if ! command -v node &>/dev/null; then
echo " ⚠️ node not found — skipping bundle-host-test"
else
(node "$ROOT/frontend/tests/bundle-host-test.cjs" 2>&1)
BUNDLE_HOST_EXIT=$?
if [ "$BUNDLE_HOST_EXIT" -ne 0 ]; then
echo " ❌ bundle-host-test failed"
exit 1
fi
fi
echo ""
echo "✅ smoke-platform all tests done"