chore: Fix more extension test type 1/N.

This commit is contained in:
cpojer
2026-02-17 10:12:14 +09:00
parent 0f8d1f175a
commit 72f00df95a
9 changed files with 75 additions and 26 deletions

View File

@@ -2,11 +2,15 @@ import { EventEmitter } from "node:events";
import type { IncomingMessage } from "node:http";
export function createMockIncomingRequest(chunks: string[]): IncomingMessage {
const req = new EventEmitter() as IncomingMessage & { destroyed?: boolean; destroy: () => void };
const req = new EventEmitter() as IncomingMessage & {
destroyed?: boolean;
destroy: (error?: Error) => IncomingMessage;
};
req.destroyed = false;
req.headers = {};
req.destroy = () => {
req.destroyed = true;
return req;
};
void Promise.resolve().then(() => {