File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
test/integration/node-specific Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ describe('Error (Integration)', function () {
18
18
] ) {
19
19
it ( `constructs the message properly with an array of ${ errors . length } errors` , ( ) => {
20
20
const error = new AggregateError ( errors ) ;
21
- const mongoError = new MongoError ( error ) ;
21
+ const mongoError = new MongoError ( message , { cause : error } ) ;
22
22
23
23
expect ( mongoError . message ) . to . equal ( message ) ;
24
24
} ) ;
@@ -28,14 +28,14 @@ describe('Error (Integration)', function () {
28
28
it ( `uses the AggregateError's message` , ( ) => {
29
29
const error = new AggregateError ( [ new Error ( 'non-empty' ) ] ) ;
30
30
error . message = 'custom error message' ;
31
- const mongoError = new MongoError ( error ) ;
31
+ const mongoError = new MongoError ( error , { cause : error } ) ;
32
32
expect ( mongoError . message ) . to . equal ( 'custom error message' ) ;
33
33
} ) ;
34
34
} ) ;
35
35
36
36
it ( 'sets the AggregateError to the cause property' , ( ) => {
37
37
const error = new AggregateError ( [ new Error ( 'error 1' ) ] ) ;
38
- const mongoError = new MongoError ( error ) ;
38
+ const mongoError = new MongoError ( error , { cause : error } ) ;
39
39
expect ( mongoError . cause ) . to . equal ( error ) ;
40
40
} ) ;
41
41
} ) ;
You can’t perform that action at this time.
0 commit comments