Skip to content

Commit 950eb7b

Browse files
remove 'as any' casts
1 parent 1eda3f1 commit 950eb7b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/unit/error.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
TopologyDescription
2323
} from '../../src/index';
2424
import * as importsFromEntryPoint from '../../src/index';
25-
import { Topology } from '../../src/sdam/topology';
25+
import { Topology, TopologyOptions } from '../../src/sdam/topology';
2626
import { isHello, ns, setDifference } from '../../src/utils';
2727
import { ReplSetFixture } from '../tools/common';
2828
import { cleanup } from '../tools/mongodb-mock/index';
@@ -120,7 +120,7 @@ describe('MongoErrors', () => {
120120
error: {
121121
code: 123
122122
}
123-
} as any as TopologyDescription;
123+
} as TopologyDescription;
124124

125125
const error = new MongoSystemError('something went wrong', topologyDescription);
126126
expect(error).to.haveOwnProperty('code', 123);
@@ -129,7 +129,7 @@ describe('MongoErrors', () => {
129129

130130
context('when the topology description does not contain an error code', () => {
131131
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;
133133

134134
const error = new MongoSystemError('something went wrong', topologyDescription);
135135
expect(error).to.haveOwnProperty('code', undefined);
@@ -138,7 +138,7 @@ describe('MongoErrors', () => {
138138

139139
context('when the topology description does not contain an error property', () => {
140140
it('contains the code as a top level property that is undefined', () => {
141-
const topologyDescription = {} as any as TopologyDescription;
141+
const topologyDescription = {} as TopologyDescription;
142142

143143
const error = new MongoSystemError('something went wrong', topologyDescription);
144144
expect(error).to.haveOwnProperty('code', undefined);
@@ -321,7 +321,7 @@ describe('MongoErrors', () => {
321321
let invoked = false;
322322
const replSet = new Topology(
323323
[test.primaryServer.hostAddress(), test.firstSecondaryServer.hostAddress()],
324-
{ replicaSet: 'rs' } as any
324+
{ replicaSet: 'rs' } as TopologyOptions
325325
);
326326

327327
replSet.once('error', err => {

0 commit comments

Comments
 (0)