Skip to content

test(NODE-6011): Add modifyCollection helper to UTR #4032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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