Skip to content

Commit 2a58338

Browse files
committed
test(NODE-5484): update test
1 parent 1d08c4b commit 2a58338

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/integration/node-specific/errors.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('Error (Integration)', function () {
1818
]) {
1919
it(`constructs the message properly with an array of ${errors.length} errors`, () => {
2020
const error = new AggregateError(errors);
21-
const mongoError = new MongoError(error);
21+
const mongoError = new MongoError(message, { cause: error });
2222

2323
expect(mongoError.message).to.equal(message);
2424
});
@@ -28,14 +28,14 @@ describe('Error (Integration)', function () {
2828
it(`uses the AggregateError's message`, () => {
2929
const error = new AggregateError([new Error('non-empty')]);
3030
error.message = 'custom error message';
31-
const mongoError = new MongoError(error);
31+
const mongoError = new MongoError(error, { cause: error });
3232
expect(mongoError.message).to.equal('custom error message');
3333
});
3434
});
3535

3636
it('sets the AggregateError to the cause property', () => {
3737
const error = new AggregateError([new Error('error 1')]);
38-
const mongoError = new MongoError(error);
38+
const mongoError = new MongoError(error, { cause: error });
3939
expect(mongoError.cause).to.equal(error);
4040
});
4141
});

0 commit comments

Comments
 (0)