We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df02a83 commit 78fa809Copy full SHA for 78fa809
1 file changed
test/parallel/test-repl-import-incomplete-crash.js
@@ -1,13 +1,10 @@
1
'use strict';
2
-const common = require('../common');
3
-const child_process = require('child_process');
4
-const assert = require('assert');
+require('../common');
+const repl = require('repl');
5
6
// Regression test for https://github.com/nodejs/node/issues/63551:
7
// Typing a bare `import` keyword in the REPL must not crash the process.
8
-const proc = child_process.spawn(process.execPath, ['-i']);
9
-proc.on('error', common.mustNotCall());
10
-proc.on('exit', common.mustCall((code) => {
11
- assert.strictEqual(code, 0);
12
-}));
13
-proc.stdin.write('import\n.exit\n');
+const replserver = new repl.REPLServer();
+
+replserver.emit('line', 'import');
+replserver.emit('line', '.exit');
0 commit comments