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

Method run

test/parallel/test-repl-reverse-search.js:25–46  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

23// Create an input stream specialized for testing an array of actions
24class ActionStream extends stream.Stream {
25 run(data) {
26 const _iter = data[Symbol.iterator]();
27 const doAction = () => {
28 const next = _iter.next();
29 if (next.done) {
30 // Close the repl. Note that it must have a clean prompt to do so.
31 setImmediate(() => {
32 this.emit('keypress', '', { ctrl: true, name: 'd' });
33 });
34 return;
35 }
36 const action = next.value;
37
38 if (typeof action === 'object') {
39 this.emit('keypress', '', action);
40 } else {
41 this.emit('data', action);
42 }
43 setImmediate(doAction);
44 };
45 doAction();
46 }
47 resume() {}
48 pause() {}
49}

Callers 1

runTestFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected