websri/runtime/bun/integrity-metadata.test.ts
Kohei Watanabe 716d3e88d5
Some checks failed
test / Node.js v20 (push) Has been cancelled
test / Node.js v22 (push) Has been cancelled
test / Deno (push) Has been cancelled
test / Bun (push) Has been cancelled
Rename Integrity-metadata.test.ts to integrity-metadata.test.ts
2024-09-05 20:32:40 +09:00

12 lines
426 B
TypeScript

import { expect, test } from "bun:test";
import { createIntegrityMetadata } from "../../src/index.ts";
test("createIntegrityMetadata()", async () => {
const res = new Response("Hello, world!");
const data = await res.arrayBuffer();
const integrityMetadata = await createIntegrityMetadata("sha256", data);
expect(integrityMetadata.toString()).toBe(
"sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
);
});