mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
18 lines
764 B
TypeScript
18 lines
764 B
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { Duplex } from "node:stream";
|
|
import { TLSSocket } from "tls";
|
|
|
|
describe("TLSSocket allowHalfOpen option with Duplex socket", () => {
|
|
// In both cases we should ignore allowHalfOpen option, regardless of read() {} implementation or not
|
|
|
|
it("ignores allowHalfOpen when socket is Duplex with or without read implementation", () => {
|
|
const duplexNoRead = new Duplex();
|
|
const socketNoRead = new TLSSocket(duplexNoRead, { allowHalfOpen: true });
|
|
expect(socketNoRead.allowHalfOpen).toBe(false);
|
|
|
|
const duplexWithRead = new Duplex({ read() {} });
|
|
const socketWithRead = new TLSSocket(duplexWithRead, { allowHalfOpen: true });
|
|
expect(socketWithRead.allowHalfOpen).toBe(false);
|
|
});
|
|
});
|