Skip to content

Commit dcb98d9

Browse files
add check for name and error message
1 parent ff2393c commit dcb98d9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/integration/client-side-encryption/client_side_encryption.prose.test.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,20 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
11761176

11771177
expect(insertError)
11781178
.to.be.instanceOf(Error)
1179-
.to.match(/connect ECONNREFUSED 127.0.0.1:27021/);
1179+
.to.have.property('name', 'MongoServerSelectionError');
1180+
1181+
expect(insertError).to.match(/connect ECONNREFUSED 127.0.0.1:27021/);
1182+
1183+
expect(insertError).to.be.instanceOf(
1184+
MongoServerSelectionError,
1185+
`
1186+
1187+
TODO(NODE-5283): The error thrown in this test fails an instanceof check with MongoServerSelectionError.
1188+
This should change after NODE-5283. If this assertion is failing, then the test
1189+
should be updated to reflect that the error thrown is now a server selection error.
1190+
1191+
`
1192+
);
11801193
});
11811194
});
11821195

0 commit comments

Comments
 (0)