Files
bun.sh/test/js/node/buffer-inspectmaxbytes.test.ts
Jarred Sumner 0b89a422bb Fix INSPECT_MAX_BYTES ESM export (#23799)
### What does this PR do?

### How did you verify your code works?

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-18 16:54:09 -07:00

14 lines
593 B
TypeScript

import { expect, test } from "bun:test";
import buffer, { INSPECT_MAX_BYTES } from "node:buffer";
test("buffer.INSPECT_MAX_BYTES is a number and not a custom getter/setter", () => {
const originalINSPECT_MAX_BYTES = INSPECT_MAX_BYTES;
expect(INSPECT_MAX_BYTES).toBeNumber();
expect(buffer.INSPECT_MAX_BYTES).toBeNumber();
buffer.INSPECT_MAX_BYTES = 1000;
expect(buffer.INSPECT_MAX_BYTES).toBe(1000);
expect(INSPECT_MAX_BYTES).toBe(originalINSPECT_MAX_BYTES);
buffer.INSPECT_MAX_BYTES = originalINSPECT_MAX_BYTES;
expect(INSPECT_MAX_BYTES).toBe(originalINSPECT_MAX_BYTES);
});