MCPcopy Index your code
hub / github.com/nodejs/node / testPullStatelessTransform

Function testPullStatelessTransform

test/parallel/test-stream-iter-pull-async.js:13–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11}
12
13async function testPullStatelessTransform() {
14 const upper = (chunks) => {
15 if (chunks === null) return null;
16 return chunks.map((c) => {
17 const str = new TextDecoder().decode(c);
18 return new TextEncoder().encode(str.toUpperCase());
19 });
20 };
21 const data = await text(pull(from('abc'), upper));
22 assert.strictEqual(data, 'ABC');
23}
24
25async function testPullStatefulTransform() {
26 const stateful = {

Callers 1

Calls 3

pullFunction · 0.70
textFunction · 0.50
fromFunction · 0.50

Tested by

no test coverage detected