GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(opencode): remove duplicate global.event mock from test double · duncan4123/t3code@f918b9d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/provider/Layers
    • OpenCodeAdapter.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/provider/Layers/OpenCodeAdapter.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/provider/Layers/OpenCodeAdapter.test.ts
-31Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,6 @@ const runtimeMock = {
8989
},
9090
};
9191

92-
function toGlobalEvent(event: unknown, directory: string): unknown {
93-
return event && typeof event === "object" && "payload" in event
94-
? event
95-
: {
96-
directory,
97-
payload: event,
98-
};
99-
}
10092

10193
const OpenCodeRuntimeTestDouble: OpenCodeRuntimeShape = {
10294
startOpenCodeServerProcess: ({ binaryPath }) =>
@@ -177,29 +169,6 @@ const OpenCodeRuntimeTestDouble: OpenCodeRuntimeShape = {
177169
: runtimeMock.state.messages;
178170
},
179171
},
180-
global: {
181-
event: async (options?: { signal?: AbortSignal }) => {
182-
runtimeMock.state.globalEventCalls += 1;
183-
return {
184-
stream: (async function* () {
185-
let index = 0;
186-
while (!options?.signal?.aborted) {
187-
if (index < runtimeMock.state.subscribedEvents.length) {
188-
yield toGlobalEvent(
189-
runtimeMock.state.subscribedEvents[index++],
190-
runtimeMock.state.subscribedEventDirectory,
191-
);
192-
continue;
193-
}
194-
if (!runtimeMock.state.keepSubscriptionOpen) {
195-
break;
196-
}
197-
await Effect.runPromise(Effect.sleep("5 millis"));
198-
}
199-
})(),
200-
};
201-
},
202-
},
203172
event: {
204173
subscribe: async (_parameters?: unknown, options?: { readonly signal?: AbortSignal }) => {
205174
runtimeMock.state.legacySubscribeCalls += 1;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.