Skip to content

Commit 55abb4b

Browse files
test(NODE-6011): Add modifyCollection helper to UTR (#4032)
1 parent 3ae4ff5 commit 55abb4b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Diff for: test/integration/crud/crud.spec.test.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,6 @@ describe('CRUD spec v1', function () {
425425
}
426426
});
427427

428-
// TODO(NODE-5998) - The Node driver UTR does not have a Collection.modifyCollection helper.
429-
const SKIPPED_TESTS = ['findOneAndUpdate document validation errInfo is accessible'];
430428
describe('CRUD unified', function () {
431-
runUnifiedSuite(loadSpecTests(path.join('crud', 'unified')), ({ description }) =>
432-
SKIPPED_TESTS.includes(description) ? `the Node driver does not have a collMod helper.` : false
433-
);
429+
runUnifiedSuite(loadSpecTests(path.join('crud', 'unified')));
434430
});

Diff for: test/tools/unified-spec-runner/operations.ts

+9
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,15 @@ operations.set('createSearchIndexes', async ({ entities, operation }) => {
896896
return collection.createSearchIndexes(models);
897897
});
898898

899+
operations.set('modifyCollection', async ({ entities, operation }) => {
900+
const db = entities.getEntity('db', operation.object);
901+
const command = {
902+
collMod: operation.arguments?.collection,
903+
validator: operation.arguments?.validator
904+
};
905+
return db.command(command, {});
906+
});
907+
899908
export async function executeOperationAndCheck(
900909
operation: OperationDescription,
901910
entities: EntitiesMap,

0 commit comments

Comments
 (0)