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

Function runCompletionTests

test/parallel/test-repl-completion-on-getters-disabled.js:9–25  ·  view source on GitHub ↗
(replInit, tests)

Source from the content-addressed store, hash-verified

7const { startNewREPLServer } = require('../common/repl');
8
9function runCompletionTests(replInit, tests) {
10 const { replServer: testRepl, input } = startNewREPLServer();
11 input.run([replInit]);
12
13 tests.forEach(([query, expectedCompletions]) => {
14 testRepl.complete(query, common.mustCall((error, data) => {
15 const actualCompletions = data[0];
16 if (expectedCompletions.length === 0) {
17 assert.deepStrictEqual(actualCompletions, []);
18 } else {
19 expectedCompletions.forEach((expectedCompletion) =>
20 assert(actualCompletions.includes(expectedCompletion), `completion '${expectedCompletion}' not found`)
21 );
22 }
23 }));
24 });
25}
26
27describe('REPL completion in relation of getters', () => {
28 describe('standard behavior without proxies/getters', () => {

Calls 6

startNewREPLServerFunction · 0.85
includesMethod · 0.80
forEachMethod · 0.65
assertFunction · 0.50
runMethod · 0.45
completeMethod · 0.45

Tested by

no test coverage detected