Skip to content

Commit b8ec3a6

Browse files
committed
test(codex): normalize socket fixture binary frames
1 parent 40df986 commit b8ec3a6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎test/plugins/codex-model-catalog.gateway.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ describe("models.list native account catalog", () => {
8080
let account: Record<string, unknown> | null = { type: "apiKey" };
8181
server.on("connection", (socket) => {
8282
socket.on("message", (data) => {
83-
const encoded = Array.isArray(data) ? Buffer.concat(data) : Buffer.from(data);
83+
const encoded = Array.isArray(data)
84+
? Buffer.concat(data)
85+
: Buffer.from(data instanceof ArrayBuffer ? new Uint8Array(data) : data);
8486
const request = JSON.parse(encoded.toString("utf8")) as {
8587
id?: number;
8688
method: string;

0 commit comments

Comments
 (0)