Skip to content

Commit

Permalink
test(NODE-6011): Add modifyCollection helper to UTR (#4032)
Browse files Browse the repository at this point in the history
  • Loading branch information
aditi-khare-mongoDB committed Mar 11, 2024
1 parent 3ae4ff5 commit 55abb4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 1 addition & 5 deletions test/integration/crud/crud.spec.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,6 @@ describe('CRUD spec v1', function () {
}
});

// TODO(NODE-5998) - The Node driver UTR does not have a Collection.modifyCollection helper.
const SKIPPED_TESTS = ['findOneAndUpdate document validation errInfo is accessible'];
describe('CRUD unified', function () {
runUnifiedSuite(loadSpecTests(path.join('crud', 'unified')), ({ description }) =>
SKIPPED_TESTS.includes(description) ? `the Node driver does not have a collMod helper.` : false
);
runUnifiedSuite(loadSpecTests(path.join('crud', 'unified')));
});
9 changes: 9 additions & 0 deletions test/tools/unified-spec-runner/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,15 @@ operations.set('createSearchIndexes', async ({ entities, operation }) => {
return collection.createSearchIndexes(models);
});

operations.set('modifyCollection', async ({ entities, operation }) => {
const db = entities.getEntity('db', operation.object);
const command = {
collMod: operation.arguments?.collection,
validator: operation.arguments?.validator
};
return db.command(command, {});
});

export async function executeOperationAndCheck(
operation: OperationDescription,
entities: EntitiesMap,
Expand Down

0 comments on commit 55abb4b

Please sign in to comment.