MCPcopy Create free account
hub / github.com/cloudflare/computer / roundTrip

Function roundTrip

packages/computer/src/exec-wire.test.ts:37–42  ·  view source on GitHub ↗
(
  events: WorkspaceExecEvent<E>[],
)

Source from the content-addressed store, hash-verified

35}
36
37async function roundTrip<E extends "utf8" | undefined>(
38 events: WorkspaceExecEvent<E>[],
39): Promise<WorkspaceExecEvent<E>[]> {
40 const bytes = encodeExecEvents(streamOf(events));
41 return collect(decodeExecEvents<E>(bytes)) as Promise<WorkspaceExecEvent<E>[]>;
42}
43
44describe("exec wire codec — utf8 events", () => {
45 it("round-trips stdout/stderr/exit events", async () => {

Callers 1

exec-wire.test.tsFile · 0.85

Calls 4

encodeExecEventsFunction · 0.85
decodeExecEventsFunction · 0.85
streamOfFunction · 0.70
collectFunction · 0.70

Tested by

no test coverage detected