xref: /third_party/node/test/parallel/test-repl-tab-complete-no-warn.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../common');
41cb0ef41Sopenharmony_ciconst ArrayStream = require('../common/arraystream');
51cb0ef41Sopenharmony_ciconst repl = require('repl');
61cb0ef41Sopenharmony_ciconst DEFAULT_MAX_LISTENERS = require('events').defaultMaxListeners;
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ciArrayStream.prototype.write = () => {};
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciconst putIn = new ArrayStream();
111cb0ef41Sopenharmony_ciconst testMe = repl.start('', putIn);
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci// https://github.com/nodejs/node/issues/18284
141cb0ef41Sopenharmony_ci// Tab-completion should not repeatedly add the
151cb0ef41Sopenharmony_ci// `Runtime.executionContextCreated` listener
161cb0ef41Sopenharmony_ciprocess.on('warning', common.mustNotCall());
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ciputIn.run(['async function test() {']);
191cb0ef41Sopenharmony_cifor (let i = 0; i < DEFAULT_MAX_LISTENERS; i++) {
201cb0ef41Sopenharmony_ci  testMe.complete('await Promise.resolve()', () => {});
211cb0ef41Sopenharmony_ci}
22

Indexes created Thu Nov 07 10:32:03 CST 2024