Skip to content

Commit 3b8da40

Browse files
authored
fix(shell-api): do not test validate command background option MONGOSH-1664 (#1799)
It turns out that actually testing that this option works on latest-alpha builds of the server is pretty tricky. Since we do not actually touch the options in any way in mongosh and just pass them through to the server, it should be okay to drop this test.
1 parent c4b4d76 commit 3b8da40

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/shell-api/src/integration.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,18 +1323,18 @@ describe('Shell API (integration)', function () {
13231323
).to.equal(true);
13241324
});
13251325

1326-
it('validate accepts a background option', async function () {
1327-
expect(
1328-
(await collection.validate({ full: false, background: true })).valid
1329-
).to.equal(true);
1330-
});
1331-
1326+
// We cannot positively test background: true since it may take a while for
1327+
// the collection can be 'ready' to be validated on recent (7.3+) server versions,
1328+
// but we can test that specific argument combinations will be rejected.
13321329
it('validate fails with background: true and full: true', async function () {
13331330
try {
13341331
await collection.validate({ full: true, background: true });
13351332
expect.fail('missed exception');
13361333
} catch (err: any) {
13371334
expect(err.name).to.equal('MongoServerError');
1335+
expect(err.codeName).to.match(
1336+
/^(CommandNotSupported|InvalidOptions)$/
1337+
);
13381338
}
13391339
});
13401340
});

0 commit comments

Comments
 (0)