Skip to content

Commit 8e9f6b7

Browse files
authored
add back node --experimental-repl-await to mongosh bin file (#183)
1 parent 7fdae7c commit 8e9f6b7

File tree

4 files changed

+124
-30
lines changed

4 files changed

+124
-30
lines changed

packages/cli-repl/.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2+
bin
23
lib

packages/cli-repl/bin/mongosh.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env node
1+
#!/bin/sh
2+
':' //; node --experimental-repl-await "$0" "$@"
23

34
/* eslint no-console: 0, no-new: 0*/
45
const { CliRepl, parseCliArgs, mapCliToDriver, generateUri, USAGE } = require('../lib');

packages/cli-repl/test/e2e.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ describe('e2e', function() {
7272
});
7373
});
7474

75+
it('does not throw for a repl await function', async() => {
76+
shell.stdio.stdin.write('await Promise.resolve(\'Nori-cat\');');
77+
78+
await eventually(() => {
79+
expect(shell.stdio.stderr).to.be.equal('');
80+
});
81+
});
82+
7583
it('runs an unterminated function', async() => {
7684
shell.stdio.stdin.write('function x () {\nconsole.log(\'y\')\n }\n');
7785

packages/java-shell/package-lock.json

Lines changed: 113 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)