Q1: type the proxy-transport test doubles (typecheck:test ratchet)

This commit is contained in:
garrytan committed 2026-10-03 22:15:53 +00:00
1 parent b2c3e15a1d
commit d98b7c1e0f
1 file changed
+6 -6
+6 -6
View File
@@ -256,14 +256,14 @@ describe('proxy terminal event ordering', () => {
let onResponse!: (res: IncomingMessage) => void;
let deadline!: () => void;
const nativeSetTimeout = globalThis.setTimeout;
const requestSpy = spyOn(http, 'request').mockImplementation((url, options, callback) => {
const requestSpy = spyOn(http, 'request').mockImplementation(((_url: unknown, _options: unknown, callback?: (res: IncomingMessage) => void) => {
onResponse = callback!;
return request as unknown as ClientRequest;
});
const timerSpy = spyOn(globalThis, 'setTimeout').mockImplementation((callback, ms, ...args) => {
deadline = callback as () => void;
return nativeSetTimeout(callback, ms, ...args);
});
}) as unknown as typeof http.request);
const timerSpy = spyOn(globalThis, 'setTimeout').mockImplementation(((callback: () => void, ms?: number) => {
deadline = callback;
return nativeSetTimeout(callback, ms);
}) as unknown as typeof setTimeout);
const clearSpy = spyOn(globalThis, 'clearTimeout');
try {
const pending = attempt(1).then(value => ({ value, error: undefined }), error => ({ value: undefined, error }));