fix: expose heartbeat controls and harden mac CLI

This commit is contained in:
Peter Steinberger
2025-12-12 23:33:12 +00:00
parent 3b72ed6e1a
commit 8846ffec64
7 changed files with 171 additions and 12 deletions

View File

@@ -39,7 +39,7 @@ import Testing
#expect(cfg.token == "t")
}
@Test func remoteWithoutTunnelIsUnavailable() async throws {
@Test func remoteWithoutTunnelRecoversByEnsuringTunnel() async throws {
let mode = ModeBox(.remote)
let store = GatewayEndpointStore(deps: .init(
mode: { mode.get() },
@@ -48,12 +48,9 @@ import Testing
remotePortIfRunning: { nil },
ensureRemoteTunnel: { 18789 }))
do {
_ = try await store.requireConfig()
Issue.record("expected requireConfig to throw")
} catch {
#expect(error.localizedDescription.contains("no active control tunnel"))
}
let cfg = try await store.requireConfig()
#expect(cfg.url.absoluteString == "ws://127.0.0.1:18789")
#expect(cfg.token == nil)
}
@Test func ensureRemoteTunnelPublishesReadyState() async throws {