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

Function testSessionNoCrash

test/parallel/test-inspector-debug-end.js:22–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22async function testSessionNoCrash() {
23 console.log('Test there\'s no crash stopping server after connecting');
24 const script = `process._debugEnd();
25 process._debugProcess(process.pid);
26 setTimeout(() => {
27 console.log("Done");
28 process.exit(42);
29 });`;
30
31 const instance = new NodeInstance('--inspect-brk=0', script);
32 const session = await instance.connectInspectorSession();
33 await session.send({ method: 'NodeRuntime.enable' });
34 await session.waitForNotification('NodeRuntime.waitingForDebugger');
35 await session.send({ 'method': 'Runtime.runIfWaitingForDebugger' });
36 await session.waitForServerDisconnect();
37 assert.strictEqual((await instance.expectShutdown()).exitCode, 42);
38}
39
40async function runTest() {
41 await testNoServerNoCrash();

Callers 1

runTestFunction · 0.85

Calls 6

expectShutdownMethod · 0.95
waitForNotificationMethod · 0.80
sendMethod · 0.65
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…