@@ -22,7 +22,7 @@ import {
22
22
TopologyDescription
23
23
} from '../../src/index' ;
24
24
import * as importsFromEntryPoint from '../../src/index' ;
25
- import { Topology } from '../../src/sdam/topology' ;
25
+ import { Topology , TopologyOptions } from '../../src/sdam/topology' ;
26
26
import { isHello , ns , setDifference } from '../../src/utils' ;
27
27
import { ReplSetFixture } from '../tools/common' ;
28
28
import { cleanup } from '../tools/mongodb-mock/index' ;
@@ -120,7 +120,7 @@ describe('MongoErrors', () => {
120
120
error : {
121
121
code : 123
122
122
}
123
- } as any as TopologyDescription ;
123
+ } as TopologyDescription ;
124
124
125
125
const error = new MongoSystemError ( 'something went wrong' , topologyDescription ) ;
126
126
expect ( error ) . to . haveOwnProperty ( 'code' , 123 ) ;
@@ -129,7 +129,7 @@ describe('MongoErrors', () => {
129
129
130
130
context ( 'when the topology description does not contain an error code' , ( ) => {
131
131
it ( 'contains the code as a top level property that is undefined' , ( ) => {
132
- const topologyDescription = { error : { } } as any as TopologyDescription ;
132
+ const topologyDescription = { error : { } } as TopologyDescription ;
133
133
134
134
const error = new MongoSystemError ( 'something went wrong' , topologyDescription ) ;
135
135
expect ( error ) . to . haveOwnProperty ( 'code' , undefined ) ;
@@ -138,7 +138,7 @@ describe('MongoErrors', () => {
138
138
139
139
context ( 'when the topology description does not contain an error property' , ( ) => {
140
140
it ( 'contains the code as a top level property that is undefined' , ( ) => {
141
- const topologyDescription = { } as any as TopologyDescription ;
141
+ const topologyDescription = { } as TopologyDescription ;
142
142
143
143
const error = new MongoSystemError ( 'something went wrong' , topologyDescription ) ;
144
144
expect ( error ) . to . haveOwnProperty ( 'code' , undefined ) ;
@@ -321,7 +321,7 @@ describe('MongoErrors', () => {
321
321
let invoked = false ;
322
322
const replSet = new Topology (
323
323
[ test . primaryServer . hostAddress ( ) , test . firstSecondaryServer . hostAddress ( ) ] ,
324
- { replicaSet : 'rs' } as any
324
+ { replicaSet : 'rs' } as TopologyOptions
325
325
) ;
326
326
327
327
replSet . once ( 'error' , err => {
0 commit comments