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

Method run

test/parallel/test-repl-persistent-history.js:27–48  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

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

Callers 1

runTestFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected