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

Function testUnref

test/node-api/test_threadsafe_function/test.js:62–78  ·  view source on GitHub ↗
(queueSize)

Source from the content-addressed store, hash-verified

60}
61
62function testUnref(queueSize) {
63 return new Promise((resolve, reject) => {
64 let output = '';
65 const child = fork(__filename, ['child', queueSize], {
66 stdio: [process.stdin, 'pipe', process.stderr, 'ipc'],
67 });
68 child.on('close', (code) => {
69 if (code === 0) {
70 resolve(output.match(/\S+/g));
71 } else {
72 reject(new Error('Child process died with code ' + code));
73 }
74 });
75 child.stdout.on('data', (data) => (output += data.toString()));
76 })
77 .then((result) => assert.strictEqual(result.indexOf(0), -1));
78}
79
80new Promise(function testWithoutJSMarshaller(resolve) {
81 let callCount = 0;

Callers 1

test.jsFile · 0.85

Calls 8

matchMethod · 0.65
forkFunction · 0.50
resolveFunction · 0.50
rejectFunction · 0.50
thenMethod · 0.45
onMethod · 0.45
toStringMethod · 0.45
indexOfMethod · 0.45

Tested by

no test coverage detected