summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2019-09-26 15:58:49 -0700
committerGus Caplan <me@gus.host>2019-10-11 12:33:40 -0700
commitc0305af2c4aba6d6ecd39eb100a59998d87ddc69 (patch)
treea83ae9edb6421e14160ed8a3ba60164979040145 /test
parent06f6d662f679ee04679d97ecd5087e6f17268141 (diff)
downloadandroid-node-v8-c0305af2c4aba6d6ecd39eb100a59998d87ddc69.tar.gz
android-node-v8-c0305af2c4aba6d6ecd39eb100a59998d87ddc69.tar.bz2
android-node-v8-c0305af2c4aba6d6ecd39eb100a59998d87ddc69.zip
repl: check for NODE_REPL_EXTERNAL_MODULE
PR-URL: https://github.com/nodejs/node/pull/29778 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/external-repl-module.js3
-rw-r--r--test/pseudo-tty/test-repl-external-module.js14
-rw-r--r--test/pseudo-tty/test-repl-external-module.out1
3 files changed, 18 insertions, 0 deletions
diff --git a/test/fixtures/external-repl-module.js b/test/fixtures/external-repl-module.js
new file mode 100644
index 0000000000..272ab0a556
--- /dev/null
+++ b/test/fixtures/external-repl-module.js
@@ -0,0 +1,3 @@
+'use strict';
+
+console.log('42');
diff --git a/test/pseudo-tty/test-repl-external-module.js b/test/pseudo-tty/test-repl-external-module.js
new file mode 100644
index 0000000000..db9ad29712
--- /dev/null
+++ b/test/pseudo-tty/test-repl-external-module.js
@@ -0,0 +1,14 @@
+'use strict';
+
+require('../common');
+const fixtures = require('../common/fixtures');
+const { execSync } = require('child_process');
+
+execSync(process.execPath, {
+ encoding: 'utf8',
+ stdio: 'inherit',
+ env: {
+ ...process.env,
+ NODE_REPL_EXTERNAL_MODULE: fixtures.path('external-repl-module.js'),
+ },
+});
diff --git a/test/pseudo-tty/test-repl-external-module.out b/test/pseudo-tty/test-repl-external-module.out
new file mode 100644
index 0000000000..d81cc0710e
--- /dev/null
+++ b/test/pseudo-tty/test-repl-external-module.out
@@ -0,0 +1 @@
+42