Skip to content

Commit 1641135

Browse files
committed
use specific errors for validation
1 parent 66a2ac6 commit 1641135

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/integration/crud/crud_api.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ describe('CRUD API', function () {
340340
// Execute the command with all steps defined
341341
// will fail
342342
const err = await cursor.toArray().catch(err => err);
343-
test.ok(err instanceof Error);
343+
expect(err).to.be.instanceof(MongoServerError);
344344
});
345345

346346
it('#toArray()', async function () {
@@ -892,7 +892,7 @@ describe('CRUD API', function () {
892892
.collection('t20_1')
893893
.bulkWrite(ops, { ordered: true, writeConcern: { w: 1 } })
894894
.catch(err => err);
895-
test.ok(err instanceof Error);
895+
expect(err).to.be.instanceOf(MongoBulkWriteError);
896896
}
897897
});
898898

0 commit comments

Comments
 (0)