1932e175f5
- 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.
15 lines
386 B
TypeScript
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==");
|
|
});
|
|
});
|