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

Function testPullChainedTransforms

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

Source from the content-addressed store, hash-verified

58}
59
60async function testPullChainedTransforms() {
61 const enc = new TextEncoder();
62 const transforms = [
63 (chunks) => {
64 if (chunks === null) return null;
65 return [...chunks, enc.encode('!')];
66 },
67 (chunks) => {
68 if (chunks === null) return null;
69 return [...chunks, enc.encode('?')];
70 },
71 ];
72 const data = await text(pull(from('hello'), ...transforms));
73 assert.strictEqual(data, 'hello!?');
74}
75
76// Source error → controller.abort() → transform listener throws →
77// source error propagates to consumer; listener error becomes uncaught

Callers 1

Calls 4

encodeMethod · 0.95
pullFunction · 0.70
textFunction · 0.50
fromFunction · 0.50

Tested by

no test coverage detected