mirror of
https://github.com/kou029w/websri.git
synced 2025-01-19 08:28:16 +00:00
14 lines
439 B
TypeScript
14 lines
439 B
TypeScript
|
import { assertEquals } from "@std/assert";
|
||
|
import { createIntegrityMetadata } from "../../src/index.ts";
|
||
|
|
||
|
Deno.test("createIntegrityMetadata()", async () => {
|
||
|
const res = new Response("Hello, world!");
|
||
|
const data = await res.arrayBuffer();
|
||
|
const integrityMetadata = await createIntegrityMetadata("sha256", data);
|
||
|
|
||
|
assertEquals(
|
||
|
integrityMetadata.toString(),
|
||
|
"sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
|
||
|
);
|
||
|
});
|