MCPcopy Create free account
hub / github.com/denoland/std / assertValidStringify

Function assertValidStringify

json/stringify_stream_test.ts:9–19  ·  view source on GitHub ↗
(
  transformer: typeof JsonStringifyStream,
  chunks: unknown[],
  expect: string[],
  options?: StringifyStreamOptions,
)

Source from the content-addressed store, hash-verified

7} from "./stringify_stream.ts";
8
9async function assertValidStringify(
10 transformer: typeof JsonStringifyStream,
11 chunks: unknown[],
12 expect: string[],
13 options?: StringifyStreamOptions,
14) {
15 const r = ReadableStream.from(chunks)
16 .pipeThrough(new transformer(options));
17 const res = await Array.fromAsync(r);
18 assertEquals(res, expect);
19}
20
21async function assertInvalidStringify(
22 transformer: typeof JsonStringifyStream,

Callers 1

fnFunction · 0.85

Calls 2

assertEqualsFunction · 0.90
fromMethod · 0.45

Tested by

no test coverage detected