mirror of
https://github.com/kou029w/websri.git
synced 2025-01-18 16:08:16 +00:00
12 lines
426 B
TypeScript
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=",
|
|
);
|
|
});
|