websri/test/integrity-metadata/stringify.ts

14 lines
414 B
TypeScript
Raw Permalink Normal View History

2024-09-17 19:08:56 +09:00
import assert from "node:assert/strict";
import { test } from "node:test";
import { IntegrityMetadata } from "../../src/index.ts";
2024-09-17 19:08:56 +09:00
test("IntegrityMetadata like object can be serialized", function () {
assert.strictEqual(
IntegrityMetadata.stringify({
alg: "sha256",
val: "MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
}),
2024-09-17 19:08:56 +09:00
"sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=",
);
});