From 0725693d70f1811fc9bf4059f3fa292b57e8f650 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 10 Feb 2023 15:39:59 +0100 Subject: [PATCH] fix(shell-api): adjust .drop() return value for server changes (#1406) See SERVER-43894, the server now returns no error when dropping non-existent collections. --- packages/shell-api/src/integration.spec.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/shell-api/src/integration.spec.ts b/packages/shell-api/src/integration.spec.ts index b50f7f25f..150e7af8d 100644 --- a/packages/shell-api/src/integration.spec.ts +++ b/packages/shell-api/src/integration.spec.ts @@ -847,8 +847,18 @@ describe('Shell API (integration)', function() { }); context('when a collection does not exist', () => { - it('returns false', async() => { - expect(await collection.drop()).to.be.false; + context('pre-7.0', () => { + skipIfServerVersion(testServer, '>= 7.0'); + it('returns false', async() => { + expect(await collection.drop()).to.be.false; + }); + }); + + context('post-7.0', () => { + skipIfServerVersion(testServer, '< 7.0'); + it('returns true', async() => { + expect(await collection.drop()).to.be.true; + }); }); }); }); @@ -865,8 +875,8 @@ describe('Shell API (integration)', function() { }); context('when a collection does not exist', () => { - it('returns false', async() => { - expect(await collection.drop()).to.be.false; + it('returns null', async() => { + expect(await collection.exists()).to.be.null; }); }); });