• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4const ArrayStream = require('../common/arraystream');
5const assert = require('assert');
6const repl = require('repl');
7
8ArrayStream.prototype.write = () => {};
9
10const putIn = new ArrayStream();
11const testMe = repl.start('', putIn);
12
13// https://github.com/nodejs/node/issues/3346
14// Tab-completion should be empty
15putIn.run(['.clear']);
16putIn.run(['function () {']);
17testMe.complete('arguments.', common.mustCall((err, completions) => {
18  assert.strictEqual(err, null);
19  assert.deepStrictEqual(completions, [[], 'arguments.']);
20}));
21
22putIn.run(['.clear']);
23putIn.run(['function () {']);
24putIn.run(['undef;']);
25testMe.complete('undef.', common.mustCall((err, completions) => {
26  assert.strictEqual(err, null);
27  assert.deepStrictEqual(completions, [[], 'undef.']);
28}));
29