File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
/** @public */
2
2
export class BSONError extends Error {
3
- constructor ( m : string ) {
4
- super ( m ) ;
3
+ constructor ( message : string ) {
4
+ super ( message ) ;
5
5
Object . setPrototypeOf ( this , BSONError . prototype ) ;
6
6
}
7
7
@@ -12,8 +12,8 @@ export class BSONError extends Error {
12
12
13
13
/** @public */
14
14
export class BSONTypeError extends TypeError {
15
- constructor ( m : string ) {
16
- super ( m ) ;
15
+ constructor ( message : string ) {
16
+ super ( message ) ;
17
17
Object . setPrototypeOf ( this , BSONTypeError . prototype ) ;
18
18
}
19
19
Original file line number Diff line number Diff line change @@ -9,8 +9,10 @@ describe('BSON error tests', function () {
9
9
const bsonTypeErr = new BSONTypeError ( ) ;
10
10
const bsonErr = new BSONError ( ) ;
11
11
12
- expect ( bsonTypeErr instanceof BSONTypeError ) . to . be . true ;
13
- expect ( bsonErr instanceof BSONError ) . to . be . true ;
12
+ expect ( bsonTypeErr ) . to . be . instanceOf ( BSONTypeError ) ;
13
+ expect ( bsonTypeErr ) . to . be . instanceOf ( TypeError ) ;
14
+ expect ( bsonErr ) . to . be . instanceOf ( BSONError ) ;
15
+ expect ( bsonErr ) . to . be . instanceOf ( Error ) ;
14
16
} ) ;
15
17
16
18
it ( 'should correctly get correct names for BSONTypeError and BSONError' , function ( ) {
You can’t perform that action at this time.
0 commit comments