diff options
author | Bradley Farias <bfarias@godaddy.com> | 2019-09-04 11:19:14 -0500 |
---|---|---|
committer | Bradley Farias <bfarias@godaddy.com> | 2019-09-06 11:47:32 -0500 |
commit | cdebd3246102be2a79546806161d121e5d3e3294 (patch) | |
tree | 76510b04d658449de4774c7cb848c6753ce87265 /test/es-module | |
parent | 63b056d8d4f0696254cd5fc40a69aee0157fc410 (diff) | |
download | android-node-v8-cdebd3246102be2a79546806161d121e5d3e3294.tar.gz android-node-v8-cdebd3246102be2a79546806161d121e5d3e3294.tar.bz2 android-node-v8-cdebd3246102be2a79546806161d121e5d3e3294.zip |
esm: make dynamic import work in the REPL
PR-URL: https://github.com/nodejs/node/pull/29437
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'test/es-module')
-rw-r--r-- | test/es-module/test-esm-repl.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/es-module/test-esm-repl.js b/test/es-module/test-esm-repl.js new file mode 100644 index 0000000000..daef48d8e1 --- /dev/null +++ b/test/es-module/test-esm-repl.js @@ -0,0 +1,19 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const { spawn } = require('child_process'); + +const child = spawn(process.execPath, [ + '--experimental-modules', + '--interactive' +]); +child.stdin.end(` +import('fs').then( + ns => ns.default === require('fs') ? 0 : 1, + _ => 2 +).then(process.exit) +`); + +child.on('exit', (code) => { + assert.strictEqual(code, 0); +}); |