summaryrefslogtreecommitdiff
path: root/test/message/async_error_eval_esm.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/message/async_error_eval_esm.js')
-rw-r--r--test/message/async_error_eval_esm.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/message/async_error_eval_esm.js b/test/message/async_error_eval_esm.js
new file mode 100644
index 0000000000..33675b5a9d
--- /dev/null
+++ b/test/message/async_error_eval_esm.js
@@ -0,0 +1,42 @@
+'use strict';
+
+require('../common');
+const { spawnSync } = require('child_process');
+
+const four = require('../common/fixtures')
+ .readSync('async-error.js')
+ .toString()
+ .split('\n')
+ .slice(2, -2)
+ .join('\n');
+
+const main = `${four}
+
+async function main() {
+ try {
+ await four();
+ } catch (e) {
+ console.log(e);
+ }
+}
+
+main();
+`;
+
+// --eval ESM
+{
+ const child = spawnSync(process.execPath, [
+ '--experimental-modules',
+ '--input-type',
+ 'module',
+ '-e',
+ main
+ ], {
+ env: { ...process.env }
+ });
+
+ if (child.status !== 0) {
+ console.error(child.stderr.toString());
+ }
+ console.error(child.stdout.toString());
+}