Files
oh-my-pi/packages/coding-agent/test/image-b64poly.test.ts
T
can1357 1932e175f5 feat(coding-agent): added Buffer.toBase64() polyfill for Bun compatibility
- Added Buffer.toBase64() polyfill for Bun compatibility to enable base64 encoding of buffers.
- Added test coverage for Buffer.toBase64() polyfill to verify base64 encoding functionality.
2026-02-21 22:59:04 +01:00

15 lines
386 B
TypeScript

import { describe, expect, it } from "bun:test";
describe("Buffer.toBase64", async () => {
await import("../src/utils/image-resize");
it("should be defined", () => {
expect(Buffer.prototype.toBase64).toBeDefined();
});
it("should return a base64 string", () => {
const buffer = Buffer.from("Hello, world!");
expect(buffer.toBase64()).toBe("SGVsbG8sIHdvcmxkIQ==");
});
});