(replInit, tests)
| 7 | const { startNewREPLServer } = require('../common/repl'); |
| 8 | |
| 9 | function 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 | |
| 27 | describe('REPL completion in relation of getters', () => { |
| 28 | describe('standard behavior without proxies/getters', () => { |
no test coverage detected