Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/cli-repl/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
bin
lib
3 changes: 2 additions & 1 deletion packages/cli-repl/bin/mongosh.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
#!/bin/sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice trick! Is this how it was done before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it was!

':' //; node --experimental-repl-await "$0" "$@"

/* eslint no-console: 0, no-new: 0*/
const { CliRepl, parseCliArgs, mapCliToDriver, generateUri, USAGE } = require('../lib');
Expand Down
8 changes: 8 additions & 0 deletions packages/cli-repl/test/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ describe('e2e', function() {
});
});

it('does not throw for a repl await function', async() => {
shell.stdio.stdin.write('await Promise.resolve(\'Nori-cat\');');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🐱


await eventually(() => {
expect(shell.stdio.stderr).to.be.equal('');
});
});

it('runs an unterminated function', async() => {
shell.stdio.stdin.write('function x () {\nconsole.log(\'y\')\n }\n');

Expand Down
142 changes: 113 additions & 29 deletions packages/java-shell/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.