Skip to content

Commit 3a91450

Browse files
committed
fix: do not throw if cause does not exist
1 parent 0123b5a commit 3a91450

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ describe('Client Side Encryption Prose Tests', metadata, function () {
11811181
expect(insertError, 'Error must contain ECONNREFUSED').to.satisfy(
11821182
error =>
11831183
/ECONNREFUSED/.test(error.message) ||
1184-
error.cause.cause.errors.every(e => e.code === 'ECONNREFUSED')
1184+
!!error.cause?.cause?.errors?.every(e => e.code === 'ECONNREFUSED')
11851185
);
11861186

11871187
expect(insertError).not.to.be.instanceOf(
@@ -1282,7 +1282,7 @@ TODO(NODE-5283): The error thrown in this test fails an instanceof check with Mo
12821282
.that.satisfies(
12831283
error =>
12841284
/ECONNREFUSED/.test(error.message) ||
1285-
error.cause.cause.errors.every(e => e.code === 'ECONNREFUSED')
1285+
!!error.cause?.cause?.errors?.every(e => e.code === 'ECONNREFUSED')
12861286
);
12871287
});
12881288
});

0 commit comments

Comments
 (0)