Skip to content

Commit d0f6364

Browse files
added support for error response
1 parent 162c2ef commit d0f6364

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

test/integration/collection-management/collection_management.spec.test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ const { loadSpecTests } = require('../../spec/index');
44
const { runUnifiedSuite } = require('../../tools/unified-spec-runner/runner');
55

66
// The Node driver does not have a Collection.modifyCollection helper.
7-
const SKIPPED_TESTS = ['modifyCollection to changeStreamPreAndPostImages enabled'];
7+
const SKIPPED_TESTS = [
8+
'modifyCollection to changeStreamPreAndPostImages enabled',
9+
'modifyCollection prepareUnique violations are accessible'
10+
];
811

912
describe('Collection management unified spec tests', function () {
1013
runUnifiedSuite(loadSpecTests('collection-management'), ({ description }) =>

test/integration/crud/crud.spec.test.js

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

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

test/tools/unified-spec-runner/match.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,4 +771,8 @@ export function expectErrorCheck(
771771
if (expected.expectResult != null) {
772772
resultCheck(error, expected.expectResult as any, entities);
773773
}
774+
775+
if (expected.errorResponse != null) {
776+
resultCheck(error, expected.errorResponse, entities);
777+
}
774778
}

test/tools/unified-spec-runner/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ export interface ExpectedError {
368368
errorLabelsContain?: string[];
369369
errorLabelsOmit?: string[];
370370
expectResult?: unknown;
371+
errorResponse?: Document;
371372
}
372373

373374
export interface ExpectedLogMessage {

0 commit comments

Comments
 (0)