Skip to content
Merged
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
15 changes: 15 additions & 0 deletions packages/cli-repl/src/cli-repl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,21 @@ describe('CliRepl', () => {
expect(output).to.include('db.version');
});

it('does not complete legacy JS get/set definitions', async function() {
if (+process.version.split('.')[0].slice(1) < 14) {
return this.skip();
}
output = '';
input.write('JSON.');
await tabtab();
await waitCompletion(cliRepl.bus);
expect(output).to.include('JSON.__proto__');
expect(output).not.to.include('JSON.__defineGetter__');
expect(output).not.to.include('JSON.__defineSetter__');
expect(output).not.to.include('JSON.__lookupGetter__');
expect(output).not.to.include('JSON.__lookupSetter__');
});

it(`${wantShardDistribution ? 'completes' : 'does not complete'} the getShardDistribution method`, async function() {
if (process.env.MONGOSH_TEST_FORCE_API_STRICT) {
return this.skip();
Expand Down