Prepare TUI lifecycle for scenario tests (#28258)

This commit is contained in:
Sebastian
2026-05-26 21:02:02 +02:00
committed by GitHub
parent fdfd0afed7
commit 848d763d08
9 changed files with 596 additions and 280 deletions
+5 -2
View File
@@ -228,9 +228,11 @@ export const TuiThreadCommand = cmd({
}, 1000).unref?.()
try {
const { tui } = await import("./app")
await tui({
const { createTuiRenderer, tui } = await import("./app")
const renderer = await createTuiRenderer(config)
const handle = tui({
url: transport.url,
renderer,
async onSnapshot() {
const tui = writeHeapSnapshot("tui.heapsnapshot")
const server = await client.call("snapshot", undefined)
@@ -249,6 +251,7 @@ export const TuiThreadCommand = cmd({
fork: args.fork,
},
})
await handle.done
} finally {
await stop()
}