chore(server): remove unused code (#30772)

chore(server): remove unnused code
This commit is contained in:
Jason Rasmussen
2026-08-14 16:58:14 -04:00
committed by GitHub
parent 6a61901e79
commit 14241ac7bc
23 changed files with 5 additions and 328 deletions
-37
View File
@@ -553,43 +553,6 @@ export const mockDuplex =
return duplex;
};
export const mockFork = vitest.fn((exitCode: number, stdout: string, stderr: string, error?: unknown) => {
const stdoutStream = new Readable({
read() {
this.push(stdout); // write mock data to stdout
this.push(null); // end stream
},
});
return {
stdout: stdoutStream,
stderr: new Readable({
read() {
this.push(stderr); // write mock data to stderr
this.push(null); // end stream
},
}),
stdin: new Writable({
write(chunk, encoding, callback) {
callback();
},
}),
exitCode,
on: vitest.fn((event, callback: any) => {
if (event === 'close') {
stdoutStream.once('end', () => callback(0));
}
if (event === 'error' && error) {
stdoutStream.once('end', () => callback(error));
}
if (event === 'exit') {
stdoutStream.once('end', () => callback(exitCode));
}
}),
kill: vitest.fn(),
} as unknown as ChildProcessWithoutNullStreams;
});
export async function* makeStream<T>(items: T[] = []): AsyncGenerator<T> {
for (const item of items) {
await Promise.resolve();