fix: http/_mock_conn.ts (#1926)

This commit is contained in:
Bartek Iwańczuk 2022-02-15 17:38:18 +01:00 committed by GitHub
parent a9f6a1c4a7
commit 658340bad4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,22 @@ export function mockConn(base: Partial<Deno.Conn> = {}): Deno.Conn {
return Promise.resolve(-1);
},
close: (): void => {},
readable: new ReadableStream({
type: "bytes",
async pull(_controller) {
},
cancel() {
},
autoAllocateChunkSize: 1,
}),
writable: new WritableStream({
async write(_chunk, _controller) {
},
close() {
},
abort() {
},
}),
// TODO(ry) Remove the following ts-ignore.
// @ts-ignore This was added to workaround incompatibilities between Deno versions.
setNoDelay: (_nodelay?: boolean): void => {},