Skip to content

Commit

Permalink
remove 'as any' casts
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Feb 22, 2022
1 parent 1eda3f1 commit 950eb7b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/unit/error.test.ts
Expand Up @@ -22,7 +22,7 @@ import {
TopologyDescription
} from '../../src/index';
import * as importsFromEntryPoint from '../../src/index';
import { Topology } from '../../src/sdam/topology';
import { Topology, TopologyOptions } from '../../src/sdam/topology';
import { isHello, ns, setDifference } from '../../src/utils';
import { ReplSetFixture } from '../tools/common';
import { cleanup } from '../tools/mongodb-mock/index';
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('MongoErrors', () => {
error: {
code: 123
}
} as any as TopologyDescription;
} as TopologyDescription;

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

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

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

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

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

replSet.once('error', err => {
Expand Down

0 comments on commit 950eb7b

Please sign in to comment.