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

Function assertCommandWaitsForInit

test/parallel/test-debugger-run-restart-init.js:59–75  ·  view source on GitHub ↗
(repl, command, gate, calls)

Source from the content-addressed store, hash-verified

57}
58
59async function assertCommandWaitsForInit(repl, command, gate, calls) {
60 let settled = false;
61 const promise = evalCommand(repl, command).then(() => {
62 settled = true;
63 });
64
65 await new Promise(setImmediate);
66 assert.strictEqual(
67 settled,
68 false,
69 `${command} resolved before post-connect initialization completed: ${calls}`,
70 );
71
72 gate.resolve();
73 await promise;
74 assert.strictEqual(settled, true);
75}
76
77(async () => {
78 const calls = [];

Calls 3

evalCommandFunction · 0.85
thenMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…