MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / expectReadBlobContentDecodesAs

Function expectReadBlobContentDecodesAs

src/pkg/utils/encoding.test.ts:7–13  ·  view source on GitHub ↗
(
  bytes: Uint8Array,
  encoding: string,
  contentType: string | null = null
)

Source from the content-addressed store, hash-verified

5 new Blob([bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer]);
6
7const expectReadBlobContentDecodesAs = async (
8 bytes: Uint8Array,
9 encoding: string,
10 contentType: string | null = null
11) => {
12 await expect(readRawContent(blobFromBytes(bytes), contentType)).resolves.toBe(bytesDecode(encoding, bytes));
13};
14
15describe.concurrent("encoding", () => {
16 describe.concurrent("parseCharsetFromContentType", () => {

Callers 1

encoding.test.tsFile · 0.85

Calls 3

readRawContentFunction · 0.90
bytesDecodeFunction · 0.90
blobFromBytesFunction · 0.85

Tested by

no test coverage detected