Skip to content

Commit 4fb3c0f

Browse files
test: skip V8 wire-format version guard assertion on Bun
Bun's node:v8 polyfill doesn't emit the 0xff+version V8 wire format, so the synthetic newer-version payload can't trigger BinaryMiddleware's guard there; gate the assertion on the wire-format marker so it runs on V8 runtimes only.
1 parent 85fb493 commit 4fb3c0f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

test/BinaryMiddleware.unittest.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ describe("BinaryMiddleware", () => {
246246
describe("invalid streams", () => {
247247
it("should throw on a payload from a newer V8 format version", () => {
248248
const payload = v8.serialize([1, "x"]);
249+
// The version guard only applies to the V8 wire format (0xff + version);
250+
// Bun's node:v8 polyfill uses a different format, so skip it there.
251+
if (payload[0] !== 0xff) return;
249252
payload[1] = 0x7f; // pretend it was written by a newer V8
250253
const header = Buffer.alloc(9);
251254
header[0] = 0xf1;

0 commit comments

Comments
 (0)