From 52f5ef4b3f38bcc3fa6d796cccb19f17697d02bc Mon Sep 17 00:00:00 2001 From: Daria Pardue <81593090+dariakp@users.noreply.github.com> Date: Wed, 12 May 2021 09:49:43 -0400 Subject: [PATCH] test: lowercase returnDocument for spec tests --- test/functional/crud_spec.test.js | 3 +++ test/functional/retryable_writes.test.js | 6 ++++-- test/functional/spec-runner/index.js | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/functional/crud_spec.test.js b/test/functional/crud_spec.test.js index 8991dbfa37f..14c4da4244a 100644 --- a/test/functional/crud_spec.test.js +++ b/test/functional/crud_spec.test.js @@ -320,6 +320,9 @@ describe('CRUD spec', function () { const filter = args.filter; const second = args.update || args.replacement; const options = Object.assign({}, args); + if (options.returnDocument) { + options.returnDocument = options.returnDocument.toLowerCase(); + } delete options.filter; delete options.update; diff --git a/test/functional/retryable_writes.test.js b/test/functional/retryable_writes.test.js index 54006fe4460..1c79a06fcd6 100644 --- a/test/functional/retryable_writes.test.js +++ b/test/functional/retryable_writes.test.js @@ -136,8 +136,10 @@ function generateArguments(test) { Object.keys(test.operation.arguments).forEach(arg => { if (arg === 'requests') { args.push(test.operation.arguments[arg].map(convertBulkWriteOperation)); - } else if (arg === 'upsert' || arg === 'returnDocument') { - options[arg] = test.operation.arguments[arg]; + } else if (arg === 'upsert') { + options.upsert = test.operation.arguments[arg]; + } else if (arg === 'returnDocument') { + options.returnDocument = test.operation.arguments[arg].toLowerCase(); } else { args.push(test.operation.arguments[arg]); } diff --git a/test/functional/spec-runner/index.js b/test/functional/spec-runner/index.js index 499bc9e6104..5a493c66819 100644 --- a/test/functional/spec-runner/index.js +++ b/test/functional/spec-runner/index.js @@ -680,6 +680,10 @@ function testOperation(operation, obj, context, options) { return; } + if (key === 'returnDocument') { + opOptions.returnDocument = operation.arguments[key].toLowerCase(); + } + if (key === 'options') { Object.assign(opOptions, operation.arguments[key]); if (opOptions.readPreference) {