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

Function event

test/parallel/test-repl.js:1041–1053  ·  view source on GitHub ↗
(ee, expected)

Source from the content-addressed store, hash-verified

1039}
1040
1041function event(ee, expected) {
1042 return new Promise((resolve, reject) => {
1043 const timeout = setTimeout(() => {
1044 const data = inspect(expected, { compact: false });
1045 const msg = `The REPL did not reply as expected for:\n\n${data}`;
1046 reject(new Error(msg));
1047 }, common.platformTimeout(9999));
1048 ee.once('data', common.mustCall((...args) => {
1049 clearTimeout(timeout);
1050 resolve(...args);
1051 }));
1052 });
1053}

Callers 1

runReplTestsFunction · 0.70

Calls 6

inspectFunction · 0.70
setTimeoutFunction · 0.50
rejectFunction · 0.50
clearTimeoutFunction · 0.50
resolveFunction · 0.50
onceMethod · 0.45

Tested by

no test coverage detected