• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Tab completion sometimes uses a separate REPL instance under the hood.
2// That REPL instance has its own domain. Make sure domain errors trickle back
3// up to the main REPL.
4//
5// Ref: https://github.com/nodejs/node/issues/21586
6
7'use strict';
8
9require('../common');
10const fixtures = require('../common/fixtures');
11
12const assert = require('assert');
13const { spawnSync } = require('child_process');
14
15const testFile = fixtures.path('repl-tab-completion-nested-repls.js');
16const result = spawnSync(process.execPath, [testFile]);
17
18// The spawned process will fail. In Node.js 10.11.0, it will fail silently. The
19// test here is to make sure that the error information bubbles up to the
20// calling process.
21assert.ok(result.status, 'testFile swallowed its error');
22const err = result.stderr.toString();
23assert.ok(err.includes('fhqwhgads'), err);
24